// File: /workspace/github_c_makefile_star2_O0/wtarreau[P]httpterm/httpterm.c
// Function: ulltoa
int ulltoa(unsigned long long n, char *dst, size_t size)
{
    int i = 0;
    char *res;

    switch(n) {
    case 1ULL ... 9ULL:
	i = 0;
	break;

    case 10ULL ... 99ULL:
	i = 1;
	break;

    case 100ULL ... 999ULL:
	i = 2;
	break;

    case 1000ULL ... 9999ULL:
	i = 3;
	break;

    case 10000ULL ... 99999ULL:
	i = 4;
	break;

    case 100000ULL ... 999999ULL:
	i = 5;
	break;

    case 1000000ULL ... 9999999ULL:
	i = 6;
	break;

    case 10000000ULL ... 99999999ULL:
	i = 7;
	break;

    case 100000000ULL ... 999999999ULL:
	i = 8;
	break;

    case 1000000000ULL ... 9999999999ULL:
	i = 9;
	break;

    case 10000000000ULL ... 99999999999ULL:
	i = 10;
	break;

    case 100000000000ULL ... 999999999999ULL:
	i = 11;
	break;

    case 1000000000000ULL ... 9999999999999ULL:
	i = 12;
	break;

    case 10000000000000ULL ... 99999999999999ULL:
	i = 13;
	break;

    case 100000000000000ULL ... 999999999999999ULL:
	i = 14;
	break;

    case 1000000000000000ULL ... 9999999999999999ULL:
	i = 15;
	break;

    case 10000000000000000ULL ... 99999999999999999ULL:
	i = 16;
	break;

    case 100000000000000000ULL ... 999999999999999999ULL:
	i = 17;
	break;

    case 1000000000000000000ULL ... 9999999999999999999ULL:
	i = 18;
	break;

    case 10000000000000000000ULL ... ULLONG_MAX:
	i = 19;
	break;
    }
    if (i + 2 > size) // (i + 1) + '\0'
	return 0;  // too long
    res = dst + i + 1;
    *res = '\0';
    for (; i >= 0; i--) {
	dst[i] = n % 10ULL + '0';
	n /= 10ULL;
    }
    return res - dst;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x38(%rbp)
decq %rax
subq $0x8, %rax
ja 0x287f
jmp 0x25ae
movl $0x0, -0x24(%rbp)
jmp 0x28a1
movl $0x1, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0xa, %rax
cmpq $0x59, %rax
jbe 0x25ba
jmp 0x28a1
movl $0x2, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x64, %rax
cmpq $0x383, %rax            # imm = 0x383
jbe 0x25d9
jmp 0x25c6
movl $0x3, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x3e8, %rax            # imm = 0x3E8
cmpq $0x2327, %rax           # imm = 0x2327
jbe 0x25f7
jmp 0x25e5
movl $0x4, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x2710, %rax           # imm = 0x2710
cmpq $0x15f8f, %rax          # imm = 0x15F8F
jbe 0x2617
jmp 0x2603
movl $0x5, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x186a0, %rax          # imm = 0x186A0
cmpq $0xdbb9f, %rax          # imm = 0xDBB9F
jbe 0x2637
jmp 0x2623
movl $0x6, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0xf4240, %rax          # imm = 0xF4240
cmpq $0x89543f, %rax         # imm = 0x89543F
jbe 0x2657
jmp 0x2643
movl $0x7, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x989680, %rax         # imm = 0x989680
cmpq $0x55d4a7f, %rax        # imm = 0x55D4A7F
jbe 0x2677
jmp 0x2663
movl $0x8, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x5f5e100, %rax        # imm = 0x5F5E100
cmpq $0x35a4e8ff, %rax       # imm = 0x35A4E8FF
jbe 0x2697
jmp 0x2683
movl $0x9, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
subq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
movabsq $0x2187119ff, %rcx      # imm = 0x2187119FF
cmpq %rcx, %rax
jbe 0x26b7
jmp 0x26a3
movl $0xa, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x2540be400, %rcx      # imm = 0x2540BE400
subq %rcx, %rax
movabsq $0x14f46b03ff, %rcx     # imm = 0x14F46B03FF
cmpq %rcx, %rax
jbe 0x26de
jmp 0x26c3
movl $0xb, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x174876e800, %rcx     # imm = 0x174876E800
subq %rcx, %rax
movabsq $0xd18c2e27ff, %rcx     # imm = 0xD18C2E27FF
cmpq %rcx, %rax
jbe 0x270c
jmp 0x26ea
movl $0xc, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0xe8d4a51000, %rcx     # imm = 0xE8D4A51000
subq %rcx, %rax
movabsq $0x82f79cd8fff, %rcx    # imm = 0x82F79CD8FFF
cmpq %rcx, %rax
jbe 0x273a
jmp 0x2718
movl $0xd, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x9184e72a000, %rcx    # imm = 0x9184E72A000
subq %rcx, %rax
movabsq $0x51dac2079fff, %rcx   # imm = 0x51DAC2079FFF
cmpq %rcx, %rax
jbe 0x2768
jmp 0x2746
movl $0xe, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x5af3107a4000, %rcx   # imm = 0x5AF3107A4000
subq %rcx, %rax
movabsq $0x3328b944c3fff, %rcx  # imm = 0x3328B944C3FFF
cmpq %rcx, %rax
jbe 0x2796
jmp 0x2774
movl $0xf, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x38d7ea4c68000, %rcx  # imm = 0x38D7EA4C68000
subq %rcx, %rax
movabsq $0x1ff973cafa7fff, %rcx # imm = 0x1FF973CAFA7FFF
cmpq %rcx, %rax
jbe 0x27c4
jmp 0x27a2
movl $0x10, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x2386f26fc10000, %rcx # imm = 0x2386F26FC10000
subq %rcx, %rax
movabsq $0x13fbe85edc8ffff, %rcx # imm = 0x13FBE85EDC8FFFF
cmpq %rcx, %rax
jbe 0x27f2
jmp 0x27d0
movl $0x11, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0x16345785d8a0000, %rcx # imm = 0x16345785D8A0000
subq %rcx, %rax
movabsq $0xc7d713b49d9ffff, %rcx # imm = 0xC7D713B49D9FFFF
cmpq %rcx, %rax
jbe 0x2820
jmp 0x27fe
movl $0x12, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $0xde0b6b3a7640000, %rcx # imm = 0xDE0B6B3A7640000
subq %rcx, %rax
movabsq $0x7ce66c50e283ffff, %rcx # imm = 0x7CE66C50E283FFFF
cmpq %rcx, %rax
jbe 0x284b
jmp 0x2829
movl $0x13, -0x24(%rbp)
jmp 0x28a1
movq -0x38(%rbp), %rax
movabsq $-0x7538dcfb76180000, %rcx # imm = 0x8AC7230489E80000
subq %rcx, %rax
movabsq $0x7538dcfb7617ffff, %rcx # imm = 0x7538DCFB7617FFFF
cmpq %rcx, %rax
jbe 0x2876
jmp 0x2854
movl -0x24(%rbp), %eax
addl $0x2, %eax
cltq
cmpq -0x20(%rbp), %rax
jbe 0x28b8
movl $0x0, -0x4(%rbp)
jmp 0x2920
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movb $0x0, (%rax)
cmpl $0x0, -0x24(%rbp)
jl 0x2912
movq -0x10(%rbp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
addq $0x30, %rdx
movq -0x18(%rbp), %rax
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl $0xa, %ecx
xorl %edx, %edx
divq %rcx
movq %rax, -0x10(%rbp)
movl -0x24(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x28d2
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)