// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test_kstring.c
// Function: test_kroundup_signed
static int test_kroundup_signed(int verbose) {
    int32_t val, ret = 0;
    size_t exp;
    for (exp = 0; exp < sizeof(val) * 8 - 1; exp++) {
        uint32_t expected = ((uint32_t) 1) << exp;
        ssize_t delta;
        for (delta = exp > 1 ? -1 : 0; delta <= (exp < 2 ? 0 : 1); delta++) {
            int32_t val_in = expected + delta;
            val = val_in;
            kroundup32(val);
            if (verbose) {
                printf("kroundup32(%d) = %d\n", val_in, val);
            }
            if (delta <= 0) {
                if ((uint32_t) val != expected) {
                    fprintf(stderr, "kroundup32(%d) produced %d, expected %u\n",
                            val_in, val, expected);
                    ret = -1;
                }
            } else {
                if (exp < sizeof(val) * 8 - 2) {
                    expected *= 2;
                } else {
                    expected = ((expected - 1) << 1 | 1);
                }
                if ((uint32_t) val != expected) {
                    fprintf(stderr, "kroundup32(%d) produced %d, expected %u\n",
                            val_in, val, expected);
                    ret = -1;
                }
            }
        }
    }
    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
movl $0x0, -0xc(%rbp)
movq $0x0, -0x18(%rbp)
cmpq $0x1f, -0x18(%rbp)
jae 0x1abc
movq -0x18(%rbp), %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl %eax, -0x1c(%rbp)
movq -0x18(%rbp), %rdx
xorl %eax, %eax
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpq $0x1, %rdx
cmoval %ecx, %eax
cltq
movq %rax, -0x28(%rbp)
movq -0x28(%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 0x1aa9
movl -0x1c(%rbp), %eax
addq -0x28(%rbp), %rax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movl %eax, -0x8(%rbp)
cmpl $0x0, -0x8(%rbp)
jle 0x19ee
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl $0x0, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl $0x2, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl $0x4, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl $0x8, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
sarl $0x10, %eax
orl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
imull $0x0, -0x8(%rbp), %edx
addl $0x1, %edx
xorl %ecx, %ecx
subl %edx, %ecx
cmpl $0x0, %ecx
setg %cl
xorb $-0x1, %cl
andb $0x1, %cl
movzbl %cl, %ecx
movslq %ecx, %rdx
movl $0x1f, %ecx
subq %rdx, %rcx
sarl %cl, %eax
andl $0x1, %eax
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
addl -0x8(%rbp), %eax
movl %eax, -0x8(%rbp)
movl -0x8(%rbp), %eax
jmp 0x19f0
jmp 0x19f0
cmpl $0x0, -0x4(%rbp)
je 0x1a0a
movl -0x2c(%rbp), %esi
movl -0x8(%rbp), %edx
leaq 0x4a2c(%rip), %rdi      # 0x642f
movb $0x0, %al
callq 0x1040
cmpq $0x0, -0x28(%rbp)
jg 0x1a44
movl -0x8(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x1a42
movq 0x75b8(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x1c(%rbp), %r8d
leaq 0x4a10(%rip), %rsi      # 0x6444
movb $0x0, %al
callq 0x1170
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
jmp 0x1a96
cmpq $0x1e, -0x18(%rbp)
jae 0x1a55
movl -0x1c(%rbp), %eax
shll %eax
movl %eax, -0x1c(%rbp)
jmp 0x1a63
movl -0x1c(%rbp), %eax
subl $0x1, %eax
shll %eax
orl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x8(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x1a94
movq 0x7566(%rip), %rax      # 0x8fd8
movq (%rax), %rdi
movl -0x2c(%rbp), %edx
movl -0x8(%rbp), %ecx
movl -0x1c(%rbp), %r8d
leaq 0x49be(%rip), %rsi      # 0x6444
movb $0x0, %al
callq 0x1170
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
jmp 0x1a96
jmp 0x1a98
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x191d
jmp 0x1aab
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x18ea
movl -0xc(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)