\documentclass{article}
\usepackage{a4wide}
\usepackage{adjustbox}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{ifthen}
\usetikzlibrary{automata}
\usepackage{datetime}
\lhead{./certificates/multibranch1-multibranch2/sim-40136.tex}
\rhead{09:11:48.776 on 2025-04-03}
\fancyfoot{}
\begin{document}
\newif\ifntiny
%\ntinyfalse
\ntinytrue
\thispagestyle{fancy}
\begin{center}
\maxsizebox{!}{0.475\textheight}{
\minsizebox{\textwidth}{!}{
\begin{tabular}{@{}c@{}}
% node count = 16
\begin{tikzpicture}[rotate = 0]
%\begin{tikzpicture}[rotate = 90]
\tikzset{initial text=$ $}

\node[accepting, state] at (2,-2) (n1) {$p?$\,\ifntiny{\tiny 40169}\fi};
\node[accepting, state] at (3,-4) (n2n0) {$p!$\,\ifntiny{\tiny 40182}\fi};
\node[accepting, state] at (1,-4) (n1n0) {$p!$\,\ifntiny{\tiny 40164}\fi};
\node[accepting, state] at (4,-4) (n2n1) {$p?$\,\ifntiny{\tiny 40178}\fi};
\node[initial, accepting, state] at (2,0) (n) {$p?$\,\ifntiny{\tiny 40184}\fi};
\node[accepting, state] at (4,-10) (n2n1n0n0n0) {$end$\,\ifntiny{\tiny 40175}\fi};
\node[accepting, state] at (4,-8) (n2n1n0n0) {$p!$\,\ifntiny{\tiny 40176}\fi};
\node[accepting, state] at (2,-4) (n1n1) {$p!$\,\ifntiny{\tiny 40168}\fi};
\node[accepting, state] at (1,-6) (n1n0n0) {$end$\,\ifntiny{\tiny 40163}\fi};
\node[accepting, state] at (0,-2) (n0) {$p?$\,\ifntiny{\tiny 40159}\fi};
\node[accepting, state] at (3,-6) (n2n0n0) {$end$\,\ifntiny{\tiny 40181}\fi};
\node[accepting, state] at (4,-2) (n2) {$p?$\,\ifntiny{\tiny 40183}\fi};
\node[accepting, state] at (0,-6) (n0n0n0) {$end$\,\ifntiny{\tiny 40157}\fi};
\node[accepting, state] at (0,-4) (n0n0) {$p!$\,\ifntiny{\tiny 40158}\fi};
\node[accepting, state] at (2,-6) (n1n1n0) {$end$\,\ifntiny{\tiny 40167}\fi};
\node[accepting, state] at (4,-6) (n2n1n0) {$p?$\,\ifntiny{\tiny 40177}\fi};

\draw[->, thick] (n) edge [near start, left] node {a1} (n0);
\draw[->, thick] (n) edge [near start, left] node {a2} (n1);
\draw[->, thick] (n) edge [near start, left] node {a3} (n2);
\draw[->, thick] (n0) edge [near start, left] node {b} (n0n0);
\draw[->, thick] (n0n0) edge [near start, left] node {x} (n0n0n0);
\draw[->, thick] (n1) edge [near start, left] node {b1} (n1n0);
\draw[->, thick] (n1) edge [near start, left] node {b2} (n1n1);
\draw[->, thick] (n1n0) edge [near start, left] node {x} (n1n0n0);
\draw[->, thick] (n1n1) edge [near start, left] node {x} (n1n1n0);
\draw[->, thick] (n2) edge [near start, left] node {a1} (n2n0);
\draw[->, thick] (n2) edge [near start, left] node {c1} (n2n1);
\draw[->, thick] (n2n0) edge [near start, left] node {x} (n2n0n0);
\draw[->, thick] (n2n1) edge [near start, left] node {c2} (n2n1n0);
\draw[->, thick] (n2n1n0) edge [near start, left] node {c3} (n2n1n0n0);
\draw[->, thick] (n2n1n0n0) edge [near start, left] node {x} (n2n1n0n0n0);

\end{tikzpicture}
\end{tabular}}}
\end{center}
\end{document}
