// File: /workspace/github_c_makefile_star2_O2/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
pushq %r14
pushq %rbx
subq $0x80, %rsp
movq %rdi, %rbx
movq 0x18(%rdi), %rdi
leaq 0x6d085(%rip), %rdx     # 0x74593
callq 0x7d08
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x7684
movq 0x18(%rbx), %rcx
leaq 0x6d07d(%rip), %rsi     # 0x745a9
leaq 0x6d060(%rip), %r8      # 0x74593
pushq $0x10
popq %rdx
movq %rax, %rdi
callq 0x816e
cmpq $0x10, %rax
jne 0x767d
movq 0x18(%rbx), %rsi
leaq 0x6d040(%rip), %rdx     # 0x74593
leaq 0x8(%rsp), %rdi
xorl %ecx, %ecx
callq 0x7d69
testl %eax, %eax
jne 0x767d
movq 0x18(%rbx), %rdi
leaq 0x70d24(%rip), %rsi     # 0x78296
leaq 0x6d01a(%rip), %rdx     # 0x74593
callq 0x7d08
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x7684
movq %rax, %r14
movq 0x18(%rbx), %rcx
leaq 0x6cff9(%rip), %r8      # 0x74593
pushq $0x23
popq %rdx
movq %rax, %rdi
xorl %esi, %esi
callq 0x8369
testl %eax, %eax
js 0x767d
movq 0x18(%rbx), %rcx
leaq 0x6cfd9(%rip), %r8      # 0x74593
pushq $0x1
popq %rsi
pushq $0x3e
popq %rdx
movq %r14, %rdi
callq 0x8369
testl %eax, %eax
js 0x767d
movq 0x18(%rbx), %rcx
leaq 0x6cfb8(%rip), %r8      # 0x74593
leaq 0x10(%rsp), %rsi
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x7e14
cmpq $0x5, %rax
jne 0x767d
leaq 0x6cfbe(%rip), %rsi     # 0x745ba
leaq 0x10(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x44c0
testl %eax, %eax
jne 0x767d
movq 0x18(%rbx), %rdx
leaq 0x6cf7b(%rip), %rcx     # 0x74593
pushq $0x9
popq %rsi
movq %r14, %rdi
callq 0x82fc
testl %eax, %eax
js 0x767d
movq 0x18(%rbx), %rcx
leaq 0x6cf61(%rip), %r8      # 0x74593
leaq 0x10(%rsp), %rsi
pushq $0x5
popq %rdx
movq %r14, %rdi
callq 0x7e14
cmpq $0x5, %rax
jne 0x767d
leaq 0x6cf71(%rip), %rsi     # 0x745c0
leaq 0x10(%rsp), %rdi
pushq $0x5
popq %rdx
callq 0x44c0
testl %eax, %eax
jne 0x767d
movq 0x18(%rbx), %rsi
leaq 0x6cf28(%rip), %rdx     # 0x74593
leaq 0x8(%rsp), %rdi
xorl %ebp, %ebp
xorl %ecx, %ecx
callq 0x7d69
testl %eax, %eax
je 0x76b5
movq 0x8(%rsp), %rbx
jmp 0x7686
xorl %ebx, %ebx
movq 0x93953(%rip), %rax     # 0x9afe0
movq (%rax), %rdi
leaq 0x6cef0(%rip), %rsi     # 0x74587
leaq 0x6cef5(%rip), %rdx     # 0x74593
xorl %eax, %eax
callq 0x4700
pushq $-0x1
popq %rbp
testq %rbx, %rbx
je 0x76b5
movq %rbx, %rdi
callq 0xad16
movl %ebp, %eax
addq $0x80, %rsp
popq %rbx
popq %r14
popq %rbp
retq