// File: /workspace/github_c_makefile_star2_O1/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 0x1b62a(%rip), %rdi     # 0x24bb4
leaq 0x2134e(%rip), %rsi     # 0x2a8df
callq 0x4260
testq %rax, %rax
je 0x9dce
movq %rax, %rbx
cmpl $0x0, 0x3045f(%rip)     # 0x39a08
jne 0x9dd5
movl 0x2dc4f(%rip), %ecx     # 0x37204
movl 0x2dc44(%rip), %r8d     # 0x37200
movq 0x2dc0d(%rip), %r9      # 0x371d0
leaq 0x1afd5(%rip), %rsi     # 0x2459f
leaq 0x1afef(%rip), %rdx     # 0x245c0
movq %rsp, %rdi
xorl %eax, %eax
callq 0x4290
cmpl $0x0, 0x30b26(%rip)     # 0x3a108
je 0x95ee
movl $0xa, 0x2dc0a(%rip)     # 0x371f8
cmpl $0x0, 0x2dc03(%rip)     # 0x371f8
js 0x9dfc
cmpl $0xb, 0x2dbf6(%rip)     # 0x371f8
jge 0x9e06
movl 0x2dbea(%rip), %eax     # 0x371f8
cmpl $0x9, %eax
jne 0x9635
cmpl $0x0, 0x30aea(%rip)     # 0x3a104
jne 0x9655
movq %rsp, %rdi
callq 0x4110
movl $0x4348442d, (%rsp,%rax) # imm = 0x4348442D
movl $0x203443, 0x3(%rsp,%rax) # imm = 0x203443
jmp 0x9655
jge 0x9655
movq %rsp, %rdi
callq 0x4110
movabsq $0x415453544942442d, %rcx # imm = 0x415453544942442D
movq %rcx, (%rsp,%rax)
movl $0x204554, 0x8(%rsp,%rax) # imm = 0x204554
movl 0x30aa9(%rip), %ebp     # 0x3a104
testl %ebp, %ebp
je 0x967f
movq %rsp, %rdi
callq 0x4110
movabsq $0x41505f534642442d, %rcx # imm = 0x41505F534642442D
movq %rcx, (%rsp,%rax)
movl $0x205241, 0x7(%rsp,%rax) # imm = 0x205241
jmp 0x969f
cmpl $0x0, 0x30a7a(%rip)     # 0x3a100
je 0x969f
movq %rsp, %rdi
callq 0x4110
movl $0x4642442d, (%rsp,%rax) # imm = 0x4642442D
movl $0x205346, 0x3(%rsp,%rax) # imm = 0x205346
cmpl $0x0, 0x30a72(%rip)     # 0x3a118
je 0x96cc
movl 0x30a52(%rip), %eax     # 0x3a100
orl %ebp, %eax
jne 0x9e2d
movq %rsp, %rdi
callq 0x4110
movl $0x504e442d, (%rsp,%rax) # imm = 0x504E442D
movw $0x20, 0x4(%rsp,%rax)
cmpl $0x0, 0x30a49(%rip)     # 0x3a11c
je 0x9702
cmpl $0x0, 0x30a24(%rip)     # 0x3a100
jne 0x9702
cmpl $0x0, 0x30a1f(%rip)     # 0x3a104
jne 0x9702
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 0x2da52(%rip), %rdx     # 0x37180
movq 0x30343(%rip), %rcx     # 0x39a78
leaq 0x1af4b(%rip), %rsi     # 0x24687
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41c0
leaq 0x1af5a(%rip), %rdi     # 0x246a7
movl $0xb, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1af4d(%rip), %rdi     # 0x246b3
movl $0x13, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1cbbe(%rip), %rdi     # 0x2633d
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1af2f(%rip), %r12     # 0x246c7
movl $0xc, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1af20(%rip), %rdi     # 0x246d4
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1af0f(%rip), %rdi     # 0x246dc
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1af0f(%rip), %r13     # 0x246f5
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1aefc(%rip), %r15     # 0x246fe
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1aee6(%rip), %rdi     # 0x24704
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1aed5(%rip), %rdi     # 0x2470c
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1aeab(%rip), %rdi     # 0x24725
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae9a(%rip), %rdi     # 0x2472d
movl $0x18, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0x8, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae70(%rip), %rbp     # 0x24746
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae59(%rip), %rdi     # 0x2474b
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae34(%rip), %rdi     # 0x24754
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae22(%rip), %rdi     # 0x2475b
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae10(%rip), %rdi     # 0x24762
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ae08(%rip), %rdi     # 0x24773
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0xc, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ade0(%rip), %rdi     # 0x24779
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movq %rbx, %rdi
movl $0x1, %esi
callq 0x938f
leaq 0x1adc3(%rip), %rdi     # 0x24782
movl $0x1e, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1adb4(%rip), %rdi     # 0x247a1
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movq %rbx, %rdi
xorl %esi, %esi
callq 0x938f
leaq 0x1ad99(%rip), %r12     # 0x247a9
movl $0x18, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ad96(%rip), %rsi     # 0x247c2
leaq 0x1adb0(%rip), %r14     # 0x247e3
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
leaq 0x1aaed(%rip), %r13     # 0x24534
movl $0x5, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ad83(%rip), %rdi     # 0x247e6
movl $0x9, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x4, %esi
movl $0x1, %edx
movq %rbp, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x18, %esi
movl $0x1, %edx
movq %r12, %rdi
movq %rbx, %rcx
callq 0x42b0
leaq 0x1ad35(%rip), %rsi     # 0x247f0
movq %rbx, %rdi
movq %r14, %rdx
xorl %eax, %eax
callq 0x41c0
movl $0x5, %esi
movl $0x1, %edx
movq %r13, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x5, %esi
movl $0x1, %edx
movq %r15, %rdi
movq %rbx, %rcx
callq 0x42b0
movl $0x6, %esi
movl $0x1, %edx
leaq 0x1ac51(%rip), %rdi     # 0x24754
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a91f(%rip), %rdi     # 0x24431
movl $0x4, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1acee(%rip), %rdi     # 0x24819
movl $0x10, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a8a9(%rip), %rdi     # 0x243ed
movl $0xa, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1c81a(%rip), %rdi     # 0x26377
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1acb4(%rip), %rdi     # 0x2482a
movl $0x16, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a897(%rip), %rdi     # 0x24426
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a98e(%rip), %rdi     # 0x24536
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movq 0x3055f(%rip), %rax     # 0x3a120
testq %rax, %rax
leaq 0x1d4c9(%rip), %r8      # 0x27094
cmovneq %rax, %r8
leaq 0x1ac6b(%rip), %rsi     # 0x24841
leaq 0x1ac7a(%rip), %rdx     # 0x24857
movq %rbx, %rdi
movq %rsp, %rcx
xorl %eax, %eax
callq 0x41c0
leaq 0x1ac6e(%rip), %rdi     # 0x2485f
movl $0x6, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
movl 0x304fb(%rip), %eax     # 0x3a104
orl 0x304f1(%rip), %eax     # 0x3a100
je 0x9c28
movabsq $0x6e2d206e61702f2e, %rax # imm = 0x6E2D206E61702F2E
movq %rax, (%rsp)
movw $0x20, 0x8(%rsp)
jmp 0x9c3f
movl 0x2d5ce(%rip), %edx     # 0x371fc
leaq 0x1ac3b(%rip), %rsi     # 0x24870
movq %rsp, %rdi
xorl %eax, %eax
callq 0x4290
movl 0x2d5b3(%rip), %edx     # 0x371f8
cmpl $0x9, %edx
jl 0x9c77
cvtsi2sdl 0x2d5ae(%rip), %xmm0 # 0x37200
mulsd 0x1982e(%rip), %xmm0    # 0x23488
movsd 0x1982e(%rip), %xmm1    # 0x23490
mulsd %xmm1, %xmm0
mulsd %xmm1, %xmm0
callq 0x4040
cvttsd2si %xmm0, %edx
decl %edx
jmp 0x9c7a
addl $0x14, %edx
leaq 0x1ac07(%rip), %rsi     # 0x24888
leaq 0x400(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x4290
movq %rsp, %rdi
movq %r14, %rsi
callq 0x4280
movl $0x206c2d, %ebp         # imm = 0x206C2D
cmpl $0x0, 0x3046e(%rip)     # 0x3a118
jne 0x9cba
movl $0x20612d, %ebp         # imm = 0x20612D
cmpl $0x0, 0x30454(%rip)     # 0x3a10c
je 0x9cc5
movq %rsp, %rdi
callq 0x4110
movl %ebp, (%rsp,%rax)
cmpl $0x0, 0x30444(%rip)     # 0x3a110
je 0x9cdd
movq %rsp, %rdi
callq 0x4110
movl $0x20452d, (%rsp,%rax)  # imm = 0x20452D
cmpl $0x0, 0x30430(%rip)     # 0x3a114
je 0x9cf5
movq %rsp, %rdi
callq 0x4110
movl $0x20412d, (%rsp,%rax)  # imm = 0x20412D
cmpl $0x0, 0x30420(%rip)     # 0x3a11c
je 0x9d1f
cmpl $0x0, 0x303fb(%rip)     # 0x3a100
jne 0x9d1f
cmpl $0x0, 0x303f6(%rip)     # 0x3a104
jne 0x9d1f
movq %rsp, %rdi
callq 0x4110
movl $0x20692d, (%rsp,%rax)  # imm = 0x20692D
movq 0x2d49a(%rip), %rsi     # 0x371c0
cmpb $0x0, (%rsi)
je 0x9d33
movq %rsp, %rdi
callq 0x4280
leaq 0x1b642(%rip), %rsi     # 0x2537c
movq %rsp, %rdx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x41c0
leaq 0x1c629(%rip), %rdi     # 0x26377
movl $0x5, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a6bf(%rip), %rdi     # 0x24426
movl $0x8, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1a7b6(%rip), %rdi     # 0x24536
movl $0x3, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
leaq 0x1aa4f(%rip), %rdi     # 0x247e8
movl $0x7, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x42b0
cmpl $0x0, 0x2fc56(%rip)     # 0x39a08
jne 0x9e10
movq %rbx, %rdi
callq 0x793c
addq $0x428, %rsp            # imm = 0x428
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4415
jmp 0x9dbc
movq 0x2d21c(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1a503(%rip), %rsi     # 0x242e9
leaq 0x1adc7(%rip), %rdx     # 0x24bb4
movq %rbx, %rcx
xorl %eax, %eax
callq 0x41c0
jmp 0x95af
callq 0x438c
jmp 0x95fb
callq 0x43b8
jmp 0x9608
movq 0x2d1e1(%rip), %rax     # 0x36ff8
movq (%rax), %rdi
leaq 0x1aa6d(%rip), %rsi     # 0x2488e
movq %rbx, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x9db4
xorl %edi, %edi
testl %ebp, %ebp
setne %dil
callq 0x43e4
jmp 0x96cc