// File: /workspace/github_c_makefile_star2_O1/mirth-lang[P]mirth/bin/mirth1.c
// Function: int_to_str
static STR* int_to_str(INT a) {
    if (IS_I63(a) || (GET_BIG(a)->size == 2)) {
        return i64_to_str(int_to_i64(a));
    } else if ((GET_BIG(a)->size == 3) && (GET_BIG(a)->radix[2] == 0)) {
        return u64_to_str(int_to_u64(a));
    } else {
        STR *s = str_alloc(GET_BIG(a)->size * 10);
        if (SIGN_RADIX(GET_BIG(a))) {
            a = int_negate(a);
            ASSERT(IS_BIG(a));
            s = str_pushn(s, "-", 1);
        }
        s = str_pushn(s,"0x",2);
        BIG* b = GET_BIG(a);
        size_t i = b->radix[b->size-1] ? b->size : b->size-1;
        while (i --> 0) {
            uint32_t r = b->radix[i];
            char c[10] = "00000000_";
            int j = 8;
            while (j --> 0) {
                uint32_t h = r & 0xF;
                c[j] = (h > 9) ? h + 'A' - 10 : h + '0';
                r = r >> 4;
            }
            s = str_pushn(s,c,8+(i>0));
        }
        big_decref(b);
        return s;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rdi, %r14
testb $0x1, %r14b
jne 0x102fb
movq 0x10(%r14), %rax
cmpq $0x3, %rax
je 0x103aa
cmpq $0x2, %rax
jne 0x103b5
movq %r14, %rdi
callq 0xe818
movq %rax, %r14
movsbq %r14b, %rax
cmpq %r14, %rax
jne 0x10332
leaq 0x11070fa(%rip), %rax   # 0x1117410
movq 0x400(%rax,%r14,8), %rbx
testq %rbx, %rbx
je 0x10332
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rbx, %rax
jmp 0x10392
movq %r14, %r12
subq $-0x80, %r12
leaq -0x50(%rbp), %rsi
leaq -0x60(%rbp), %rbx
leaq -0x58(%rbp), %r15
movl $0x20, %edx
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
callq 0x540a
movq (%rbx), %rdi
movq (%r15), %rsi
callq 0x92e9
movq %rax, %rbx
cmpq $0xff, %r12
ja 0x104a5
leaq 0x1107096(%rip), %rax   # 0x1117410
movq %rbx, 0x400(%rax,%r14,8)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rbx, %rax
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0x104a5
incl (%rax)
jmp 0x104a5
cmpl $0x0, 0x20(%r14)
je 0x104b7
addq %rax, %rax
leaq (%rax,%rax,4), %rdi
callq 0xf9f7
movq %rax, %rbx
movq 0x10(%r14), %rax
cmpl $0x0, 0x14(%r14,%rax,4)
jns 0x103fc
movq %r14, %rdi
callq 0xf1af
movq %rax, %r14
testb $0x1, %r14b
jne 0x1055e
leaq 0xd50ca(%rip), %rsi     # 0xe54b6
movl $0x1, %edx
movq %rbx, %rdi
callq 0xf88f
movq %rax, %rbx
leaq 0xd50b5(%rip), %rsi     # 0xe54b8
movl $0x2, %edx
movq %rbx, %rdi
callq 0xf88f
movq %rax, %rbx
movq 0x10(%r14), %rax
cmpl $0x0, 0x14(%r14,%rax,4)
leaq -0x1(%rax), %r12
cmovneq %rax, %r12
testq %r12, %r12
je 0x10498
movabsq $0x3030303030303030, %r13 # imm = 0x3030303030303030
leaq -0x50(%rbp), %r15
movl 0x14(%r14,%r12,4), %eax
decq %r12
movq %r13, -0x50(%rbp)
movw $0x5f, -0x48(%rbp)
movl $0x9, %ecx
movl %eax, %edx
andl $0xf, %edx
leal 0x30(%rdx), %esi
leal 0x37(%rdx), %edi
cmpl $0xa, %edx
movzbl %dil, %edx
movzbl %sil, %esi
cmovael %edx, %esi
movb %sil, -0x52(%rbp,%rcx)
shrl $0x4, %eax
decq %rcx
cmpq $0x1, %rcx
ja 0x1044f
xorl %edx, %edx
testq %r12, %r12
sete %dl
xorq $0x9, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xf88f
movq %rax, %rbx
testq %r12, %r12
jne 0x10438
decl (%r14)
jne 0x104a5
movq %r14, %rdi
callq 0x5030
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xe818
movq %rax, %r14
cmpq $0xff, %rax
ja 0x104de
leaq 0x110773f(%rip), %rax   # 0x1117c10
movq (%rax,%r14,8), %rbx
testq %rbx, %rbx
jne 0x10323
xorps %xmm0, %xmm0
leaq -0x32(%rbp), %rdi
movaps %xmm0, -0xe(%rdi)
movaps %xmm0, -0x1e(%rdi)
xorl %esi, %esi
movabsq $-0x3333333333333333, %r8 # imm = 0xCCCCCCCCCCCCCCCD
leaq -0x50(%rbp), %r9
movq %r14, %rdx
movq %rdx, %rcx
movq %rdx, %rax
mulq %r8
shrq $0x3, %rdx
leal (%rdx,%rdx), %eax
leal (%rax,%rax,4), %eax
movl %ecx, %r10d
subl %eax, %r10d
orb $0x30, %r10b
movb %r10b, (%rdi)
incq %rsi
cmpq %r9, %rdi
seta %al
decq %rdi
cmpq $0xa, %rcx
jb 0x10536
testb %al, %al
jne 0x10500
incq %rdi
callq 0x92e9
movq %rax, %rbx
cmpq $0xff, %r14
ja 0x104a5
leaq 0x11076bb(%rip), %rax   # 0x1117c10
movq %rbx, (%rax,%r14,8)
jmp 0x10382
leaq 0xd4f19(%rip), %rsi     # 0xe547e
movl $0x37, %edx
movl $0x2, %edi
callq 0x5060
callq 0x52be
movl $0x1, %edi
callq 0x5130