// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/./htslib/kstring.h
// Function: kputll
static inline int kputll(long long c, kstring_t *s)
{
    // Worst case expansion.  One check reduces function size
    // and aids inlining chance.  Memory overhead is minimal.
    if (ks_resize(s, s->l + 23) < 0)
	return EOF;

    unsigned long long x = c;
    if (c < 0) {
	x = -x;
        s->s[s->l++] = '-';
    }

    if (x <= UINT32_MAX)
	return kputuw(x, s);

    static const char kputull_dig2r[] =
        "00010203040506070809"
        "10111213141516171819"
        "20212223242526272829"
        "30313233343536373839"
        "40414243444546474849"
        "50515253545556575859"
        "60616263646566676869"
        "70717273747576777879"
        "80818283848586878889"
        "90919293949596979899";
    unsigned int l, j;
    char *cp;

    // Find out how long the number is (could consider clzll)
    uint64_t m = 1;
    l = 0;
    if (sizeof(long long)==sizeof(uint64_t) && x >= 10000000000000000000ULL) {
	// avoids overflow below
	l = 20;
    } else {
	do {
	    l++;
	    m *= 10;
	} while (x >= m);
    }

    // Add digits two at a time
    j = l;
    cp = s->s + s->l;
    while (x >= 10) {
        const char *d = &kputull_dig2r[2*(x%100)];
        x /= 100;
        memcpy(&cp[j-=2], d, 2);
    }

    // Last one (if necessary).  We know that x < 10 by now.
    if (j == 1)
        cp[0] = x + '0';

    s->l += l;
    s->s[s->l] = 0;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movq -0x18(%rbp), %rax
movq (%rax), %rsi
addq $0x17, %rsi
callq 0x3f730
cmpl $0x0, %eax
jge 0x457d5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x45921
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x10(%rbp)
jge 0x4580b
xorl %eax, %eax
subq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rdx
movq (%rdx), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, (%rdx)
movb $0x2d, (%rax,%rcx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x20(%rbp)
ja 0x4582d
movq -0x20(%rbp), %rax
movl %eax, %edi
movq -0x18(%rbp), %rsi
callq 0x45990
movl %eax, -0x4(%rbp)
jmp 0x45921
movq $0x1, -0x38(%rbp)
movl $0x0, -0x24(%rbp)
movabsq $-0x7538dcfb76180000, %rax # imm = 0x8AC7230489E80000
cmpq %rax, -0x20(%rbp)
jb 0x45855
movl $0x14, -0x24(%rbp)
jmp 0x45875
jmp 0x45857
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
imulq $0xa, -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x45857
jmp 0x45875
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
addq (%rcx), %rax
movq %rax, -0x30(%rbp)
cmpq $0xa, -0x20(%rbp)
jb 0x458e2
movq -0x20(%rbp), %rax
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
shlq %rdx
leaq 0xac003(%rip), %rax     # 0xf18b0
addq %rdx, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
movl $0x64, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rax
movl -0x28(%rbp), %ecx
subl $0x2, %ecx
movl %ecx, -0x28(%rbp)
movl %ecx, %ecx
movq -0x40(%rbp), %rdx
movw (%rdx), %dx
movw %dx, (%rax,%rcx)
jmp 0x4588e
cmpl $0x1, -0x28(%rbp)
jne 0x458f8
movq -0x20(%rbp), %rax
addq $0x30, %rax
movb %al, %cl
movq -0x30(%rbp), %rax
movb %cl, (%rax)
movl -0x24(%rbp), %eax
movl %eax, %ecx
movq -0x18(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
movb $0x0, (%rax,%rcx)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)