// File: /workspace/github_c_makefile_star2_O2/JimKent[P]linearSat/lib/obscure.c
// Function: sprintLongWithCommas
void sprintLongWithCommas(char *s, long long l)
/* Print out a long number with commas a thousands, millions, etc. */
{
long long trillions, billions, millions, thousands;
if (l >= 1000000000000LL)
    {
    trillions = l/1000000000000LL;
    l -= trillions * 1000000000000LL;
    billions = l/1000000000;
    l -= billions * 1000000000;
    millions = l/1000000;
    l -= millions * 1000000;
    thousands = l/1000;
    l -= thousands * 1000;
    sprintf(s, "%lld,%03lld,%03lld,%03lld,%03lld", trillions, billions, millions, thousands, l);
    }
else if (l >= 1000000000)
    {
    billions = l/1000000000;
    l -= billions * 1000000000;
    millions = l/1000000;
    l -= millions * 1000000;
    thousands = l/1000;
    l -= thousands * 1000;
    sprintf(s, "%lld,%03lld,%03lld,%03lld", billions, millions, thousands, l);
    }
else if (l >= 1000000)
    {
    millions = l/1000000;
    l -= millions * (long long)1000000;
    thousands = l/1000;
    l -= thousands * 1000;
    sprintf(s, "%lld,%03lld,%03lld", millions, thousands, l);
    }
else if (l >= 1000)
    {
    thousands = l/1000;
    l -= thousands * 1000;
    sprintf(s, "%lld,%03lld", thousands, l);
    }
else
    sprintf(s, "%lld", l);
}

// Assembly:
movq %rsi, %r10
movabsq $0xe8d4a51000, %rcx     # imm = 0xE8D4A51000
cmpq %rcx, %rsi
jl 0xe86a
pushq %rax
movq %r10, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r8
movabsq $-0xe8d4a51000, %rsi    # imm = 0xFFFFFF172B5AF000
imulq %rax, %rsi
addq %r10, %rsi
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
movq %rsi, %rax
cqto
idivq %rcx
movq %rax, %rcx
imulq $-0x3b9aca00, %rax, %r9 # imm = 0xC4653600
addq %rsi, %r9
movl $0xf4240, %esi          # imm = 0xF4240
movq %r9, %rax
cqto
idivq %rsi
movq %rax, %r10
imulq $-0xf4240, %rax, %rsi   # imm = 0xFFF0BDC0
addq %r9, %rsi
movl $0x3e8, %r9d            # imm = 0x3E8
movq %rsi, %rax
cqto
idivq %r9
imulq $-0x3e8, %rax, %rdx     # imm = 0xFC18
addq %rsi, %rdx
movq %rdx, (%rsp)
leaq 0xa0c1(%rip), %rsi      # 0x18919
movq %r8, %rdx
movq %r10, %r8
movq %rax, %r9
xorl %eax, %eax
callq 0x36d0
popq %rax
retq
cmpq $0x3b9aca00, %r10       # imm = 0x3B9ACA00
jl 0xe8d2
movl $0x3b9aca00, %ecx       # imm = 0x3B9ACA00
movq %r10, %rax
xorl %edx, %edx
divq %rcx
movq %rax, %r8
imulq $-0x3b9aca00, %rax, %rsi # imm = 0xC4653600
addq %r10, %rsi
movl $0xf4240, %ecx          # imm = 0xF4240
movq %rsi, %rax
cqto
idivq %rcx
movq %rax, %rcx
imulq $-0xf4240, %rax, %r10   # imm = 0xFFF0BDC0
addq %rsi, %r10
movl $0x3e8, %esi            # imm = 0x3E8
movq %r10, %rax
cqto
idivq %rsi
imulq $-0x3e8, %rax, %r9      # imm = 0xFC18
addq %r10, %r9
leaq 0xa075(%rip), %rsi      # 0x1893a
movq %r8, %rdx
movq %rax, %r8
xorl %eax, %eax
jmp 0x36d0
cmpq $0xf4240, %r10          # imm = 0xF4240
jl 0xe91c
movl $0xf4240, %ecx          # imm = 0xF4240
movl %r10d, %eax
xorl %edx, %edx
divl %ecx
movl %eax, %r9d
imulq $-0xf4240, %r9, %rsi    # imm = 0xFFF0BDC0
addq %r10, %rsi
movl $0x3e8, %ecx            # imm = 0x3E8
movl %esi, %eax
cltd
idivl %ecx
movslq %eax, %rcx
imulq $-0x3e8, %rcx, %r8      # imm = 0xFC18
addq %rsi, %r8
leaq 0xa042(%rip), %rsi      # 0x18954
movq %r9, %rdx
xorl %eax, %eax
jmp 0x36d0
cmpq $0x3e8, %r10            # imm = 0x3E8
jl 0xe94c
movl $0x3e8, %ecx            # imm = 0x3E8
movl %r10d, %eax
xorl %edx, %edx
divl %ecx
imulq $-0x3e8, %rax, %rcx     # imm = 0xFC18
addq %r10, %rcx
leaq 0xa025(%rip), %rsi      # 0x18967
movq %rax, %rdx
xorl %eax, %eax
jmp 0x36d0
leaq 0x8f3b(%rip), %rsi      # 0x1788e
movq %r10, %rdx
xorl %eax, %eax
jmp 0x36d0