// File: /workspace/github_c_makefile_star2_O0/c-zhou[P]oatk/run_syncasm.c
// Function: main
int main(int argc, char *argv[])
{
    const char *opt_str = "k:s:c:a:D:t:v:o:Vh";
    ketopt_t opt = KETOPT_INIT;
    int c, k, s, bubble_size, tip_size, min_k_cov, n_threads;
    size_t m_data;
    double min_a_cov_f, weak_cross;
    char *out;
    int do_ec, do_unzip;
    FILE *fp_help = stderr;
    int ret = 0;

    sys_init();

    k = 1001;
    s = 31;
    min_k_cov = 3;
    min_a_cov_f = .35;
    n_threads = 1;
    bubble_size = 100000;
    tip_size = 10000;
    weak_cross = 0.3;
    m_data = 0;
    do_ec = 1;
    do_unzip = 3;
    out = "syncasm.asm";

    while ((c = ketopt(&opt, argc, argv, 1, opt_str, long_options)) >= 0) {
        if (c == 'k') k = atoi(opt.arg);
        else if (c == 's') s = atoi(opt.arg);
        else if (c == 'c') min_k_cov = atoi(opt.arg);
        else if (c == 'a') min_a_cov_f = atof(opt.arg);
        else if (c == 'D') {
            char *q;
            m_data = strtol(opt.arg, &q, 0);
            if (*q == 'k' || *q == 'K') m_data <<= 10;
            else if (*q == 'm' || *q == 'M') m_data <<= 20;
            else if (*q == 'g' || *q == 'G') m_data <<= 30;
        }
        else if (c == 't') n_threads = atoi(opt.arg);
        else if (c == 301) bubble_size = atoi(opt.arg);
        else if (c == 302) tip_size = atoi(opt.arg);
        else if (c == 303) weak_cross = atof(opt.arg);
        else if (c == 304) do_unzip = atoi(opt.arg);
        else if (c == 305) do_ec = 0;
        else if (c == 'o') {
            if (strcmp(opt.arg, "-") != 0)
                out = opt.arg;
        }
        else if (c == 'v') VERBOSE = atoi(opt.arg);
        else if (c == 'V') {
            puts(SYNCASM_VERSION);
            return 0;
        }
        else if (c == 'h') fp_help = stdout;
        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 (argc == opt.ind || fp_help == stdout) {
        fprintf(fp_help, "\n");
        fprintf(fp_help, "Usage: syncasm [options] <target.fa[stq][.gz]> [...]\n");
        fprintf(fp_help, "Options:\n");
        fprintf(fp_help, "    -k INT               kmer size [%d]\n", k);
        fprintf(fp_help, "    -s INT               smer size (no larger than 31) [%d]\n", s);
        fprintf(fp_help, "    -c INT               minimum kmer coverage [%d]\n", min_k_cov);
        fprintf(fp_help, "    -a FLOAT             minimum arc coverage [%.2f]\n", min_a_cov_f);
        fprintf(fp_help, "    -D INT               maximum amount of data to use; suffix K/M/G recognized [%lu]\n", m_data);
        fprintf(fp_help, "    -t INT               number of threads [%d]\n", n_threads);
        fprintf(fp_help, "    -o FILE              prefix of output files [%s]\n", out);
        fprintf(fp_help, "    --max-bubble  INT    maximum bubble size for assembly graph clean [%d]\n", bubble_size);
        fprintf(fp_help, "    --max-tip     INT    maximum tip size for assembly graph clean [%d]\n", tip_size);
        fprintf(fp_help, "    --weak-cross  FLOAT  maximum relative edge coverage for weak crosslink clean [%.2f]\n", weak_cross);
        fprintf(fp_help, "    --unzip-round INT    maximum round of assembly graph unzipping [%d]\n", do_unzip);
        fprintf(fp_help, "    --no-read-ec         do not do read error correction\n");
        fprintf(fp_help, "    -v INT               verbose level [%d]\n", VERBOSE);
        fprintf(fp_help, "    --version            show version number\n");
        fprintf(fp_help, "\n");
        fprintf(fp_help, "Example: ./syncasm -k 1001 -c 50 -t 8 -o syncasm.asm hifi.fa.gz\n\n");
        return fp_help == stdout? 0 : 1;
    }

    ret = syncasm(argv + opt.ind, argc - opt.ind, m_data, k, s, bubble_size, tip_size, min_k_cov, min_a_cov_f, weak_cross, do_ec, do_unzip, n_threads, out, 0, VERBOSE);

    if (ret) {
        fprintf(stderr, "[E::%s] failed to constrcut assembly\n", __func__);
        exit(EXIT_FAILURE);
    }

    if (fflush(stdout) == EOF) {
        fprintf(stderr, "[E::%s] failed to write the results\n", __func__);
        exit(EXIT_FAILURE);
    }

    if (VERBOSE >= 0) {
        fprintf(stderr, "[M::%s] Version: %s\n", __func__, SYNCASM_VERSION);
        fprintf(stderr, "[M::%s] CMD:", __func__);
        int i;
        for (i = 0; i < argc; ++i)
            fprintf(stderr, " %s", argv[i]);
        fprintf(stderr, "\n[M::%s] Real time: %.3f sec; CPU: %.3f sec; Peak RSS: %.3f GB\n", __func__, realtime() - realtime0, cputime(), peakrss() / 1024.0 / 1024.0 / 1024.0);
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl $0x0, -0x2c(%rbp)
movl %edi, -0x30(%rbp)
movq %rsi, -0x38(%rbp)
leaq 0x2a346(%rip), %rax     # 0x2d22f
movq %rax, -0x40(%rbp)
movq 0x313cc(%rip), %rax     # 0x342c0
movq %rax, -0x60(%rbp)
movq 0x313c9(%rip), %rax     # 0x342c8
movq %rax, -0x58(%rbp)
movq 0x313c6(%rip), %rax     # 0x342d0
movq %rax, -0x50(%rbp)
movq 0x313c3(%rip), %rax     # 0x342d8
movq %rax, -0x48(%rbp)
movq 0x310d8(%rip), %rax     # 0x33ff8
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
movl $0x0, -0xb4(%rbp)
callq 0x291c0
movl $0x3e9, -0x68(%rbp)     # imm = 0x3E9
movl $0x1f, -0x6c(%rbp)
movl $0x3, -0x78(%rbp)
movsd 0x2a0d2(%rip), %xmm0    # 0x2d028
movsd %xmm0, -0x90(%rbp)
movl $0x1, -0x7c(%rbp)
movl $0x186a0, -0x70(%rbp)   # imm = 0x186A0
movl $0x2710, -0x74(%rbp)    # imm = 0x2710
movsd 0x2a0a5(%rip), %xmm0    # 0x2d020
movsd %xmm0, -0x98(%rbp)
movq $0x0, -0x88(%rbp)
movl $0x1, -0xa4(%rbp)
movl $0x3, -0xa8(%rbp)
leaq 0x2a299(%rip), %rax     # 0x2d242
movq %rax, -0xa0(%rbp)
movl -0x30(%rbp), %esi
movq -0x38(%rbp), %rdx
movq -0x40(%rbp), %r8
leaq -0x60(%rbp), %rdi
movl $0x1, %ecx
leaq 0x31315(%rip), %r9      # 0x342e0
callq 0x3730
movl %eax, -0x64(%rbp)
cmpl $0x0, %eax
jl 0x32c4
cmpl $0x6b, -0x64(%rbp)
jne 0x2ff3
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x68(%rbp)
jmp 0x32bf
cmpl $0x73, -0x64(%rbp)
jne 0x300a
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x6c(%rbp)
jmp 0x32bd
cmpl $0x63, -0x64(%rbp)
jne 0x3021
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x78(%rbp)
jmp 0x32bb
cmpl $0x61, -0x64(%rbp)
jne 0x303d
movq -0x58(%rbp), %rdi
callq 0x20f0
movsd %xmm0, -0x90(%rbp)
jmp 0x32b9
cmpl $0x44, -0x64(%rbp)
jne 0x30fd
movq -0x58(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
xorl %edx, %edx
callq 0x22b0
movq %rax, -0x88(%rbp)
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
je 0x307e
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4b, %eax
jne 0x3092
movq -0x88(%rbp), %rax
shlq $0xa, %rax
movq %rax, -0x88(%rbp)
jmp 0x30f8
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6d, %eax
je 0x30b0
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4d, %eax
jne 0x30c4
movq -0x88(%rbp), %rax
shlq $0x14, %rax
movq %rax, -0x88(%rbp)
jmp 0x30f6
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x67, %eax
je 0x30e2
movq -0xc0(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
jne 0x30f4
movq -0x88(%rbp), %rax
shlq $0x1e, %rax
movq %rax, -0x88(%rbp)
jmp 0x30f6
jmp 0x30f8
jmp 0x32b7
cmpl $0x74, -0x64(%rbp)
jne 0x3114
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x7c(%rbp)
jmp 0x32b5
cmpl $0x12d, -0x64(%rbp)     # imm = 0x12D
jne 0x312e
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x70(%rbp)
jmp 0x32b3
cmpl $0x12e, -0x64(%rbp)     # imm = 0x12E
jne 0x3148
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0x74(%rbp)
jmp 0x32b1
cmpl $0x12f, -0x64(%rbp)     # imm = 0x12F
jne 0x3167
movq -0x58(%rbp), %rdi
callq 0x20f0
movsd %xmm0, -0x98(%rbp)
jmp 0x32af
cmpl $0x130, -0x64(%rbp)     # imm = 0x130
jne 0x3184
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, -0xa8(%rbp)
jmp 0x32ad
cmpl $0x131, -0x64(%rbp)     # imm = 0x131
jne 0x319c
movl $0x0, -0xa4(%rbp)
jmp 0x32ab
cmpl $0x6f, -0x64(%rbp)
jne 0x31c7
movq -0x58(%rbp), %rdi
leaq 0x2a76a(%rip), %rsi     # 0x2d917
callq 0x2260
cmpl $0x0, %eax
je 0x31c2
movq -0x58(%rbp), %rax
movq %rax, -0xa0(%rbp)
jmp 0x32a9
cmpl $0x76, -0x64(%rbp)
jne 0x31e1
movq -0x58(%rbp), %rdi
callq 0x2430
movl %eax, 0x312c8(%rip)     # 0x344a4
jmp 0x32a7
cmpl $0x56, -0x64(%rbp)
jne 0x31ff
leaq 0x2a060(%rip), %rdi     # 0x2d24e
callq 0x20c0
movl $0x0, -0x2c(%rbp)
jmp 0x370d
cmpl $0x68, -0x64(%rbp)
jne 0x321b
movq 0x30dcc(%rip), %rax     # 0x33fd8
movq (%rax), %rax
movq %rax, -0xb0(%rbp)
jmp 0x32a3
cmpl $0x3f, -0x64(%rbp)
jne 0x325d
movq 0x30dd0(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x2a00f(%rip), %rsi     # 0x2d252
leaq 0x2a026(%rip), %rdx     # 0x2d270
movb $0x0, %al
callq 0x2290
movl $0x1, -0x2c(%rbp)
jmp 0x370d
cmpl $0x3a, -0x64(%rbp)
jne 0x329f
movq 0x30d8e(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movl -0x4c(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rcx
leaq 0x29ff0(%rip), %rsi     # 0x2d275
leaq 0x29fe4(%rip), %rdx     # 0x2d270
movb $0x0, %al
callq 0x2290
movl $0x1, -0x2c(%rbp)
jmp 0x370d
jmp 0x32a1
jmp 0x32a3
jmp 0x32a5
jmp 0x32a7
jmp 0x32a9
jmp 0x32ab
jmp 0x32ad
jmp 0x32af
jmp 0x32b1
jmp 0x32b3
jmp 0x32b5
jmp 0x32b7
jmp 0x32b9
jmp 0x32bb
jmp 0x32bd
jmp 0x32bf
jmp 0x2fb0
movl -0x30(%rbp), %eax
cmpl -0x60(%rbp), %eax
je 0x32e3
movq -0xb0(%rbp), %rax
movq 0x30cfe(%rip), %rcx     # 0x33fd8
cmpq (%rcx), %rax
jne 0x34d4
movq -0xb0(%rbp), %rdi
leaq 0x2a37d(%rip), %rsi     # 0x2d66e
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x29f8d(%rip), %rsi     # 0x2d293
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x29fae(%rip), %rsi     # 0x2d2c9
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x68(%rbp), %edx
leaq 0x29fa0(%rip), %rsi     # 0x2d2d3
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x6c(%rbp), %edx
leaq 0x29fb1(%rip), %rsi     # 0x2d2fc
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x78(%rbp), %edx
leaq 0x29fd6(%rip), %rsi     # 0x2d339
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movsd -0x90(%rbp), %xmm0
leaq 0x29fee(%rip), %rsi     # 0x2d36e
movb $0x1, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movq -0x88(%rbp), %rdx
leaq 0x2a008(%rip), %rsi     # 0x2d3a4
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x7c(%rbp), %edx
leaq 0x2a047(%rip), %rsi     # 0x2d3fb
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movq -0xa0(%rbp), %rdx
leaq 0x2a05c(%rip), %rsi     # 0x2d42c
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x70(%rbp), %edx
leaq 0x2a07a(%rip), %rsi     # 0x2d462
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0x74(%rbp), %edx
leaq 0x2a0ae(%rip), %rsi     # 0x2d4ae
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movsd -0x98(%rbp), %xmm0
leaq 0x2a0da(%rip), %rsi     # 0x2d4f7
movb $0x1, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl -0xa8(%rbp), %edx
leaq 0x2a118(%rip), %rsi     # 0x2d550
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x2a14c(%rip), %rsi     # 0x2d599
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
movl 0x31043(%rip), %edx     # 0x344a4
leaq 0x2a16b(%rip), %rsi     # 0x2d5d3
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x2a183(%rip), %rsi     # 0x2d600
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x2a1dc(%rip), %rsi     # 0x2d66e
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdi
leaq 0x2a187(%rip), %rsi     # 0x2d62e
movb $0x0, %al
callq 0x2290
movq -0xb0(%rbp), %rdx
movq 0x30b1c(%rip), %rax     # 0x33fd8
movq (%rax), %rsi
movl $0x1, %eax
xorl %ecx, %ecx
cmpq %rsi, %rdx
cmovel %ecx, %eax
movl %eax, -0x2c(%rbp)
jmp 0x370d
movq -0x38(%rbp), %rdi
movslq -0x60(%rbp), %rax
shlq $0x3, %rax
addq %rax, %rdi
movl -0x30(%rbp), %esi
subl -0x60(%rbp), %esi
movq -0x88(%rbp), %rdx
movl -0x68(%rbp), %ecx
movl -0x6c(%rbp), %r8d
movl -0x70(%rbp), %r9d
movl -0x74(%rbp), %r12d
movl -0x78(%rbp), %r15d
movsd -0x90(%rbp), %xmm0
movsd -0x98(%rbp), %xmm1
movl -0xa4(%rbp), %r14d
movl -0xa8(%rbp), %ebx
movl -0x7c(%rbp), %r11d
movq -0xa0(%rbp), %r10
movl 0x30f73(%rip), %eax     # 0x344a4
xorl %r13d, %r13d
movl %r12d, (%rsp)
movl %r15d, 0x8(%rsp)
movl %r14d, 0x10(%rsp)
movl %ebx, 0x18(%rsp)
movl %r11d, 0x20(%rsp)
movq %r10, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
movl %eax, 0x38(%rsp)
callq 0x2650
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
je 0x359a
movq 0x30a80(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a0ee(%rip), %rsi     # 0x2d670
leaq 0x29ce7(%rip), %rdx     # 0x2d270
movb $0x0, %al
callq 0x2290
movl $0x1, %edi
callq 0x2450
movq 0x30a37(%rip), %rax     # 0x33fd8
movq (%rax), %rdi
callq 0x2330
cmpl $-0x1, %eax
jne 0x35d7
movq 0x30a43(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a0d7(%rip), %rsi     # 0x2d696
leaq 0x29caa(%rip), %rdx     # 0x2d270
movb $0x0, %al
callq 0x2290
movl $0x1, %edi
callq 0x2450
cmpl $0x0, 0x30ec6(%rip)     # 0x344a4
jl 0x3706
movq 0x30a0d(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a0c6(%rip), %rsi     # 0x2d6bb
leaq 0x29c74(%rip), %rdx     # 0x2d270
leaq 0x29c4b(%rip), %rcx     # 0x2d24e
movb $0x0, %al
callq 0x2290
movq 0x309e7(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
leaq 0x2a0b5(%rip), %rsi     # 0x2d6d0
leaq 0x29c4e(%rip), %rdx     # 0x2d270
movb $0x0, %al
callq 0x2290
movl $0x0, -0xc4(%rbp)
movl -0xc4(%rbp), %eax
cmpl -0x30(%rbp), %eax
jge 0x3676
movq 0x309b3(%rip), %rax     # 0x33ff8
movq (%rax), %rdi
movq -0x38(%rbp), %rax
movslq -0xc4(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
leaq 0x2a07f(%rip), %rsi     # 0x2d6dd
movb $0x0, %al
callq 0x2290
movl -0xc4(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc4(%rbp)
jmp 0x3633
movq 0x3097b(%rip), %rax     # 0x33ff8
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
callq 0x29140
leaq 0x30e65(%rip), %rax     # 0x344f8
subsd (%rax), %xmm0
movsd %xmm0, -0xd8(%rbp)
callq 0x290b0
movsd %xmm0, -0xd0(%rbp)
callq 0x29110
movq -0xe0(%rbp), %rdi
movsd -0xd8(%rbp), %xmm0
movsd -0xd0(%rbp), %xmm1
cvtsi2sd %rax, %xmm2
movsd 0x2995b(%rip), %xmm3    # 0x2d030
divsd %xmm3, %xmm2
movsd 0x2994f(%rip), %xmm3    # 0x2d030
divsd %xmm3, %xmm2
movsd 0x29943(%rip), %xmm3    # 0x2d030
divsd %xmm3, %xmm2
leaq 0x29fe9(%rip), %rsi     # 0x2d6e1
leaq 0x29b71(%rip), %rdx     # 0x2d270
movb $0x3, %al
callq 0x2290
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nopw %cs:(%rax,%rax)