// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]yahs/juicer.c
// Function: main_post
static int main_post(int argc, char *argv[])
{
    FILE *fo;
    char *fa, *fa1, *out, *out1;

    liftrlimit();
    jc_realtime0 = realtime();

    const char *opt_str = "o:Vh";
    ketopt_t opt = KETOPT_INIT;
    int c, ret, is_fai;
    FILE *fp_help = stderr;
    sdict_t *sdict;
    fa = fa1 = out = out1 = 0;

    while ((c = ketopt(&opt, argc, argv, 1, opt_str, long_options)) >= 0) {
        if (c == 302) {
            DEFAULT_AGP_SEQ_COMPONENT_TYPE = agp_component_type_key(opt.arg);
            if (DEFAULT_AGP_SEQ_COMPONENT_TYPE == AGP_CT_N ||
                    DEFAULT_AGP_SEQ_COMPONENT_TYPE == AGP_CT_U)
                fprintf(stderr, "[W::%s] a GAP component identifier will be used for sequences: %s\n",
                        __func__, opt.arg);
        } else if (c == 303) {
            DEFAULT_AGP_GAP_COMPONENT_TYPE = agp_component_type_key(opt.arg);
            if (DEFAULT_AGP_GAP_COMPONENT_TYPE != AGP_CT_N &&
                    DEFAULT_AGP_GAP_COMPONENT_TYPE != AGP_CT_U)
                fprintf(stderr, "[W::%s] a SEQ component identifier will be used for gaps: %s\n",
                        __func__, opt.arg);
        } else if (c == 304) {
            DEFAULT_AGP_LINKAGE_EVIDENCE = agp_linkage_evidence_key(opt.arg);
        } else if (c == 305) {
            DEFAULT_AGP_GAP_SIZE = atoi(opt.arg);
        } else if (c == 'o') {
            out = opt.arg;
        } else if (c == 'h') {
            fp_help = stdout;
        } else if (c == 'V') {
            puts(JUICER_VERSION);
            return 0;
        } else if (c == '?') {
            fprintf(stderr, "[E::%s] unknown option: \"%s\"\n", __func__, argv[opt.i - 1]);
            return 1;
        } else if (c == ':') {
            fprintf(stderr, "[E::%s] missing option: \"%s\"\n", __func__, argv[opt.i - 1]);
            return 1;
        }
    }

    if (fp_help == stdout) {
        print_help_post(stdout);
        return 0;
    }

    if (argc - opt.ind < 3) {
        fprintf(stderr, "[E::%s] missing input: three positional options required\n", __func__);
        print_help_post(stderr);
        return 1;
    }

    if (out) {
        out1 = (char *) malloc(strlen(out) + 35);
        sprintf(out1, "%s.FINAL.agp", out);
    }

    fo = out1 == 0? stdout : fopen(out1, "w");
    if (fo == 0) {
        fprintf(stderr, "[E::%s] cannot open file %s for writing\n", __func__, out);
        exit(EXIT_FAILURE);
    }

    fa = argv[opt.ind + 2];
    is_fai = strlen(fa) > 4 && !strcmp(fa + strlen(fa) - 4, ".fai");

    ret = 0;
    sdict = is_fai? make_sdict_from_index(fa, 0) : make_sdict_from_fa(fa, 0);
    ret = assembly_to_agp(argv[opt.ind], argv[opt.ind + 1], sdict, fo);
    fflush(fo);
    if (out != 0)
        fclose(fo);

    if (!ret && !is_fai && out1) {
        fa1 = (char *) malloc(strlen(out) + 35);
        sprintf(fa1, "%s.FINAL.fa", out);
        fprintf(stderr, "[I::%s] writing FASTA file for scaffolds\n", __func__);
        FILE *fo1;
        fo1 = fopen(fa1, "w");
        if (fo1 == NULL) {
            fprintf(stderr, "[E::%s] cannot open file %s for writing\n", __func__, fa1);
            exit(EXIT_FAILURE);
        }
        write_fasta_file_from_agp(fa, out1, fo1, 60, 0);
        fclose(fo1);
    }

    sd_destroy(sdict);

    if (out1)
        free(out1);

    if (fa1)
        free(fa1);

    fprintf(stderr, "[I::%s] Version: %s\n", __func__, JUICER_VERSION);
    fprintf(stderr, "[I::%s] CMD: juicer", __func__);
    int i;
    for (i = 0; i < argc; ++i)
        fprintf(stderr, " %s", argv[i]);
    fprintf(stderr, "\n[I::%s] Real time: %.3f sec; CPU: %.3f sec; Peak RSS: %.3f GB\n", __func__, 
            realtime() - jc_realtime0, cputime(), peakrss() / 1024.0 / 1024.0 / 1024.0);

    return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xd0, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, %al
callq 0x2600
callq 0x2670
movsd %xmm0, 0xa7f2(%rip)     # 0x18428
leaq 0x6388(%rip), %rax      # 0x13fc5
movq %rax, -0x40(%rbp)
movq 0xa738(%rip), %rax      # 0x18380
movq %rax, -0x60(%rbp)
movq 0xa735(%rip), %rax      # 0x18388
movq %rax, -0x58(%rbp)
movq 0xa732(%rip), %rax      # 0x18390
movq %rax, -0x50(%rbp)
movq 0xa72f(%rip), %rax      # 0x18398
movq %rax, -0x48(%rbp)
movq 0xa384(%rip), %rax      # 0x17ff8
movq (%rax), %rax
movq %rax, -0x78(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x20(%rbp)
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %r8
leaq -0x60(%rbp), %rdi
movl $0x1, %ecx
leaq 0xa6ea(%rip), %r9       # 0x183a0
callq 0xe310
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
jl 0xdeb4
cmpl $0x12e, -0x64(%rbp)     # imm = 0x12E
jne 0xdd2a
movq -0x58(%rbp), %rdi
callq 0x11b80
movl %eax, %ecx
leaq 0xa57e(%rip), %rax      # 0x18260
movl %ecx, (%rax)
leaq 0xa575(%rip), %rax      # 0x18260
cmpl $0x2b613, (%rax)        # imm = 0x2B613
je 0xdd02
leaq 0xa566(%rip), %rax      # 0x18260
cmpl $0x2b61a, (%rax)        # imm = 0x2B61A
jne 0xdd25
movq 0xa2ef(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
leaq 0x6cc5(%rip), %rsi      # 0x149dc
leaq 0x6d01(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
jmp 0xdeaf
cmpl $0x12f, -0x64(%rbp)     # imm = 0x12F
jne 0xdd8d
movq -0x58(%rbp), %rdi
callq 0x11b80
movl %eax, %ecx
leaq 0xa51f(%rip), %rax      # 0x18264
movl %ecx, (%rax)
leaq 0xa516(%rip), %rax      # 0x18264
cmpl $0x2b613, (%rax)        # imm = 0x2B613
je 0xdd88
leaq 0xa507(%rip), %rax      # 0x18264
cmpl $0x2b61a, (%rax)        # imm = 0x2B61A
je 0xdd88
movq 0xa28c(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x58(%rbp), %rcx
leaq 0x6caf(%rip), %rsi      # 0x14a29
leaq 0x6c9e(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
jmp 0xdead
cmpl $0x130, -0x64(%rbp)     # imm = 0x130
jne 0xddaf
movq -0x58(%rbp), %rdi
callq 0x11ce0
movl %eax, %ecx
leaq 0xa4c4(%rip), %rax      # 0x1826c
movl %ecx, (%rax)
jmp 0xdeab
cmpl $0x131, -0x64(%rbp)     # imm = 0x131
jne 0xddd1
movq -0x58(%rbp), %rdi
callq 0x23c0
movl %eax, %ecx
leaq 0xa4a6(%rip), %rax      # 0x18270
movl %ecx, (%rax)
jmp 0xdea9
cmpl $0x6f, -0x64(%rbp)
jne 0xdde4
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0xdea7
cmpl $0x68, -0x64(%rbp)
jne 0xddfd
movq 0xa1df(%rip), %rax      # 0x17fd0
movq (%rax), %rax
movq %rax, -0x78(%rbp)
jmp 0xdea5
cmpl $0x56, -0x64(%rbp)
jne 0xde1b
leaq 0x60c5(%rip), %rdi      # 0x13ecf
callq 0x20c0
movl $0x0, -0x4(%rbp)
jmp 0xe2f8
cmpl $0x3f, -0x64(%rbp)
jne 0xde5d
movq 0xa1d0(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x61c1(%rip), %rsi      # 0x14004
leaq 0x6bd5(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movl $0x1, -0x4(%rbp)
jmp 0xe2f8
cmpl $0x3a, -0x64(%rbp)
jne 0xde9f
movq 0xa18e(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x619d(%rip), %rsi      # 0x14022
leaq 0x6b93(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movl $0x1, -0x4(%rbp)
jmp 0xe2f8
jmp 0xdea1
jmp 0xdea3
jmp 0xdea5
jmp 0xdea7
jmp 0xdea9
jmp 0xdeab
jmp 0xdead
jmp 0xdeaf
jmp 0xdc9b
movq -0x78(%rbp), %rax
movq 0xa111(%rip), %rcx      # 0x17fd0
cmpq (%rcx), %rax
jne 0xdedf
movq 0xa105(%rip), %rax      # 0x17fd0
movq (%rax), %rdi
callq 0x11f10
movl $0x0, -0x4(%rbp)
jmp 0xe2f8
movl -0x8(%rbp), %eax
subl -0x60(%rbp), %eax
cmpl $0x3, %eax
jge 0xdf24
movq 0xa107(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
leaq 0x618a(%rip), %rsi      # 0x14085
leaq 0x6b1d(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movq 0xa0e8(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
callq 0x11f10
movl $0x1, -0x4(%rbp)
jmp 0xe2f8
cmpq $0x0, -0x30(%rbp)
je 0xdf5a
movq -0x30(%rbp), %rdi
callq 0x2130
movq %rax, %rdi
addq $0x23, %rdi
callq 0x22a0
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x6b14(%rip), %rsi      # 0x14a67
movb $0x0, %al
callq 0x23d0
cmpq $0x0, -0x38(%rbp)
jne 0xdf74
movq 0xa068(%rip), %rax      # 0x17fd0
movq (%rax), %rax
movq %rax, -0x98(%rbp)
jmp 0xdf8b
movq -0x38(%rbp), %rdi
leaq 0x5091(%rip), %rsi      # 0x13010
callq 0x2340
movq %rax, -0x98(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0xdfca
movq 0xa054(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x30(%rbp), %rcx
leaq 0x6202(%rip), %rsi      # 0x141b4
leaq 0x6a66(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movl $0x1, %edi
callq 0x23e0
movq -0x10(%rbp), %rax
movl -0x60(%rbp), %ecx
addl $0x2, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x4, %rcx
movb %al, -0x99(%rbp)
jbe 0xe035
movq -0x20(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
callq 0x2130
movq -0xa8(%rbp), %rdi
addq %rax, %rdi
addq $-0x4, %rdi
leaq 0x6a52(%rip), %rsi      # 0x14a74
callq 0x2210
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x99(%rbp)
movb -0x99(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x6c(%rbp)
movl $0x0, -0x68(%rbp)
cmpl $0x0, -0x6c(%rbp)
je 0xe064
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x72b0
movq %rax, -0xb0(%rbp)
jmp 0xe076
movq -0x20(%rbp), %rdi
xorl %esi, %esi
callq 0x6ca0
movq %rax, -0xb0(%rbp)
movq -0xb0(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x10(%rbp), %rax
movslq -0x60(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
movq -0x10(%rbp), %rax
movl -0x60(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rsi
movq -0x80(%rbp), %rdx
movq -0x18(%rbp), %rcx
callq 0x12010
movl %eax, -0x68(%rbp)
movq -0x18(%rbp), %rdi
callq 0x22b0
cmpq $0x0, -0x30(%rbp)
je 0xe0c7
movq -0x18(%rbp), %rdi
callq 0x2120
cmpl $0x0, -0x68(%rbp)
jne 0xe1aa
cmpl $0x0, -0x6c(%rbp)
jne 0xe1aa
cmpq $0x0, -0x38(%rbp)
je 0xe1aa
movq -0x30(%rbp), %rdi
callq 0x2130
movq %rax, %rdi
addq $0x23, %rdi
callq 0x22a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
movq -0x30(%rbp), %rdx
leaq 0x696b(%rip), %rsi      # 0x14a79
movb $0x0, %al
callq 0x23d0
movq 0x9edc(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
leaq 0x695f(%rip), %rsi      # 0x14a85
leaq 0x68f2(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movq -0x28(%rbp), %rdi
leaq 0x4ed1(%rip), %rsi      # 0x13010
callq 0x2340
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
jne 0xe182
movq 0x9e9c(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x28(%rbp), %rcx
leaq 0x604a(%rip), %rsi      # 0x141b4
leaq 0x68ae(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movl $0x1, %edi
callq 0x23e0
movq -0x20(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x88(%rbp), %rdx
movl $0x3c, %ecx
xorl %r8d, %r8d
callq 0xb4e0
movq -0x88(%rbp), %rdi
callq 0x2120
movq -0x80(%rbp), %rdi
callq 0x62a0
cmpq $0x0, -0x38(%rbp)
je 0xe1c3
movq -0x38(%rbp), %rdi
callq 0x2050
cmpq $0x0, -0x28(%rbp)
je 0xe1d3
movq -0x28(%rbp), %rdi
callq 0x2050
movq 0x9e1e(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
leaq 0x622b(%rip), %rsi      # 0x1440f
leaq 0x6834(%rip), %rdx      # 0x14a1f
leaq 0x5cdd(%rip), %rcx      # 0x13ecf
movb $0x0, %al
callq 0x2230
movq 0x9df8(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
leaq 0x621a(%rip), %rsi      # 0x14424
leaq 0x680e(%rip), %rdx      # 0x14a1f
movb $0x0, %al
callq 0x2230
movl $0x0, -0x8c(%rbp)
movl -0x8c(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0xe265
movq 0x9dc4(%rip), %rax      # 0x17ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movslq -0x8c(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x4ef1(%rip), %rsi      # 0x1313e
movb $0x0, %al
callq 0x2230
movl -0x8c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8c(%rbp)
jmp 0xe222
movq 0x9d8c(%rip), %rax      # 0x17ff8
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
callq 0x2670
subsd 0xa1a5(%rip), %xmm0     # 0x18428
movsd %xmm0, -0xc0(%rbp)
callq 0x25a0
movsd %xmm0, -0xb8(%rbp)
callq 0x2640
movq -0xc8(%rbp), %rdi
movsd -0xc0(%rbp), %xmm0
movsd -0xb8(%rbp), %xmm1
cvtsi2sd %rax, %xmm2
movsd 0x5b37(%rip), %xmm3     # 0x13df8
divsd %xmm3, %xmm2
movsd 0x5b2b(%rip), %xmm3     # 0x13df8
divsd %xmm3, %xmm2
movsd 0x5b1f(%rip), %xmm3     # 0x13df8
divsd %xmm3, %xmm2
leaq 0x6154(%rip), %rsi      # 0x14438
leaq 0x6734(%rip), %rdx      # 0x14a1f
movb $0x3, %al
callq 0x2230
movl -0x68(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xd0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)