// File: /workspace/github_c_makefile_star2_O3/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 0x47f6d
cmpl $0x3, %eax
jne 0x47fe0
movl %ecx, %ebp
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x36182
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x47f9f
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x490ac
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x47f9f
leaq 0x148(%r15), %rdi
movq %rdi, 0x10(%rsp)
callq 0x14b57
decl %eax
movq %rax, 0x30(%rsp)
movl %eax, %edi
movq %rbx, %rsi
callq 0x2b7af
cmpl $0x0, (%rbx)
jne 0x48082
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x36119
cmpl $0x0, (%rbx)
movq %r14, %rcx
je 0x4811d
movq %rcx, %rbp
jmp 0x47fa4
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x36182
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x47f9f
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x490ac
movq %rax, %r13
cmpl $0x0, (%rbx)
je 0x48072
movq %r14, %rbp
xorl %eax, %eax
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x2b166
movq %r13, %rdi
callq 0x2b166
movq %r15, %rdi
callq 0x2b166
movq %r12, %rdi
callq 0x2b166
cmpl $0x0, (%rbx)
jne 0x48014
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2b7af
cmpl $0x0, (%rbx)
je 0x48025
movq %r14, %rdi
jmp 0x4800f
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x2dad5(%rip), %r8      # 0x75ac6
movq %rbx, %rdi
movl $0x19, %esi
movl $0x454, %r9d            # imm = 0x454
callq 0x145c8
movq %r12, %rdi
callq 0x2b166
movq %r15, %rdi
callq 0x2b166
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 0x2bc8f
movq %rax, %r12
movq %r14, %rdi
callq 0x2b166
movq %r15, %rdi
callq 0x2b166
movl %r12d, %edi
movq %rbx, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2b71f
movq %r15, %rdi
movq %rbx, %rsi
callq 0x36182
cmpl $0x0, (%rbx)
je 0x4808a
movq %r14, %rbp
jmp 0x47fa4
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x490ac
cmpl $0x0, (%rbx)
movq %r14, %rbp
jne 0x47fa4
movq %rax, 0x8(%rsp)
movq 0x148(%r12), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4d258
cmpl $0x0, (%rbx)
jne 0x481d4
movq %rax, 0x10(%rsp)
movq 0x148(%r15), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4d258
cmpl $0x0, (%rbx)
jne 0x481d4
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 0x4956f
movq %rax, %r14
jmp 0x481d4
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 0x4d258
cmpl $0x0, (%rbx)
je 0x4814e
movq 0x28(%rsp), %rbp
jmp 0x481d4
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
callq 0x14db1
movslq 0x30(%rsp), %rdx
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x481e7
cmpl $0x0, (%rbx)
je 0x48182
movq %r14, %rbp
xorl %r14d, %r14d
jmp 0x481d4
testb %bpl, %bpl
je 0x48198
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq %r13, 0x8(%rsp)
jmp 0x481a8
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 0x4956f
movq %rax, %r14
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rax
jmp 0x47fa7
nop