// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: flatten_expr
static void flatten_expr(vector_t* expr_list, expr_t* exp)
{
	vec_push_back(expr_list, &exp);

	switch (exp->type)
	{
		case EXP_NULL:
		case EXP_BOOL:
		case EXP_CHAR:
		case EXP_NUMBER:
		case EXP_STRING:
		case EXP_EXTERN:
		case EXP_VAR:
		case EXP_STRUCT_DECL:
			break;

		case EXP_EXTERN_LIST:
		{
			for (int i = 0; i < exp->extern_array.length; ++i)
				flatten_expr(expr_list, vec_get_value(&exp->extern_array, i, expr_t*));
		} break;

		case EXP_DOT:
		case EXP_COLON:
		{
			flatten_expr(expr_list, exp->dotx.value);
		} break;

		case EXP_STRUCT_NEW:
		{
			for (int i = 0; i < exp->newx.init.length; ++i)
				flatten_expr(expr_list, vec_get_value(&exp->newx.init, i, expr_t*));
		} break;

		case EXP_PAREN:
		{
			flatten_expr(expr_list, exp->paren);
		} break;

		case EXP_ARRAY_INDEX:
		{
			flatten_expr(expr_list, exp->array_index.array);
			flatten_expr(expr_list, exp->array_index.index);
		} break;

		case EXP_ARRAY_LITERAL:
		{
			for (int i = 0; i < exp->array_literal.values.length; ++i)
				flatten_expr(expr_list, vec_get_value(&exp->array_literal.values, i, expr_t*));
		} break;
		
		case EXP_UNARY:
		{
			flatten_expr(expr_list, exp->unaryx.rhs);
		} break;

		case EXP_BINARY:
		{
			flatten_expr(expr_list, exp->binx.lhs);
			flatten_expr(expr_list, exp->binx.rhs);
		} break;

		case EXP_CALL:
		{
			flatten_expr(expr_list, exp->callx.func);
	
			for (int i = 0; i < exp->callx.args.length; ++i)
				flatten_expr(expr_list, vec_get_value(&exp->callx.args, i, expr_t*));
		} break;

		case EXP_RETURN:
		{
			flatten_expr(expr_list, exp->retx.value);
		} break;

		case EXP_BLOCK:
		{
			for (int i = 0; i < exp->block.length; ++i)
				flatten_expr(expr_list, vec_get_value(&exp->block, i, expr_t*));
		} break;

		case EXP_FUNC:
		{
			flatten_expr(expr_list, exp->funcx.body);
		} break;

		case EXP_ATOMIC:
		{
			flatten_expr(expr_list, exp->atomx);
		} break;

		case EXP_IF:
		{
			flatten_expr(expr_list, exp->ifx.cond);
			flatten_expr(expr_list, exp->ifx.body);

			if (exp->ifx.alt)
				flatten_expr(expr_list, exp->ifx.alt);
		} break;

		case EXP_WHILE:
		{
			flatten_expr(expr_list, exp->whilex.cond);
			flatten_expr(expr_list, exp->whilex.body);
		} break;

		case EXP_FOR:
		{
			flatten_expr(expr_list, exp->forx.init);
			flatten_expr(expr_list, exp->forx.cond);
			flatten_expr(expr_list, exp->forx.step);
			flatten_expr(expr_list, exp->forx.body);
		} break;

		case EXP_WRITE:
		{
			flatten_expr(expr_list, exp->write);
		} break;

		case EXP_LEN:
		{
			flatten_expr(expr_list, exp->len);
		} break;

		default:
			assert(0);
			break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x11960
movq -0x10(%rbp), %rax
movl 0x28(%rax), %eax
movq %rax, -0x30(%rbp)
subq $0x1a, %rax
ja 0x9832
movq -0x30(%rbp), %rax
leaq 0x9e23(%rip), %rcx      # 0x13310
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x9851
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x9540
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x14(%rbp), %rsi
callq 0x11890
movq -0x38(%rbp), %rdi
movq (%rax), %rsi
callq 0x94b0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x9502
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
movl $0x0, -0x18(%rbp)
movslq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x95a4
movq -0x8(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x18(%rbp), %rsi
callq 0x11890
movq -0x40(%rbp), %rdi
movq (%rax), %rsi
callq 0x94b0
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x9562
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
jmp 0x9851
movl $0x0, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x962f
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x1c(%rbp), %rsi
callq 0x11890
movq -0x48(%rbp), %rdi
movq (%rax), %rsi
callq 0x94b0
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x95ed
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movl $0x0, -0x20(%rbp)
movslq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x50(%rcx), %rax
jae 0x96cb
movq -0x8(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movslq -0x20(%rbp), %rsi
callq 0x11890
movq -0x50(%rbp), %rdi
movq (%rax), %rsi
callq 0x94b0
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x9689
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
jmp 0x9851
movl $0x0, -0x24(%rbp)
movslq -0x24(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x48(%rcx), %rax
jae 0x972b
movq -0x8(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
addq $0x38, %rdi
movslq -0x24(%rbp), %rsi
callq 0x11890
movq -0x58(%rbp), %rdi
movq (%rax), %rsi
callq 0x94b0
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x96ed
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x979a
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rsi
callq 0x94b0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rsi
callq 0x94b0
jmp 0x9851
leaq 0xa3eb(%rip), %rdi      # 0x13c24
leaq 0xa3e6(%rip), %rsi      # 0x13c26
movl $0xbc9, %edx            # imm = 0xBC9
leaq 0xa567(%rip), %rcx      # 0x13db3
callq 0x20f0
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)