// File: /workspace/github_c_makefile_star2_O2/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 0xf54e
movq 0x10(%r14), %rax
cmpq $0x3, %rax
je 0xf5f4
cmpq $0x2, %rax
jne 0xf5ff
movq %r14, %rdi
callq 0xdc43
movq %rax, %r14
movsbq %r14b, %rax
leaq 0x10faeac(%rip), %r12   # 0x110a410
cmpq %r14, %rax
jne 0xf585
movq 0x400(%r12,%r14,8), %rbx
testq %rbx, %rbx
je 0xf585
movabsq $0xfffffffffffc, %rax   # imm = 0xFFFFFFFFFFFC
andq %rbx, %rax
jmp 0xf5dc
movq %r14, %r13
subq $-0x80, %r13
leaq -0x60(%rbp), %rsi
pushq $0x20
popq %rdx
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r15
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
callq 0x53d1
movq (%rbx), %rdi
movq (%r15), %rsi
callq 0x8a21
movq %rax, %rbx
cmpq $0xff, %r13
ja 0xf6e5
movq %rbx, 0x400(%r12,%r14,8)
movabsq $0xfffffffffffc, %rcx   # imm = 0xFFFFFFFFFFFC
movq %rbx, %rax
andq %rcx, %rax
sete %cl
testb $0x3, %bl
setne %dl
orb %cl, %dl
jne 0xf6e5
incl (%rax)
jmp 0xf6e5
cmpl $0x0, 0x20(%r14)
je 0xf6f7
imulq $0xa, %rax, %rdi
callq 0xeccc
movq %rax, %rbx
movq 0x10(%r14), %rax
cmpl $0x0, 0x14(%r14,%rax,4)
jns 0xf641
movq %r14, %rdi
callq 0xe53d
movq %rax, %r14
testb $0x1, %r14b
jne 0xf75b
leaq 0xc67cf(%rip), %rsi     # 0xd5e02
pushq $0x1
popq %rdx
movq %rbx, %rdi
callq 0xeb6a
movq %rax, %rbx
leaq 0xc5ef5(%rip), %rsi     # 0xd553d
pushq $0x2
popq %rdx
movq %rbx, %rdi
callq 0xeb6a
movq %rax, %rbx
movq 0x10(%r14), %rax
leaq -0x1(%rax), %r12
cmpl $0x0, 0x14(%r14,%rax,4)
cmovneq %rax, %r12
pushq $0x9
popq %r13
leaq -0x60(%rbp), %r15
subq $0x1, %r12
jb 0xf6dd
movl 0x18(%r14,%r12,4), %eax
movabsq $0x3030303030303030, %rcx # imm = 0x3030303030303030
movq %rcx, -0x60(%rbp)
movw $0x5f, -0x58(%rbp)
pushq $0x8
popq %rdx
movq %rdx, %rcx
subq $0x1, %rcx
jb 0xf6c2
movl %eax, %esi
andl $0xf, %esi
leal 0x30(%rsi), %edi
leal 0x37(%rsi), %r8d
cmpl $0xa, %esi
movzbl %r8b, %esi
movzbl %dil, %edi
cmovael %esi, %edi
movb %dil, -0x61(%rbp,%rdx)
shrl $0x4, %eax
movq %rcx, %rdx
jmp 0xf695
cmpq $0x1, %r12
movq %r13, %rdx
sbbq $0x0, %rdx
movq %rbx, %rdi
movq %r15, %rsi
callq 0xeb6a
movq %rax, %rbx
jmp 0xf670
movq %r14, %rdi
callq 0xe181
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0xdc43
movq %rax, %r14
leaq 0x10fb507(%rip), %r12   # 0x110ac10
cmpq $0xff, %rax
ja 0xf71e
movq (%r12,%r14,8), %rbx
testq %rbx, %rbx
jne 0xf576
leaq -0x60(%rbp), %rsi
pushq $0x20
popq %rdx
leaq -0x38(%rbp), %rbx
leaq -0x30(%rbp), %r15
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
callq 0x5336
movq (%rbx), %rdi
movq (%r15), %rsi
callq 0x8a21
movq %rax, %rbx
cmpq $0xff, %r14
ja 0xf6e5
movq %rbx, (%r12,%r14,8)
jmp 0xf5cc
leaq 0xc5da3(%rip), %rsi     # 0xd5505
pushq $0x2
popq %rdi
pushq $0x37
popq %rdx
callq 0x5060
callq 0x52ae
pushq $0x1
popq %rdi
callq 0x5130