// File: /workspace/github_c_makefile_star2_O1/hsjoihs[P]c-compiler/codegen_expression.c
// Function: print_simple_binary_op
static void print_simple_binary_op(enum SimpleBinOp kind,
                                   const struct Type *ref_left_type, int size)
{
	const struct Type left_type = *ref_left_type;
	assert(!is_struct_or_union(&left_type));
	if (left_type.type_category == PTR_) {
		switch (kind) {
		case SIMPLE_BIN_OP_PLUS:
			print_op_pointer_plusminus_int(1, size);
			return;
		case SIMPLE_BIN_OP_MINUS:
			print_op_pointer_plusminus_int(0, size);
			return;

		case SIMPLE_BIN_OP_EQ_EQ:
			gen_compare_ptrs("sete");
			return;
		case SIMPLE_BIN_OP_NOT_EQ:
			gen_compare_ptrs("setne");
			return;
		case SIMPLE_BIN_OP_LT_EQ:
			gen_compare_ptrs("setbe");
			return;
		case SIMPLE_BIN_OP_GT_EQ:
			gen_compare_ptrs("setnb");
			return;
		case SIMPLE_BIN_OP_LT:
			gen_compare_ptrs("setb");
			return;
		case SIMPLE_BIN_OP_GT:
			gen_compare_ptrs("seta");
			return;
		default:
			simple_error("unexpected pointer in binary operation\n");
		}
	}
	switch (kind) {
	case SIMPLE_BIN_OP_PLUS:
		gen_op_ints("addl");
		return;
	case SIMPLE_BIN_OP_MINUS:
		gen_op_ints("subl");
		return;
	case SIMPLE_BIN_OP_ASTERISK:
		gen_mul_ints();
		return;
	case SIMPLE_BIN_OP_SLASH:
		gen_div_ints();
		return;
	case SIMPLE_BIN_OP_PERCENT:
		gen_rem_ints();
		return;
	case SIMPLE_BIN_OP_LT:
		gen_compare_ints("setl");
		return;
	case SIMPLE_BIN_OP_LT_EQ:
		gen_compare_ints("setle");
		return;
	case SIMPLE_BIN_OP_LSHIFT:
		gen_shift_ints("sall");
		return;
	case SIMPLE_BIN_OP_GT:
		gen_compare_ints("setg");
		return;
	case SIMPLE_BIN_OP_GT_EQ:
		gen_compare_ints("setge");
		return;
	case SIMPLE_BIN_OP_RSHIFT:
		gen_shift_ints("sarl");
		return;
	case SIMPLE_BIN_OP_AND:
		gen_op_ints("andl");
		return;
	case SIMPLE_BIN_OP_OR:
		gen_op_ints("orl");
		return;
	case SIMPLE_BIN_OP_EQ_EQ:
		gen_compare_ints("sete");
		return;
	case SIMPLE_BIN_OP_NOT_EQ:
		gen_compare_ints("setne");
		return;
	case SIMPLE_BIN_OP_HAT:
		gen_op_ints("xorl");
		return;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x58, %rsp
movl %edx, %ebx
movl %edi, %r14d
leaq -0x68(%rbp), %r15
movl $0xa, %ecx
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0x9516
xorl %edi, %edi
testl %eax, %eax
sete %dil
xorl %eax, %eax
callq 0x243c
cmpl $0x1, (%r15)
jne 0x5887
cmpl $0xe, %r14d
ja 0x59a7
movl %r14d, %eax
leaq 0x950b(%rip), %rcx      # 0xed74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0xae90
movl %ebx, %edi
callq 0xaf40
leaq 0x98ae(%rip), %rdi      # 0xf133
jmp 0x58f0
cmpl $0xf, %r14d
ja 0x599c
movl %r14d, %eax
leaq 0x9499(%rip), %rcx      # 0xed34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9ae6(%rip), %rdi      # 0xf391
jmp 0x5960
leaq 0x9aad(%rip), %rdi      # 0xf364
jmp 0x5901
leaq 0x9a99(%rip), %rdi      # 0xf359
jmp 0x5901
leaq 0x9a96(%rip), %rdi      # 0xf35f
jmp 0x5901
leaq 0x9a7b(%rip), %rdi      # 0xf34d
jmp 0x5901
leaq 0x9a78(%rip), %rdi      # 0xf353
jmp 0x5901
callq 0xae90
movl %ebx, %edi
callq 0xaf40
leaq 0x9848(%rip), %rdi      # 0xf138
callq 0xae58
jmp 0x599c
leaq 0x9a47(%rip), %rdi      # 0xf348
callq 0xadad
jmp 0x599c
leaq 0x9a3b(%rip), %rdi      # 0xf34d
jmp 0x5997
leaq 0x9a9d(%rip), %rdi      # 0xf3bb
jmp 0x5960
callq 0xacfd
jmp 0x599c
leaq 0x9a93(%rip), %rdi      # 0xf3c1
jmp 0x5960
leaq 0x9a79(%rip), %rdi      # 0xf3b0
jmp 0x5997
callq 0xacad
jmp 0x599c
leaq 0x9a79(%rip), %rdi      # 0xf3c0
jmp 0x5960
callq 0xacd5
jmp 0x599c
leaq 0x9a4f(%rip), %rdi      # 0xf3a6
jmp 0x5989
leaq 0x9a36(%rip), %rdi      # 0xf396
callq 0xac3d
jmp 0x599c
leaq 0x9a2d(%rip), %rdi      # 0xf39b
jmp 0x5997
leaq 0x99d1(%rip), %rdi      # 0xf348
jmp 0x5997
leaq 0x9a20(%rip), %rdi      # 0xf3a0
jmp 0x5997
leaq 0x9a2d(%rip), %rdi      # 0xf3b6
callq 0xad25
jmp 0x599c
leaq 0x9a14(%rip), %rdi      # 0xf3ab
callq 0xac75
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x99bb(%rip), %rdi      # 0xf369
callq 0x9492
nop