// File: BenLangmead[P]bowtie/bowtie_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((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(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 0x87ff7
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x6d78(%rip), %rsi      # 0x8e8ba
callq 0xa880
cmpl $0x0, %eax
jne 0x87ff7
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x18(%rbp)
leaq -0x220(%rbp), %rdi
movq %rdi, -0x12f0(%rbp)
callq 0xa6f0
movq -0x12f0(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0xa370
jmp 0x87b86
movl $0xffffffff, -0x1234(%rbp) # imm = 0xFFFFFFFF
leaq -0x220(%rbp), %rdi
leaq -0x1230(%rbp), %rsi
movl $0xfff, %edx            # imm = 0xFFF
callq 0xa1a0
movq %rax, -0x12f8(%rbp)
jmp 0x87bb1
movq -0x12f8(%rbp), %rdi
movq (%rdi), %rax
movq -0x18(%rax), %rax
addq %rax, %rdi
callq 0xa790
movb %al, -0x12f9(%rbp)
jmp 0x87bcf
movb -0x12f9(%rbp), %al
testb $0x1, %al
jne 0x87bde
jmp 0x87f62
leaq -0x1258(%rbp), %rdi
callq 0x27220
jmp 0x87bec
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x1310(%rbp)
leaq -0x1279(%rbp), %rdi
movq %rdi, -0x1308(%rbp)
callq 0xab70
movq -0x1310(%rbp), %rsi
movq -0x1308(%rbp), %rdx
leaq -0x1278(%rbp), %rdi
callq 0x24c10
jmp 0x87c29
leaq -0x1258(%rbp), %rdi
leaq -0x1278(%rbp), %rsi
callq 0x26380
jmp 0x87c3e
leaq -0x1278(%rbp), %rdi
callq 0xacd8
leaq -0x1279(%rbp), %rdi
callq 0xa670
leaq -0x12a1(%rbp), %rdi
movq %rdi, -0x1318(%rbp)
callq 0xab70
movq -0x1318(%rbp), %rdx
leaq -0x12a0(%rbp), %rdi
leaq -0x1230(%rbp), %rsi
callq 0x24c10
jmp 0x87c85
leaq -0x12c9(%rbp), %rdi
movq %rdi, -0x1320(%rbp)
callq 0xab70
movq -0x1320(%rbp), %rdx
leaq 0x6bf3(%rip), %rsi      # 0x8e899
leaq -0x12c8(%rbp), %rdi
callq 0x24c10
jmp 0x87cb4
callq 0x27450
movq %rax, %rcx
leaq -0x12a0(%rbp), %rdi
leaq -0x12c8(%rbp), %rsi
leaq -0x1258(%rbp), %rdx
callq 0x88020
jmp 0x87cd8
leaq -0x12c8(%rbp), %rdi
callq 0xacd8
leaq -0x12c9(%rbp), %rdi
callq 0xa670
leaq -0x12a0(%rbp), %rdi
callq 0xacd8
leaq -0x12a1(%rbp), %rdi
callq 0xa670
leaq -0x1258(%rbp), %rdi
callq 0x26400
movq %rax, -0x1328(%rbp)
jmp 0x87d1d
movq -0x1328(%rbp), %rdi
shlq $0x3, %rdi
callq 0xa800
movq %rax, -0x12d8(%rbp)
movq $0x0, -0x12e0(%rbp)
movq -0x12e0(%rbp), %rax
movq %rax, -0x1338(%rbp)
leaq -0x1258(%rbp), %rdi
callq 0x26400
movq %rax, -0x1330(%rbp)
jmp 0x87d62
movq -0x1338(%rbp), %rax
movq -0x1330(%rbp), %rcx
cmpq %rcx, %rax
jae 0x87ead
movq -0x12e0(%rbp), %rsi
leaq -0x1258(%rbp), %rdi
callq 0x27460
movq %rax, -0x1340(%rbp)
jmp 0x87d95
movq -0x1340(%rbp), %rdi
callq 0xa210
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 0x87d3f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x87fe9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x87e16
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x1278(%rbp), %rdi
callq 0xacd8
leaq -0x1279(%rbp), %rdi
callq 0xa670
jmp 0x87f51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x87e85
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x87e6d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x12c8(%rbp), %rdi
callq 0xacd8
leaq -0x12c9(%rbp), %rdi
callq 0xa670
leaq -0x12a0(%rbp), %rdi
callq 0xacd8
leaq -0x12a1(%rbp), %rdi
callq 0xa670
jmp 0x87f51
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
jmp 0x87f51
leaq -0x1258(%rbp), %rdi
callq 0x26400
movq %rax, -0x1348(%rbp)
jmp 0x87ec2
movq -0x1348(%rbp), %rax
cmpq $0x1, %rax
jne 0x87edb
movl $0x2, -0x12e4(%rbp)
jmp 0x87f2f
leaq -0x1258(%rbp), %rdi
callq 0x26400
movq %rax, -0x1350(%rbp)
jmp 0x87ef0
movq -0x1350(%rbp), %rax
movl %eax, %edi
movq -0x12d8(%rbp), %rsi
callq 0x11b50
movl %eax, -0x1354(%rbp)
jmp 0x87f0d
movl -0x1354(%rbp), %eax
movl %eax, -0x1234(%rbp)
movq -0x12d8(%rbp), %rdi
callq 0xa730
movl $0x0, -0x12e4(%rbp)
leaq -0x1258(%rbp), %rdi
callq 0x27260
movl -0x12e4(%rbp), %eax
testl %eax, %eax
je 0x87f4c
jmp 0x87f47
jmp 0x87b90
jmp 0x87b90
leaq -0x1258(%rbp), %rdi
callq 0x27260
jmp 0x87fe9
cmpl $-0x1, -0x1234(%rbp)
jne 0x87fc8
movq 0x2007e(%rip), %rdi     # 0xa7ff0
leaq 0x6944(%rip), %rsi      # 0x8e8bd
callq 0xa5d0
movq %rax, -0x1360(%rbp)
jmp 0x87f87
movq -0x1360(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xa5d0
movq %rax, -0x1368(%rbp)
jmp 0x87fa0
movq -0x1368(%rbp), %rdi
movq 0x1ffba(%rip), %rsi     # 0xa7f68
callq 0xa640
jmp 0x87fb5
movl $0x0, -0x4(%rbp)
movl $0x1, -0x12e4(%rbp)
jmp 0x87fdb
movl -0x1234(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x12e4(%rbp)
leaq -0x220(%rbp), %rdi
callq 0xa150
jmp 0x88006
leaq -0x220(%rbp), %rdi
callq 0xa150
jmp 0x88012
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
callq 0x11b50
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x1370, %rsp           # imm = 0x1370
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0xab60
nop