// File: /workspace/github_c_makefile_star2_O2/markdryan[P]subtilis/frontend/builtins_ir.c
// Function: subtilis_builtin_ir_call_hex_to_str
subtilis_exp_t *subtilis_builtin_ir_call_hex_to_str(subtilis_parser_t *p,
						    size_t val_reg,
						    size_t buf_reg,
						    subtilis_error_t *err)
{
	subtilis_ir_section_t *fn;

	const subtilis_type_t *ptype[2];

	ptype[0] = &subtilis_type_integer;
	ptype[1] = &subtilis_type_integer;

	fn = prv_add_args(p, "_hex_to_str", 2, ptype, &subtilis_type_integer,
			  err);
	if (err->type != SUBTILIS_ERROR_OK) {
		if (err->type != SUBTILIS_ERROR_ALREADY_DEFINED)
			return NULL;
		subtilis_error_init(err);
	} else {
		prv_builtins_ir_hex_to_str(p, fn, err);
		if (err->type != SUBTILIS_ERROR_OK)
			return NULL;
	}

	return subtilis_parser_call_2_arg_fn(
	    p, "_hex_to_str", val_reg, buf_reg, SUBTILIS_IR_REG_TYPE_INTEGER,
	    SUBTILIS_IR_REG_TYPE_INTEGER, &subtilis_type_integer, false, err);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x3d1cc(%rip), %r13     # 0x6e8c8
leaq 0x60(%rsp), %rcx
movq %r13, (%rcx)
movq %r13, 0x8(%rcx)
leaq 0x3db37(%rip), %rsi     # 0x6f246
pushq $0x2
popq %rdx
movq %r13, %r8
movq %r12, %r9
callq 0x314be
movq %rax, %rbp
movl (%r12), %eax
testl %eax, %eax
je 0x31767
cmpl $0x20, %eax
jne 0x31b20
movq %r12, %rdi
callq 0x140a4
movq %r12, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
movq %r13, (%rsp)
leaq 0x3daf8(%rip), %rsi     # 0x6f246
movq %r15, %rdi
movq %r14, %rdx
movq %rbx, %rcx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x1deea
jmp 0x31b22
movq %r14, 0x50(%rsp)
movq %rbx, 0x58(%rsp)
movq 0x48(%r15), %rax
movq %rax, 0x48(%rsp)
movq %rbp, 0x48(%r15)
movq 0x98(%rbp), %rax
movq %rax, 0x28(%rsp)
movq %rbp, %rdi
callq 0x2b774
movq %rax, %r14
movq %rbp, %rdi
callq 0x2b774
movq %rax, %rbx
movq %rbp, %rdi
callq 0x2b774
movq %rax, 0x40(%rsp)
movq %rbp, %rdi
callq 0x2b774
movq %rax, 0x38(%rsp)
movq %rbp, %rdi
callq 0x2b774
movq %rax, 0x20(%rsp)
movq 0xa8(%rbp), %rax
movq %rax, 0x30(%rsp)
pushq $0x43
popq %rsi
pushq $0x4
popq %rdx
movq %rbp, %rdi
movq %rbx, %rcx
movq %r14, %r8
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x1b
popq %rsi
pushq $0x30
popq %rdx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x2a981
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x16
popq %rsi
pushq $0x5
popq %rcx
movq %rbp, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x48
popq %rsi
pushq $0x1
popq %rdx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x2a997
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq %rbx, %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x1d
popq %rsi
pushq $0x5
popq %rdx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x2a981
cmpl $0x0, (%r12)
jne 0x31b17
movq %rax, %r14
pushq $0x1b
popq %rsi
pushq $0x20
popq %rdx
movq %rbp, %rdi
movq %r12, %rcx
callq 0x2a981
movq %rax, 0x18(%rsp)
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq 0x40(%rsp), %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0xb
popq %rsi
pushq $0x4
popq %rcx
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x1d
popq %rsi
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movq %rax, %rcx
movq %r12, %r8
callq 0x2a9a4
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x4d
popq %rsi
pushq $0x4
popq %rdx
movq %rbp, %rdi
movq 0x18(%rsp), %rcx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x25
popq %rsi
pushq $0xf
popq %rcx
movq %rbp, %rdi
movq %rax, %rdx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
movq %rax, %rbx
pushq $0x33
popq %rsi
pushq $0x5
popq %rdx
movq %rbp, %rdi
movq %r14, %rcx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x26
popq %rsi
movq %rbp, %rdi
movq %rbx, %rdx
movq %rax, %rcx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x43
popq %rsi
movq %rbp, %rdi
movq %rax, %rdx
movq 0x20(%rsp), %rcx
movq 0x38(%rsp), %r8
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq 0x20(%rsp), %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x9
popq %rsi
pushq $0x30
popq %rcx
movq %rbp, %rdi
movq %rbx, %rdx
movq %r12, %r8
callq 0x2a819
movq %rax, 0x20(%rsp)
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x41
popq %rsi
pushq $0xa
popq %rcx
movq %rbp, %rdi
movq %rbx, %rdx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0xd
popq %rsi
movl $0xfffffff9, %ecx       # imm = 0xFFFFFFF9
movq %rbp, %rdi
movq %rax, %rdx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
xorl %esi, %esi
movq %rax, %rdx
movq 0x20(%rsp), %rcx
movq %r12, %r8
callq 0x2a819
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x16
popq %rsi
pushq $0x5
popq %rcx
movq %rbp, %rdi
movq %rax, %rdx
xorl %r8d, %r8d
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x9
popq %rsi
pushq $0x5
popq %rcx
pushq $0x1
popq %r8
movq %rbp, %rdi
movq %rcx, %rdx
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq 0x38(%rsp), %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x43
popq %rsi
movq %rbp, %rdi
movq 0x18(%rsp), %rdx
movq 0x40(%rsp), %rcx
movq 0x28(%rsp), %r8
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
jne 0x31b17
movq %rbp, %rdi
movq 0x28(%rsp), %rsi
movq %r12, %rdx
callq 0x2b781
cmpl $0x0, (%r12)
jne 0x31b17
pushq $0x2
popq %rsi
pushq $0x5
popq %rcx
movq %rbp, %rdi
movq 0x30(%rsp), %rdx
movq %r14, %r8
movq %r12, %r9
callq 0x2a8c1
cmpl $0x0, (%r12)
je 0x31b31
movq 0x48(%rsp), %rax
movq %rax, 0x48(%r15)
xorl %eax, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x47
popq %rsi
movq %rbp, %rdi
movq 0x30(%rsp), %rdx
movq %r12, %rcx
callq 0x2a997
cmpl $0x0, (%r12)
movq 0x48(%rsp), %rax
movq %rax, 0x48(%r15)
movq 0x58(%rsp), %rbx
movq 0x50(%rsp), %r14
jne 0x31b20
jmp 0x31739