// File: /workspace/github_c_makefile_star2_O2/lucvoo[P]sparse-dev/inline.c
// Function: copy_one_statement
static struct statement *copy_one_statement(struct statement *stmt)
{
	if (!stmt)
		return NULL;
	switch(stmt->type) {
	case STMT_NONE:
		break;
	case STMT_DECLARATION: {
		struct symbol *sym;
		struct statement *newstmt = dup_statement(stmt);
		newstmt->declaration = NULL;
		FOR_EACH_PTR(stmt->declaration, sym) {
			struct symbol *newsym = copy_symbol(stmt->pos, sym);
			if (newsym != sym)
				newsym->initializer = copy_expression(sym->initializer);
			add_symbol(&newstmt->declaration, newsym);
		} END_FOR_EACH_PTR(sym);
		stmt = newstmt;
		break;
	}
	case STMT_CONTEXT:
	case STMT_EXPRESSION: {
		struct expression *expr = copy_expression(stmt->expression);
		if (expr == stmt->expression)
			break;
		stmt = dup_statement(stmt);
		stmt->expression = expr;
		break;
	}
	case STMT_RANGE: {
		struct expression *expr = copy_expression(stmt->range_expression);
		if (expr == stmt->expression)
			break;
		stmt = dup_statement(stmt);
		stmt->range_expression = expr;
		break;
	}
	case STMT_COMPOUND: {
		struct statement *new = alloc_statement(stmt->pos, STMT_COMPOUND);
		copy_statement(stmt, new);
		stmt = new;
		break;
	}
	case STMT_IF: {
		struct expression *cond = stmt->if_conditional;
		struct statement *valt = stmt->if_true;
		struct statement *valf = stmt->if_false;

		cond = copy_expression(cond);
		valt = copy_one_statement(valt);
		valf = copy_one_statement(valf);
		if (stmt->if_conditional == cond &&
		    stmt->if_true == valt &&
		    stmt->if_false == valf)
			break;
		stmt = dup_statement(stmt);
		stmt->if_conditional = cond;
		stmt->if_true = valt;
		stmt->if_false = valf;
		break;
	}
	case STMT_RETURN: {
		struct expression *retval = copy_expression(stmt->ret_value);
		struct symbol *sym = copy_symbol(stmt->pos, stmt->ret_target);

		stmt = dup_statement(stmt);
		stmt->ret_value = retval;
		stmt->ret_target = sym;
		break;
	}
	case STMT_CASE: {
		stmt = dup_statement(stmt);
		stmt->case_label = copy_symbol(stmt->pos, stmt->case_label);
		stmt->case_label->stmt = stmt;
		stmt->case_expression = copy_expression(stmt->case_expression);
		stmt->case_to = copy_expression(stmt->case_to);
		stmt->case_statement = copy_one_statement(stmt->case_statement);
		break;
	}
	case STMT_SWITCH: {
		struct symbol *switch_break = copy_symbol(stmt->pos, stmt->switch_break);
		struct symbol *switch_case = copy_symbol(stmt->pos, stmt->switch_case);
		struct expression *expr = copy_expression(stmt->switch_expression);
		struct statement *switch_stmt = copy_one_statement(stmt->switch_statement);

		stmt = dup_statement(stmt);
		switch_case->symbol_list = copy_symbol_list(switch_case->symbol_list);
		stmt->switch_break = switch_break;
		stmt->switch_case = switch_case;
		stmt->switch_expression = expr;
		stmt->switch_statement = switch_stmt;
		break;		
	}
	case STMT_ITERATOR: {
		stmt = dup_statement(stmt);
		stmt->iterator_break = copy_symbol(stmt->pos, stmt->iterator_break);
		stmt->iterator_continue = copy_symbol(stmt->pos, stmt->iterator_continue);
		stmt->iterator_syms = copy_symbol_list(stmt->iterator_syms);

		stmt->iterator_pre_statement = copy_one_statement(stmt->iterator_pre_statement);
		stmt->iterator_pre_condition = copy_expression(stmt->iterator_pre_condition);

		stmt->iterator_statement = copy_one_statement(stmt->iterator_statement);

		stmt->iterator_post_statement = copy_one_statement(stmt->iterator_post_statement);
		stmt->iterator_post_condition = copy_expression(stmt->iterator_post_condition);
		break;
	}
	case STMT_LABEL: {
		stmt = dup_statement(stmt);
		stmt->label_identifier = copy_symbol(stmt->pos, stmt->label_identifier);
		stmt->label_statement = copy_one_statement(stmt->label_statement);
		break;
	}
	case STMT_GOTO: {
		stmt = dup_statement(stmt);
		stmt->goto_label = copy_symbol(stmt->pos, stmt->goto_label);
		stmt->goto_expression = copy_expression(stmt->goto_expression);
		stmt->target_list = copy_symbol_list(stmt->target_list);
		break;
	}
	case STMT_ASM: {
		stmt = dup_statement(stmt);
		stmt->asm_inputs = copy_asm_operands(stmt->asm_inputs);
		stmt->asm_outputs = copy_asm_operands(stmt->asm_outputs);
		/* no need to dup "clobbers", since they are all constant strings */
		break;
	}
	default:
		warning(stmt->pos, "trying to copy statement type %d", stmt->type);
		break;
	}
	return stmt;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
testq %rdi, %rdi
je 0x10555
movq %rdi, %rbx
movl (%rdi), %edx
cmpq $0xd, %rdx
ja 0x10861
leaq 0x28e8e(%rip), %rax     # 0x393b0
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
movq 0x10(%rbx), %rdi
callq 0x108f4
cmpq 0x10(%rbx), %rax
je 0x10878
movq %rax, %r14
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq %r14, 0x10(%rax)
jmp 0x10878
xorl %ebx, %ebx
jmp 0x10878
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x4(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x1088a
movq %rax, 0x10(%rbx)
jmp 0x10852
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x4(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x1088a
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0x108f4
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
callq 0x10c92
jmp 0x1085b
movq 0x4(%rbx), %rdi
movq 0x20(%rbx), %rsi
callq 0x1088a
movq %rax, %r14
movq 0x4(%rbx), %rdi
movq 0x28(%rbx), %rsi
callq 0x1088a
movq %rax, %r15
movq 0x10(%rbx), %rdi
callq 0x108f4
movq %rax, %r12
movq 0x18(%rbx), %rdi
callq 0x104f9
movq %rax, %r13
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x98(%r15), %rdi
callq 0x10c92
movq %rax, 0x98(%r15)
movq %r14, 0x20(%rbx)
movq %r15, 0x28(%rbx)
movq %r12, 0x10(%rbx)
movq %r13, 0x18(%rbx)
jmp 0x10878
movq %rbx, %rdi
callq 0x108d7
andq $0x0, 0x10(%rax)
movq 0x10(%rbx), %rcx
testq %rcx, %rcx
je 0x10875
movq %rax, 0x8(%rsp)
movq %rax, %r15
addq $0x10, %r15
movq %rcx, %rbp
movq %rcx, 0x10(%rsp)
xorl %r14d, %r14d
movl (%rbp), %eax
movsbq %al, %rcx
cmpq %rcx, %r14
jge 0x106a4
movq 0x18(%rbp,%r14,8), %r12
cmpw $0x100, %ax             # imm = 0x100
jb 0x1066c
testq %r12, %r12
je 0x1069f
movq 0x4(%rbx), %rdi
movq %r12, %rsi
callq 0x1088a
movq %rax, %r13
cmpq %r12, %rax
je 0x10694
movq 0xb0(%r12), %rdi
callq 0x108f4
movq %rax, 0xb0(%r13)
movq %r15, %rdi
movq %r13, %rsi
callq 0x1fae9
incq %r14
jmp 0x10650
movq 0x10(%rbp), %rbp
movq 0x10(%rsp), %rcx
cmpq %rcx, %rbp
jne 0x1064d
movq 0x8(%rsp), %rbx
jmp 0x10878
movq 0x10(%rbx), %rdi
callq 0x108f4
movq %rax, %r14
movq 0x4(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0x1088a
movq %rax, %r15
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq %r14, 0x10(%rax)
movq %r15, 0x18(%rax)
jmp 0x10878
movq 0x4(%rbx), %rdi
pushq $0x3
popq %rsi
callq 0x17530
movq %rax, %r14
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1034c
movq %r14, %rbx
jmp 0x10878
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x20(%rax), %rdi
callq 0x10d02
movq %rax, 0x20(%rbx)
movq 0x18(%rbx), %rdi
callq 0x10d02
movq %rax, 0x18(%rbx)
jmp 0x10878
movq 0x10(%rbx), %rdi
movq 0x18(%rbx), %r15
movq 0x20(%rbx), %r12
callq 0x108f4
movq %rax, %r14
movq %r15, %rdi
callq 0x104f9
movq %rax, %r15
movq %r12, %rdi
callq 0x104f9
movq %rax, %r12
cmpq %r14, 0x10(%rbx)
jne 0x1077c
cmpq %r15, 0x18(%rbx)
jne 0x1077c
cmpq %r12, 0x20(%rbx)
je 0x10878
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq %r14, 0x10(%rax)
movq %r15, 0x18(%rax)
movq %r12, 0x20(%rax)
jmp 0x10878
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x4(%rax), %rdi
movq 0x10(%rax), %rsi
callq 0x1088a
movq %rax, 0x10(%rbx)
movq 0x4(%rbx), %rdi
movq 0x18(%rbx), %rsi
callq 0x1088a
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
callq 0x10c92
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
callq 0x104f9
movq %rax, 0x28(%rbx)
movq 0x30(%rbx), %rdi
callq 0x108f4
movq %rax, 0x30(%rbx)
movq 0x38(%rbx), %rdi
callq 0x104f9
movq %rax, 0x38(%rbx)
movq 0x40(%rbx), %rdi
callq 0x104f9
movq %rax, 0x40(%rbx)
movq 0x48(%rbx), %rdi
callq 0x108f4
movq %rax, 0x48(%rbx)
jmp 0x10878
movq %rbx, %rdi
callq 0x108d7
movq %rax, %rbx
movq 0x4(%rax), %rdi
movq 0x28(%rax), %rsi
callq 0x1088a
movq %rax, 0x28(%rbx)
movq %rbx, 0x90(%rax)
movq 0x10(%rbx), %rdi
callq 0x108f4
movq %rax, 0x10(%rbx)
movq 0x18(%rbx), %rdi
callq 0x108f4
movq %rax, 0x18(%rbx)
movq 0x20(%rbx), %rdi
callq 0x104f9
movq %rax, 0x20(%rbx)
jmp 0x10878
movq 0x4(%rbx), %rdi
leaq 0x28c20(%rip), %rsi     # 0x3948c
xorl %eax, %eax
callq 0x1108a
jmp 0x10878
movq %rax, %rbx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq