// File: /workspace/github_c_makefile_star2_O0/lucvoo[P]sparse-dev/optimize.c
// Function: optimize
void optimize(struct entrypoint *ep)
{
	if (fdump_ir & PASS_LINEARIZE)
		show_entry(ep);

	/*
	 * Do trivial flow simplification - branches to
	 * branches, kill dead basicblocks etc
	 */
	kill_unreachable_bbs(ep);
	ir_validate(ep);

	cfg_postorder(ep);
	if (simplify_cfg_early(ep))
		kill_unreachable_bbs(ep);
	ir_validate(ep);

	domtree_build(ep);

	/*
	 * Turn symbols into pseudos
	 */
	if (fpasses & PASS_MEM2REG)
		ssa_convert(ep);
	ir_validate(ep);
	if (fdump_ir & PASS_MEM2REG)
		show_entry(ep);

	if (!(fpasses & PASS_OPTIM))
		return;
repeat:
	/*
	 * Remove trivial instructions, and try to CSE
	 * the rest.
	 */
	do {
		simplify_memops(ep);
		do {
			repeat_phase = 0;
			clean_up_insns(ep);
			if (repeat_phase & REPEAT_CFG_CLEANUP)
				kill_unreachable_bbs(ep);

			cse_eliminate(ep);
			simplify_memops(ep);
		} while (repeat_phase);
		pack_basic_blocks(ep);
		if (repeat_phase & REPEAT_CFG_CLEANUP)
			cleanup_cfg(ep);
	} while (repeat_phase);

	vrfy_flow(ep);

	/* Cleanup */
	clear_symbol_pseudos(ep);

	/* And track pseudo register usage */
	track_pseudo_liveness(ep);

	/*
	 * Some flow optimizations can only effectively
	 * be done when we've done liveness analysis. But
	 * if they trigger, we need to start all over
	 * again
	 */
	if (simplify_flow(ep)) {
		clear_liveness(ep);
		if (repeat_phase & REPEAT_CFG_CLEANUP)
			cleanup_cfg(ep);
		goto repeat;
	}

	/* Finally, add deathnotes to pseudos now that we have them */
	if (dbg_dead)
		track_pseudo_death(ep);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
leaq 0x6c885(%rip), %rax     # 0x8d2f8
movq (%rax), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0x20a89
movq -0x8(%rbp), %rdi
callq 0x19d60
movq -0x8(%rbp), %rdi
callq 0x59bc0
movq -0x8(%rbp), %rdi
callq 0x5cf10
movq -0x8(%rbp), %rdi
callq 0x5c300
movq -0x8(%rbp), %rdi
callq 0x5a330
cmpl $0x0, %eax
je 0x20abb
movq -0x8(%rbp), %rdi
callq 0x59bc0
movq -0x8(%rbp), %rdi
callq 0x5cf10
movq -0x8(%rbp), %rdi
callq 0x5c640
leaq 0x63d2c(%rip), %rax     # 0x84800
movq (%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0x20aea
movq -0x8(%rbp), %rdi
callq 0x3db40
movq -0x8(%rbp), %rdi
callq 0x5cf10
leaq 0x6c7fe(%rip), %rax     # 0x8d2f8
movq (%rax), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0x20b10
movq -0x8(%rbp), %rdi
callq 0x19d60
leaq 0x63ce9(%rip), %rax     # 0x84800
movq (%rax), %rax
andq $0x8, %rax
cmpq $0x0, %rax
jne 0x20b29
jmp 0x20c09
jmp 0x20b2b
jmp 0x20b2d
movq -0x8(%rbp), %rdi
callq 0x5f2f0
movl $0x0, 0x6c614(%rip)     # 0x8d154
movq -0x8(%rbp), %rdi
callq 0x20c10
movl 0x6c605(%rip), %eax     # 0x8d154
andl $0x4, %eax
cmpl $0x0, %eax
je 0x20b60
movq -0x8(%rbp), %rdi
callq 0x59bc0
movq -0x8(%rbp), %rdi
callq 0x497d0
movq -0x8(%rbp), %rdi
callq 0x5f2f0
cmpl $0x0, 0x6c5db(%rip)     # 0x8d154
jne 0x20b36
movq -0x8(%rbp), %rdi
callq 0x5aa10
movl 0x6c5ca(%rip), %eax     # 0x8d154
andl $0x4, %eax
cmpl $0x0, %eax
je 0x20b9b
movq -0x8(%rbp), %rdi
callq 0x20dd0
jmp 0x20b9d
cmpl $0x0, 0x6c5b0(%rip)     # 0x8d154
jne 0x20b2d
movq -0x8(%rbp), %rdi
callq 0x59e60
movq -0x8(%rbp), %rdi
callq 0x20e00
movq -0x8(%rbp), %rdi
callq 0x5db90
movq -0x8(%rbp), %rdi
callq 0x58d60
cmpl $0x0, %eax
je 0x20bf4
movq -0x8(%rbp), %rdi
callq 0x5dac0
movl 0x6c576(%rip), %eax     # 0x8d154
andl $0x4, %eax
cmpl $0x0, %eax
je 0x20bef
movq -0x8(%rbp), %rdi
callq 0x20dd0
jmp 0x20b2b
leaq 0x6c58d(%rip), %rax     # 0x8d188
cmpl $0x0, (%rax)
je 0x20c09
movq -0x8(%rbp), %rdi
callq 0x5e6e0
addq $0x10, %rsp
popq %rbp
retq
nop