// File: /workspace/github_c_makefile_star2_O3/lucvoo[P]sparse-dev/linearize.c
// Function: linearize_asm_statement
static pseudo_t linearize_asm_statement(struct entrypoint *ep, struct statement *stmt)
{
	struct instruction *insn;
	struct expression *expr, *clob;
	struct asm_rules *rules;
	struct asm_operand *op;

	insn = alloc_instruction(OP_ASM, 0);
	expr = stmt->asm_string;
	if (!expr || expr->type != EXPR_STRING) {
		warning(stmt->pos, "expected string in inline asm");
		return VOID;
	}
	insn->string = expr->string->data;

	rules = __alloc_asm_rules(0);
	insn->asm_rules = rules;

	/* Gather the inputs.. */
	FOR_EACH_PTR(stmt->asm_inputs, op) {
		add_asm_input(ep, insn, op);
	} END_FOR_EACH_PTR(op);

	/* ... and the addresses for memory outputs */
	FOR_EACH_PTR(stmt->asm_outputs, op) {
		add_asm_output_address(ep, insn, op);
	} END_FOR_EACH_PTR(op);

	add_one_insn(ep, insn);

	/* Assign the outputs */
	FOR_EACH_PTR(stmt->asm_outputs, op) {
		add_asm_output(ep, insn, op);
	} END_FOR_EACH_PTR(op);

	/* and finally, look if it clobbers memory */
	FOR_EACH_PTR(stmt->asm_clobbers, clob) {
		if (!strcmp(clob->string->data, "memory"))
			insn->clobber_memory = 1;
	} END_FOR_EACH_PTR(clob);

	return VOID;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r14
movq %rdi, %r15
xorl %edi, %edi
callq 0x2fca9
movq %rax, %rbx
movl $0x80, %eax
andl (%rbx), %eax
orl $0x4e, %eax
movl %eax, (%rbx)
movq 0x52c77(%rip), %rax     # 0x66d68
movq %rax, 0x10(%rbx)
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x14385
cmpb $0x2, (%rax)
jne 0x14385
movq 0x28(%rax), %rax
addq $0x4, %rax
movq %rax, 0x30(%rbx)
leaq 0x4c0ca(%rip), %rdi     # 0x601e8
movl $0x18, %esi
callq 0x2f700
movq %rax, 0x38(%rbx)
movq %r14, (%rsp)
movq 0x20(%r14), %r14
testq %r14, %r14
je 0x14198
movq %r14, %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x1418f
xorl %ebp, %ebp
movq 0x18(%r13,%rbp,8), %r12
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x1415c
testq %r12, %r12
je 0x14180
movq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x144d5
movq 0x38(%rbx), %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x153d5
movzwl (%r13), %eax
incq %rbp
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %rbp
jl 0x14147
movq 0x10(%r13), %r13
cmpq %r14, %r13
jne 0x1413c
movq (%rsp), %rax
movq 0x18(%rax), %r14
testq %r14, %r14
je 0x14214
movq %r14, %r13
movzwl (%r13), %eax
testb %al, %al
jle 0x1420b
xorl %ebp, %ebp
movq 0x18(%r13,%rbp,8), %r12
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x141c8
testq %r12, %r12
je 0x141fc
testb $0x20, 0x18(%r12)
je 0x141fc
movq 0x10(%r12), %rsi
movq %r15, %rdi
callq 0x144d5
movq 0x38(%rbx), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
movq %r12, %rdx
movq %rax, %rcx
callq 0x153d5
orb $0x2, 0x40(%rbx)
movzwl (%r13), %eax
incq %rbp
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %rbp
jl 0x141b3
movq 0x10(%r13), %r13
cmpq %r14, %r13
jne 0x141a8
movq 0x20(%r15), %rdi
testq %rdi, %rdi
je 0x1422d
movq %rdi, 0x8(%rbx)
addq $0x28, %rdi
movq %rbx, %rsi
callq 0x227b4
movq (%rsp), %rax
movq 0x18(%rax), %rax
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x14307
movq 0x8(%rsp), %r14
movzwl (%r14), %eax
testb %al, %al
jle 0x142f8
xorl %r12d, %r12d
movq 0x18(%r14,%r12,8), %r13
movzwl %ax, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x1426c
testq %r13, %r13
je 0x142e5
xorps %xmm0, %xmm0
movaps %xmm0, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
testb $0x20, 0x18(%r13)
jne 0x142e1
movq 0x10(%r13), %rsi
movq %r15, %rdi
leaq 0x10(%rsp), %rdx
callq 0x17ae1
testl %eax, %eax
je 0x142e1
xorl %edi, %edi
callq 0x2fd6f
movq %rax, %rbp
movl $0x3, 0x4(%rax)
movl 0x528a4(%rip), %eax     # 0x66b50
incl %eax
movl %eax, 0x5289c(%rip)     # 0x66b50
movl %eax, (%rbp)
movq %rbx, 0x18(%rbp)
movq %r15, %rdi
movq %rbp, %rsi
leaq 0x10(%rsp), %rdx
callq 0x1684b
movq 0x38(%rbx), %rsi
addq $0x8, %rsi
movq %rbx, %rdi
movq %r13, %rdx
movq %rbp, %rcx
callq 0x153d5
movzwl (%r14), %eax
incq %r12
movzwl %ax, %ecx
movsbq %cl, %rcx
cmpq %rcx, %r12
jl 0x14257
movq 0x10(%r14), %r14
cmpq 0x8(%rsp), %r14
jne 0x14248
movq (%rsp), %rax
movq 0x28(%rax), %r15
testq %r15, %r15
je 0x14376
leaq 0x34434(%rip), %r14     # 0x4874f
movq %r15, %r12
movzwl (%r12), %ebp
testb %bpl, %bpl
jle 0x1436c
xorl %r13d, %r13d
movq 0x18(%r12,%r13,8), %rax
movzwl %bp, %ecx
cmpl $0x100, %ecx            # imm = 0x100
jb 0x14340
testq %rax, %rax
je 0x1435d
movq 0x28(%rax), %rdi
addq $0x4, %rdi
movq %r14, %rsi
callq 0xe1c0
testl %eax, %eax
jne 0x1435d
orb $0x1, 0x40(%rbx)
movzwl (%r12), %ebp
incq %r13
movzwl %bp, %eax
movsbq %al, %rax
cmpq %rax, %r13
jl 0x1432b
movq 0x10(%r12), %r12
cmpq %r15, %r12
jne 0x1431e
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x4(%r14), %rdi
leaq 0x2d6c9(%rip), %rsi     # 0x41a59
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x118fc