// File: BenLangmead[P]bowtie/bowtie_build_main.cpp
// Function: main
int main(int argc, const char **argv) {
	if(argc > 2 && strcmp(argv[1], "-A") == 0) {
		const char *file = argv[2];
		ifstream in;
		in.open(file);
		char buf[4096];
		int lastret = -1;
		while(in.getline(buf, 4095)) {
			EList<string> args;
			args.push_back(string(argv[0]));
			tokenize(buf, " \t", args);
			const char **myargs = (const char**)malloc(sizeof(char*)*args.size());
			for(size_t i = 0; i < args.size(); i++) {
				myargs[i] = args[i].c_str();
			}
			if(args.size() == 1) continue;
			lastret = bowtie_build((int)args.size(), myargs);
			free(myargs);
		}
		if(lastret == -1) {
			cerr << "Warning: No arg strings parsed from " << file << endl;
			return 0;
		}
		return lastret;
	} else {
		return bowtie_build(argc, argv);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1370, %rsp           # imm = 0x1370
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
jle 0x437e7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x3d3e(%rip), %rsi      # 0x47070
callq 0x6650
cmpl $0x0, %eax
jne 0x437e7
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x12f0(%rbp)
callq 0x6510
movq -0x12f0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0x6240
jmp 0x43376
movl $0xffffffff, -0x1234(%rbp) # imm = 0xFFFFFFFF
leaq -0x220(%rbp), %rdi
leaq -0x1230(%rbp), %rsi
movl $0xfff, %edx            # imm = 0xFFF
callq 0x6160
movq %rax, -0x12f8(%rbp)
jmp 0x433a1
movq -0x12f8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0x6580
movb %al, -0x12f9(%rbp)
jmp 0x433bf
movb -0x12f9(%rbp), %al
testb $0x1, %al
jne 0x433ce
jmp 0x43752
leaq -0x1258(%rbp), %rdi
callq 0x16d00
jmp 0x433dc
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1310(%rbp)
leaq -0x1279(%rbp), %rdi
movq %rdi, -0x1308(%rbp)
callq 0x6860
movq -0x1310(%rbp), %rsi
movq -0x1308(%rbp), %rdx
leaq -0x1278(%rbp), %rdi
callq 0x146f0
jmp 0x43419
leaq -0x1258(%rbp), %rdi
leaq -0x1278(%rbp), %rsi
callq 0x15e60
jmp 0x4342e
leaq -0x1278(%rbp), %rdi
callq 0x69a8
leaq -0x1279(%rbp), %rdi
callq 0x64a0
leaq -0x12a1(%rbp), %rdi
movq %rdi, -0x1318(%rbp)
callq 0x6860
movq -0x1318(%rbp), %rdx
leaq -0x12a0(%rbp), %rdi
leaq -0x1230(%rbp), %rsi
callq 0x146f0
jmp 0x43475
leaq -0x12c9(%rbp), %rdi
movq %rdi, -0x1320(%rbp)
callq 0x6860
movq -0x1320(%rbp), %rdx
leaq 0x3bdd(%rip), %rsi      # 0x47073
leaq -0x12c8(%rbp), %rdi
callq 0x146f0
jmp 0x434a4
callq 0x16d40
movq %rax, %rcx
leaq -0x12a0(%rbp), %rdi
leaq -0x12c8(%rbp), %rsi
leaq -0x1258(%rbp), %rdx
callq 0x43810
jmp 0x434c8
leaq -0x12c8(%rbp), %rdi
callq 0x69a8
leaq -0x12c9(%rbp), %rdi
callq 0x64a0
leaq -0x12a0(%rbp), %rdi
callq 0x69a8
leaq -0x12a1(%rbp), %rdi
callq 0x64a0
leaq -0x1258(%rbp), %rdi
callq 0x15ee0
movq %rax, -0x1328(%rbp)
jmp 0x4350d
movq -0x1328(%rbp), %rdi
shlq $0x3, %rdi
callq 0x65e0
movq %rax, -0x12d8(%rbp)
movq $0x0, -0x12e0(%rbp)
movq -0x12e0(%rbp), %rax
movq %rax, -0x1338(%rbp)
leaq -0x1258(%rbp), %rdi
callq 0x15ee0
movq %rax, -0x1330(%rbp)
jmp 0x43552
movq -0x1338(%rbp), %rax
movq -0x1330(%rbp), %rcx
cmpq %rcx, %rax
jae 0x4369d
movq -0x12e0(%rbp), %rsi
leaq -0x1258(%rbp), %rdi
callq 0x16eb0
movq %rax, -0x1340(%rbp)
jmp 0x43585
movq -0x1340(%rbp), %rdi
callq 0x61b0
movq %rax, %rdx
movq -0x12d8(%rbp), %rax
movq -0x12e0(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x12e0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x12e0(%rbp)
jmp 0x4352f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x437d9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x43606
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x1278(%rbp), %rdi
callq 0x69a8
leaq -0x1279(%rbp), %rdi
callq 0x64a0
jmp 0x43741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x43675
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x4365d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x12c8(%rbp), %rdi
callq 0x69a8
leaq -0x12c9(%rbp), %rdi
callq 0x64a0
leaq -0x12a0(%rbp), %rdi
callq 0x69a8
leaq -0x12a1(%rbp), %rdi
callq 0x64a0
jmp 0x43741
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x43741
leaq -0x1258(%rbp), %rdi
callq 0x15ee0
movq %rax, -0x1348(%rbp)
jmp 0x436b2
movq -0x1348(%rbp), %rax
cmpq $0x1, %rax
jne 0x436cb
movl $0x2, -0x12e4(%rbp)
jmp 0x4371f
leaq -0x1258(%rbp), %rdi
callq 0x15ee0
movq %rax, -0x1350(%rbp)
jmp 0x436e0
movq -0x1350(%rbp), %rax
movl %eax, %edi
movq -0x12d8(%rbp), %rsi
callq 0xbe90
movl %eax, -0x1354(%rbp)
jmp 0x436fd
movl -0x1354(%rbp), %eax
movl %eax, -0x1234(%rbp)
movq -0x12d8(%rbp), %rdi
callq 0x6540
movl $0x0, -0x12e4(%rbp)
leaq -0x1258(%rbp), %rdi
callq 0x16f80
movl -0x12e4(%rbp), %eax
testl %eax, %eax
je 0x4373c
jmp 0x43737
jmp 0x43380
jmp 0x43380
leaq -0x1258(%rbp), %rdi
callq 0x16f80
jmp 0x437d9
cmpl $-0x1, -0x1234(%rbp)
jne 0x437b8
movq 0xe88e(%rip), %rdi      # 0x51ff0
leaq 0x390d(%rip), %rsi      # 0x47076
callq 0x6410
movq %rax, -0x1360(%rbp)
jmp 0x43777
movq -0x1360(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x6410
movq %rax, -0x1368(%rbp)
jmp 0x43790
movq -0x1368(%rbp), %rdi
movq 0xe7ca(%rip), %rsi      # 0x51f68
callq 0x6470
jmp 0x437a5
movl $0x0, -0x4(%rbp)
movl $0x1, -0x12e4(%rbp)
jmp 0x437cb
movl -0x1234(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x12e4(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x6120
jmp 0x437f6
leaq -0x220(%rbp), %rdi
callq 0x6120
jmp 0x43802
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0xbe90
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1370, %rsp           # imm = 0x1370
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x6850
nop