// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/sam.c
// Function: test_update_int
static int test_update_int(bam1_t *aln,
                           const char target_id[2], int64_t target_val,
                           char expected_type,
                           const char next_id[2], int64_t next_val,
                           char next_type) {
    uint8_t *p;

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

    // Check it's there and has the right type and value
    p = bam_aux_get(aln, target_id);
    if (!p) {
        fail("find  %.2s tag", target_id);
        return -1;
    }
    if (*p != expected_type || bam_aux2i(p) != target_val) {
        fail("%.2s field is %c:%"PRId64"; expected %c:%"PRId64,
             target_id, *p, bam_aux2i(p), expected_type, target_val);
        return -1;
    }

    // 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 to %"PRId64":"
             " %.2s field is %c:%"PRId64"; expected %c:%"PRId64,
             target_id, target_val,
             next_id, *p, bam_aux2i(p), next_type, next_val);
        return -1;
    }
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movb %cl, %al
movb 0x10(%rbp), %cl
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movb %al, -0x21(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
callq 0x46260
cmpl $0x0, %eax
jge 0xcf3b
movq -0x18(%rbp), %rsi
leaq 0xe4419(%rip), %rdi     # 0xf1341
movb $0x0, %al
callq 0x5b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd0b2
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x43840
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xcf71
movq -0x18(%rbp), %rsi
leaq 0xe43f3(%rip), %rdi     # 0xf1351
movb $0x0, %al
callq 0x5b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd0b2
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movsbl -0x21(%rbp), %ecx
cmpl %ecx, %eax
jne 0xcf8f
movq -0x40(%rbp), %rdi
callq 0x46a90
cmpq -0x20(%rbp), %rax
je 0xcfd7
movq -0x18(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rdi
callq 0x46a90
movq -0x50(%rbp), %rsi
movl -0x44(%rbp), %edx
movq %rax, %rcx
movsbl -0x21(%rbp), %r8d
movq -0x20(%rbp), %r9
leaq 0xe43db(%rip), %rdi     # 0xf139f
movb $0x0, %al
callq 0x5b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd0b2
movq -0x30(%rbp), %rax
cmpb $0x0, (%rax)
jne 0xcfec
movl $0x0, -0x4(%rbp)
jmp 0xd0b2
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x43840
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0xd026
movq -0x30(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq 0xe434d(%rip), %rdi     # 0xf1360
movb $0x0, %al
callq 0x5b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd0b2
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movsbl 0x10(%rbp), %ecx
cmpl %ecx, %eax
jne 0xd044
movq -0x40(%rbp), %rdi
callq 0x46a90
cmpq -0x38(%rbp), %rax
je 0xd0ab
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x30(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x40(%rbp), %rax
movzbl (%rax), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rdi
callq 0x46a90
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq -0x60(%rbp), %rcx
movl -0x54(%rbp), %r8d
movq %rax, %r9
movsbl 0x10(%rbp), %r10d
movq -0x38(%rbp), %rax
leaq 0xe42f1(%rip), %rdi     # 0xf1383
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
movb $0x0, %al
callq 0x5b50
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd0b2
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nop