// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x1440, %rsp           # imm = 0x1440
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq $0x0, -0x420(%rbp)
leaq 0x2f2ac(%rip), %rax     # 0x47ba0
cmpl $0x0, (%rax)
je 0x18ad1
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
leaq 0x1ebb2(%rip), %rsi     # 0x374be
callq 0x19030
movq %rax, -0x420(%rbp)
cmpq $0x0, %rax
je 0x18ad1
leaq -0x1420(%rbp), %rdi
leaq 0x2fc20(%rip), %rsi     # 0x48550
callq 0x40a0
movq -0x420(%rbp), %rdx
leaq 0x2fc0d(%rip), %rdi     # 0x48550
leaq 0x1ea69(%rip), %rsi     # 0x373b3
movb $0x0, %al
callq 0x4260
movq 0x3e678(%rip), %rdi     # 0x56fd0
callq 0xadb0
leaq 0x2fbec(%rip), %rdi     # 0x48550
leaq 0x1d17e(%rip), %rsi     # 0x35ae9
callq 0x4250
movq -0x420(%rbp), %rdi
leaq 0x1e5b1(%rip), %rsi     # 0x36f2f
callq 0x4180
cmpl $0x0, %eax
jne 0x18997
movl $0x1, %edi
callq 0x180c0
jmp 0x18aa8
movq -0x420(%rbp), %rdi
leaq 0x1e599(%rip), %rsi     # 0x36f3e
callq 0x4180
cmpl $0x0, %eax
jne 0x189f2
leaq 0x2fb9a(%rip), %rdi     # 0x48550
movl $0x28, %esi
callq 0x4110
movq %rax, -0x1428(%rbp)
cmpq $0x0, -0x1428(%rbp)
je 0x189ed
movq 0x2fb68(%rip), %rdi     # 0x48540
movq -0x1428(%rbp), %rdx
leaq 0x1e9d4(%rip), %rsi     # 0x373ba
movb $0x0, %al
callq 0x4190
jmp 0x18aa6
movq -0x420(%rbp), %rdi
leaq 0x1e551(%rip), %rsi     # 0x36f51
callq 0x4180
cmpl $0x0, %eax
jne 0x18a4a
leaq 0x2fb3f(%rip), %rdi     # 0x48550
movl $0x28, %esi
callq 0x4110
movq %rax, -0x1430(%rbp)
cmpq $0x0, -0x1430(%rbp)
je 0x18a48
movq 0x2fb0d(%rip), %rdi     # 0x48540
movq -0x1430(%rbp), %rdx
leaq 0x1e99a(%rip), %rsi     # 0x373db
movb $0x0, %al
callq 0x4190
jmp 0x18aa4
movq -0x420(%rbp), %rdi
leaq 0x1e50c(%rip), %rsi     # 0x36f64
callq 0x4180
cmpl $0x0, %eax
jne 0x18aa2
leaq 0x2fae7(%rip), %rdi     # 0x48550
movl $0x28, %esi
callq 0x4110
movq %rax, -0x1438(%rbp)
cmpq $0x0, -0x1438(%rbp)
je 0x18aa0
movq 0x2fab5(%rip), %rdi     # 0x48540
movq -0x1438(%rbp), %rdx
leaq 0x1e963(%rip), %rsi     # 0x373fc
movb $0x0, %al
callq 0x4190
jmp 0x18aa2
jmp 0x18aa4
jmp 0x18aa6
jmp 0x18aa8
leaq -0x1420(%rbp), %rsi
leaq 0x2fa9a(%rip), %rdi     # 0x48550
callq 0x40a0
movq $0x0, 0x3e512(%rip) # 0x56fd8
movq $0x0, 0x3e4ff(%rip) # 0x56fd0
movq -0x8(%rbp), %rax
cmpl $0x159, 0x18(%rax)      # imm = 0x159
jne 0x18b58
leaq 0x26477(%rip), %rdi     # 0x3ef5c
callq 0x15790
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xadb0
leaq 0x2c6c6(%rip), %rax     # 0x451c4
cmpl $0x0, (%rax)
je 0x18b11
leaq 0x1e915(%rip), %rdi     # 0x3741f
callq 0x15790
jmp 0x18b1d
leaq 0x1e814(%rip), %rdi     # 0x3732c
callq 0x15790
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
xorl %esi, %esi
callq 0x15ad0
leaq 0x1e8f0(%rip), %rdi     # 0x37423
callq 0x15790
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
xorl %esi, %esi
callq 0x15ad0
leaq 0x1cf9b(%rip), %rdi     # 0x35ae9
callq 0x15790
jmp 0x18c13
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
movq 0x38(%rax), %rsi
movl -0xc(%rbp), %r8d
leaq 0x1e0b7(%rip), %r9      # 0x36c26
xorl %eax, %eax
movl %eax, %edx
leaq -0x410(%rbp), %rcx
callq 0x19250
movl %eax, -0x414(%rbp)
movl -0x414(%rbp), %eax
movl %eax, -0x143c(%rbp)
testl %eax, %eax
je 0x18bf2
jmp 0x18b97
movl -0x143c(%rbp), %eax
subl $0x1, %eax
je 0x18bc2
jmp 0x18ba4
movl -0x143c(%rbp), %eax
subl $0x2, %eax
jne 0x18c11
jmp 0x18bb1
movl -0xc(%rbp), %edi
leaq 0x1e86c(%rip), %rsi     # 0x37427
callq 0x15880
jmp 0x18c11
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
leaq -0x410(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rcx
movl -0xc(%rbp), %r8d
leaq 0x1ce73(%rip), %rdx     # 0x35a57
leaq 0x1e83c(%rip), %r9      # 0x37427
callq 0x19610
jmp 0x18c11
movq -0x8(%rbp), %rax
movq 0x30(%rax), %rdi
leaq -0x410(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdx
movl -0xc(%rbp), %ecx
callq 0x197b0
jmp 0x18c13
addq $0x1440, %rsp           # imm = 0x1440
popq %rbp
retq
nopl (%rax)