// File: /workspace/github_c_makefile_star2_O0/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
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
jne 0x21205
movq -0x10(%rbp), %rax
cmpq $0x2, 0x10(%rax)
jne 0x2121f
movq -0x10(%rbp), %rdi
callq 0xc6c0
movq %rax, %rdi
callq 0x21430
movq %rax, -0x8(%rbp)
jmp 0x21421
movq -0x10(%rbp), %rax
cmpq $0x3, 0x10(%rax)
jne 0x2124e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
jne 0x2124e
movq -0x10(%rbp), %rdi
callq 0x1b680
movq %rax, %rdi
callq 0x216b0
movq %rax, -0x8(%rbp)
jmp 0x21421
movq -0x10(%rbp), %rax
imulq $0xa, 0x10(%rax), %rdi
callq 0x1f850
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq $0x1, %rcx
movl 0x18(%rax,%rcx,4), %eax
andl $0x80000000, %eax       # imm = 0x80000000
cmpl $0x0, %eax
je 0x21286
movb $0x1, %al
testb $0x1, %al
jne 0x2128e
jmp 0x212f6
xorl %eax, %eax
testb $0x1, %al
jne 0x2128e
jmp 0x212f6
movq -0x10(%rbp), %rdi
callq 0x1c7f0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x212db
movl $0x2, %edi
leaq 0x33398f(%rip), %rsi    # 0x354c4c
movl $0x37, %edx
callq 0x5060
callq 0x5310
callq 0x53b0
movl $0x1, %edi
callq 0x5130
jmp 0x212dd
movq -0x18(%rbp), %rdi
leaq 0x3342b9(%rip), %rsi    # 0x3555a1
movl $0x1, %edx
callq 0x1f4f0
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x333983(%rip), %rsi    # 0x354c84
movl $0x2, %edx
callq 0x1f4f0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x28(%rbp), %rcx
movq 0x10(%rcx), %rcx
subq $0x1, %rcx
cmpl $0x0, 0x18(%rax,%rcx,4)
je 0x2133c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x2134c
movq -0x28(%rbp), %rax
movq 0x10(%rax), %rax
subq $0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq %rax, %rcx
addq $-0x1, %rcx
movq %rcx, -0x30(%rbp)
cmpq $0x0, %rax
jbe 0x21410
movq -0x28(%rbp), %rax
movq -0x30(%rbp), %rcx
movl 0x18(%rax,%rcx,4), %eax
movl %eax, -0x34(%rbp)
movq 0x333904(%rip), %rax    # 0x354c87
movq %rax, -0x3e(%rbp)
movw 0x333901(%rip), %ax     # 0x354c8f
movw %ax, -0x36(%rbp)
movl $0x8, -0x44(%rbp)
movl -0x44(%rbp), %eax
movl %eax, %ecx
addl $-0x1, %ecx
movl %ecx, -0x44(%rbp)
cmpl $0x0, %eax
jle 0x213e7
movl -0x34(%rbp), %eax
andl $0xf, %eax
movl %eax, -0x48(%rbp)
cmpl $0x9, -0x48(%rbp)
jbe 0x213c6
movl -0x48(%rbp), %eax
addl $0x41, %eax
subl $0xa, %eax
movl %eax, -0x54(%rbp)
jmp 0x213cf
movl -0x48(%rbp), %eax
addl $0x30, %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %eax
movb %al, %cl
movslq -0x44(%rbp), %rax
movb %cl, -0x3e(%rbp,%rax)
movl -0x34(%rbp), %eax
shrl $0x4, %eax
movl %eax, -0x34(%rbp)
jmp 0x21399
movq -0x18(%rbp), %rdi
leaq -0x3e(%rbp), %rsi
cmpq $0x0, -0x30(%rbp)
seta %al
andb $0x1, %al
movzbl %al, %eax
addl $0x8, %eax
movslq %eax, %rdx
callq 0x1f4f0
movq %rax, -0x18(%rbp)
jmp 0x21354
movq -0x28(%rbp), %rdi
callq 0x1c3a0
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax,%rax)