// File: /workspace/github_c_makefile_star2_O1/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 0x47fed
cmpl $0x3, %eax
jne 0x48060
movl %ecx, %ebp
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x362d2
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x4801f
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4912c
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x4801f
leaq 0x148(%r15), %rdi
movq %rdi, 0x10(%rsp)
callq 0x14ba1
decl %eax
movq %rax, 0x30(%rsp)
movl %eax, %edi
movq %rbx, %rsi
callq 0x2bb29
cmpl $0x0, (%rbx)
jne 0x48102
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x36269
cmpl $0x0, (%rbx)
movq %r14, %rcx
je 0x4819d
movq %rcx, %rbp
jmp 0x48024
movl %r8d, 0x1c(%rsp)
movq %r12, %rdi
movq %rbx, %rsi
callq 0x362d2
movq %rax, %r13
cmpl $0x0, (%rbx)
jne 0x4801f
movq %r14, %rdi
movq %r13, %rsi
movq %rbx, %rdx
callq 0x4912c
movq %rax, %r13
cmpl $0x0, (%rbx)
je 0x480f2
movq %r14, %rbp
xorl %eax, %eax
xorl %r14d, %r14d
movq %rax, %rdi
callq 0x2b4c3
movq %r13, %rdi
callq 0x2b4c3
movq %r15, %rdi
callq 0x2b4c3
movq %r12, %rdi
callq 0x2b4c3
cmpl $0x0, (%rbx)
jne 0x48094
xorl %edi, %edi
movq %rbx, %rsi
callq 0x2bb29
cmpl $0x0, (%rbx)
je 0x480a5
movq %r14, %rdi
jmp 0x4808f
movq (%r14), %rax
movq 0x30(%rax), %rdx
movl 0x38(%rax), %ecx
leaq 0x2da11(%rip), %r8      # 0x75a82
movq %rbx, %rdi
movl $0x19, %esi
movl $0x454, %r9d            # imm = 0x454
callq 0x14618
movq %r12, %rdi
callq 0x2b4c3
movq %r15, %rdi
callq 0x2b4c3
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 0x2c00f
movq %rax, %r12
movq %r14, %rdi
callq 0x2b4c3
movq %r15, %rdi
callq 0x2b4c3
movl %r12d, %edi
movq %rbx, %rsi
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x2ba99
movq %r15, %rdi
movq %rbx, %rsi
callq 0x362d2
cmpl $0x0, (%rbx)
je 0x4810a
movq %r14, %rbp
jmp 0x48024
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x4912c
cmpl $0x0, (%rbx)
movq %r14, %rbp
jne 0x48024
movq %rax, 0x8(%rsp)
movq 0x148(%r12), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4d29c
cmpl $0x0, (%rbx)
jne 0x48254
movq %rax, 0x10(%rsp)
movq 0x148(%r15), %rsi
xorl %r14d, %r14d
movq %rbp, %rdi
xorl %edx, %edx
movq %rbx, %rcx
callq 0x4d29c
cmpl $0x0, (%rbx)
jne 0x48254
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 0x495ef
movq %rax, %r14
jmp 0x48254
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 0x4d29c
cmpl $0x0, (%rbx)
je 0x481ce
movq 0x28(%rsp), %rbp
jmp 0x48254
movq %rax, 0x20(%rsp)
movq 0x10(%rsp), %rdi
callq 0x14dfb
movslq 0x30(%rsp), %rdx
movq 0x28(%rsp), %r14
movq %r14, %rdi
movq %rax, %rsi
movq %rbx, %rcx
callq 0x48267
cmpl $0x0, (%rbx)
je 0x48202
movq %r14, %rbp
xorl %r14d, %r14d
jmp 0x48254
testb %bpl, %bpl
je 0x48218
movq 0x20(%rsp), %rcx
movq 0x8(%rsp), %rdx
movq %r13, 0x8(%rsp)
jmp 0x48228
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 0x495ef
movq %rax, %r14
movq 0x10(%rsp), %r13
movq 0x8(%rsp), %rax
jmp 0x48027
nop