// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/string_type_if.c
// Function: prv_compare
static subtilis_exp_t *prv_compare(subtilis_parser_t *p, subtilis_exp_t *a1,
				   subtilis_exp_t *a2, bool swapped,
				   subtilis_op_instr_type_t itype,
				   subtilis_error_t *err)
{
	subtilis_exp_t *zero;
	size_t res;

	switch (a2->type.type) {
	case SUBTILIS_TYPE_CONST_STRING:
		a1 = prv_compare_non_const_const(p, a1, a2, swapped, err);
		break;
	case SUBTILIS_TYPE_STRING:
		a1 = prv_compare_non_const_non_const(p, a1, a2, err);
		break;
	default:
		subtilis_error_set_bad_expression(err, p->l->stream->name,
						  p->l->line);
		subtilis_exp_delete(a1);
		subtilis_exp_delete(a2);
		return NULL;
	}
	if (err->type != SUBTILIS_ERROR_OK)
		return NULL;

	zero = subtilis_exp_new_int32(0, err);
	if (err->type != SUBTILIS_ERROR_OK) {
		subtilis_exp_delete(a1);
		return NULL;
	}

	res = subtilis_ir_section_add_instr(p->current, itype, a1->exp.ir_op,
					    zero->exp.ir_op, err);
	subtilis_exp_delete(a1);
	subtilis_exp_delete(zero);

	return subtilis_exp_new_int32_var(res, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %r9, %rbx
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %r14
movl (%rdx), %eax
cmpl $0x7, %eax
je 0x45653
cmpl $0x3, %eax
jne 0x456c6
movl %ecx, %ebp
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x341c4
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x45685
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4673c
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x45685
leaq 0x148(%r15), %rdi
movq %rdi, 0x10(%rsp)
callq 0x14804
decl %eax
movq %rax, 0x30(%rsp)
movl %eax, %edi
movq %rbx, %rsi
callq 0x2a369
cmpl $0x0, (%rbx)
jne 0x45766
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x3415f
cmpl $0x0, (%rbx)
movq %r14, %rcx
je 0x45801
movq %rcx, %rbp
jmp 0x4568a
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x341c4
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x45685
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4673c
movq %rax, %r13
cmpl $0x0, (%rbx)
je 0x45756
movq %r14, %rbp
xorl %eax, %eax
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x29d88
movq %r13, %rdi
callq 0x29d88
movq %r15, %rdi
callq 0x29d88
movq %r12, %rdi
callq 0x29d88
cmpl $0x0, (%rbx)
jne 0x456f8
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2a369
cmpl $0x0, (%rbx)
je 0x45709
movq %r14, %rdi
jmp 0x456f3
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x2a37b(%rip), %r8      # 0x6fa52
pushq $0x19
popq %rsi
movq %rbx, %rdi
movl $0x454, %r9d            # imm = 0x454
callq 0x142c0
movq %r12, %rdi
callq 0x29d88
movq %r15, %rdi
callq 0x29d88
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r15
movq 0x48(%rbp), %rdi
movq 0x148(%r14), %rdx
movq 0x148(%rax), %rcx
movl 0x1c(%rsp), %esi
movq %rbx, %r8
callq 0x2a819
movq %rax, %r12
movq %r14, %rdi
callq 0x29d88
movq %r15, %rdi
callq 0x29d88
movl %r12d, %edi
movq %rbx, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2a336
movq %r15, %rdi
movq %rbx, %rsi
callq 0x341c4
cmpl $0x0, (%rbx)
je 0x4576e
movq %r14, %rbp
jmp 0x4568a
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x4673c
cmpl $0x0, (%rbx)
movq %r14, %rbp
jne 0x4568a
movq %rax, 0x8(%rsp)
movq 0x148(%r12), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4a690
cmpl $0x0, (%rbx)
jne 0x458b8
movq %rax, 0x10(%rsp)
movq 0x148(%r15), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4a690
cmpl $0x0, (%rbx)
jne 0x458b8
movq 0x148(%r13), %rdx
movq 0x8(%rsp), %rcx
movq 0x148(%rcx), %r8
movq %rbp, %rdi
movq 0x10(%rsp), %rsi
movq %rax, %rcx
movq %rbx, %r9
callq 0x46bcf
movq %rax, %r14
jmp 0x458b8
movq %rax, 0x8(%rsp)
movq 0x148(%r12), %rsi
xorl %r14d, %r14d
movq %rcx, 0x28(%rsp)
movq %rcx, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4a690
cmpl $0x0, (%rbx)
je 0x45832
movq 0x28(%rsp), %rbp
jmp 0x458b8
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
callq 0x14a53
movslq 0x30(%rsp), %rdx
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x458cb
cmpl $0x0, (%rbx)
je 0x45866
movq %r14, %rbp
xorl %r14d, %r14d
jmp 0x458b8
testb %bpl, %bpl
je 0x4587c
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq %r13, 0x8(%rsp)
jmp 0x4588c
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %r13, %rdx
movq 0x8(%rsp), %r13
movq %rdx, 0x10(%rsp)
movq 0x148(%rdx), %rdx
movq 0x148(%r13), %r8
movq %r14, %rbp
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %r9
callq 0x46bcf
movq %rax, %r14
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rax
jmp 0x4568d
nop