// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/test/sam.c
// Function: test_update_array
static int test_update_array(bam1_t *aln, const char target_id[2],
                             uint8_t type, uint32_t nitems, void *data,
                             const char next_id[2], int64_t next_val,
                             char next_type)
{
    uint8_t *p;

    // Try updating target
    if (bam_aux_update_array(aln, target_id, type, nitems, data) < 0) {
        fail("update %2.s tag", target_id);
        return -1;
    }

    // Check values
    p = bam_aux_get(aln, target_id);
    if (!p) {
        fail("find  %.2s tag", target_id);
        return -1;
    }
    switch (type) {
        case 'c':
            CHECK_ARRAY_VALS(int8_t, bam_auxB2i, PRId64, PRId8); break;
        case 'C':
            CHECK_ARRAY_VALS(uint8_t, bam_auxB2i, PRId64, PRIu8); break;
        case 's':
            CHECK_ARRAY_VALS(int16_t, bam_auxB2i, PRId64, PRId16); break;
        case 'S':
            CHECK_ARRAY_VALS(uint16_t, bam_auxB2i, PRId64, PRIu16); break;
        case 'i':
            CHECK_ARRAY_VALS(int32_t, bam_auxB2i, PRId64, PRId32); break;
        case 'I':
            CHECK_ARRAY_VALS(uint32_t, bam_auxB2i, PRId64, PRIu32); break;
        case 'f':
            CHECK_ARRAY_VALS(float, bam_auxB2f, "e", "e"); break;
    }

    // If given, check that the next tag hasn't been clobbered by the
    // update above.
    if (!*next_id) return 0;
    p = bam_aux_get(aln, next_id);
    if (!p) {
        fail("find  %.2s tag after updating %.2s", next_id, target_id);
        return -1;
    }
    if (*p != next_type || bam_aux2i(p) != next_val) {
        fail("after updating %.2s:"
             " %.2s field is %c:%"PRId64"; expected %c:%"PRId64,
             target_id, next_id, *p, bam_aux2i(p), next_type, next_val);
        return -1;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, %r13
movq %r8, %rbx
movq %rcx, %r14
movl %edx, %ebp
movl %esi, %r15d
movq %rdi, %r12
leaq 0x6c7f0(%rip), %rsi     # 0x7776a
movl %r15d, %edx
movl %ebp, %ecx
movq %r14, %r8
callq 0x2a50c
testl %eax, %eax
js 0xb008
movq %r13, 0x10(%rsp)
leaq 0x6c7d3(%rip), %rsi     # 0x7776a
movq %r12, %rdi
callq 0x28b08
testq %rax, %rax
je 0xb011
movq %rax, %r13
cmpb $0x73, %r15b
je 0xb0d6
movzbl %r15b, %eax
cmpl $0x53, %eax
je 0xb0af
cmpl $0x63, %eax
je 0xb02b
cmpl $0x66, %eax
je 0xb080
cmpl $0x69, %eax
je 0xb056
cmpl $0x49, %eax
jne 0xb0fd
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movl (%r14,%rbp,4), %ecx
cmpq %rcx, %rax
jne 0xb1e1
incq %rbp
jmp 0xafe3
leaq 0x6ca66(%rip), %rdi     # 0x77a75
jmp 0xb018
leaq 0x6c9e9(%rip), %rdi     # 0x77a01
leaq 0x6c74b(%rip), %rsi     # 0x7776a
xorl %eax, %eax
callq 0x5b0d
jmp 0xb239
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movsbq (%r14,%rbp), %rcx
cmpq %rcx, %rax
jne 0xb190
incq %rbp
jmp 0xb030
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movslq (%r14,%rbp,4), %rcx
cmpq %rcx, %rax
jne 0xb1a1
incq %rbp
jmp 0xb05b
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a852
cvtss2sd (%r14,%rbp,4), %xmm1
ucomisd %xmm1, %xmm0
jne 0xb1b1
jp 0xb1b1
incq %rbp
jmp 0xb085
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movzwl (%r14,%rbp,2), %ecx
cmpq %rcx, %rax
jne 0xb1f1
incq %rbp
jmp 0xb0b4
movl %ebp, %r15d
xorl %ebp, %ebp
cmpq %rbp, %r15
je 0xb0fd
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movswq (%r14,%rbp,2), %rcx
cmpq %rcx, %rax
jne 0xb209
incq %rbp
jmp 0xb0db
xorl %ebp, %ebp
cmpb $0x0, (%rbx)
je 0xb23c
movq %r12, %rdi
movq %rbx, %rsi
callq 0x28b08
testq %rax, %rax
je 0xb173
movq %rax, %r14
movb 0x50(%rsp), %r15b
movb (%rax), %al
cmpb %r15b, %al
movq 0x10(%rsp), %r12
jne 0xb140
movq %r14, %rdi
callq 0x2a715
cmpq %r12, %rax
je 0xb23c
movb (%r14), %al
movzbl %r15b, %ebp
movzbl %al, %r15d
movq %r14, %rdi
callq 0x2a715
movq %r12, (%rsp)
leaq 0x6ca02(%rip), %rdi     # 0x77b5d
leaq 0x6c608(%rip), %rsi     # 0x7776a
movq %rbx, %rdx
movl %r15d, %ecx
movq %rax, %r8
movl %ebp, %r9d
jmp 0xb232
leaq 0x6c896(%rip), %rdi     # 0x77a10
leaq 0x6c5e9(%rip), %rdx     # 0x7776a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x5b0d
jmp 0xb239
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movsbl (%r14,%rbp), %r9d
jmp 0xb218
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movl (%r14,%rbp,4), %r9d
jmp 0xb218
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a852
cvtss2sd (%r14,%rbp,4), %xmm1
leaq 0x6c94a(%rip), %rdi     # 0x77b12
leaq 0x6c983(%rip), %rsi     # 0x77b52
leaq 0x6c594(%rip), %rdx     # 0x7776a
movl %ebp, %ecx
movb $0x2, %al
callq 0x5b0d
jmp 0xb239
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movl (%r14,%rbp,4), %r9d
jmp 0xb200
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movzwl (%r14,%rbp,2), %r9d
leaq 0x6c8ca(%rip), %rdi     # 0x77ad1
jmp 0xb21f
movq %r13, %rdi
movl %ebp, %esi
callq 0x2a811
movswl (%r14,%rbp,2), %r9d
leaq 0x6c866(%rip), %rdi     # 0x77a85
leaq 0x6c8a0(%rip), %rsi     # 0x77ac6
leaq 0x6c53d(%rip), %rdx     # 0x7776a
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x5b0d
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq