// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/test_bgzf.c
// Function: test_useek_read_small
static int test_useek_read_small(Files *f, const char *mode) {

    BGZF* bgz = NULL;
    char bg_buf[99];

    bgz = try_bgzf_open(f->tmp_bgzf, mode, __func__);
    if (!bgz) goto fail;


    if (try_bgzf_write(bgz, "#>Hello, World!\n", 16,
                       f->tmp_bgzf, __func__) != 16)
        goto fail;
    if (try_bgzf_close(&bgz, f->tmp_bgzf, __func__, 0) != 0) goto fail;

    bgz = try_bgzf_open(f->tmp_bgzf, "r", __func__);
    if (!bgz) goto fail;

    if (try_bgzf_getc(bgz, 0, '#', f->tmp_bgzf, __func__) < 0 ||
        try_bgzf_getc(bgz, 1, '>', f->tmp_bgzf, __func__) < 0)
        goto fail;

    if (try_bgzf_read(bgz, bg_buf, 5, f->tmp_bgzf, __func__) != 5)
        goto fail;
    if (memcmp(bg_buf, "Hello", 5) != 0)
        goto fail;

    if (try_bgzf_useek(bgz, 9, SEEK_SET, f->tmp_bgzf, __func__) < 0)
        goto fail;

    if (try_bgzf_read(bgz, bg_buf, 5, f->tmp_bgzf, __func__) != 5)
        goto fail;
    if (memcmp(bg_buf, "World", 5) != 0)
        goto fail;

    if (try_bgzf_close(&bgz, f->tmp_bgzf, __func__, 0) != 0) goto fail;
    return 0;

 fail:
    fprintf(stderr, "%s: failed\n", __func__);
    if (bgz) bgzf_close(bgz);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
movq -0x18(%rbp), %rsi
leaq 0xe2555(%rip), %rdx     # 0xea593
callq 0x8b70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x8053
jmp 0x820f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
leaq 0xe2543(%rip), %rsi     # 0xea5a9
movl $0x10, %edx
leaq 0xe2521(%rip), %r8      # 0xea593
callq 0x9370
cmpq $0x10, %rax
je 0x8082
jmp 0x820f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x20(%rbp), %rdi
leaq 0xe24fe(%rip), %rdx     # 0xea593
xorl %ecx, %ecx
callq 0x8c10
cmpl $0x0, %eax
je 0x80a6
jmp 0x820f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
leaq 0xe64cc(%rip), %rsi     # 0xee581
leaq 0xe24d7(%rip), %rdx     # 0xea593
callq 0x8b70
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x80d1
jmp 0x820f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
xorl %eax, %eax
movl %eax, %esi
movl $0x23, %edx
leaq 0xe24a6(%rip), %r8      # 0xea593
callq 0x98a0
cmpl $0x0, %eax
jl 0x811e
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x1, %esi
movl $0x3e, %edx
leaq 0xe247f(%rip), %r8      # 0xea593
callq 0x98a0
cmpl $0x0, %eax
jge 0x8123
jmp 0x820f
movq -0x20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x5, %edx
leaq 0xe2451(%rip), %r8      # 0xea593
callq 0x8d30
cmpq $0x5, %rax
je 0x8152
jmp 0x820f
leaq -0x90(%rbp), %rdi
leaq 0xe245a(%rip), %rsi     # 0xea5ba
movl $0x5, %edx
callq 0x41b0
cmpl $0x0, %eax
je 0x8174
jmp 0x820f
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x9, %esi
xorl %edx, %edx
leaq 0xe2405(%rip), %r8      # 0xea593
callq 0x97f0
cmpl $0x0, %eax
jge 0x819a
jmp 0x820f
movq -0x20(%rbp), %rdi
leaq -0x90(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movl $0x5, %edx
leaq 0xe23da(%rip), %r8      # 0xea593
callq 0x8d30
cmpq $0x5, %rax
je 0x81c6
jmp 0x820f
leaq -0x90(%rbp), %rdi
leaq 0xe23ec(%rip), %rsi     # 0xea5c0
movl $0x5, %edx
callq 0x41b0
cmpl $0x0, %eax
je 0x81e5
jmp 0x820f
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
leaq -0x20(%rbp), %rdi
leaq 0xe239b(%rip), %rdx     # 0xea593
xorl %ecx, %ecx
callq 0x8c10
cmpl $0x0, %eax
je 0x8206
jmp 0x820f
movl $0x0, -0x4(%rbp)
jmp 0x8245
movq 0xffdca(%rip), %rax     # 0x107fe0
movq (%rax), %rdi
leaq 0xe2367(%rip), %rsi     # 0xea587
leaq 0xe236c(%rip), %rdx     # 0xea593
movb $0x0, %al
callq 0x46d0
cmpq $0x0, -0x20(%rbp)
je 0x823e
movq -0x20(%rbp), %rdi
callq 0xe0e0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x90, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)