// File: /workspace/github_c_makefile_star2_O0/markdryan[P]subtilis/frontend/float64_type.c
// Function: prv_commutative
static subtilis_exp_t *prv_commutative(subtilis_parser_t *p, subtilis_exp_t *a1,
				       subtilis_exp_t *a2,
				       subtilis_op_instr_type_t real_var_imm,
				       subtilis_op_instr_type_t real_var_var,
				       subtilis_error_t *err)
{
	size_t reg;

	switch (a2->type.type) {
	case SUBTILIS_TYPE_CONST_INTEGER:
		a2->exp.ir_op.real = (double)a2->exp.ir_op.integer;
	case SUBTILIS_TYPE_CONST_REAL:
		reg = subtilis_ir_section_add_instr(p->current, real_var_imm,
						    a1->exp.ir_op,
						    a2->exp.ir_op, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		a1->exp.ir_op.reg = reg;
		break;
	case SUBTILIS_TYPE_BYTE:
		a2 = subtilis_type_if_to_int(p, a2, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
	case SUBTILIS_TYPE_INTEGER:
		reg = subtilis_ir_section_add_instr2(
		    p->current, SUBTILIS_OP_INSTR_MOV_I32_FP, a2->exp.ir_op,
		    err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		a2->type.type = SUBTILIS_TYPE_REAL;
		a2->exp.ir_op.reg = reg;
	case SUBTILIS_TYPE_REAL:
		reg = subtilis_ir_section_add_instr(p->current, real_var_var,
						    a1->exp.ir_op,
						    a2->exp.ir_op, err);
		if (err->type != SUBTILIS_ERROR_OK)
			goto on_error;
		a1->exp.ir_op.reg = reg;
		break;
	default:
		subtilis_error_set_bad_expression(err, p->l->stream->name,
						  p->l->line);
		break;
	}

	subtilis_exp_delete(a2);
	return a1;

on_error:
	subtilis_exp_delete(a1);
	subtilis_exp_delete(a2);
	return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movq %rax, -0x40(%rbp)
subq $0x6, %rax
ja 0x4d88a
movq -0x40(%rbp), %rax
leaq 0x5ec5a(%rip), %rcx     # 0xac3b8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
cvtsi2sdl 0x148(%rax), %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, 0x148(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movl -0x24(%rbp), %esi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %r8
movq 0x148(%rcx), %rdx
movq 0x148(%rax), %rcx
callq 0x38230
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4d7bb
jmp 0x4d8cd
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x148(%rax)
jmp 0x4d8ba
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x488b0
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4d7f2
jmp 0x4d8cd
jmp 0x4d7f4
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
movq 0x148(%rax), %rdx
movl $0x51, %esi
callq 0x38490
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4d827
jmp 0x4d8cd
movq -0x20(%rbp), %rax
movl $0x4, (%rax)
movq -0x38(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rdi
movl -0x28(%rbp), %esi
movq -0x18(%rbp), %rcx
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %r8
movq 0x148(%rcx), %rdx
movq 0x148(%rax), %rcx
callq 0x38230
movq %rax, -0x38(%rbp)
movq -0x30(%rbp), %rax
cmpl $0x0, (%rax)
je 0x4d879
jmp 0x4d8cd
movq -0x38(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x148(%rax)
jmp 0x4d8ba
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x30(%rax), %rdx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl 0x38(%rax), %ecx
movl $0x19, %esi
leaq 0x5eb4f(%rip), %r8      # 0xac3fe
movl $0x3d7, %r9d            # imm = 0x3D7
callq 0x15930
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x4d8e7
movq -0x18(%rbp), %rdi
callq 0x36ee0
movq -0x20(%rbp), %rdi
callq 0x36ee0
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)