// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test_kstring.c
// Function: test_kroundup_size_t
static int test_kroundup_size_t(int verbose) {
    size_t val, exp;
    int ret = 0;

    val = 0;
    kroundup_size_t(val);
    if (verbose) {
        printf("kroundup_size_t(0) = 0x%zx\n", val);
    }
    if (val != 0) {
        fprintf(stderr, "kroundup_size_t(0) produced 0x%zx, expected 0\n", val);
        ret = -1;
    }

    for (exp = 0; exp < sizeof(val) * 8; exp++) {
        size_t expected = ((size_t) 1) << exp;
        ssize_t delta;
        for (delta = exp > 1 ? -1 : 0; delta <= (exp < 2 ? 0 : 1); delta++) {
            size_t val_in = expected + delta;
            val = val_in;
            kroundup_size_t(val);
            if (verbose) {
                printf("kroundup_size_t(0x%zx) = 0x%zx\n", val_in, val);
            }
            if (delta <= 0) {
                if (val != expected) {
                    fprintf(stderr, "kroundup_size_t(0x%zx) produced 0x%zx, "
                            "expected 0x%zx\n",
                            val_in, val, expected);
                    ret = -1;
                }
            } else {
                expected *= 2;
                if (!expected) --expected;
                if (val != expected) {
                    fprintf(stderr, "kroundup_size_t(0x%zx) produced 0x%zx, "
                            "expected 0x%zx\n",
                            val_in, val, expected);
                    ret = -1;
                }
            }
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0x1c(%rbp)
movq $0x0, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0x1672
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x2, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x4, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x10, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x20, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
imulq $0x0, -0x10(%rbp), %rdx
addq $0x1, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpq $0x0, %rcx
seta %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rdx
movl $0x3f, %ecx
subq %rdx, %rcx
shrq %cl, %rax
andq $0x1, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
jmp 0x1674
jmp 0x1674
cmpl $0x0, -0x4(%rbp)
je 0x168c
movq -0x10(%rbp), %rsi
leaq 0x4d08(%rip), %rdi      # 0x638d
movb $0x0, %al
callq 0x1040
cmpq $0x0, -0x10(%rbp)
je 0x16b6
movq 0x793e(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x4d01(%rip), %rsi      # 0x63a9
movb $0x0, %al
callq 0x1170
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
movq $0x0, -0x18(%rbp)
cmpq $0x40, -0x18(%rbp)
jae 0x18c6
movq -0x18(%rbp), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq $0x1, %rdx
cmoval %ecx, %eax
cltq
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rsi
movl $0x1, %ecx
xorl %edx, %edx
cmpq $0x2, %rsi
cmovbl %edx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jg 0x18b3
movq -0x28(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jbe 0x17ef
movq -0x10(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x2, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x4, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x8, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x10, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
shrq $0x20, %rax
orq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
imulq $0x0, -0x10(%rbp), %rdx
addq $0x1, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpq $0x0, %rcx
seta %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rdx
movl $0x3f, %ecx
subq %rdx, %rcx
shrq %cl, %rax
andq $0x1, %rax
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
cltq
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
jmp 0x17f1
jmp 0x17f1
cmpl $0x0, -0x4(%rbp)
je 0x180d
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq 0x4bd2(%rip), %rdi      # 0x63d8
movb $0x0, %al
callq 0x1040
cmpq $0x0, -0x30(%rbp)
jg 0x184b
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x1849
movq 0x77b3(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %r8
leaq 0x4bbd(%rip), %rsi      # 0x63f8
movb $0x0, %al
callq 0x1170
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0x18a0
movq -0x28(%rbp), %rax
shlq %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1869
movq -0x28(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x189e
movq 0x775e(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movq -0x38(%rbp), %rdx
movq -0x10(%rbp), %rcx
movq -0x28(%rbp), %r8
leaq 0x4b68(%rip), %rsi      # 0x63f8
movb $0x0, %al
callq 0x1170
movl $0xffffffff, -0x1c(%rbp) # imm = 0xFFFFFFFF
jmp 0x18a0
jmp 0x18a2
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0x16f1
jmp 0x18b5
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x16be
movl -0x1c(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop