// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/linearize.c
// Function: linearize_cond_branch
static pseudo_t linearize_cond_branch(struct entrypoint *ep, struct expression *expr, struct basic_block *bb_true, struct basic_block *bb_false)
{
	pseudo_t cond;

	if (!expr || !valid_type(expr->ctype) || !bb_reachable(ep->active))
		return VOID;

	switch (expr->type) {

	case EXPR_STRING:
	case EXPR_VALUE:
		add_goto(ep, expr->value ? bb_true : bb_false);
		break;
	case EXPR_FVALUE:
		add_goto(ep, expr->fvalue ? bb_true : bb_false);
		break;
	case EXPR_LOGICAL:
		linearize_logical_branch(ep, expr, bb_true, bb_false);
		break;
	case EXPR_COMPARE:
		cond = linearize_compare(ep, expr);
		add_branch(ep, cond, bb_true, bb_false);
		break;
	case EXPR_PREOP:
		if (expr->op == '!')
			return linearize_cond_branch(ep, expr->unop, bb_false, bb_true);
		/* fall through */
	default:
		cond = linearize_expression_to_bool(ep, expr);
		add_branch(ep, cond, bb_true, bb_false);
		break;
	}
	return VOID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rsi, %r12
movq %rdi, %r14
leaq 0x5685e(%rip), %rbp     # 0x6d8b8
movq %rdx, %r15
testq %r12, %r12
je 0x1711e
movq 0x10(%r12), %rax
testq %rax, %rax
je 0x1711e
cmpq %rbp, %rax
je 0x1711e
cmpq $0x0, 0x20(%r14)
je 0x1711e
movzbl (%r12), %eax
cmpl $0x7, %eax
jne 0x170f8
movq 0x8(%r12), %rbx
xorl %edi, %edi
callq 0x30217
movq %rax, %r13
movq %rbx, (%rax)
movq %r14, 0x10(%rax)
movl 0x50cc2(%rip), %eax     # 0x67d70
leal 0x1(%rax), %ecx
movl %ecx, 0x50cb9(%rip)     # 0x67d70
movl %eax, 0x38(%r13)
cmpl $0x10e, 0x4(%r12)       # imm = 0x10E
movq 0x20(%r12), %rsi
movq %r14, %rdi
jne 0x170d6
movq %r15, %rdx
movq %r13, %rcx
jmp 0x170de
movq %r13, %rdx
movq 0x10(%rsp), %rcx
callq 0x1703a
movq %r14, %rdi
movq %r13, %rsi
callq 0x1401d
movq 0x28(%r12), %r12
jmp 0x1705d
cmpl $0x8, %eax
jle 0x1712d
cmpl $0x9, %eax
jne 0x17148
cmpl $0x21, 0x4(%r12)
jne 0x17184
movq 0x20(%r12), %r12
movq 0x10(%rsp), %rdx
movq %r15, 0x10(%rsp)
jmp 0x1705a
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
decl %eax
cmpl $0x2, %eax
jae 0x17184
cmpq $0x0, 0x20(%r12)
cmoveq 0x10(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
jmp 0x17171
cmpl $0x16, %eax
je 0x171e3
cmpl $0x1c, %eax
jne 0x17184
fldt 0x20(%r12)
fldz
fucompi %st(1), %st
fstp %st(0)
movq 0x10(%rsp), %rsi
cmovneq %r15, %rsi
cmovpq %r15, %rsi
movq %r14, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x143fb
movq %r14, %rdi
movq %r12, %rsi
callq 0x1447d
movq %rax, %r13
movq 0x10(%r12), %r12
testq %r12, %r12
sete %al
leaq 0x4f82c(%rip), %rsi     # 0x669d0
cmpq %rsi, %r13
sete %cl
orb %al, %cl
jne 0x17280
movzbl (%r12), %eax
movq %r12, %rcx
cmpl $0x3, %eax
jne 0x171c4
movq 0x60(%r12), %rcx
cmpq 0x49e15(%rip), %rcx     # 0x60fe0
je 0x171db
cmpl $0x6, 0x4(%r13)
jne 0x171f9
cmpq $0x2, 0x18(%r13)
jae 0x171f9
movq %r13, %rsi
jmp 0x17280
movq %r14, %rdi
movq %r12, %rsi
callq 0x16015
movq %r14, %rdi
movq %rax, %rsi
jmp 0x17283
movq %r12, %rcx
cmpl $0x3, %eax
jne 0x17206
movq 0x60(%r12), %rcx
movq 0x60(%rcx), %rax
cmpq 0x49d2f(%rip), %rax     # 0x60f40
je 0x17221
xorl %edi, %edi
callq 0x136d3
movl $0x30, %edx
jmp 0x17260
fldz
fstpt (%rsp)
movq %r14, %rdi
movq %r12, %rsi
callq 0x149c4
cmpb $0x3, (%r12)
movq %r12, %rcx
jne 0x17240
movq 0x60(%r12), %rcx
movq 0x60(%rcx), %rcx
movl $0x30, %edx
cmpq 0x49cf0(%rip), %rcx     # 0x60f40
jne 0x17260
leaq 0x2b9f7(%rip), %rcx     # 0x42c50
movsbl 0x183(%rcx), %edx
leaq 0x54dd1(%rip), %rsi     # 0x6c038
movq %r14, %rdi
movq %r13, %rcx
movq %rax, %r8
callq 0x16d46
movq %rax, %rsi
movq 0x18(%rax), %rax
movq %r12, 0x40(%rax)
movq %r14, %rdi
movq %r15, %rdx
movq 0x10(%rsp), %rcx
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x17395