// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]Modex/Src/xtract.c
// Function: modex_if
static void
modex_if(if_node *ifn, int tabs)
{	char oO[1024];
	int xtmp;
	char *efn = NULL;

	if (visu != 0 && ((efn = has_instrumented(ifn->cond, "")) != NULL))
	{	char MBuf[BigEnough];

		// move instrumented function call out of conditional test

		strcpy(MBuf, OutBuf);	// remember

		sprintf(OutBuf, "F: %s(", efn);
		modex_recur(keep_pars);
		strcat(OutBuf, ")");

		if (strcmp(efn, "pthread_create") == 0)
		{	handle_pthread_create(1);
		} else if (strcmp(efn, "pthread_mutex_init") == 0)
		{	char *z;
			z = strchr(OutBuf, '(');
			if (z)
			{	fprintf(fp, "\t\tc_code { spin_mutex_init%s; }\n", z);
			}
		} else if (strcmp(efn, "pthread_mutex_lock") == 0)
		{	char *z;
			z = strchr(OutBuf, '(');
			if (z)
			{	fprintf(fp, "\t\tc_code { spin_mutex_lock%s; }\n", z);
			}
		} else if (strcmp(efn, "pthread_mutex_unlock") == 0)
		{	char *z;
			z = strchr(OutBuf, '(');
			if (z)
			{	fprintf(fp, "\t\tc_code { spin_mutex_unlock%s; }\n", z);
			}
		}

		strcpy(OutBuf, MBuf);	// restore

		keep_root = 0;
		keep_pars = 0;
	}

	if (ifn->hdr.tok == QUESTMARK)		/* cond expr */
	{	vis_print("(");
		modex_recur(ifn->cond);
		if (use_c_code)			/* should be stmnt specific */
			vis_print(" ? ");	/* c-syntax */
		else
			vis_print(" -> ");	/* promela-syntax */
		modex_any(ifn->then_n, 0);
		vis_print(" : ");
		modex_any(ifn->else_n, 0);
		vis_print(")");
	} else
	{	xtmp = handle_cond(ifn->cond, ifn->then_n, ZN, oO, tabs, "if\n");
		switch (xtmp) {
		case 2:
			vis_indent(tabs, "\n\tfi;\n");
			break;
		case 1:
			handle_neg(ifn->cond, oO, "\n", ifn->else_n, tabs, "\n\tfi;\n");
			break;
		case 0:
			handle_shortcut(ifn->cond, oO, ifn->else_n, tabs);
			break;
	}	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
movl %esi, %ebx
movq %rdi, %r14
leaq 0x23715(%rip), %rax     # 0x389d8
cmpl $0x0, (%rax)
je 0x1540d
movq 0x30(%r14), %rdi
callq 0x1564e
testq %rax, %rax
je 0x1540d
movq %rax, %r15
leaq 0x24098(%rip), %r12     # 0x39380
movq %rsp, %rdi
movq %r12, %rsi
callq 0x40b0
leaq 0x10c9e(%rip), %rsi     # 0x25f98
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x42a0
movq 0x32af2(%rip), %rdi     # 0x47e00
callq 0xaca3
movq %r12, %rdi
callq 0x4110
movw $0x29, (%rax,%r12)
leaq 0x10816(%rip), %rsi     # 0x25b3f
movq %r15, %rdi
callq 0x41c0
testl %eax, %eax
je 0x15398
leaq 0x10812(%rip), %rsi     # 0x25b4e
movq %r15, %rdi
callq 0x41c0
testl %eax, %eax
je 0x1539f
leaq 0x10812(%rip), %rsi     # 0x25b61
movq %r15, %rdi
callq 0x41c0
testl %eax, %eax
je 0x153c5
leaq 0x10812(%rip), %rsi     # 0x25b74
movq %r15, %rdi
callq 0x41c0
testl %eax, %eax
jne 0x153f3
leaq 0x24007(%rip), %rdi     # 0x39380
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x153f3
movq 0x23fe1(%rip), %rdi     # 0x39370
leaq 0x10c4b(%rip), %rsi     # 0x25fe1
jmp 0x153e9
callq 0x14c06
jmp 0x153f3
leaq 0x23fda(%rip), %rdi     # 0x39380
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x153f3
movq 0x23fb4(%rip), %rdi     # 0x39370
leaq 0x10bdc(%rip), %rsi     # 0x25f9f
jmp 0x153e9
leaq 0x23fb4(%rip), %rdi     # 0x39380
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x153f3
movq 0x23f8e(%rip), %rdi     # 0x39370
leaq 0x10bd7(%rip), %rsi     # 0x25fc0
movq %rax, %rdx
xorl %eax, %eax
callq 0x41d0
leaq 0x23f86(%rip), %rdi     # 0x39380
movq %rsp, %rsi
callq 0x40b0
movq $0x0, 0x329f3(%rip) # 0x47e00
cmpl $0x159, 0x18(%r14)      # imm = 0x159
jne 0x15480
leaq 0x1848e(%rip), %rdi     # 0x2d8ac
callq 0x12500
movq 0x30(%r14), %rdi
callq 0xaca3
leaq 0x20dc1(%rip), %rax     # 0x361f4
cmpl $0x0, (%rax)
leaq 0x10ad4(%rip), %rax     # 0x25f11
leaq 0x10bc0(%rip), %rdi     # 0x26004
cmoveq %rax, %rdi
callq 0x12500
movq 0x38(%r14), %rdi
xorl %esi, %esi
callq 0x12743
leaq 0x10ba9(%rip), %rdi     # 0x26008
callq 0x12500
movq 0x40(%r14), %rdi
xorl %esi, %esi
callq 0x12743
leaq 0xf386(%rip), %rdi      # 0x247fc
callq 0x12500
jmp 0x15507
movq 0x30(%r14), %rdi
movq 0x38(%r14), %rsi
leaq 0x103a7(%rip), %r9      # 0x25836
movq %rsp, %rcx
xorl %edx, %edx
movl %ebx, %r8d
callq 0x15753
movq 0x30(%r14), %rdi
movq 0x40(%r14), %r14
testb $0x1, %al
je 0x154c6
leaq 0xf2bb(%rip), %rdx      # 0x2476a
leaq 0x10b56(%rip), %r9      # 0x2600c
movq %rsp, %rsi
movq %r14, %rcx
movl %ebx, %r8d
callq 0x15985
jmp 0x15507
movb $0x0, 0x23eb3(%rip)     # 0x39380
cmpb $0x0, (%rsp)
je 0x15507
movq %rsp, %rsi
callq 0x15a24
cmpl $0x0, 0x2c616(%rip)     # 0x41af8
je 0x154f7
movb $0x0, 0x23e95(%rip)     # 0x39380
movq %r14, %rdi
movl %ebx, %esi
callq 0x12743
jmp 0x15507
cmpl $0x0, 0x2c5f6(%rip)     # 0x41af4
je 0x15516
movb $0x0, 0x23e79(%rip)     # 0x39380
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x10b74(%rip), %rsi     # 0x26091
movl %ebx, %edi
callq 0x125bf
movq %r14, %rdi
callq 0x11f2d
leaq 0xf237(%rip), %rdi      # 0x2476a
callq 0xeab6
jmp 0x154eb