// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]Modex/Src/modex.c
// Function: mkruncmd
void
mkruncmd(void)
{	FILE *fd;
	char buf[1024];
	char buf_w[32];

	if ((fd = fopen("_modex_.run", MFLAGS)) == NULL)
	{	fprintf(stderr, "modex: cannot create run cmd\n");
		return;
	}
if (debug_io) fprintf(stderr, "Open %s -> %p\n", "_modex_.run", fd);

	sprintf(buf, "%s -DVECTORSZ=%d -DMEMLIM=%d %s ", CC, vectorsz, memlim, optimized);

	if (exhaustive)
	{	quality = 10;
	}

	if (quality < 0)
	{	fprintf(stderr, "quality parameter must be 1..10, assuming 1\n");
		quality = 1;
	}
	if (quality > 10)
	{	fprintf(stderr, "quality parameter must be 1..10, assuming 10\n");
		quality = 10;
	}
	if (quality == 9)
	{	if (!bfs_par)
		{	strcat(buf, "-DHC4 ");
		}
	} else if (quality < 9)
	{	strcat(buf, "-DBITSTATE ");
	}

	if (bfs_par)
	{	strcat(buf, "-DBFS_PAR ");
	} else if (bfsx)
	{	strcat(buf, "-DBFS ");
	}

	/* liveness */
	if (!loops && !np_loops)
	{	/* strcat(buf, "-DSAFETY "); */
		/* misses presence of ltl formula */
	} else if (np_loops)
	{	if (bfs_par || bfsx)
		{	fprintf(stderr, "np_loops disabled by bfs%s\n", (bfs_par)?"_par":"");
		} else
		{	strcat(buf, "-DNP ");
	}	}

	/* shortest */
	if (shortest && !bfsx && !bfs_par)
	{	strcat(buf, "-DREACH ");
	}

	strcat(buf, "-o pan pan.c");

	fprintf(fd, "## generated by %s\n## from %s\n\n", VERSION, file_name);
	if (0) fprintf(fd, "set -v\n");

	fprintf(fd, "r_flags=\"\"\n");
	fprintf(fd, "while [ $# -gt 0 ]\n");
	fprintf(fd, "do\n");
	fprintf(fd, "	case $1 in\n");
	fprintf(fd, "	\"-E\")\n");
	fprintf(fd, "		r_flags=\"$r_flags -E\"\n");
	fprintf(fd, "		shift\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	\"-A\")\n");
	fprintf(fd, "		r_flags=\"$r_flags -A\"\n");
	fprintf(fd, "		shift\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	\"-a\")\n");
	fprintf(fd, "		r_flags=\"$r_flags -a\"\n");
	fprintf(fd, "		shift\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	*)\n");
	fprintf(fd, "		break\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	esac\n");
	fprintf(fd, "done\n\n");

	fprintf(fd, "if [ $# -eq 1 ]\n");
	fprintf(fd, "then\n");
	fprintf(fd, "	case $1 in\n");
	fprintf(fd, "	pprep)\n");
				boiler_plate(fd, 1);
	fprintf(fd, "		exit 0	# preserve tmp files\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	prep)\n");
				boiler_plate(fd, 0);
	fprintf(fd, "		if [ -f _modex_.cln ]\n");
	fprintf(fd, "		then %s _modex_.cln # cleanup\n", SH);
	fprintf(fd, "		fi\n");
	fprintf(fd, "		exit 0\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	*)\n");
	fprintf(fd, "		if [ -f _modex_.cln ]\n");
	fprintf(fd, "		then	%s _modex_.cln # cleanup and run\n", SH);
	fprintf(fd, "		fi\n");
	fprintf(fd, "		;;\n");
	fprintf(fd, "	esac\n");
	fprintf(fd, "fi\n\n");

	fprintf(fd, "if [ -f model ]\n");
	fprintf(fd, "then	true\n");
	fprintf(fd, "else\n");
	fprintf(fd, "	echo \"no model file\"\n");
	fprintf(fd, "	exit 1\n");
	fprintf(fd, "fi\n");

	fprintf(fd, "if %s model && %s %s\n", SPIN,
		buf, lnkage_info?lnkage_info:"");
	fprintf(fd, "then\n\t");

	if (bfsx || bfs_par)
	{	sprintf(buf, "./pan -n ");
	} else
	{	sprintf(buf, "./pan $r_flags -n -m%d ", maxdepth);
	}
#if 0
	int wmax = (int) log2( ((double)memlim / (double)vectorsz)*1024.*1024. );
	int wmin = (int) log2( ((double)memlim / (double)8)*1024.*1024. );
	fprintf(stderr, "w: %d .. %d (%d)\n", wmax, wmin, sizeof(long));
#endif

	if (quality >= 9)
	{	sprintf(buf_w, "-w%d ",
			(int) log2( ((double)memlim / (double)8)*1024.*1024. ) - 1);
	} else
	{	sprintf(buf_w, "-w%d ", 20+quality); /* 21 .. 28 */
	}
	strcat(buf, buf_w);

	if (np_loops)
		strcat(buf, "-l ");
	else if (loops)
		strcat(buf, "-a ");
	if (noend)
		strcat(buf, "-E ");
	if (noassert)
		strcat(buf, "-A ");
	if (shortest && !bfsx && !bfs_par)
		strcat(buf, "-i ");
	if (strlen(runtime) > 0)	/* can override builtin options */
		strcat(buf, runtime);

	fprintf(fd, "%s\n", buf);

	fprintf(fd, "else\n");
	fprintf(fd, "	exit 1\n");

	fprintf(fd, "fi\n");
	fprintf(fd, "exit 0\n");
if (debug_io) fprintf(stderr, "close 4 %p\n", fd);
	Fclose(fd);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x428, %rsp            # imm = 0x428
leaq 0x1a7d9(%rip), %rdi     # 0x23bb4
leaq 0x204fd(%rip), %rsi     # 0x298df
callq 0x4270
testq %rax, %rax
je 0x9c2f
movq %rax, %rbx
cmpl $0x0, 0x2f61e(%rip)     # 0x38a18
jne 0x9c36
movl 0x2ce0e(%rip), %ecx     # 0x36214
movl 0x2ce03(%rip), %r8d     # 0x36210
movq 0x2cdcc(%rip), %r9      # 0x361e0
leaq 0x1a184(%rip), %rsi     # 0x2359f
leaq 0x1a19e(%rip), %rdx     # 0x235c0
movq %rsp, %rdi
xorl %eax, %eax
callq 0x42a0
movl $0xa, %eax
cmpl $0x0, 0x2fce0(%rip)     # 0x39118
je 0x9442
movl %eax, 0x2cdc8(%rip)     # 0x36208
jmp 0x9481
movl 0x2cdc0(%rip), %eax     # 0x36208
testl %eax, %eax
js 0x9cb8
cmpl $0xb, %eax
jae 0x9cc7
cmpl $0x9, %eax
jne 0x9481
movl 0x2fcb0(%rip), %ebp     # 0x39114
testl %ebp, %ebp
jne 0x94ae
movq %rsp, %rdi
callq 0x4110
movl $0x4348442d, (%rsp,%rax) # imm = 0x4348442D
movl $0x203443, 0x3(%rsp,%rax) # imm = 0x203443
jmp 0x94a4
cmpl $0x8, %eax
ja 0x94a4
movq %rsp, %rdi
callq 0x4110
movabsq $0x415453544942442d, %rcx # imm = 0x415453544942442D
movq %rcx, (%rsp,%rax)
movl $0x204554, 0x8(%rsp,%rax) # imm = 0x204554
movl 0x2fc6a(%rip), %ebp     # 0x39114
testl %ebp, %ebp
je 0x94d7
movq %rsp, %rdi
callq 0x4110
movabsq $0x41505f534642442d, %rcx # imm = 0x41505F534642442D
movq %rcx, (%rsp,%rax)
movl $0x205241, 0x7(%rsp,%rax) # imm = 0x205241
movb $0x1, %al
movl 0x2fc3b(%rip), %r14d    # 0x39110
jmp 0x9503
movl 0x2fc32(%rip), %r14d    # 0x39110
testl %r14d, %r14d
je 0x94fc
movq %rsp, %rdi
callq 0x4110
movl $0x4642442d, (%rsp,%rax) # imm = 0x4642442D
movl $0x205346, 0x3(%rsp,%rax) # imm = 0x205346
jmp 0x94ff
xorl %r14d, %r14d
xorl %ebp, %ebp
xorl %eax, %eax
cmpl $0x0, 0x2fc1e(%rip)     # 0x39128
je 0x9536
testl %r14d, %r14d
setne %cl
orb %al, %cl
cmpb $0x1, %cl
je 0x9c7a
movq %rsp, %rdi
callq 0x4110
movl $0x504e442d, (%rsp,%rax) # imm = 0x504E442D
movw $0x20, 0x4(%rsp,%rax)
xorl %r14d, %r14d
cmpl $0x0, 0x2fbef(%rip)     # 0x3912c
je 0x9563
testl %r14d, %r14d
jne 0x9563
testl %ebp, %ebp
jne 0x9563
movq %rsp, %rdi
callq 0x4110
movabsq $0x204843414552442d, %rcx # imm = 0x204843414552442D
movq %rcx, (%rsp,%rax)
movb $0x0, 0x8(%rsp,%rax)
movq %rsp, %rdi
callq 0x4110
movabsq $0x70206e6170206f2d, %rcx # imm = 0x70206E6170206F2D
movq %rcx, (%rsp,%rax)
movabsq $0x632e6e6170206e, %rcx # imm = 0x632E6E6170206E
movq %rcx, 0x5(%rsp,%rax)
movq 0x2cc01(%rip), %rdx     # 0x36190
movq 0x2f4f2(%rip), %rcx     # 0x38a88
leaq 0x1a0ea(%rip), %rsi     # 0x23687
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
leaq 0x1a0f9(%rip), %rdi     # 0x236a7
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a0ec(%rip), %rdi     # 0x236b3
movl $0x13, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1bd5d(%rip), %rdi     # 0x2533d
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a0ce(%rip), %r12     # 0x236c7
movl $0xc, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a0bf(%rip), %rdi     # 0x236d4
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a0ae(%rip), %rdi     # 0x236dc
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a0ae(%rip), %r13     # 0x236f5
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a09b(%rip), %r15     # 0x236fe
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a085(%rip), %rdi     # 0x23704
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a074(%rip), %rdi     # 0x2370c
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a04a(%rip), %rdi     # 0x23725
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a039(%rip), %rdi     # 0x2372d
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x1a00f(%rip), %rbp     # 0x23746
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19ff8(%rip), %rdi     # 0x2374b
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19fd3(%rip), %rdi     # 0x23754
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19fc1(%rip), %rdi     # 0x2375b
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19faf(%rip), %rdi     # 0x23762
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19fa7(%rip), %rdi     # 0x23773
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0xc, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19f7f(%rip), %rdi     # 0x23779
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x91e0
leaq 0x19f62(%rip), %rdi     # 0x23782
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19f53(%rip), %rdi     # 0x237a1
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x91e0
leaq 0x19f38(%rip), %r12     # 0x237a9
movl $0x18, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19f35(%rip), %rsi     # 0x237c2
leaq 0x19f4f(%rip), %r14     # 0x237e3
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x41d0
leaq 0x19c8c(%rip), %r13     # 0x23534
movl $0x5, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19f22(%rip), %rdi     # 0x237e6
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x18, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42c0
leaq 0x19ed4(%rip), %rsi     # 0x237f0
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x41d0
movl $0x5, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42c0
movl $0x6, %esi
movl $0x1, %edx
leaq 0x19df0(%rip), %rdi     # 0x23754
movq %rbx, %rcx
callq 0x42c0
leaq 0x19abe(%rip), %rdi     # 0x23431
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19e8d(%rip), %rdi     # 0x23819
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19a48(%rip), %rdi     # 0x233ed
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1b9b9(%rip), %rdi     # 0x25377
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19e53(%rip), %rdi     # 0x2382a
movl $0x16, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19a36(%rip), %rdi     # 0x23426
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19b2d(%rip), %rdi     # 0x23536
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movq 0x2f70e(%rip), %rax     # 0x39130
testq %rax, %rax
leaq 0x1c665(%rip), %r8      # 0x26091
cmovneq %rax, %r8
leaq 0x19e0a(%rip), %rsi     # 0x23841
leaq 0x19e19(%rip), %rdx     # 0x23857
movq %rbx, %rdi
movq %rsp, %rcx
xorl %eax, %eax
callq 0x41d0
leaq 0x19e0d(%rip), %rdi     # 0x2385f
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
movl 0x2f6aa(%rip), %eax     # 0x39114
orl 0x2f6a0(%rip), %eax     # 0x39110
je 0x9a89
movabsq $0x6e2d206e61702f2e, %rax # imm = 0x6E2D206E61702F2E
movq %rax, (%rsp)
movw $0x20, 0x8(%rsp)
jmp 0x9aa0
movl 0x2c77d(%rip), %edx     # 0x3620c
leaq 0x19dda(%rip), %rsi     # 0x23870
movq %rsp, %rdi
xorl %eax, %eax
callq 0x42a0
movl 0x2c762(%rip), %edx     # 0x36208
cmpl $0x9, %edx
jl 0x9ad8
cvtsi2sdl 0x2c75d(%rip), %xmm0 # 0x36210
mulsd 0x189cd(%rip), %xmm0    # 0x22488
movsd 0x189cd(%rip), %xmm1    # 0x22490
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
callq 0x4040
cvttsd2si %xmm0, %edx
decl %edx
jmp 0x9adb
addl $0x14, %edx
leaq 0x19da6(%rip), %rsi     # 0x23888
leaq 0x400(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x42a0
movq %rsp, %rdi
movq %r14, %rsi
callq 0x4290
movl $0x206c2d, %ebp         # imm = 0x206C2D
cmpl $0x0, 0x2f61d(%rip)     # 0x39128
jne 0x9b1b
movl $0x20612d, %ebp         # imm = 0x20612D
cmpl $0x0, 0x2f603(%rip)     # 0x3911c
je 0x9b26
movq %rsp, %rdi
callq 0x4110
movl %ebp, (%rsp,%rax)
cmpl $0x0, 0x2f5f3(%rip)     # 0x39120
je 0x9b3e
movq %rsp, %rdi
callq 0x4110
movl $0x20452d, (%rsp,%rax)  # imm = 0x20452D
cmpl $0x0, 0x2f5df(%rip)     # 0x39124
je 0x9b56
movq %rsp, %rdi
callq 0x4110
movl $0x20412d, (%rsp,%rax)  # imm = 0x20412D
cmpl $0x0, 0x2f5cf(%rip)     # 0x3912c
je 0x9b80
cmpl $0x0, 0x2f5aa(%rip)     # 0x39110
jne 0x9b80
cmpl $0x0, 0x2f5a5(%rip)     # 0x39114
jne 0x9b80
movq %rsp, %rdi
callq 0x4110
movl $0x20692d, (%rsp,%rax)  # imm = 0x20692D
movq 0x2c649(%rip), %rsi     # 0x361d0
cmpb $0x0, (%rsi)
je 0x9b94
movq %rsp, %rdi
callq 0x4290
leaq 0x1a7e1(%rip), %rsi     # 0x2437c
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41d0
leaq 0x1b7c8(%rip), %rdi     # 0x25377
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x1985e(%rip), %rdi     # 0x23426
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19955(%rip), %rdi     # 0x23536
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
leaq 0x19bee(%rip), %rdi     # 0x237e8
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42c0
cmpl $0x0, 0x2ee05(%rip)     # 0x38a18
jne 0x9c5d
movq %rbx, %rdi
callq 0x77d0
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4416
jmp 0x9c1d
movq 0x2c3bb(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x196a2(%rip), %rsi     # 0x232e9
leaq 0x19f66(%rip), %rdx     # 0x23bb4
movq %rbx, %rcx
xorl %eax, %eax
callq 0x41d0
jmp 0x9400
movq 0x2c394(%rip), %rax     # 0x35ff8
movq (%rax), %rdi
leaq 0x19c20(%rip), %rsi     # 0x2388e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41d0
jmp 0x9c15
movq 0x2c377(%rip), %rcx     # 0x35ff8
movq (%rcx), %rdi
leaq 0x199db(%rip), %rcx     # 0x23666
leaq 0x1c3ff(%rip), %rdx     # 0x26091
testb %al, %al
cmovneq %rcx, %rdx
leaq 0x199ab(%rip), %rsi     # 0x2364a
xorl %eax, %eax
callq 0x41d0
movl 0x2f463(%rip), %r14d    # 0x39110
movl 0x2f461(%rip), %ebp     # 0x39114
jmp 0x9536
callq 0x43fa
movl $0x1, %eax
jmp 0x943a
callq 0x43ce
jmp 0x94a4