// File: /workspace/github_c_makefile_star2_O1/JulStrat[P]bams/bams_ptr_app.c
// Function: main
int
main(int argc, char *argv[])
{
    BAMS *bas;
    char **keys;
    size_t bas_sz = 0;
    int i;

    /*
     * for (i = 1; i < argc; i++) { printf("%s\n", argv[i]); } 
     */
    bas = bams_create(0, cmp_str);
    for (i = 1; i < argc; i++) {
        bams_insert(bas, argv[i]);
    }
    keys = bams_array(bas, &bas_sz);
    for (i = 0; i < bas_sz; i++)
        printf("%s\n", keys[i]);

    printf("Min key: %s\n", bams_min(bas));
    printf("Max key: %s\n", bams_max(bas));

    free(keys);

    printf("Set size: %lu\n", bams_size(bas));
    printf("Check structure result: %d\n", bams_check_structure(bas));

    bams_clear(bas);

    for (i = 1; i < argc; i++) {
        bams_insert(bas, argv[i]);
    }
    keys = bams_array(bas, &bas_sz);
    for (i = 0; i < bas_sz; i++)
        printf("%s\n", keys[i]);

    printf("Min key: %s\n", bams_min(bas));
    printf("Max key: %s\n", bams_max(bas));

    free(keys);

    printf("Set size: %lu\n", bams_size(bas));
    printf("Check structure result: %d\n", bams_check_structure(bas));

    bams_free(bas);
    /*
     * qsort(&argv[1], argc-1, sizeof (char *), cmp_str); for (i = 1; i <
     * argc; i++) { printf("%s\n", argv[i]); } 
     */
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r14
movl %edi, %ebp
movq $0x0, 0x8(%rsp)
leaq -0x2c(%rip), %rsi       # 0x11ac
xorl %edi, %edi
callq 0x17bf
movq %rax, %rbx
cmpl $0x2, %ebp
jl 0x1204
movl %ebp, %r15d
movl $0x1, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x182a
incq %r12
cmpq %r12, %r15
jne 0x11f0
leaq 0x8(%rsp), %r12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2276
movq %rax, %r15
cmpq $0x0, (%r12)
je 0x1234
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x1040
incq %r12
cmpq %r12, 0x8(%rsp)
ja 0x1221
movq %rbx, %rdi
callq 0x1977
leaq 0x1dc1(%rip), %rdi      # 0x3004
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x1a2e
leaq 0x1db5(%rip), %rdi      # 0x3011
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %r15, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x2307
leaq 0x1da1(%rip), %rdi      # 0x301e
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x23f0
leaq 0x1d97(%rip), %rdi      # 0x302d
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x2331
cmpl $0x2, %ebp
jl 0x12c9
movl %ebp, %r15d
movl $0x1, %r12d
movq (%r14,%r12,8), %rsi
movq %rbx, %rdi
callq 0x182a
incq %r12
cmpq %r12, %r15
jne 0x12b5
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2276
movq %rax, %r14
cmpq $0x0, (%r15)
je 0x12f8
xorl %r15d, %r15d
movq (%r14,%r15,8), %rdi
callq 0x1040
incq %r15
cmpq %r15, 0x8(%rsp)
ja 0x12e5
movq %rbx, %rdi
callq 0x1977
leaq 0x1cfd(%rip), %rdi      # 0x3004
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x1a2e
leaq 0x1cf1(%rip), %rdi      # 0x3011
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %r14, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x2307
leaq 0x1cdd(%rip), %rdi      # 0x301e
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x23f0
leaq 0x1cd3(%rip), %rdi      # 0x302d
movl %eax, %esi
xorl %eax, %eax
callq 0x1050
movq %rbx, %rdi
callq 0x2392
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop