// File: /workspace/github_c_makefile_star2_O0/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
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rsi
leaq -0x68(%rbp), %rdi
movl $0x50, %edx
callq 0x10e0
leaq -0x68(%rbp), %rdi
callq 0xb250
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %edi
movb $0x0, %al
callq 0x1260
cmpl $0x1, -0x68(%rbp)
jne 0x5ed6
movl -0x4(%rbp), %eax
movq %rax, -0x70(%rbp)
subq $0xe, %rax
ja 0x5eca
movq -0x70(%rbp), %rax
leaq 0xdff6(%rip), %rcx      # 0x13e30
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl -0x14(%rbp), %esi
movl $0x1, %edi
callq 0x5c70
jmp 0x5fd6
movl -0x14(%rbp), %esi
xorl %edi, %edi
callq 0x5c70
jmp 0x5fd6
leaq 0xe599(%rip), %rdi      # 0x14404
callq 0xd8e0
jmp 0x5fd6
leaq 0xe58d(%rip), %rdi      # 0x14409
callq 0xd8e0
jmp 0x5fd6
leaq 0xe582(%rip), %rdi      # 0x1440f
callq 0xd8e0
jmp 0x5fd6
leaq 0xe577(%rip), %rdi      # 0x14415
callq 0xd8e0
jmp 0x5fd6
leaq 0xe56c(%rip), %rdi      # 0x1441b
callq 0xd8e0
jmp 0x5fd6
leaq 0xe560(%rip), %rdi      # 0x14420
callq 0xd8e0
jmp 0x5fd6
leaq 0xe554(%rip), %rdi      # 0x14425
callq 0xb150
movl -0x4(%rbp), %eax
movq %rax, -0x78(%rbp)
subq $0xf, %rax
ja 0x5fd6
movq -0x78(%rbp), %rax
leaq 0xdefe(%rip), %rcx      # 0x13df0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0xe54b(%rip), %rdi      # 0x1444d
callq 0xd730
jmp 0x5fd6
leaq 0xe53f(%rip), %rdi      # 0x14452
callq 0xd730
jmp 0x5fd6
callq 0xd7b0
jmp 0x5fd6
callq 0xd7e0
jmp 0x5fd6
callq 0xd810
jmp 0x5fd6
leaq 0xe515(%rip), %rdi      # 0x14457
callq 0xd770
jmp 0x5fd6
leaq 0xe509(%rip), %rdi      # 0x1445c
callq 0xd770
jmp 0x5fd6
leaq 0xe501(%rip), %rdi      # 0x14462
callq 0xd840
jmp 0x5fd6
leaq 0xe4f8(%rip), %rdi      # 0x14467
callq 0xd770
jmp 0x5fd6
leaq 0xe4ef(%rip), %rdi      # 0x1446c
callq 0xd770
jmp 0x5fd6
leaq 0xe4e7(%rip), %rdi      # 0x14472
callq 0xd840
jmp 0x5fd6
leaq 0xe4de(%rip), %rdi      # 0x14477
callq 0xd730
jmp 0x5fd6
leaq 0xe4d6(%rip), %rdi      # 0x1447d
callq 0xd730
jmp 0x5fd6
leaq 0xe44f(%rip), %rdi      # 0x14404
callq 0xd770
jmp 0x5fd6
leaq 0xe446(%rip), %rdi      # 0x14409
callq 0xd770
jmp 0x5fd6
leaq 0xe4ab(%rip), %rdi      # 0x1447c
callq 0xd730
addq $0x80, %rsp
popq %rbp
retq
nop