// File: /workspace/github_c_makefile_star2_O2/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
pushq $0xa
popq %rcx
leaq -0x68(%rbp), %r15
movq %r15, %rdi
rep  movsq (%rsi), %es:(%rdi)
movq %r15, %rdi
callq 0x81cb
xorl %edi, %edi
testl %eax, %eax
sete %dil
xorl %eax, %eax
callq 0x128c
cmpl $0x1, (%r15)
jne 0x4771
cmpl $0xe, %r14d
ja 0x4882
movl %r14d, %eax
leaq 0x9611(%rip), %rcx      # 0xdd74
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
pushq $0x1
popq %rdi
jmp 0x47c9
cmpl $0xf, %r14d
ja 0x4877
movl %r14d, %eax
leaq 0x95af(%rip), %rcx      # 0xdd34
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x9bfc(%rip), %rdi      # 0xe391
jmp 0x483b
leaq 0x9bc3(%rip), %rdi      # 0xe364
jmp 0x47dc
leaq 0x9baf(%rip), %rdi      # 0xe359
jmp 0x47dc
leaq 0x9bac(%rip), %rdi      # 0xe35f
jmp 0x47dc
leaq 0x9b91(%rip), %rdi      # 0xe34d
jmp 0x47dc
leaq 0x9b8e(%rip), %rdi      # 0xe353
jmp 0x47dc
xorl %edi, %edi
movl %ebx, %esi
callq 0x45e4
jmp 0x4877
leaq 0x9b6c(%rip), %rdi      # 0xe348
callq 0x9cfa
jmp 0x4877
leaq 0x9b60(%rip), %rdi      # 0xe34d
jmp 0x4872
leaq 0x9bc2(%rip), %rdi      # 0xe3bb
jmp 0x483b
callq 0x9c4a
jmp 0x4877
leaq 0x9bb8(%rip), %rdi      # 0xe3c1
jmp 0x483b
leaq 0x9b9e(%rip), %rdi      # 0xe3b0
jmp 0x4872
callq 0x9bfa
jmp 0x4877
leaq 0x9b9e(%rip), %rdi      # 0xe3c0
jmp 0x483b
callq 0x9c22
jmp 0x4877
leaq 0x9b74(%rip), %rdi      # 0xe3a6
jmp 0x4864
leaq 0x9b5b(%rip), %rdi      # 0xe396
callq 0x9b8a
jmp 0x4877
leaq 0x9b52(%rip), %rdi      # 0xe39b
jmp 0x4872
leaq 0x9af6(%rip), %rdi      # 0xe348
jmp 0x4872
leaq 0x9b45(%rip), %rdi      # 0xe3a0
jmp 0x4872
leaq 0x9b52(%rip), %rdi      # 0xe3b6
callq 0x9c72
jmp 0x4877
leaq 0x9b39(%rip), %rdi      # 0xe3ab
callq 0x9bc2
addq $0x58, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9ae0(%rip), %rdi      # 0xe369
callq 0x814d
nop