// File: /workspace/github_cpp_makefile_star2_O2/ParkerLab[P]cta/src/cta.cpp
// Function: main
int main(int argc, char **argv)
{
    int c, option_index = 0;
    bool verbose = 0;

    long long int max_edit_distance = 1;
    long long int fudge = 0;
    long long int trim_start = 0;
    long long int rc_length = 20;
    std::string input_filename1;
    std::string input_filename2;
    std::string barcode_filename;
	std::string selected_barcode_filename;
    std::string output_filename1;
    std::string output_filename2;

    static struct option long_options[] = {
        {"help", no_argument, NULL, 'h'},
        {"verbose", no_argument, NULL, 'v'},
        {"version", no_argument, NULL, 0},
        {"max-edit-distance", required_argument, NULL, 'd'},
        {"fudge", required_argument, NULL, 'f'},
        {"trim-from-start", required_argument, NULL, 't'},
        {"rc-length", required_argument, NULL, 'r'},
        {"append-barcode", required_argument, NULL, 'a'},
		{"selected-barcodes", required_argument, NULL, 'x'},
        {0, 0, 0, 0}
    };

    // parse the command line arguments
    while ((c = getopt_long(argc, argv, "d:f:t:r:a:x:vh?", long_options, &option_index)) != -1) {
        switch (c) {
        case 'h':
        case '?':
            print_usage();
            exit(1);
        case 'v':
            verbose = true;
            break;
        case 'd':
            max_edit_distance = std::stoll(optarg);
            break;
        case 'f':
            fudge = std::stoll(optarg);
            break;
        case 's':
            trim_start = std::stoll(optarg);
            break;
        case 'r':
            rc_length = std::stoll(optarg);
            break;
        case 'a':
            barcode_filename = optarg;
            break;
		case 'x':
			selected_barcode_filename = optarg;
			break;
        case 0:
            if (long_options[option_index].flag != 0){
                break;
            }

            if (long_options[option_index].name == std::string("version")) {
                std::cout << version_string() << std::endl;
                exit(1);
            }

        default:
            print_usage();
            exit(1);
        }
    }

    if (argc < (optind + 2)) {
        print_usage();
        exit(1);
    }

    input_filename1 = argv[optind];
    input_filename2 = argv[optind + 1];

    if (argc > (optind + 2)) {
        if (argc == optind + 4) {
            output_filename1 = argv[optind + 2];
            output_filename2 = argv[optind + 3];
        } else {
            print_usage();
            exit(1);
        }
    }

    bio::file_source input_file1(input_filename1);
    bio::stream<bio::file_source> input_stream1(input_file1);

    bio::file_source input_file2(input_filename2);
    bio::stream<bio::file_source> input_stream2(input_file2);

    bio::file_source barcode_file(barcode_filename);
    bio::stream<bio::file_source> barcode_stream(barcode_file);

    bio::filtering_stream<bio::input> in1;
    if (is_gzipped_file(input_filename1)) {
        in1.push(bio::gzip_decompressor());
    }
    in1.push(input_stream1);

    bio::filtering_stream<bio::input> in2;
    if (is_gzipped_file(input_filename2)) {
        in2.push(bio::gzip_decompressor());
    }
    in2.push(input_stream2);

    bio::filtering_stream<bio::input> inBarcode;
    if (!barcode_filename.empty() && is_gzipped_file(barcode_filename)) {
        inBarcode.push(bio::gzip_decompressor());
    }
    inBarcode.push(barcode_stream);

    if (output_filename1.empty()) {
        output_filename1 = make_trimmed_filename(input_filename1);
    }

    if (output_filename2.empty()) {
        output_filename2 = make_trimmed_filename(input_filename2);
    }

    if (verbose) {
        std::cout << "Writing to " << output_filename1 << " and " << output_filename2 << "...\n";
    }

    std::ofstream output_file1(output_filename1, std::ios_base::out | std::ios_base::binary);
    std::ofstream output_file2(output_filename2, std::ios_base::out | std::ios_base::binary);

    bio::filtering_stream<bio::output> out1;
    if (is_gzipped_filename(output_filename1)) {
        out1.push(bio::gzip_compressor(bio::gzip_params(bio::gzip::best_speed)));
    }
    out1.push(output_file1);

    bio::filtering_stream<bio::output> out2;
    if (is_gzipped_filename(output_filename2)) {
        out2.push(bio::gzip_compressor(bio::gzip_params(bio::gzip::best_speed)));
    }
    out2.push(output_file2);

    FASTQRecord record1;
    FASTQRecord record2;
    FASTQRecord recordBarcode;

	if (!barcode_filename.empty()) {
		if (!selected_barcode_filename.empty()) {
			// Read list of selected barcodes
			std::map<std::string,bool> selected_barcodes;

			// Get the contents of file in a vector
			bool result = getFileContent(selected_barcode_filename, selected_barcodes);

			// check is barcode is in selected barcodes, if yes, trim and append
			while ((in1 >> record1) && (in2 >> record2) && (inBarcode >> recordBarcode)) {
				std::string barcode = recordBarcode.sequence;
				if (selected_barcodes.count(barcode) > 0) {
					trim_pair(record1, record2, rc_length, max_edit_distance, fudge, trim_start, verbose);
					record1.append_barcode(barcode);
					record2.append_barcode(barcode);
					out1 << record1;
					out2 << record2;
				}
			}
		}
		else {
			// just trim and append barcode
			while ((in1 >> record1) && (in2 >> record2) && (inBarcode >> recordBarcode)) {
				std::string barcode = recordBarcode.sequence;
				trim_pair(record1, record2, rc_length, max_edit_distance, fudge, trim_start, verbose);
				record1.append_barcode(barcode);
				record2.append_barcode(barcode);
				out1 << record1;
				out2 << record2;
			}
		}
	}
	else {
		// just trim
		while ((in1 >> record1) && (in2 >> record2)){
			trim_pair(record1, record2, rc_length, max_edit_distance, fudge, trim_start, verbose);
			out1 << record1;
			out2 << record2;
		}
	}
    bio::close(out1);
    bio::close(out2);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1298, %rsp           # imm = 0x1298
leaq 0x44(%rsp), %r14
andl $0x0, (%r14)
leaq 0x110(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movq %rsi, %r13
movl %edi, %ebp
xorl %edx, %edx
leaq 0xf0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0xd0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x130(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movb %dl, (%rcx)
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
leaq 0x60(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %dl, (%rax)
movq $0x0, 0x28(%rsp)
movb %dl, (%rcx)
pushq $0x14
popq %rax
movq %rax, 0x38(%rsp)
pushq $0x1
popq %rax
movq %rax, 0x20(%rsp)
leaq 0x18dd0(%rip), %r12     # 0x268f6
leaq 0x31973(%rip), %r15     # 0x3f4a0
leaq 0x184f0(%rip), %rbx     # 0x26024
movq $0x0, 0x30(%rsp)
movq $0x0, 0x48(%rsp)
movl %ebp, %edi
movq %r13, %rsi
movq %r12, %rdx
movq %r15, %rcx
movq %r14, %r8
callq 0xc7a0
leal -0x72(%rax), %ecx
cmpl $0x6, %ecx
jbe 0xdb83
leal -0x61(%rax), %ecx
cmpl $0x7, %ecx
ja 0xdba5
leaq 0x18494(%rip), %rdx     # 0x26004
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
leaq 0xc0(%rsp), %rdi
jmp 0xdb94
movslq (%rbx,%rcx,4), %rax
addq %rbx, %rax
leaq 0x120(%rsp), %rdi
jmpq *%rax
movq 0x31385(%rip), %rax     # 0x3ef20
movq (%rax), %rsi
callq 0xc8c0
jmp 0xdb46
testl %eax, %eax
jne 0xdcc2
movslq 0x44(%rsp), %rax
shlq $0x5, %rax
cmpq $0x0, 0x10(%rax,%r15)
jne 0xdb46
jmp 0xe83c
movq 0x31356(%rip), %rax     # 0x3ef20
movq (%rax), %rsi
leaq 0x390(%rsp), %rdi
leaq 0xbb8(%rsp), %rdx
callq 0xeca8
leaq 0x390(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xef44
movq %rax, 0x30(%rsp)
jmp 0xdcb0
movb $0x1, %al
movq %rax, 0x48(%rsp)
jmp 0xdb46
movq 0x3130f(%rip), %rax     # 0x3ef20
movq (%rax), %rsi
leaq 0x390(%rsp), %rdi
leaq 0xbb8(%rsp), %rdx
callq 0xeca8
leaq 0x390(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xef44
movq %rax, 0x38(%rsp)
jmp 0xdcb0
movq 0x312d7(%rip), %rax     # 0x3ef20
movq (%rax), %rsi
leaq 0x390(%rsp), %rdi
leaq 0xbb8(%rsp), %rdx
callq 0xeca8
leaq 0x390(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xef44
movq %rax, 0x20(%rsp)
jmp 0xdcb0
movq 0x3129f(%rip), %rax     # 0x3ef20
movq (%rax), %rsi
leaq 0x390(%rsp), %rdi
leaq 0xbb8(%rsp), %rdx
callq 0xeca8
leaq 0x390(%rsp), %rdi
xorl %esi, %esi
pushq $0xa
popq %rdx
callq 0xef44
movq %rax, 0x28(%rsp)
leaq 0x390(%rsp), %rdi
callq 0xc250
jmp 0xdb46
cmpl $-0x1, %eax
jne 0xe829
movq 0x312b6(%rip), %rbx     # 0x3ef88
movslq (%rbx), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0xe8c4
movq (%r13,%rax,8), %rsi
leaq 0x100(%rsp), %rdi
callq 0xc8c0
movslq (%rbx), %rax
movq 0x8(%r13,%rax,8), %rsi
leaq 0xe0(%rsp), %rdi
callq 0xc8c0
movslq (%rbx), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jge 0xdd3d
leal 0x4(%rax), %ecx
cmpl %ebp, %ecx
jne 0xe8cb
movq 0x10(%r13,%rax,8), %rsi
leaq 0x70(%rsp), %rdi
callq 0xc8c0
movslq (%rbx), %rax
movq 0x18(%r13,%rax,8), %rsi
leaq 0x50(%rsp), %rdi
callq 0xc8c0
leaq 0xb0(%rsp), %rdi
leaq 0x100(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0xef76
leaq 0x10f8(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xef82
movq 0x48(%rsp), %r15
leaq 0xa0(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0xef76
leaq 0xf58(%rsp), %rdi
leaq 0xa0(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xef82
leaq 0x90(%rsp), %rdi
leaq 0xc0(%rsp), %rsi
pushq $0x8
popq %rdx
callq 0xef76
leaq 0xdb8(%rsp), %rdi
leaq 0x90(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xef82
leaq 0x6e8(%rsp), %rdi
callq 0xf046
leaq 0x100(%rsp), %rdi
callq 0xcb66
testb %al, %al
je 0xde36
leaq 0x390(%rsp), %rdi
pushq $0xf
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf0a4
movq 0x6f0(%rsp), %rdi
leaq 0x390(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x1f386
leaq 0x390(%rsp), %rdi
callq 0xf14c
leaq 0x6e8(%rsp), %rdi
leaq 0x10f8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xf172
leaq 0x5b0(%rsp), %rdi
callq 0xf046
leaq 0xe0(%rsp), %rdi
callq 0xcb66
testb %al, %al
je 0xdeac
leaq 0x390(%rsp), %rdi
pushq $0xf
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf0a4
movq 0x5b8(%rsp), %rdi
leaq 0x390(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x1f386
leaq 0x390(%rsp), %rdi
callq 0xf14c
leaq 0x5b0(%rsp), %rdi
leaq 0xf58(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xf172
leaq 0x950(%rsp), %rdi
callq 0xf046
cmpq $0x0, 0xc8(%rsp)
je 0xdf2d
leaq 0xc0(%rsp), %rdi
callq 0xcb66
testb %al, %al
je 0xdf2d
leaq 0x390(%rsp), %rdi
pushq $0xf
popq %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf0a4
movq 0x958(%rsp), %rdi
leaq 0x390(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x1f386
leaq 0x390(%rsp), %rdi
callq 0xf14c
leaq 0x950(%rsp), %rdi
leaq 0xdb8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xf172
cmpq $0x0, 0x78(%rsp)
jne 0xdf82
leaq 0x390(%rsp), %rdi
leaq 0x100(%rsp), %rsi
callq 0xccf9
leaq 0x70(%rsp), %rdi
leaq 0x390(%rsp), %rbx
movq %rbx, %rsi
callq 0xc5d0
movq %rbx, %rdi
callq 0xc250
cmpq $0x0, 0x58(%rsp)
jne 0xdfbc
leaq 0x390(%rsp), %rdi
leaq 0xe0(%rsp), %rsi
callq 0xccf9
leaq 0x50(%rsp), %rdi
leaq 0x390(%rsp), %rbx
movq %rbx, %rsi
callq 0xc5d0
movq %rbx, %rdi
callq 0xc250
testb $0x1, %r15b
je 0xe00d
movq 0x30faf(%rip), %rdi     # 0x3ef78
leaq 0x18936(%rip), %rsi     # 0x26906
callq 0xc490
leaq 0x70(%rsp), %rsi
movq %rax, %rdi
callq 0xc430
leaq 0x18929(%rip), %rsi     # 0x26912
movq %rax, %rdi
callq 0xc490
leaq 0x50(%rsp), %rsi
movq %rax, %rdi
callq 0xc430
leaq 0x18913(%rip), %rsi     # 0x26918
movq %rax, %rdi
callq 0xc490
leaq 0x390(%rsp), %rdi
leaq 0x70(%rsp), %rsi
pushq $0x14
popq %rdx
callq 0xc8d0
leaq 0xbb8(%rsp), %rdi
leaq 0x50(%rsp), %rsi
pushq $0x14
popq %rdx
callq 0xc8d0
leaq 0xa88(%rsp), %rdi
callq 0xf184
leaq 0x70(%rsp), %rdi
callq 0xcc7d
testb %al, %al
je 0xe13c
leaq 0x1847e(%rip), %rsi     # 0x264db
leaq 0x370(%rsp), %rbx
leaq 0x210(%rsp), %rdx
movq %rbx, %rdi
callq 0xeca8
leaq 0x1845f(%rip), %rsi     # 0x264db
leaq 0x350(%rsp), %r14
leaq 0x290(%rsp), %rdx
movq %r14, %rdi
callq 0xeca8
movq 0x30eb5(%rip), %rax     # 0x3ef50
movl (%rax), %esi
movq 0x30e6c(%rip), %rax     # 0x3ef10
movl (%rax), %edx
movq 0x30ee3(%rip), %rax     # 0x3ef90
movl (%rax), %r9d
movq %r14, 0x8(%rsp)
movq %rbx, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x170(%rsp), %rdi
pushq $0xf
popq %rcx
pushq $0x8
popq %r8
callq 0xf1e2
leaq 0x820(%rsp), %rdi
leaq 0x170(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf246
movq 0xa90(%rsp), %rdi
leaq 0x820(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x22eac
leaq 0x820(%rsp), %rdi
callq 0xf460
leaq 0x170(%rsp), %rdi
callq 0xf484
leaq 0x350(%rsp), %rdi
callq 0xc250
leaq 0x370(%rsp), %rdi
callq 0xc250
leaq 0xa88(%rsp), %rdi
leaq 0x390(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xf49e
leaq 0x820(%rsp), %rdi
callq 0xf184
leaq 0x50(%rsp), %rdi
callq 0xcc7d
testb %al, %al
je 0xe25c
leaq 0x1835e(%rip), %rsi     # 0x264db
leaq 0x330(%rsp), %rbx
leaq 0x290(%rsp), %rdx
movq %rbx, %rdi
callq 0xeca8
leaq 0x1833f(%rip), %rsi     # 0x264db
leaq 0x310(%rsp), %r14
leaq 0x140(%rsp), %rdx
movq %r14, %rdi
callq 0xeca8
movq 0x30d95(%rip), %rax     # 0x3ef50
movl (%rax), %esi
movq 0x30d4c(%rip), %rax     # 0x3ef10
movl (%rax), %edx
movq 0x30dc3(%rip), %rax     # 0x3ef90
movl (%rax), %r9d
movq %r14, 0x8(%rsp)
movq %rbx, (%rsp)
andq $0x0, 0x10(%rsp)
leaq 0x210(%rsp), %rdi
pushq $0xf
popq %rcx
pushq $0x8
popq %r8
callq 0xf1e2
leaq 0x170(%rsp), %rdi
leaq 0x210(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0xf246
movq 0x828(%rsp), %rdi
leaq 0x170(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0x22eac
leaq 0x170(%rsp), %rdi
callq 0xf460
leaq 0x210(%rsp), %rdi
callq 0xf484
leaq 0x310(%rsp), %rdi
callq 0xc250
leaq 0x330(%rsp), %rdi
callq 0xc250
leaq 0x820(%rsp), %rdi
leaq 0xbb8(%rsp), %rsi
pushq $-0x1
popq %rcx
movq %rcx, %rdx
callq 0xf49e
leaq 0x180(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
xorl %eax, %eax
movb %al, (%rcx)
leaq 0x1a0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x1c0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x1e0(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
leaq 0x220(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rdx)
leaq 0x240(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rdx)
leaq 0x260(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
movb %al, (%rdx)
leaq 0x280(%rsp), %rdx
movq %rdx, -0x10(%rdx)
andq $0x0, -0x8(%rdx)
leaq 0x2a0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %al, (%rsi)
leaq 0x2c0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %al, (%rsi)
leaq 0x2e0(%rsp), %rsi
movq %rsi, -0x10(%rsi)
andq $0x0, -0x8(%rsi)
movb %al, (%rcx)
movb %al, (%rdx)
movb %al, (%rsi)
leaq 0x300(%rsp), %rcx
movq %rcx, -0x10(%rcx)
andq $0x0, -0x8(%rcx)
movb %al, (%rcx)
movzbl %r15b, %r14d
cmpq %rax, 0xc8(%rsp)
je 0xe655
cmpq $0x0, 0x128(%rsp)
je 0xe70e
leaq 0x148(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x1f0(%rsp), %rdi
leaq 0x120(%rsp), %rsi
callq 0xc660
leaq 0x1f0(%rsp), %rdi
leaq 0x140(%rsp), %rsi
callq 0xd976
leaq 0x1f0(%rsp), %rdi
callq 0xc250
leaq 0x6f8(%rsp), %rbx
leaq 0x170(%rsp), %r12
leaq 0x210(%rsp), %rbp
leaq 0x290(%rsp), %r13
leaq 0x590(%rsp), %r15
andl $0x1, %r14d
movq %rbx, %rdi
movq %r12, %rsi
callq 0xcb25
movq 0x6f8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x718(%rsp,%rax)
jne 0xe502
leaq 0x5c0(%rsp), %rdi
movq %rbp, %rsi
callq 0xcb25
movq 0x5c0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x5e0(%rsp,%rax)
jne 0xe502
leaq 0x960(%rsp), %rdi
movq %r13, %rsi
callq 0xcb25
movq 0x960(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x980(%rsp,%rax)
jne 0xe502
movq %r15, %rdi
leaq 0x2d0(%rsp), %rsi
callq 0xc660
leaq 0x140(%rsp), %rdi
movq %r15, %rsi
callq 0xf4b0
testq %rax, %rax
je 0xe4f5
movl %r14d, (%rsp)
movq %r12, %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0xd406
movq %r12, %rdi
movq %r15, %rsi
callq 0xf4ca
movq %rbp, %rdi
movq %r15, %rsi
callq 0xf4ca
leaq 0xa98(%rsp), %rdi
movq %r12, %rsi
callq 0xcabc
leaq 0x830(%rsp), %rdi
movq %rbp, %rsi
callq 0xcabc
movq %r15, %rdi
callq 0xc250
jmp 0xe3fe
leaq 0x140(%rsp), %rdi
callq 0xf836
leaq 0xa88(%rsp), %rdi
callq 0x24fa2
leaq 0x820(%rsp), %rdi
callq 0x24fa2
leaq 0x290(%rsp), %rdi
callq 0xf572
leaq 0x210(%rsp), %rdi
callq 0xf572
leaq 0x170(%rsp), %rdi
callq 0xf572
leaq 0x820(%rsp), %rdi
callq 0xf59a
leaq 0xa88(%rsp), %rdi
callq 0xf59a
leaq 0xbb8(%rsp), %rdi
callq 0xc6e0
leaq 0x390(%rsp), %rdi
callq 0xc6e0
leaq 0x950(%rsp), %rdi
callq 0xf5b8
leaq 0x5b0(%rsp), %rdi
callq 0xf5b8
leaq 0x6e8(%rsp), %rdi
callq 0xf5b8
leaq 0xdb8(%rsp), %rdi
callq 0xf5d6
leaq 0x98(%rsp), %rdi
callq 0xf7fc
leaq 0xf58(%rsp), %rdi
callq 0xf5d6
leaq 0xa8(%rsp), %rdi
callq 0xf7fc
leaq 0x10f8(%rsp), %rdi
callq 0xf5d6
leaq 0xb8(%rsp), %rdi
callq 0xf7fc
leaq 0x50(%rsp), %rdi
callq 0xc250
leaq 0x70(%rsp), %rdi
callq 0xc250
leaq 0x120(%rsp), %rdi
callq 0xc250
leaq 0xc0(%rsp), %rdi
callq 0xc250
leaq 0xe0(%rsp), %rdi
callq 0xc250
leaq 0x100(%rsp), %rdi
callq 0xc250
xorl %eax, %eax
addq $0x1298, %rsp           # imm = 0x1298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x6f8(%rsp), %rbx
leaq 0x5c0(%rsp), %r15
leaq 0x830(%rsp), %r12
leaq 0x170(%rsp), %r13
leaq 0x210(%rsp), %rbp
andl $0x1, %r14d
movq %rbx, %rdi
movq %r13, %rsi
callq 0xcb25
movq 0x6f8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x718(%rsp,%rax)
jne 0xe50f
movq %r15, %rdi
movq %rbp, %rsi
callq 0xcb25
movq 0x5c0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x5e0(%rsp,%rax)
jne 0xe50f
movl %r14d, (%rsp)
movq %r13, %rdi
movq %rbp, %rsi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0xd406
leaq 0xa98(%rsp), %rdi
movq %r13, %rsi
callq 0xcabc
movq %r12, %rdi
movq %rbp, %rsi
callq 0xcabc
jmp 0xe681
leaq 0x6f8(%rsp), %rbx
leaq 0x170(%rsp), %rbp
leaq 0x210(%rsp), %r12
leaq 0x290(%rsp), %r13
leaq 0x140(%rsp), %r15
andl $0x1, %r14d
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xcb25
movq 0x6f8(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x718(%rsp,%rax)
jne 0xe50f
leaq 0x5c0(%rsp), %rdi
movq %r12, %rsi
callq 0xcb25
movq 0x5c0(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x5e0(%rsp,%rax)
jne 0xe50f
leaq 0x960(%rsp), %rdi
movq %r13, %rsi
callq 0xcb25
movq 0x960(%rsp), %rax
movq -0x18(%rax), %rax
testb $0x5, 0x980(%rsp,%rax)
jne 0xe50f
movq %r15, %rdi
leaq 0x2d0(%rsp), %rsi
callq 0xc660
movl %r14d, (%rsp)
movq %rbp, %rdi
movq %r12, %rsi
movq 0x38(%rsp), %rdx
movq 0x20(%rsp), %rcx
movq 0x28(%rsp), %r8
movq 0x30(%rsp), %r9
callq 0xd406
movq %rbp, %rdi
movq %r15, %rsi
callq 0xf4ca
movq %r12, %rdi
movq %r15, %rsi
callq 0xf4ca
leaq 0xa98(%rsp), %rdi
movq %rbp, %rsi
callq 0xcabc
leaq 0x830(%rsp), %rdi
movq %r12, %rsi
callq 0xcabc
movq %r15, %rdi
callq 0xc250
jmp 0xe73a
cmpl $0x3f, %eax
jne 0xe8b7
callq 0xd75c
jmp 0xe8bc
addq %rax, %r15
movq (%r15), %rbx
leaq 0x18052(%rip), %rsi     # 0x2689b
leaq 0x390(%rsp), %rdi
leaq 0xbb8(%rsp), %rdx
callq 0xeca8
leaq 0x390(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xef60
movl %eax, %ebx
movq %r14, %rdi
callq 0xc250
testb %bl, %bl
je 0xe8b7
leaq 0x390(%rsp), %rdi
callq 0xd6b1
movq 0x306e5(%rip), %rdi     # 0x3ef78
leaq 0x390(%rsp), %rsi
callq 0xc430
movq %rax, %rdi
callq 0xc270
leaq 0x390(%rsp), %rdi
callq 0xc250
jmp 0xe8bc
callq 0xd75c
pushq $0x1
popq %rdi
callq 0xc5c0
callq 0xd75c
jmp 0xe8bc
callq 0xd75c
jmp 0xe8bc
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0xf14c
jmp 0xeb31
jmp 0xea8e
jmp 0xea8e
jmp 0xea8e
movq %rax, %rbx
leaq 0x1f0(%rsp), %rdi
jmp 0xeabf
jmp 0xeaaa
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0xf460
jmp 0xe920
movq %rax, %rbx
leaq 0x210(%rsp), %rdi
callq 0xf484
jmp 0xe932
movq %rax, %rbx
leaq 0x310(%rsp), %rdi
callq 0xc250
jmp 0xe944
movq %rax, %rbx
leaq 0x330(%rsp), %rdi
callq 0xc250
jmp 0xeafd
jmp 0xea50
movq %rax, %rbx
leaq 0x820(%rsp), %rdi
callq 0xf460
jmp 0xe970
movq %rax, %rbx
leaq 0x170(%rsp), %rdi
callq 0xf484
jmp 0xe982
movq %rax, %rbx
leaq 0x350(%rsp), %rdi
callq 0xc250
jmp 0xe994
movq %rax, %rbx
leaq 0x370(%rsp), %rdi
callq 0xc250
jmp 0xeb0a
jmp 0xea58
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0xf14c
jmp 0xeb3e
jmp 0xea60
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0xf14c
jmp 0xeb4b
jmp 0xea68
jmp 0xea58
movq %rax, %rbx
jmp 0xeb17
movq %rax, %rbx
jmp 0xeb24
jmp 0xea8e
jmp 0xea60
jmp 0xea68
movq %rax, %rbx
jmp 0xeb58
movq %rax, %rbx
jmp 0xeb65
movq %rax, %rbx
jmp 0xeb72
movq %rax, %rbx
jmp 0xeb7f
movq %rax, %rbx
jmp 0xeb8c
movq %rax, %rbx
jmp 0xeb99
jmp 0xebaa
jmp 0xea72
jmp 0xebaa
jmp 0xea72
jmp 0xebaa
jmp 0xea72
jmp 0xebaa
jmp 0xea72
jmp 0xebaa
jmp 0xead3
movq %rax, %rbx
jmp 0xeafd
movq %rax, %rbx
jmp 0xeb0a
movq %rax, %rbx
jmp 0xeb3e
movq %rax, %rbx
jmp 0xeb4b
jmp 0xead3
movq %rax, %rbx
leaq 0x390(%rsp), %rdi
callq 0xc250
jmp 0xebad
jmp 0xebaa
jmp 0xeaaa
movq %rax, %rbx
jmp 0xeb31
jmp 0xead3
movq %rax, %rbx
leaq 0x140(%rsp), %rdi
callq 0xc250
jmp 0xead6
movq %rax, %rbx
jmp 0xeac4
jmp 0xebaa
movq %rax, %rbx
leaq 0x590(%rsp), %rdi
callq 0xc250
leaq 0x140(%rsp), %rdi
callq 0xf836
jmp 0xead6
movq %rax, %rbx
leaq 0x290(%rsp), %rdi
callq 0xf572
leaq 0x210(%rsp), %rdi
callq 0xf572
leaq 0x170(%rsp), %rdi
callq 0xf572
leaq 0x820(%rsp), %rdi
callq 0xf59a
leaq 0xa88(%rsp), %rdi
callq 0xf59a
leaq 0xbb8(%rsp), %rdi
callq 0xc6e0
leaq 0x390(%rsp), %rdi
callq 0xc6e0
leaq 0x950(%rsp), %rdi
callq 0xf5b8
leaq 0x5b0(%rsp), %rdi
callq 0xf5b8
leaq 0x6e8(%rsp), %rdi
callq 0xf5b8
leaq 0xdb8(%rsp), %rdi
callq 0xf5d6
leaq 0x98(%rsp), %rdi
callq 0xf7fc
leaq 0xf58(%rsp), %rdi
callq 0xf5d6
leaq 0xa8(%rsp), %rdi
callq 0xf7fc
leaq 0x10f8(%rsp), %rdi
callq 0xf5d6
leaq 0xb8(%rsp), %rdi
callq 0xf7fc
jmp 0xebad
jmp 0xebaa
movq %rax, %rbx
leaq 0x50(%rsp), %rdi
callq 0xc250
leaq 0x70(%rsp), %rdi
callq 0xc250
leaq 0x120(%rsp), %rdi
callq 0xc250
leaq 0xc0(%rsp), %rdi
callq 0xc250
leaq 0xe0(%rsp), %rdi
callq 0xc250
leaq 0x100(%rsp), %rdi
callq 0xc250
movq %rbx, %rdi
callq 0xc820