// File: /workspace/github_c_makefile_star2_O1/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 0x8c084(%rip), %rsi     # 0x9776a
movl %r15d, %edx
movl %ebp, %ecx
movq %r14, %r8
callq 0x347a0
testl %eax, %eax
js 0xb8e9
movq %r13, 0x10(%rsp)
leaq 0x8c063(%rip), %rsi     # 0x9776a
movq %r12, %rdi
callq 0x31e40
testq %rax, %rax
je 0xb8f2
movq %rax, %r13
movzbl %r15b, %eax
cmpl $0x65, %eax
jg 0xb771
cmpl $0x49, %eax
je 0xb7ba
cmpl $0x53, %eax
je 0xb825
cmpl $0x63, %eax
jne 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movsbq (%r14,%rbp), %rcx
cmpq %rcx, %rax
jne 0xb96c
incq %rbp
cmpq %rbp, %r15
jne 0xb74c
jmp 0xb878
cmpl $0x66, %eax
je 0xb7eb
cmpl $0x69, %eax
je 0xb850
cmpl $0x73, %eax
jne 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movswq (%r14,%rbp,2), %rcx
cmpq %rcx, %rax
jne 0xb97d
incq %rbp
cmpq %rbp, %r15
jne 0xb795
jmp 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movl (%r14,%rbp,4), %ecx
cmpq %rcx, %rax
jne 0xb929
incq %rbp
cmpq %rbp, %r15
jne 0xb7c7
jmp 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34c8f
xorps %xmm1, %xmm1
cvtss2sd (%r14,%rbp,4), %xmm1
ucomisd %xmm1, %xmm0
jne 0xb939
jp 0xb939
incq %rbp
cmpq %rbp, %r15
jne 0xb7f8
jmp 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movzwl (%r14,%rbp,2), %ecx
cmpq %rcx, %rax
jne 0xb98e
incq %rbp
cmpq %rbp, %r15
jne 0xb82e
jmp 0xb878
testl %ebp, %ebp
je 0xb878
movl %ebp, %r15d
xorl %ebp, %ebp
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movslq (%r14,%rbp,4), %rcx
cmpq %rcx, %rax
jne 0xb9a6
incq %rbp
cmpq %rbp, %r15
jne 0xb859
xorl %ebp, %ebp
cmpb $0x0, (%rbx)
je 0xb9da
movq %r12, %rdi
movq %rbx, %rsi
callq 0x31e40
testq %rax, %rax
je 0xb90c
movq %rax, %r14
movb 0x50(%rsp), %r15b
cmpb %r15b, (%rax)
movq 0x10(%rsp), %r12
jne 0xb8b6
movq %r14, %rdi
callq 0x34aab
cmpq %r12, %rax
je 0xb9da
movzbl %r15b, %ebp
movzbl (%r14), %r15d
movq %r14, %rdi
callq 0x34aab
movq %r12, (%rsp)
leaq 0x8c28c(%rip), %rdi     # 0x97b5d
leaq 0x8be92(%rip), %rsi     # 0x9776a
movq %rbx, %rdx
movl %r15d, %ecx
movq %rax, %r8
movl %ebp, %r9d
jmp 0xb9ce
leaq 0x8c185(%rip), %rdi     # 0x97a75
jmp 0xb8f9
leaq 0x8c108(%rip), %rdi     # 0x97a01
leaq 0x8be6a(%rip), %rsi     # 0x9776a
xorl %eax, %eax
callq 0x49e0
jmp 0xb9d5
leaq 0x8c0fd(%rip), %rdi     # 0x97a10
leaq 0x8be50(%rip), %rdx     # 0x9776a
movq %rbx, %rsi
xorl %eax, %eax
callq 0x49e0
jmp 0xb9d5
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movl (%r14,%rbp,4), %r9d
jmp 0xb99d
movq %r13, %rdi
movl %ebp, %esi
callq 0x34c8f
xorps %xmm1, %xmm1
cvtss2sd (%r14,%rbp,4), %xmm1
leaq 0x8c1bf(%rip), %rdi     # 0x97b12
leaq 0x8c1f8(%rip), %rsi     # 0x97b52
leaq 0x8be09(%rip), %rdx     # 0x9776a
movl %ebp, %ecx
movb $0x2, %al
callq 0x49e0
jmp 0xb9d5
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movsbl (%r14,%rbp), %r9d
jmp 0xb9b4
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movswl (%r14,%rbp,2), %r9d
jmp 0xb9b4
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movzwl (%r14,%rbp,2), %r9d
leaq 0x8c12d(%rip), %rdi     # 0x97ad1
jmp 0xb9bb
movq %r13, %rdi
movl %ebp, %esi
callq 0x34bdf
movl (%r14,%rbp,4), %r9d
leaq 0x8c0ca(%rip), %rdi     # 0x97a85
leaq 0x8c104(%rip), %rsi     # 0x97ac6
leaq 0x8bda1(%rip), %rdx     # 0x9776a
movl %ebp, %ecx
movq %rax, %r8
xorl %eax, %eax
callq 0x49e0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq