// File: /workspace/github_c_makefile_star2_O1/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 0x24875(%rip), %rax     # 0x399c8
cmpl $0x0, (%rax)
je 0x1529d
movq 0x30(%r14), %rdi
callq 0x154de
testq %rax, %rax
je 0x1529d
movq %rax, %r15
leaq 0x251f8(%rip), %r12     # 0x3a370
movq %rsp, %rdi
movq %r12, %rsi
callq 0x40b0
leaq 0x11e0e(%rip), %rsi     # 0x26f98
movq %r12, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x4290
movq 0x33c52(%rip), %rdi     # 0x48df0
callq 0xadf7
movq %r12, %rdi
callq 0x4110
movw $0x29, (%rax,%r12)
leaq 0x11986(%rip), %rsi     # 0x26b3f
movq %r15, %rdi
callq 0x41b0
testl %eax, %eax
je 0x15228
leaq 0x11982(%rip), %rsi     # 0x26b4e
movq %r15, %rdi
callq 0x41b0
testl %eax, %eax
je 0x1522f
leaq 0x11982(%rip), %rsi     # 0x26b61
movq %r15, %rdi
callq 0x41b0
testl %eax, %eax
je 0x15255
leaq 0x11982(%rip), %rsi     # 0x26b74
movq %r15, %rdi
callq 0x41b0
testl %eax, %eax
jne 0x15283
leaq 0x25167(%rip), %rdi     # 0x3a370
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x15283
movq 0x25141(%rip), %rdi     # 0x3a360
leaq 0x11dbb(%rip), %rsi     # 0x26fe1
jmp 0x15279
callq 0x14aaa
jmp 0x15283
leaq 0x2513a(%rip), %rdi     # 0x3a370
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x15283
movq 0x25114(%rip), %rdi     # 0x3a360
leaq 0x11d4c(%rip), %rsi     # 0x26f9f
jmp 0x15279
leaq 0x25114(%rip), %rdi     # 0x3a370
movl $0x28, %esi
callq 0x4130
testq %rax, %rax
je 0x15283
movq 0x250ee(%rip), %rdi     # 0x3a360
leaq 0x11d47(%rip), %rsi     # 0x26fc0
movq %rax, %rdx
xorl %eax, %eax
callq 0x41c0
leaq 0x250e6(%rip), %rdi     # 0x3a370
movq %rsp, %rsi
callq 0x40b0
movq $0x0, 0x33b53(%rip) # 0x48df0
cmpl $0x159, 0x18(%r14)      # imm = 0x159
jne 0x15310
leaq 0x19612(%rip), %rdi     # 0x2e8c0
callq 0x12436
movq 0x30(%r14), %rdi
callq 0xadf7
leaq 0x21f21(%rip), %rax     # 0x371e4
cmpl $0x0, (%rax)
leaq 0x11c44(%rip), %rax     # 0x26f11
leaq 0x11d30(%rip), %rdi     # 0x27004
cmoveq %rax, %rdi
callq 0x12436
movq 0x38(%r14), %rdi
xorl %esi, %esi
callq 0x12679
leaq 0x11d19(%rip), %rdi     # 0x27008
callq 0x12436
movq 0x40(%r14), %rdi
xorl %esi, %esi
callq 0x12679
leaq 0x104f6(%rip), %rdi     # 0x257fc
callq 0x12436
jmp 0x15397
movq 0x30(%r14), %rdi
movq 0x38(%r14), %rsi
leaq 0x11517(%rip), %r9      # 0x26836
movq %rsp, %rcx
xorl %edx, %edx
movl %ebx, %r8d
callq 0x15601
movq 0x30(%r14), %rdi
movq 0x40(%r14), %r14
testb $0x1, %al
je 0x15356
leaq 0x1042b(%rip), %rdx     # 0x2576a
leaq 0x11cc6(%rip), %r9      # 0x2700c
movq %rsp, %rsi
movq %r14, %rcx
movl %ebx, %r8d
callq 0x1584e
jmp 0x15397
movb $0x0, 0x25013(%rip)     # 0x3a370
cmpb $0x0, (%rsp)
je 0x15397
movq %rsp, %rsi
callq 0x158e5
cmpl $0x0, 0x2d776(%rip)     # 0x42ae8
je 0x15387
movb $0x0, 0x24ff5(%rip)     # 0x3a370
movq %r14, %rdi
movl %ebx, %esi
callq 0x12679
jmp 0x15397
cmpl $0x0, 0x2d756(%rip)     # 0x42ae4
je 0x153a6
movb $0x0, 0x24fd9(%rip)     # 0x3a370
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r14
popq %r15
retq
leaq 0x11ce7(%rip), %rsi     # 0x27094
movl %ebx, %edi
callq 0x124f5
movq %r14, %rdi
callq 0x11e5f
leaq 0x103a7(%rip), %rdi     # 0x2576a
callq 0xebec
jmp 0x1537b