// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/sam.c
// Function: set_qname
static void set_qname(void)
{
    static const char sam[] = "data:,"
"@SQ\tSN:one\tLN:1000\n"
"@SQ\tSN:two\tLN:500\n"
"r1\t0\tone\t500\t20\t8M\t*\t0\t0\tATGCATGC\tqqqqqqqq\tXA:A:k\tXi:i:37\tXf:f:" xstr(PI) "\tXd:d:" xstr(E) "\tXZ:Z:" HELLO "\tXH:H:" BEEF "\tXB:B:c,-2,0,+2\tB0:B:i,-2147483648,-1,0,1,2147483647\tB1:B:I,0,1,2147483648,4294967295\tB2:B:s,-32768,-1,0,1,32767\tB3:B:S,0,1,32768,65535\tB4:B:c,-128,-1,0,1,127\tB5:B:C,0,1,127,255\tBf:B:f,-3.14159,2.71828\tZZ:i:1000000\tF2:d:2.46801\tY1:i:-2147483648\tY2:i:-2147483647\tY3:i:-1\tY4:i:0\tY5:i:1\tY6:i:2147483647\tY7:i:2147483648\tY8:i:4294967295\n"
"r22\t0x8D\t*\t0\t0\t*\t*\t0\t0\tATGC\tqqqq\n"
"r12345678\t0x8D\t*\t0\t0\t*\t*\t0\t0\tATGC\tqqqq\n"
;

    // Canonical form of the alignment records above, as output by sam_format1()
    static const char r1[] = "r1\t0\tone\t500\t20\t8M\t*\t0\t0\tATGCATGC\tqqqqqqqq\tXA:A:k\tXi:i:37\tXf:f:3.14159\tXd:d:2.71828\tXZ:Z:" HELLO "\tXH:H:" BEEF "\tXB:B:c,-2,0,2\tB0:B:i,-2147483648,-1,0,1,2147483647\tB1:B:I,0,1,2147483648,4294967295\tB2:B:s,-32768,-1,0,1,32767\tB3:B:S,0,1,32768,65535\tB4:B:c,-128,-1,0,1,127\tB5:B:C,0,1,127,255\tBf:B:f,-3.14159,2.71828\tZZ:i:1000000\tF2:d:2.46801\tY1:i:-2147483648\tY2:i:-2147483647\tY3:i:-1\tY4:i:0\tY5:i:1\tY6:i:2147483647\tY7:i:2147483648\tY8:i:4294967295";
    static const char r2[] = "r234\t141\t*\t0\t0\t*\t*\t0\t0\tATGC\tqqqq";
    static const char r3[] = "xyz\t141\t*\t0\t0\t*\t*\t0\t0\tATGC\tqqqq";

    samFile *in = sam_open(sam, "r");
    bam_hdr_t *header = sam_hdr_read(in);
    bam1_t *aln = bam_init1();
    kstring_t ks = { 0, 0, NULL };

    if (sam_read1(in, header, aln) >= 0) {
        bam_set_qname(aln, "r1");
        if (sam_format1(header, aln, &ks) < 0) fail("can't format record");
        if (strcmp(ks.s, r1) != 0) fail("record formatted incorrectly:\nGot: \"%s\"\nExp: \"%s\"\n", ks.s, r1);
    }
    else fail("can't read record");

    if (sam_read1(in, header, aln) >= 0) {
        bam_set_qname(aln, "r234");
        if (sam_format1(header, aln, &ks) < 0) fail("can't format record");
        if (strcmp(ks.s, r2) != 0) fail("record formatted incorrectly:\nGot: \"%s\"\nExp: \"%s\"\n", ks.s, r2);
    }
    else fail("can't read record");

    if (sam_read1(in, header, aln) >= 0) {
        bam_set_qname(aln, "xyz");
        if (sam_format1(header, aln, &ks) < 0) fail("can't format record");
        if (strcmp(ks.s, r3) != 0) fail("record formatted incorrectly:\nGot: \"%s\"\nExp: \"%s\"\n", ks.s, r3);
    }
    else fail("can't read record");

    bam_destroy1(aln);
    bam_hdr_destroy(header);
    sam_close(in);
    free(ks.s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
leaq 0xe5cd1(%rip), %rdi     # 0xf0540
leaq 0xed202(%rip), %rsi     # 0xf7a78
callq 0x232d0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x3c9b0
movq %rax, -0x10(%rbp)
callq 0x37e90
movq %rax, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4240
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x41af0
cmpl $0x0, %eax
jl 0xa91f
movq -0x18(%rbp), %rdi
leaq 0xe7622(%rip), %rsi     # 0xf1ee8
callq 0x39c90
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x42a40
cmpl $0x0, %eax
jge 0xa8ef
leaq 0xe6860(%rip), %rdi     # 0xf1148
movb $0x0, %al
callq 0x5b50
movq -0x20(%rbp), %rdi
leaq 0xe5e96(%rip), %rsi     # 0xf0790
callq 0x4690
cmpl $0x0, %eax
je 0xa91d
movq -0x20(%rbp), %rsi
leaq 0xe810d(%rip), %rdi     # 0xf2a1c
leaq 0xe5e7a(%rip), %rdx     # 0xf0790
movb $0x0, %al
callq 0x5b50
jmp 0xa92d
leaq 0xe68aa(%rip), %rdi     # 0xf11d0
movb $0x0, %al
callq 0x5b50
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x41af0
cmpl $0x0, %eax
jl 0xa9a7
movq -0x18(%rbp), %rdi
leaq 0xe8101(%rip), %rsi     # 0xf2a4f
callq 0x39c90
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x42a40
cmpl $0x0, %eax
jge 0xa977
leaq 0xe67d8(%rip), %rdi     # 0xf1148
movb $0x0, %al
callq 0x5b50
movq -0x20(%rbp), %rdi
leaq 0xe5fce(%rip), %rsi     # 0xf0950
callq 0x4690
cmpl $0x0, %eax
je 0xa9a5
movq -0x20(%rbp), %rsi
leaq 0xe8085(%rip), %rdi     # 0xf2a1c
leaq 0xe5fb2(%rip), %rdx     # 0xf0950
movb $0x0, %al
callq 0x5b50
jmp 0xa9b5
leaq 0xe6822(%rip), %rdi     # 0xf11d0
movb $0x0, %al
callq 0x5b50
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x41af0
cmpl $0x0, %eax
jl 0xaa2f
movq -0x18(%rbp), %rdi
leaq 0xe807e(%rip), %rsi     # 0xf2a54
callq 0x39c90
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x42a40
cmpl $0x0, %eax
jge 0xa9ff
leaq 0xe6750(%rip), %rdi     # 0xf1148
movb $0x0, %al
callq 0x5b50
movq -0x20(%rbp), %rdi
leaq 0xe5f76(%rip), %rsi     # 0xf0980
callq 0x4690
cmpl $0x0, %eax
je 0xaa2d
movq -0x20(%rbp), %rsi
leaq 0xe7ffd(%rip), %rdi     # 0xf2a1c
leaq 0xe5f5a(%rip), %rdx     # 0xf0980
movb $0x0, %al
callq 0x5b50
jmp 0xaa3d
leaq 0xe679a(%rip), %rdi     # 0xf11d0
movb $0x0, %al
callq 0x5b50
movq -0x18(%rbp), %rdi
callq 0x380d0
movq -0x10(%rbp), %rdi
callq 0xd7a0
movq -0x8(%rbp), %rdi
callq 0x253f0
movq -0x20(%rbp), %rdi
callq 0x45a0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)