// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/test/sam.c
// Function: use_header_api
static void use_header_api(void) {
    static const char header_text[] = "data:,"
            "@HD\tVN:1.4\tGO:group\tSS:coordinate:queryname\n"
            "@SQ\tSN:ref0\tLN:100\n"
            "@CO\tThis line below will be updated\n"
            "@SQ\tSN:ref1\tLN:5001\tM5:983dalu9ue2\n"
            "@SQ\tSN:ref1.5\tLN:5001\n"
            "@CO\tThis line is good\n"
            "@SQ\tSN:ref2\tLN:5002\n";

    static const char rg_line[] =
            { '@', 'R', 'G', '\t', 'I', 'D', ':', 'r', 'u', 'n', '1' };

    static const char expected[] =
            "@HD\tVN:1.5\tSO:coordinate\n"
            "@CO\tThis line below will be updated\n"
            "@SQ\tSN:ref1\tLN:5001\tM5:kja8u34a2q3\n"
            "@CO\tThis line is good\n"
            "@SQ\tSN:ref2\tLN:5002\n"
            "@SQ\tSN:ref3\tLN:5003\n"
            "@PG\tID:samtools\tPN:samtools\tVN:1.9\n"
            "@RG\tID:run1\n"
            "@RG\tID:run4\n";

    static const char *expected_targets[] = { "ref1", "ref2", "ref3" };
    static const int   expected_lengths[] = { 5001, 5002, 5003 };
    const int expected_n_targets = sizeof(expected_targets) / sizeof(char *);

    const char outfname[] = "test/sam_header.tmp.sam_";
    const char outmode[] = "w";
    FILE *inf = NULL;
    char buffer[sizeof(expected) + 1024];

    samFile *in = sam_open(header_text, "r");
    samFile *out = sam_open(outfname, outmode);
    sam_hdr_t *header = NULL;
    kstring_t ks = { 0, 0, NULL };
    size_t bytes;
    int r;
    const char *name;

    if (!in) {
        fail("couldn't open file");
        goto err;
    }
    if (!out) {
        fail("couldn't open %s with mode %s", outfname, outmode);
        goto err;
    }

    header = sam_hdr_read(in);
    if (!header) {
        fail("reading header from file");
        goto err;
    }
    r = sam_hdr_remove_tag_id(header, "HD", NULL, NULL, "GO");
    if (r != 1) { fail("sam_hdr_remove_tag_id"); goto err; }

    r = sam_hdr_update_hd(header, "VN", "1.5");
    if (r != 0) { fail("sam_hdr_update_hd"); goto err; }

    r = sam_hdr_add_line(header, "SQ", "SN", "ref3", "LN", "5003", NULL);
    if (r < 0) { fail("sam_hdr_add_line"); goto err; }

    r = sam_hdr_update_line(header, "SQ", "SN", "ref1",
                             "M5", "kja8u34a2q3", NULL);
    if (r != 0) { fail("sam_hdr_update_line SQ"); goto err; }

    r = sam_hdr_add_pg(header, "samtools", "VN", "1.9", NULL);
    if (r != 0) { fail("sam_hdr_add_pg"); goto err; }

    // Test addition with no newline or trailing NUL
    r = sam_hdr_add_lines(header, rg_line, sizeof(rg_line));
    if (r != 0) { fail("sam_hdr_add_lines rg_line"); goto err; }

    // Test header line removal
    r = sam_hdr_add_line(header, "RG", "ID", "run2", NULL);
    if (r < 0) { fail("sam_hdr_add_line"); goto err; }

    r = sam_hdr_add_line(header, "RG", "ID", "run3", NULL);
    if (r < 0) { fail("sam_hdr_add_line"); goto err; }

    r = sam_hdr_add_line(header, "RG", "ID", "run4", NULL);
    if (r < 0) { fail("sam_hdr_add_line"); goto err; }

    r = sam_hdr_line_index(header, "RG", "run4");
    if (r != 3) { fail("sam_hdr_line_index - run4~3"); goto err; }

    r = sam_hdr_line_index(header, "RG", "run5");
    if (r != -1) { fail("sam_hdr_line_index - run5~-1"); goto err; }

    name = sam_hdr_line_name(header, "RG", 2);
    if (!name || strcmp(name, "run3")) { fail("sam_hdr_line_name - 2~run3"); goto err; }

    name = sam_hdr_line_name(header, "RG", 10);
    if (name) { fail("sam_hdr_line_name - 10~NULL"); goto err; }

    r = sam_hdr_remove_line_id(header, "RG", "ID", "run2");
    if (r < 0) { fail("sam_hdr_remove_line_id"); goto err; }

    r = sam_hdr_find_tag_id(header, "RG", "ID", "run3", "ID", &ks);
    if (r < 0 || !ks.s || strcmp(ks.s, "run3") != 0) {
        fail("sam_hdr_find_tag_id() expected \"run3\" got \"%s\"",
             r == 0 && ks.s ? ks.s : "NULL");
        goto err;
    }

    r = sam_hdr_remove_line_pos(header, "RG", 1); // Removes run3
    if (r < 0) { fail("sam_hdr_remove_line_pos"); goto err; }

    r = sam_hdr_remove_line_id(header, "SQ", "SN", "ref0");
    if (r < 0) { fail("sam_hdr_remove_line_id"); goto err; }

    r = sam_hdr_remove_line_pos(header, "SQ", 1); // Removes ref1.5
    if (r < 0) { fail("sam_hdr_remove_line_pos"); goto err; }

    r = sam_hdr_find_tag_id(header, "SQ", "SN", "ref1", "M5", &ks);
    if (r < 0 || !ks.s || strcmp(ks.s, "kja8u34a2q3") != 0) {
        fail("sam_hdr_find_tag_id() expected \"kja8u34a2q3\" got \"%s\"",
             r == 0 && ks.s ? ks.s : "NULL");
        goto err;
    }

    r = sam_hdr_line_index(header, "RG", "run4");
    if (r != 1) { fail("sam_hdr_line_index - run4~1"); goto err; }

    name = sam_hdr_line_name(header, "RG", 2);
    if (name) { fail("sam_hdr_line_name - 2~NULL"); goto err; }

    r = sam_hdr_remove_tag_hd(header, "SS");
    if (r < 0) {
        fail("sam_hdr_remove_tag_hd");
    }

    r = sam_hdr_find_hd(header, &ks);
    if (r < 0 || !ks.s || strcmp(ks.s, "@HD\tVN:1.5") != 0) {
        fail("sam_hdr_find_hd() expected \"@HD\tVN:1.5\" got \"%s\"",
             r == 0 && ks.s ? ks.s : "NULL");
    }

    r = sam_hdr_find_tag_hd(header, "VN", &ks);
    if (r < 0 || !ks.s || strcmp(ks.s, "1.5") != 0) {
        fail("sam_hdr_find_tag_hd() expected \"1.5\" got \"%s\"",
             r == 0 && ks.s ? ks.s : "NULL");
    }

    r = sam_hdr_update_hd(header, "SO", "coordinate");
    if (r < 0) {
        fail("sam_hdr_update_hd");
    }

    if (check_target_names(header, expected_n_targets, expected_targets,
                           expected_lengths) < 0) {
        goto err;
    }

    if ((r = sam_hdr_count_lines(header, "HD")) != 1) {
        fail("incorrect HD line count - expected 1, got %d", r);
        goto err;
    }
    if ((r = sam_hdr_count_lines(header, "SQ")) != 3) {
        fail("incorrect SQ line count - expected 3, got %d", r);
        goto err;
    }
    if ((r = sam_hdr_count_lines(header, "PG")) != 1) {
        fail("incorrect PG line count - expected 1, got %d", r);
        goto err;
    }
    if ((r = sam_hdr_count_lines(header, "RG")) != 2) {
        fail("incorrect RG line count - expected 2, got %d", r);
        goto err;
    }
    if ((r = sam_hdr_count_lines(header, "CO")) != 2) {
        fail("incorrect CO line count - expected 2, got %d", r);
        goto err;
    }

    if (sam_hdr_write(out, header) < 0) {
        fail("writing headers to \"%s\"", outfname);
        goto err;
    }
    r = sam_close(out);
    out = NULL;
    if (r < 0) {
        fail("close \"%s\"", outfname);
        goto err;
    }

    inf = fopen(outfname, "r");
    if (!inf) {
        fail("Opening written header \"%s\"", outfname);
        goto err;
    }
    bytes = fread(buffer, 1, sizeof(buffer), inf);
    if (bytes != sizeof(expected) - 1 || memcmp(buffer, expected, bytes) != 0) {
        fail("edited header does not match expected version");
        fprintf(stderr,
                "---------- Expected:\n%.*s\n"
                "++++++++++ Got:\n%.*s\n"
                "====================\n",
                (int) sizeof(expected), expected,
                (int) bytes, buffer);
        goto err;
    }

    free(ks_release(&ks));

 err:
    sam_hdr_destroy(header);
    header = NULL;
    if (in) sam_close(in);
    if (out) sam_close(out);
    if (inf) fclose(inf);
    free(ks_release(&ks));
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x580, %rsp            # imm = 0x580
movl $0x3, -0x4(%rbp)
movq 0xebc37(%rip), %rax     # 0xf3330
movq %rax, -0x20(%rbp)
movq 0xebc34(%rip), %rax     # 0xf3338
movq %rax, -0x18(%rbp)
movq 0xebc31(%rip), %rax     # 0xf3340
movq %rax, -0x10(%rbp)
movb 0xebc2f(%rip), %al      # 0xf3348
movb %al, -0x8(%rbp)
movw 0xef5cb(%rip), %ax      # 0xf6cee
movw %ax, -0x22(%rbp)
movq $0x0, -0x30(%rbp)
leaq 0xe85da(%rip), %rdi     # 0xefd10
leaq 0xf033b(%rip), %rsi     # 0xf7a78
callq 0x232d0
movq %rax, -0x518(%rbp)
leaq -0x20(%rbp), %rdi
leaq -0x22(%rbp), %rsi
callq 0x232d0
movq %rax, -0x520(%rbp)
movq $0x0, -0x528(%rbp)
leaq -0x540(%rbp), %rdi
xorl %esi, %esi
movl $0x18, %edx
callq 0x4240
cmpq $0x0, -0x518(%rbp)
jne 0x7798
leaq 0xe9f20(%rip), %rdi     # 0xf16ac
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
cmpq $0x0, -0x520(%rbp)
jne 0x77bd
leaq -0x20(%rbp), %rsi
leaq -0x22(%rbp), %rdx
leaq 0xe9e0d(%rip), %rdi     # 0xf15be
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x518(%rbp), %rdi
callq 0x3c9b0
movq %rax, -0x528(%rbp)
cmpq $0x0, -0x528(%rbp)
jne 0x77ed
leaq 0xe9ede(%rip), %rdi     # 0xf16bf
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xf015c(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq 0xe9ed2(%rip), %r8      # 0xf16d8
movq %rcx, %rdx
callq 0x18af0
movl %eax, -0x54c(%rbp)
cmpl $0x1, -0x54c(%rbp)
je 0x7830
leaq 0xe9eb7(%rip), %rdi     # 0xf16db
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xf0119(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq 0xef930(%rip), %r8      # 0xf7179
leaq 0xea0a0(%rip), %r9      # 0xf18f0
movq %rcx, %rdx
movq $0x0, (%rsp)
movb $0x0, %al
callq 0x159f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
je 0x7884
leaq 0xe9e79(%rip), %rdi     # 0xf16f1
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9eb0(%rip), %rsi     # 0xf1742
leaq 0xe9e6a(%rip), %rdx     # 0xf1703
leaq 0xe9e07(%rip), %rcx     # 0xf16a7
leaq 0xe9e5f(%rip), %r8      # 0xf1706
leaq 0xe9e5b(%rip), %r9      # 0xf1709
xorl %eax, %eax
movq $0x0, (%rsp)
movb $0x0, %al
callq 0x143a0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x78e1
leaq 0xe9e39(%rip), %rdi     # 0xf170e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9e53(%rip), %rsi     # 0xf1742
leaq 0xe9e0d(%rip), %rdx     # 0xf1703
leaq 0xe9da0(%rip), %rcx     # 0xf169d
leaq 0xe9e1b(%rip), %r8      # 0xf171f
leaq 0xe9e17(%rip), %r9      # 0xf1722
xorl %eax, %eax
movq $0x0, (%rsp)
movb $0x0, %al
callq 0x159f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
je 0x793e
leaq 0xe9dfc(%rip), %rdi     # 0xf172e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9df9(%rip), %rsi     # 0xf1745
leaq 0xef826(%rip), %rdx     # 0xf7179
leaq 0xe9df4(%rip), %rcx     # 0xf174e
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x19250
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
je 0x7988
leaq 0xe9dd6(%rip), %rdi     # 0xf1752
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe8447(%rip), %rsi     # 0xefddd
movl $0xb, %edx
callq 0x14230
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
je 0x79c2
leaq 0xe9dab(%rip), %rdi     # 0xf1761
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9dab(%rip), %rsi     # 0xf177b
leaq 0xe9da7(%rip), %rdx     # 0xf177e
leaq 0xe9da3(%rip), %rcx     # 0xf1781
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x143a0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7a0c
leaq 0xe9d0e(%rip), %rdi     # 0xf170e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9d61(%rip), %rsi     # 0xf177b
leaq 0xe9d5d(%rip), %rdx     # 0xf177e
leaq 0xe9db7(%rip), %rcx     # 0xf17df
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x143a0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7a56
leaq 0xe9cc4(%rip), %rdi     # 0xf170e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9d17(%rip), %rsi     # 0xf177b
leaq 0xe9d13(%rip), %rdx     # 0xf177e
leaq 0xe9d14(%rip), %rcx     # 0xf1786
xorl %eax, %eax
movl %eax, %r8d
movb $0x0, %al
callq 0x143a0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7aa0
leaq 0xe9c7a(%rip), %rdi     # 0xf170e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9ccd(%rip), %rsi     # 0xf177b
leaq 0xe9cd1(%rip), %rdx     # 0xf1786
callq 0x18400
movl %eax, -0x54c(%rbp)
cmpl $0x3, -0x54c(%rbp)
je 0x7adc
leaq 0xe9cbb(%rip), %rdi     # 0xf178b
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9c91(%rip), %rsi     # 0xf177b
leaq 0xe9cb6(%rip), %rdx     # 0xf17a7
callq 0x18400
movl %eax, -0x54c(%rbp)
cmpl $-0x1, -0x54c(%rbp)
je 0x7b18
leaq 0xe9ca0(%rip), %rdi     # 0xf17ac
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9c55(%rip), %rsi     # 0xf177b
movl $0x2, %edx
callq 0x18610
movq %rax, -0x558(%rbp)
cmpq $0x0, -0x558(%rbp)
je 0x7b59
movq -0x558(%rbp), %rdi
leaq 0xe9c90(%rip), %rsi     # 0xf17df
callq 0x4690
cmpl $0x0, %eax
je 0x7b6c
leaq 0xe9c69(%rip), %rdi     # 0xf17c9
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9c01(%rip), %rsi     # 0xf177b
movl $0xa, %edx
callq 0x18610
movq %rax, -0x558(%rbp)
cmpq $0x0, -0x558(%rbp)
je 0x7ba8
leaq 0xe9c48(%rip), %rdi     # 0xf17e4
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9bc5(%rip), %rsi     # 0xf177b
leaq 0xe9bc1(%rip), %rdx     # 0xf177e
leaq 0xe9bbd(%rip), %rcx     # 0xf1781
callq 0x15580
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7beb
leaq 0xe9c21(%rip), %rdi     # 0xf1800
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9b82(%rip), %rsi     # 0xf177b
leaq 0xe9b7e(%rip), %r8      # 0xf177e
leaq 0xe9bd8(%rip), %rcx     # 0xf17df
leaq -0x540(%rbp), %r9
movq %r8, %rdx
callq 0x187f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jl 0x7c47
cmpq $0x0, -0x530(%rbp)
je 0x7c47
movq -0x530(%rbp), %rdi
leaq 0xe9ba2(%rip), %rsi     # 0xf17df
callq 0x4690
cmpl $0x0, %eax
je 0x7c94
cmpl $0x0, -0x54c(%rbp)
jne 0x7c6a
cmpq $0x0, -0x530(%rbp)
je 0x7c6a
movq -0x530(%rbp), %rax
movq %rax, -0x560(%rbp)
jmp 0x7c7a
leaq 0xedfd1(%rip), %rax     # 0xf5c42
movq %rax, -0x560(%rbp)
jmp 0x7c7a
movq -0x560(%rbp), %rsi
leaq 0xe9b8f(%rip), %rdi     # 0xf1817
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9ad9(%rip), %rsi     # 0xf177b
movl $0x1, %edx
callq 0x158b0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7cce
leaq 0xe9b84(%rip), %rdi     # 0xf1846
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9a66(%rip), %rsi     # 0xf1742
leaq 0xe9a20(%rip), %rdx     # 0xf1703
leaq 0xe9b74(%rip), %rcx     # 0xf185e
callq 0x15580
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7d11
leaq 0xe9afb(%rip), %rdi     # 0xf1800
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9a23(%rip), %rsi     # 0xf1742
movl $0x1, %edx
callq 0x158b0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7d4b
leaq 0xe9b07(%rip), %rdi     # 0xf1846
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe99e9(%rip), %rsi     # 0xf1742
leaq 0xe99a3(%rip), %rdx     # 0xf1703
leaq 0xe9936(%rip), %rcx     # 0xf169d
leaq 0xe99b1(%rip), %r8      # 0xf171f
leaq -0x540(%rbp), %r9
callq 0x187f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jl 0x7dab
cmpq $0x0, -0x530(%rbp)
je 0x7dab
movq -0x530(%rbp), %rdi
leaq 0xe9981(%rip), %rsi     # 0xf1722
callq 0x4690
cmpl $0x0, %eax
je 0x7df8
cmpl $0x0, -0x54c(%rbp)
jne 0x7dce
cmpq $0x0, -0x530(%rbp)
je 0x7dce
movq -0x530(%rbp), %rax
movq %rax, -0x568(%rbp)
jmp 0x7dde
leaq 0xede6d(%rip), %rax     # 0xf5c42
movq %rax, -0x568(%rbp)
jmp 0x7dde
movq -0x568(%rbp), %rsi
leaq 0xe9a77(%rip), %rdi     # 0xf1863
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9975(%rip), %rsi     # 0xf177b
leaq 0xe9979(%rip), %rdx     # 0xf1786
callq 0x18400
movl %eax, -0x54c(%rbp)
cmpl $0x1, -0x54c(%rbp)
je 0x7e34
leaq 0xe9a71(%rip), %rdi     # 0xf1899
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9939(%rip), %rsi     # 0xf177b
movl $0x2, %edx
callq 0x18610
movq %rax, -0x558(%rbp)
cmpq $0x0, -0x558(%rbp)
je 0x7e70
leaq 0xe9a51(%rip), %rdi     # 0xf18b5
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xefad9(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq 0xe9a47(%rip), %r8      # 0xf18d0
movq %rcx, %rdx
callq 0x18af0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x7eae
leaq 0xe9a2c(%rip), %rdi     # 0xf18d3
movb $0x0, %al
callq 0x5b50
movq -0x528(%rbp), %rdi
leaq 0xefa9b(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq -0x540(%rbp), %r8
movq %rcx, %rdx
callq 0x14d90
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jl 0x7f00
cmpq $0x0, -0x530(%rbp)
je 0x7f00
movq -0x530(%rbp), %rdi
leaq 0xe99f3(%rip), %rsi     # 0xf18e9
callq 0x4690
cmpl $0x0, %eax
je 0x7f48
cmpl $0x0, -0x54c(%rbp)
jne 0x7f23
cmpq $0x0, -0x530(%rbp)
je 0x7f23
movq -0x530(%rbp), %rax
movq %rax, -0x570(%rbp)
jmp 0x7f33
leaq 0xedd18(%rip), %rax     # 0xf5c42
movq %rax, -0x570(%rbp)
jmp 0x7f33
movq -0x570(%rbp), %rsi
leaq 0xe99b3(%rip), %rdi     # 0xf18f4
movb $0x0, %al
callq 0x5b50
movq -0x528(%rbp), %rdi
leaq 0xefa01(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq 0xef218(%rip), %r8      # 0xf7179
leaq -0x540(%rbp), %r9
movq %rcx, %rdx
callq 0x187f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jl 0x7fa1
cmpq $0x0, -0x530(%rbp)
je 0x7fa1
movq -0x530(%rbp), %rdi
leaq 0xe9959(%rip), %rsi     # 0xf18f0
callq 0x4690
cmpl $0x0, %eax
je 0x7fe9
cmpl $0x0, -0x54c(%rbp)
jne 0x7fc4
cmpq $0x0, -0x530(%rbp)
je 0x7fc4
movq -0x530(%rbp), %rax
movq %rax, -0x578(%rbp)
jmp 0x7fd4
leaq 0xedc77(%rip), %rax     # 0xf5c42
movq %rax, -0x578(%rbp)
jmp 0x7fd4
movq -0x578(%rbp), %rsi
leaq 0xe9943(%rip), %rdi     # 0xf1925
movb $0x0, %al
callq 0x5b50
movq -0x528(%rbp), %rdi
leaq 0xef960(%rip), %rsi     # 0xf7957
xorl %eax, %eax
movl %eax, %ecx
leaq 0xe9951(%rip), %r8      # 0xf1953
leaq 0xe994d(%rip), %r9      # 0xf1956
movq %rcx, %rdx
movq $0x0, (%rsp)
movb $0x0, %al
callq 0x159f0
movl %eax, -0x54c(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x8038
leaq 0xe96c0(%rip), %rdi     # 0xf16f1
movb $0x0, %al
callq 0x5b50
movq -0x528(%rbp), %rdi
movl $0x3, %esi
leaq 0x1094a5(%rip), %rdx    # 0x1114f0
leaq 0xe7e7a(%rip), %rcx     # 0xefecc
callq 0xd9f0
cmpl $0x0, %eax
jge 0x8061
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xef8e8(%rip), %rsi     # 0xf7957
callq 0x18290
movl %eax, -0x54c(%rbp)
cmpl $0x1, %eax
je 0x8098
movl -0x54c(%rbp), %esi
leaq 0xe98d5(%rip), %rdi     # 0xf1961
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe969c(%rip), %rsi     # 0xf1742
callq 0x18290
movl %eax, -0x54c(%rbp)
cmpl $0x3, %eax
je 0x80cf
movl -0x54c(%rbp), %esi
leaq 0xe98cb(%rip), %rdi     # 0xf198e
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe98de(%rip), %rsi     # 0xf19bb
callq 0x18290
movl %eax, -0x54c(%rbp)
cmpl $0x1, %eax
je 0x8106
movl -0x54c(%rbp), %esi
leaq 0xe98c4(%rip), %rdi     # 0xf19be
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xe9667(%rip), %rsi     # 0xf177b
callq 0x18290
movl %eax, -0x54c(%rbp)
cmpl $0x2, %eax
je 0x813d
movl -0x54c(%rbp), %esi
leaq 0xe98ba(%rip), %rdi     # 0xf19eb
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x528(%rbp), %rdi
leaq 0xef65a(%rip), %rsi     # 0xf77a5
callq 0x18290
movl %eax, -0x54c(%rbp)
cmpl $0x2, %eax
je 0x8174
movl -0x54c(%rbp), %esi
leaq 0xe98b0(%rip), %rdi     # 0xf1a18
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x520(%rbp), %rdi
movq -0x528(%rbp), %rsi
callq 0x3d9c0
cmpl $0x0, %eax
jge 0x81a3
leaq -0x20(%rbp), %rsi
leaq 0xe98ae(%rip), %rdi     # 0xf1a45
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
movq -0x520(%rbp), %rdi
callq 0x253f0
movl %eax, -0x54c(%rbp)
movq $0x0, -0x520(%rbp)
cmpl $0x0, -0x54c(%rbp)
jge 0x81e0
leaq -0x20(%rbp), %rsi
leaq 0xe9889(%rip), %rdi     # 0xf1a5d
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
leaq -0x20(%rbp), %rdi
leaq 0xef88d(%rip), %rsi     # 0xf7a78
callq 0x4590
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x8212
leaq -0x20(%rbp), %rsi
leaq 0xe9862(%rip), %rdi     # 0xf1a68
movb $0x0, %al
callq 0x5b50
jmp 0x82b8
leaq -0x510(%rbp), %rdi
movq -0x30(%rbp), %rcx
movl $0x1, %esi
movl $0x4da, %edx            # imm = 0x4DA
callq 0x4770
movq %rax, -0x548(%rbp)
cmpq $0xd9, -0x548(%rbp)
jne 0x825f
leaq -0x510(%rbp), %rdi
movq -0x548(%rbp), %rdx
leaq 0xe7b9b(%rip), %rsi     # 0xefdf0
callq 0x41b0
cmpl $0x0, %eax
je 0x82a4
leaq 0xe981e(%rip), %rdi     # 0xf1a84
movb $0x0, %al
callq 0x5b50
movq 0x108d6c(%rip), %rax    # 0x110fe0
movq (%rax), %rdi
movq -0x548(%rbp), %rax
movl %eax, %r8d
leaq -0x510(%rbp), %r9
leaq 0xe9823(%rip), %rsi     # 0xf1ab2
movl $0xda, %edx
leaq 0xe7b55(%rip), %rcx     # 0xefdf0
movb $0x0, %al
callq 0x46d0
jmp 0x82b8
leaq -0x540(%rbp), %rdi
callq 0xdbb0
movq %rax, %rdi
callq 0x45a0
movq -0x528(%rbp), %rdi
callq 0x36f50
movq $0x0, -0x528(%rbp)
cmpq $0x0, -0x518(%rbp)
je 0x82e5
movq -0x518(%rbp), %rdi
callq 0x253f0
cmpq $0x0, -0x520(%rbp)
je 0x82fb
movq -0x520(%rbp), %rdi
callq 0x253f0
cmpq $0x0, -0x30(%rbp)
je 0x830b
movq -0x30(%rbp), %rdi
callq 0x4490
leaq -0x540(%rbp), %rdi
callq 0xdbb0
movq %rax, %rdi
callq 0x45a0
addq $0x580, %rsp            # imm = 0x580
popq %rbp
retq
nopl (%rax,%rax)