// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]libcperciva/tests/fork_func/main.c
// Function: main
int
main(int argc, char ** argv)
{
	int child_ms = -1;
	int num_reps = -1;
	const char * ch;
	enum modes mode = UNSET;

	WARNP_INIT;

	/* Process arguments. */
	while ((ch = GETOPT(argc, argv)) != NULL) {
		GETOPT_SWITCH(ch) {
		GETOPT_OPT("-c"):
			mode = CHECK_ORDER;
			break;
		GETOPT_OPTARG("-d"):
			if (PARSENUM(&child_ms, optarg, 0, 10000)) {
				warnp("parsenum");
				goto err0;
			}
			break;
		GETOPT_OPT("-e"):
			mode = CHECK_EXEC;
			break;
		GETOPT_OPTARG("-n"):
			if (PARSENUM(&num_reps, optarg, 0, 10000)) {
				warnp("parsenum");
				goto err0;
			}
			break;
		GETOPT_OPT("-t"):
			mode = PERFTEST;
			break;
		GETOPT_OPT("-x"):
			mode = CHECK_EXIT;
			break;
		GETOPT_DEFAULT:
			usage();
		}
	}
	argc -= optind;
	argv += optind;

	/* We should have processed all the arguments. */
	if (argc != 0)
		usage();
	(void)argv; /* argv is not used beyond this point. */

	/* Run test. */
	switch (mode) {
	case CHECK_ORDER:
		/* Sanity test. */
		if ((child_ms != -1) || (num_reps != -1))
			usage();

		/* Run check. */
		if (check_order())
			goto err0;
		break;
	case CHECK_EXEC:
		/* Sanity test. */
		if ((child_ms != -1) || (num_reps != -1))
			usage();

		/* Run check. */
		if (check_exec())
			goto err0;
		break;
	case CHECK_EXIT:
		/* Sanity test. */
		if ((child_ms != -1) || (num_reps != -1))
			usage();

		/* Run check. */
		if (check_exit())
			goto err0;
		break;
	case PERFTEST:
		/* Sanity test. */
		if ((child_ms == -1) || (num_reps == -1))
			usage();

		/* Run perftest. */
		if (check_perftest(child_ms, num_reps))
			goto err0;
		break;
	case UNSET:
		usage();
	}

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edi, %r12d
movq %rsi, 0x30(%rsp)
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x137f
callq 0x27e4
movl $0x0, 0x4(%rsp)
pushq $-0x1
popq %rax
leaq 0x3df7(%rip), %rbp      # 0x5188
pushq $0x1
popq %r15
pushq $0x3d
popq %r14
leaq 0x1cbd(%rip), %r13      # 0x305d
movq %rax, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movl %r12d, 0x20(%rsp)
movl %r12d, %edi
movq 0x30(%rsp), %rsi
callq 0x1d3c
testq %rax, %rax
je 0x15c2
movq %rax, %rbx
movq $0x27, 0x8(%rsp)
movq 0x8(%rsp), %rax
decq %rax
movq %rax, 0x28(%rsp)
movl $0x0, 0x24(%rsp)
cmpl $0x0, (%rbp)
je 0x13fb
movq %rbx, %rdi
callq 0x2151
addq 0x8(%rsp), %rax
jmp 0x1409
movq 0x28(%rsp), %rax
leaq 0x1(%rax), %rcx
movq %rcx, 0x28(%rsp)
cmpq $0x28, %rax
je 0x14fb
cmpq $0x2b, %rax
je 0x14d5
cmpq $0x31, %rax
je 0x146e
cmpq $0x34, %rax
je 0x14a7
cmpq $0x3a, %rax
je 0x148c
cmpq $0x3d, %rax
je 0x14c2
cmpq $0x40, %rax
je 0x1520
cmpl $0x0, (%rbp)
jne 0x1695
cmpl $0x0, 0x24(%rsp)
jne 0x13e6
pushq $0x40
popq %rdi
subq 0x8(%rsp), %rdi
callq 0x24be
movl $0x1, 0x24(%rsp)
jmp 0x13e6
cmpl $0x0, (%rbp)
jne 0x15b6
pushq $0x31
popq %rsi
subq 0x8(%rsp), %rsi
leaq 0x1bcd(%rip), %rdi      # 0x3054
jmp 0x1514
cmpl $0x0, (%rbp)
jne 0x15aa
pushq $0x3a
popq %rsi
subq 0x8(%rsp), %rsi
leaq 0x1bb5(%rip), %rdi      # 0x305a
jmp 0x1514
cmpl $0x0, (%rbp)
jne 0x1538
pushq $0x34
popq %rsi
subq 0x8(%rsp), %rsi
leaq 0x1b97(%rip), %rdi      # 0x3057
jmp 0x14ee
cmpl $0x0, (%rbp)
jne 0x152c
movq %r14, %rsi
subq 0x8(%rsp), %rsi
movq %r13, %rdi
jmp 0x1514
cmpl $0x0, (%rbp)
jne 0x1565
pushq $0x2b
popq %rsi
subq 0x8(%rsp), %rsi
leaq 0x1b5a(%rip), %rdi      # 0x3048
movl %r15d, %edx
callq 0x2269
jmp 0x13e6
cmpl $0x0, (%rbp)
jne 0x15a0
pushq $0x28
popq %rsi
subq 0x8(%rsp), %rsi
leaq 0x1b04(%rip), %rdi      # 0x3018
xorl %edx, %edx
callq 0x2269
jmp 0x13e6
movl $0x1, (%rbp)
jmp 0x13af
pushq $0x3
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x13af
leaq 0x3c41(%rip), %rax      # 0x5180
movq (%rax), %r12
testq %r12, %r12
je 0x1618
callq 0x1080
movq %rax, %rbx
andl $0x0, (%rax)
movq %r12, %rdi
callq 0x16b2
movq %rax, 0x10(%rsp)
jmp 0x1590
leaq 0x3c14(%rip), %rax      # 0x5180
movq (%rax), %r12
testq %r12, %r12
je 0x1631
callq 0x1080
movq %rax, %rbx
andl $0x0, (%rax)
movq %r12, %rdi
callq 0x16b2
movq %rax, 0x18(%rsp)
cmpl $0x0, (%rbx)
movl 0x20(%rsp), %r12d
je 0x13af
jmp 0x1602
movl %r15d, 0x4(%rsp)
jmp 0x13af
pushq $0x4
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x13af
pushq $0x2
popq %rax
movl %eax, 0x4(%rsp)
jmp 0x13af
leaq 0x3b8f(%rip), %rax      # 0x5158
cmpl %r12d, (%rax)
jne 0x1695
movl 0x4(%rsp), %eax
leaq 0x1a27(%rip), %rcx      # 0x3004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x18(%rsp), %rax
andl 0x10(%rsp), %eax
cmpl $-0x1, %eax
jne 0x1695
callq 0x1834
jmp 0x169f
leaq 0x1a42(%rip), %rdi      # 0x304b
xorl %eax, %eax
callq 0x2861
andl $0x0, (%rbx)
jmp 0x16aa
leaq 0x19fc(%rip), %rdi      # 0x301b
leaq 0x1a04(%rip), %rsi      # 0x302a
leaq 0x1a04(%rip), %rcx      # 0x3031
pushq $0x34
jmp 0x1648
leaq 0x19e3(%rip), %rdi      # 0x301b
leaq 0x19eb(%rip), %rsi      # 0x302a
leaq 0x19eb(%rip), %rcx      # 0x3031
pushq $0x2b
popq %rdx
callq 0x1110
movq 0x18(%rsp), %rdi
cmpl $-0x1, %edi
sete %al
movq 0x10(%rsp), %rsi
cmpl $-0x1, %esi
sete %cl
orb %al, %cl
cmpb $0x1, %cl
je 0x1695
callq 0x19b8
jmp 0x169f
movq 0x18(%rsp), %rax
andl 0x10(%rsp), %eax
cmpl $-0x1, %eax
jne 0x1695
callq 0x1764
jmp 0x169f
movq 0x18(%rsp), %rax
andl 0x10(%rsp), %eax
cmpl $-0x1, %eax
je 0x169a
callq 0x1723
callq 0x17d8
testl %eax, %eax
jne 0x16aa
xorl %edi, %edi
callq 0x11f0
pushq $0x1
popq %rdi
callq 0x11f0