// File: /workspace/github_c_makefile_star2_O3/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bamshuf.c
// Function: main_bamshuf
int main_bamshuf(int argc, char *argv[])
{
	int c, n_files = 64, clevel = DEF_CLEVEL, is_stdout = 0, is_un = 0;
	while ((c = getopt(argc, argv, "n:l:uO")) >= 0) {
		switch (c) {
		case 'n': n_files = atoi(optarg); break;
		case 'l': clevel = atoi(optarg); break;
		case 'u': is_un = 1; break;
		case 'O': is_stdout = 1; break;
		}
	}
	if (is_un) clevel = 0;
	if (optind + 2 > argc) {
		fprintf(stderr, "\nUsage:   bamshuf [-Ou] [-n nFiles] [-c cLevel] <in.bam> <out.prefix>\n\n");
		fprintf(stderr, "Options: -O      output to stdout\n");
		fprintf(stderr, "         -u      uncompressed BAM output\n");
		fprintf(stderr, "         -l INT  compression level [%d]\n", DEF_CLEVEL);
		fprintf(stderr, "         -n INT  number of temporary files [%d]\n", n_files);
		fprintf(stderr, "\n");
		return 1;
	}
	bamshuf(argv[optind], n_files, argv[optind+1], clevel, is_stdout);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x2463c(%rip), %rdx     # 0x42eff
callq 0x3210
testl %eax, %eax
js 0x1e962
movl $0x40, 0xc(%rsp)
movl $0x1, %r14d
xorl %r12d, %r12d
leaq 0x24617(%rip), %r15     # 0x42eff
xorl %r13d, %r13d
cmpl $0x6d, %eax
jg 0x1e90e
cmpl $0x4f, %eax
je 0x1e92d
cmpl $0x6c, %eax
jne 0x1e93b
movq 0x316df(%rip), %rax     # 0x4ffe0
movq (%rax), %rdi
callq 0x34c0
movl %eax, %r14d
jmp 0x1e93b
cmpl $0x75, %eax
je 0x1e935
cmpl $0x6e, %eax
jne 0x1e93b
movq 0x316c1(%rip), %rax     # 0x4ffe0
movq (%rax), %rdi
callq 0x34c0
movl %eax, 0xc(%rsp)
jmp 0x1e93b
movl $0x1, %r13d
jmp 0x1e93b
movl $0x1, %r12d
movl %ebp, %edi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x3210
testl %eax, %eax
jns 0x1e8eb
xorl %esi, %esi
testl %r12d, %r12d
cmovel %r14d, %esi
testl %r13d, %r13d
sete %dl
movl 0xc(%rsp), %r14d
jmp 0x1e96f
movl $0x1, %esi
movb $0x1, %dl
movl $0x40, %r14d
movq 0x31642(%rip), %rax     # 0x4ffb8
movslq (%rax), %rax
leal 0x2(%rax), %ecx
cmpl %ebp, %ecx
jg 0x1ee2d
movl %esi, 0x2c(%rsp)
movb %dl, 0xb(%rsp)
movq (%rbx,%rax,8), %rdi
movq 0x8(%rbx,%rax,8), %r12
cmpb $0x2d, (%rdi)
jne 0x1e9a4
cmpb $0x0, 0x1(%rdi)
je 0x1ee0b
leaq 0x273a4(%rip), %rsi     # 0x45d4f
callq 0x20308
testq %rax, %rax
je 0x1ee5b
movq %rax, 0x18(%rsp)
movq %rax, %rdi
callq 0x235fb
movq %rax, 0x10(%rsp)
movslq %r14d, %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x3610
movq %rax, %r15
movl $0x8, %esi
movq %rbx, %rdi
callq 0x3610
movq %rax, %rbp
movl $0x8, %esi
movq %rbx, %rdi
callq 0x3610
movq %rax, 0x20(%rsp)
movq %r12, %rdi
callq 0x3360
movq %rax, 0x30(%rsp)
movl %r14d, 0xc(%rsp)
movl %r14d, %r13d
testl %ebx, %ebx
movq %r13, 0x40(%rsp)
jle 0x1ea85
movq 0x30(%rsp), %rax
addl $0xa, %eax
movslq %eax, %rbx
xorl %r14d, %r14d
movl $0x1, %esi
movq %rbx, %rdi
callq 0x3610
movq %rax, %r13
movq %rax, (%r15,%r14,8)
movq %rax, %rdi
leaq 0x245ed(%rip), %rsi     # 0x43037
movq %r12, %rdx
movl %r14d, %ecx
xorl %eax, %eax
callq 0x3400
movq %r13, %rdi
movq 0x40(%rsp), %r13
leaq 0x245dd(%rip), %rsi     # 0x43043
callq 0x20308
movq %rax, (%rbp,%r14,8)
movq %rax, %rdi
movq 0x10(%rsp), %rsi
callq 0x237d0
incq %r14
cmpq %r14, %r13
jne 0x1ea2c
movq %r12, 0x50(%rsp)
movq %r15, 0x38(%rsp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x3610
movq %rax, %rbx
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x2393b
testl %eax, %eax
movq 0x20(%rsp), %r12
movl 0xc(%rsp), %r15d
js 0x1eb48
movq 0x30(%rbx), %rdx
movsbl (%rdx), %ecx
movl $0x0, %eax
testl %ecx, %ecx
je 0x1eb1a
movb 0x1(%rdx), %al
testb %al, %al
je 0x1eaf0
addq $0x2, %rdx
movl %ecx, %esi
shll $0x5, %esi
subl %ecx, %esi
movsbl %al, %ecx
addl %esi, %ecx
movb (%rdx), %al
incq %rdx
testb %al, %al
jne 0x1eadb
movl %ecx, %eax
shll $0xf, %eax
notl %eax
addl %ecx, %eax
movl %eax, %ecx
shrl $0xa, %ecx
xorl %eax, %ecx
leal (%rcx,%rcx,8), %eax
movl %eax, %ecx
shrl $0x6, %ecx
xorl %eax, %ecx
movl %ecx, %edx
shll $0xb, %edx
notl %edx
addl %ecx, %edx
movl %edx, %eax
shrl $0x10, %eax
xorl %edx, %eax
xorl %edx, %edx
divl %r15d
movl %edx, %r14d
movq (%rbp,%r14,8), %rdi
movq %rbx, %rsi
callq 0x24370
incq (%r12,%r14,8)
movq 0x18(%rsp), %rdi
movq %rbx, %rsi
callq 0x2393b
testl %eax, %eax
jns 0x1eac0
testq %rbx, %rbx
je 0x1eb5e
movq 0x30(%rbx), %rdi
callq 0x3350
movq %rbx, %rdi
callq 0x3350
testl %r15d, %r15d
movq 0x38(%rsp), %r14
jle 0x1eb7c
xorl %ebx, %ebx
movq (%rbp,%rbx,8), %rdi
callq 0x21311
incq %rbx
cmpq %rbx, %r13
jne 0x1eb6a
movq %rbp, %rdi
callq 0x3350
movq 0x18(%rsp), %rdi
callq 0x21311
movl 0x2c(%rsp), %eax
cmpl $0xa, %eax
movl $0x1, %edx
cmovbl %eax, %edx
leaq 0x244a2(%rip), %rsi     # 0x43046
leaq 0x48(%rsp), %rdi
xorl %eax, %eax
callq 0x3400
cmpb $0x0, 0xb(%rsp)
je 0x1ebff
movq 0x30(%rsp), %rax
addl $0x5, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x3610
movq %rax, %rbx
leaq 0x24474(%rip), %rsi     # 0x4304a
movq %rax, %rdi
movq 0x50(%rsp), %rdx
xorl %eax, %eax
callq 0x3400
leaq 0x48(%rsp), %rsi
movq %rbx, %rdi
callq 0x20308
movq %rax, %r15
movq %rbx, %rdi
callq 0x3350
jmp 0x1ec1d
movq 0x313f2(%rip), %rax     # 0x4fff8
movq (%rax), %rdi
callq 0x3030
leaq 0x48(%rsp), %rsi
movl %eax, %edi
callq 0x20487
movq %rax, %r15
movq 0x10(%rsp), %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x237d0
movq %rbx, %rdi
callq 0x23577
cmpl $0x0, 0xc(%rsp)
jle 0x1ede2
xorl %eax, %eax
movq (%r12,%rax,8), %r13
movq %rax, 0x18(%rsp)
movq %r14, %r12
movq (%r14,%rax,8), %r14
movq %r14, %rdi
leaq 0x270f3(%rip), %rsi     # 0x45d4f
callq 0x20308
movq %rax, %rbx
movq %rax, %rdi
callq 0x235fb
movq %rax, %rdi
callq 0x23577
movl $0x10, %esi
movq %r13, %rdi
callq 0x3610
movq %rax, %rbp
testq %r13, %r13
jle 0x1ed9c
movq %r14, 0x10(%rsp)
xorl %r14d, %r14d
movl $0x1, %edi
movl $0x38, %esi
callq 0x3610
movq %r14, %r12
shlq $0x4, %r12
movq %rax, 0x8(%rbp,%r12)
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2393b
testl %eax, %eax
js 0x1ee3c
addq %rbp, %r12
movq 0x8(%r12), %rax
movq 0x30(%rax), %rcx
movsbl (%rcx), %eax
testl %eax, %eax
je 0x1ed22
movb 0x1(%rcx), %dl
testb %dl, %dl
je 0x1ecf6
addq $0x2, %rcx
movl %eax, %esi
shll $0x5, %esi
subl %eax, %esi
movsbl %dl, %eax
addl %esi, %eax
movb (%rcx), %dl
incq %rcx
testb %dl, %dl
jne 0x1ece1
movl %eax, %ecx
shll $0xf, %ecx
notl %ecx
addl %eax, %ecx
movl %ecx, %eax
shrl $0xa, %eax
xorl %ecx, %eax
leal (%rax,%rax,8), %eax
movl %eax, %ecx
shrl $0x6, %ecx
xorl %eax, %ecx
movl %ecx, %edx
shll $0xb, %edx
notl %edx
addl %ecx, %edx
movl %edx, %eax
shrl $0x10, %eax
xorl %edx, %eax
jmp 0x1ed24
xorl %eax, %eax
movl %eax, (%r12)
incq %r14
cmpq %r13, %r14
jne 0x1ec95
movq %rbx, %rdi
callq 0x21311
movq 0x10(%rsp), %rbx
movq %rbx, %rdi
callq 0x3250
movq %rbx, %rdi
callq 0x3350
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1e060
movq %rbp, %rbx
addq $0x8, %rbx
movq 0x38(%rsp), %r14
movq 0x20(%rsp), %r12
movq (%rbx), %rsi
movq %r15, %rdi
callq 0x24370
movq (%rbx), %rax
testq %rax, %rax
je 0x1ed91
movq 0x30(%rax), %rdi
callq 0x3350
movq (%rbx), %rdi
callq 0x3350
addq $0x10, %rbx
decq %r13
jne 0x1ed6d
jmp 0x1edc7
movq %rbx, %rdi
callq 0x21311
movq %r14, %rdi
callq 0x3250
movq %r14, %rdi
callq 0x3350
movq %r13, %rdi
movq %rbp, %rsi
callq 0x1e060
movq %r12, %r14
movq 0x20(%rsp), %r12
movq %rbp, %rdi
callq 0x3350
movq 0x18(%rsp), %rax
incq %rax
cmpq 0x40(%rsp), %rax
jne 0x1ec42
movq %r15, %rdi
callq 0x21311
movq %r14, %rdi
callq 0x3350
movq %r12, %rdi
callq 0x3350
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x311be(%rip), %rax     # 0x4ffd0
movq (%rax), %rdi
callq 0x3030
leaq 0x26f2e(%rip), %rsi     # 0x45d4f
movl %eax, %edi
callq 0x20487
jmp 0x1e9b0
movl %r14d, %edi
callq 0x4708
movl $0x1, %eax
jmp 0x1edfc
leaq 0x2420e(%rip), %rdi     # 0x43051
leaq 0x241ab(%rip), %rsi     # 0x42ff5
leaq 0x241ae(%rip), %rcx     # 0x42fff
movl $0x65, %edx
callq 0x31b0
leaq 0x20317(%rip), %rdi     # 0x3f179
leaq 0x2418c(%rip), %rsi     # 0x42ff5
leaq 0x2418f(%rip), %rcx     # 0x42fff
movl $0x3c, %edx
callq 0x31b0
nop