// File: /workspace/github_c_makefile_star2_O1/genometools[P]genometools/src/external/samtools-0.1.18/bam_sort.c
// Function: bam_merge_core
int bam_merge_core(int by_qname, const char *out, const char *headers, int n, char * const *fn,
					int flag, const char *reg)
{
	bamFile fpout, *fp;
	heap1_t *heap;
	bam_header_t *hout = 0;
	bam_header_t *hheaders = NULL;
	int i, j, *RG_len = 0;
	uint64_t idx = 0;
	char **RG = 0;
	bam_iter_t *iter = 0;

	if (headers) {
		tamFile fpheaders = sam_open(headers);
		if (fpheaders == 0) {
			const char *message = strerror(errno);
			fprintf(stderr, "[bam_merge_core] cannot open '%s': %s\n", headers, message);
			return -1;
		}
		hheaders = sam_header_read(fpheaders);
		sam_close(fpheaders);
	}

	g_is_by_qname = by_qname;
	fp = (bamFile*)calloc(n, sizeof(bamFile));
	heap = (heap1_t*)calloc(n, sizeof(heap1_t));
	iter = (bam_iter_t*)calloc(n, sizeof(bam_iter_t));
	// prepare RG tag
	if (flag & MERGE_RG) {
		RG = (char**)calloc(n, sizeof(void*));
		RG_len = (int*)calloc(n, sizeof(int));
		for (i = 0; i != n; ++i) {
			int l = strlen(fn[i]);
			const char *s = fn[i];
			if (l > 4 && strcmp(s + l - 4, ".bam") == 0) l -= 4;
			for (j = l - 1; j >= 0; --j) if (s[j] == '/') break;
			++j; l -= j;
			RG[i] = calloc(l + 1, 1);
			RG_len[i] = l;
			strncpy(RG[i], s + j, l);
		}
	}
	// read the first
	for (i = 0; i != n; ++i) {
		bam_header_t *hin;
		fp[i] = bam_open(fn[i], "r");
		if (fp[i] == 0) {
			int j;
			fprintf(stderr, "[bam_merge_core] fail to open file %s\n", fn[i]);
			for (j = 0; j < i; ++j) bam_close(fp[j]);
			free(fp); free(heap);
			// FIXME: possible memory leak
			return -1;
		}
		hin = bam_header_read(fp[i]);
		if (i == 0) { // the first BAM
			hout = hin;
		} else { // validate multiple baf
			int min_n_targets = hout->n_targets;
			if (hin->n_targets < min_n_targets) min_n_targets = hin->n_targets;

			for (j = 0; j < min_n_targets; ++j)
				if (strcmp(hout->target_name[j], hin->target_name[j]) != 0) {
					fprintf(stderr, "[bam_merge_core] different target sequence name: '%s' != '%s' in file '%s'\n",
							hout->target_name[j], hin->target_name[j], fn[i]);
					return -1;
				}

			// If this input file has additional target reference sequences,
			// add them to the headers to be output
			if (hin->n_targets > hout->n_targets) {
				swap_header_targets(hout, hin);
				// FIXME Possibly we should also create @SQ text headers
				// for the newly added reference sequences
			}

			bam_header_destroy(hin);
		}
	}

	if (hheaders) {
		// If the text headers to be swapped in include any @SQ headers,
		// check that they are consistent with the existing binary list
		// of reference information.
		if (hheaders->n_targets > 0) {
			if (hout->n_targets != hheaders->n_targets) {
				fprintf(stderr, "[bam_merge_core] number of @SQ headers in '%s' differs from number of target sequences\n", headers);
				if (!reg) return -1;
			}
			for (j = 0; j < hout->n_targets; ++j)
				if (strcmp(hout->target_name[j], hheaders->target_name[j]) != 0) {
					fprintf(stderr, "[bam_merge_core] @SQ header '%s' in '%s' differs from target sequence\n", hheaders->target_name[j], headers);
					if (!reg) return -1;
				}
		}

		swap_header_text(hout, hheaders);
		bam_header_destroy(hheaders);
	}

	if (reg) {
		int tid, beg, end;
		if (bam_parse_region(hout, reg, &tid, &beg, &end) < 0) {
			fprintf(stderr, "[%s] Malformated region string or undefined reference name\n", __func__);
			return -1;
		}
		for (i = 0; i < n; ++i) {
			bam_index_t *idx;
			idx = bam_index_load(fn[i]);
			iter[i] = bam_iter_query(idx, tid, beg, end);
			bam_index_destroy(idx);
		}
	}

	for (i = 0; i < n; ++i) {
		heap1_t *h = heap + i;
		h->i = i;
		h->b = (bam1_t*)calloc(1, sizeof(bam1_t));
		if (bam_iter_read(fp[i], iter[i], h->b) >= 0) {
			h->pos = ((uint64_t)h->b->core.tid<<32) | (uint32_t)((int32_t)h->b->core.pos+1)<<1 | bam1_strand(h->b);
			h->idx = idx++;
		}
		else h->pos = HEAP_EMPTY;
	}
	if (flag & MERGE_UNCOMP) fpout = strcmp(out, "-")? bam_open(out, "wu") : bam_dopen(fileno(stdout), "wu");
	else if (flag & MERGE_LEVEL1) fpout = strcmp(out, "-")? bam_open(out, "w1") : bam_dopen(fileno(stdout), "w1");
	else fpout = strcmp(out, "-")? bam_open(out, "w") : bam_dopen(fileno(stdout), "w");
	if (fpout == 0) {
		fprintf(stderr, "[%s] fail to create the output file.\n", __func__);
		return -1;
	}
	bam_header_write(fpout, hout);
	bam_header_destroy(hout);

	ks_heapmake(heap, n, heap);
	while (heap->pos != HEAP_EMPTY) {
		bam1_t *b = heap->b;
		if (flag & MERGE_RG) {
			uint8_t *rg = bam_aux_get(b, "RG");
			if (rg) bam_aux_del(b, rg);
			bam_aux_append(b, "RG", 'Z', RG_len[heap->i] + 1, (uint8_t*)RG[heap->i]);
		}
		bam_write1_core(fpout, &b->core, b->data_len, b->data);
		if ((j = bam_iter_read(fp[heap->i], iter[heap->i], b)) >= 0) {
			heap->pos = ((uint64_t)b->core.tid<<32) | (uint32_t)((int)b->core.pos+1)<<1 | bam1_strand(b);
			heap->idx = idx++;
		} else if (j == -1) {
			heap->pos = HEAP_EMPTY;
			free(heap->b->data); free(heap->b);
			heap->b = 0;
		} else fprintf(stderr, "[bam_merge_core] '%s' is truncated. Continue anyway.\n", fn[heap->i]);
		ks_heapadjust(heap, 0, n, heap);
	}

	if (flag & MERGE_RG) {
		for (i = 0; i != n; ++i) free(RG[i]);
		free(RG); free(RG_len);
	}
	for (i = 0; i != n; ++i) {
		bam_iter_destroy(iter[i]);
		bam_close(fp[i]);
	}
	bam_close(fpout);
	free(fp); free(heap); free(iter);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xa8, %rsp
movl %r9d, %r12d
movq %r8, 0x20(%rsp)
movl %ecx, 0xc(%rsp)
movq %rdx, %r15
movq %rsi, 0x78(%rsp)
movl %edi, %ebx
testq %rdx, %rdx
je 0x302a54
movq %r15, %rdi
callq 0x2f57c0
movq %rax, %r14
testq %rax, %rax
je 0x30301e
movq %r14, %rdi
callq 0x2f4401
movq %rax, 0x48(%rsp)
movq %r14, %rdi
callq 0x2f586b
testq %r14, %r14
jne 0x302a5d
jmp 0x30328f
movq $0x0, 0x48(%rsp)
movq %r15, 0x70(%rsp)
movl %ebx, 0x1978fc(%rip)    # 0x49a364
movslq 0xc(%rsp), %rbx
movl $0x8, %esi
movq %rbx, %rdi
callq 0x30ed0
movq %rax, %r14
movl $0x20, %esi
movq %rbx, %rdi
callq 0x30ed0
movq %rax, %r15
movl $0x8, %esi
movq %rbx, %rdi
callq 0x30ed0
movq %rax, %r13
movl %r12d, 0x2c(%rsp)
testb $0x1, %r12b
movq %r14, 0x40(%rsp)
movq %r15, 0x18(%rsp)
movq %rax, 0x10(%rsp)
movq %rbx, 0x90(%rsp)
jne 0x302adb
movq $0x0, 0x38(%rsp)
movq $0x0, 0x50(%rsp)
movq 0x20(%rsp), %r12
jmp 0x302bdf
movl $0x8, %esi
movq %rbx, %rdi
callq 0x30ed0
movq %rax, 0x38(%rsp)
movl $0x4, %esi
movq %rbx, %rdi
callq 0x30ed0
movq %rax, 0x50(%rsp)
testl %ebx, %ebx
movq 0x20(%rsp), %r12
je 0x302bdf
movl 0xc(%rsp), %r14d
xorl %ebp, %ebp
leaq 0xbfe48(%rip), %rbx     # 0x3c2962
movq (%r12,%rbp,8), %r13
movq %r13, %rdi
callq 0x2ee50
movq %rax, %r12
cmpl $0x5, %r12d
jl 0x302b55
movl %r12d, %eax
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq (%rax,%r13), %rdi
addq $-0x4, %rdi
movq %rbx, %rsi
callq 0x308e0
leal -0x4(%r12), %ecx
testl %eax, %eax
cmovnel %r12d, %ecx
movl %ecx, %r12d
movl %r12d, %r15d
movl %r12d, %eax
sarl $0x1f, %eax
andl %r12d, %eax
incl %r12d
movq %r15, %rcx
testl %ecx, %ecx
jle 0x302b7c
decl %r12d
cmpb $0x2f, -0x1(%r13,%rcx)
leaq -0x1(%rcx), %rcx
jne 0x302b67
jmp 0x302b7f
movl %eax, %r12d
subl %r12d, %r15d
leal 0x1(%r15), %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x30ed0
movq 0x38(%rsp), %rcx
movq %rax, (%rcx,%rbp,8)
movq 0x50(%rsp), %rcx
movl %r15d, (%rcx,%rbp,4)
movslq %r12d, %rcx
addq %rcx, %r13
movslq %r15d, %rdx
movq %rax, %rdi
movq %r13, %rsi
callq 0x31120
incq %rbp
cmpq %r14, %rbp
movq 0x18(%rsp), %r15
movq 0x20(%rsp), %r12
jne 0x302b1a
movl 0xc(%rsp), %ebp
movq 0x40(%rsp), %r14
movq 0x10(%rsp), %r13
jmp 0x302be3
movl 0xc(%rsp), %ebp
testl %ebp, %ebp
je 0x302d98
movl %ebp, %eax
movq %rax, 0xa0(%rsp)
xorl %ebx, %ebx
movq $0x0, 0x30(%rsp)
leaq (%r12,%rbx,8), %rax
movq %rax, 0x80(%rsp)
movq (%rax), %rdi
leaq 0x459d5(%rip), %rsi     # 0x3485eb
callq 0x2eee0b
movq %rax, (%r14,%rbx,8)
testq %rax, %rax
je 0x302d7e
movq %rax, %rdi
callq 0x2f18d8
movq %rax, %rdi
testq %rbx, %rbx
je 0x302d06
movq %rbx, 0x88(%rsp)
movq 0x30(%rsp), %rax
movl (%rax), %ecx
movl (%rdi), %edx
cmpl %ecx, %edx
movl %ecx, %ebx
cmovll %edx, %ebx
testl %ebx, %ebx
setle %bpl
jle 0x302d38
movl %edx, 0x5c(%rsp)
movl %ecx, 0x60(%rsp)
movq 0x8(%rax), %r13
movq %rdi, 0x98(%rsp)
movq 0x8(%rdi), %r15
movq (%r13), %r14
movq (%r15), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x308e0
testl %eax, %eax
jne 0x302cbf
movl %ebx, %ebp
movl $0x1, %ebx
cmpq %rbx, %rbp
je 0x302d10
movq (%r13,%rbx,8), %r14
movq (%r15,%rbx,8), %r12
movq %r14, %rdi
movq %r12, %rsi
callq 0x308e0
incq %rbx
testl %eax, %eax
je 0x302c95
decq %rbx
cmpq %rbp, %rbx
setae %bpl
movq 0x18d2fa(%rip), %rax    # 0x48ffc0
movq (%rax), %rdi
movq 0x80(%rsp), %rax
movq (%rax), %r8
leaq 0xbf77c(%rip), %rsi     # 0x3c2457
movq %r14, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x31920
movq 0x40(%rsp), %r14
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r13
movq 0x20(%rsp), %r12
movq 0x88(%rsp), %rbx
jmp 0x302d62
movb $0x1, %bpl
movq %rdi, 0x30(%rsp)
jmp 0x302d62
setbe %bpl
movq 0x40(%rsp), %r14
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r13
movq 0x20(%rsp), %r12
movq 0x98(%rsp), %rdi
movl 0x60(%rsp), %ecx
movl 0x5c(%rsp), %edx
cmpl %ecx, %edx
movq 0x88(%rsp), %rbx
jle 0x302d5d
movq 0x30(%rsp), %rax
movl %edx, (%rax)
movl %ecx, (%rdi)
movups 0x8(%rdi), %xmm0
movups 0x8(%rax), %xmm1
movups %xmm0, 0x8(%rax)
movups %xmm1, 0x8(%rdi)
callq 0x2f1856
testb %bpl, %bpl
je 0x30328f
incq %rbx
cmpq 0xa0(%rsp), %rbx
jne 0x302c00
jmp 0x302da1
movq 0x80(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
movq %r15, %rcx
callq 0xab0c6
xorl %ebp, %ebp
jmp 0x302d62
movq $0x0, 0x30(%rsp)
movq 0xe0(%rsp), %rbx
movq 0x48(%rsp), %rax
testq %rax, %rax
movq 0x30(%rsp), %r12
je 0x302e6c
movl (%rax), %eax
testl %eax, %eax
jle 0x302e34
cmpl %eax, (%r12)
jne 0x3032b0
cmpl $0x0, (%r12)
jle 0x302e34
movq 0x18d1e6(%rip), %rbp    # 0x48ffc0
leaq 0xbf71a(%rip), %r14     # 0x3c24fb
xorl %r13d, %r13d
movq 0x8(%r12), %rax
movq (%rax,%r13,8), %rdi
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rax
movq (%rax,%r13,8), %r15
movq %r15, %rsi
callq 0x308e0
testl %eax, %eax
jne 0x302e14
incq %r13
movslq (%r12), %rax
cmpq %rax, %r13
jl 0x302de4
jmp 0x302e34
movq (%rbp), %rdi
movq %r14, %rsi
movq %r15, %rdx
movq 0x70(%rsp), %rcx
xorl %eax, %eax
callq 0x31920
testq %rbx, %rbx
jne 0x302e06
jmp 0x30328f
movslq 0x30(%r12), %rax
movq 0x48(%rsp), %rdi
movq 0x30(%rdi), %rcx
movq %rcx, 0x30(%r12)
movq %rax, 0x30(%rdi)
movq 0x40(%r12), %rax
movq 0x40(%rdi), %rcx
movq %rcx, 0x40(%r12)
movq %rax, 0x40(%rdi)
callq 0x2f1856
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r13
testq %rbx, %rbx
je 0x302eeb
leaq 0x6c(%rsp), %rdx
leaq 0x68(%rsp), %rcx
leaq 0x64(%rsp), %r8
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2f0f19
movl %eax, %ebp
testl %eax, %eax
js 0x3032a6
cmpl $0x0, 0xc(%rsp)
movq 0x20(%rsp), %rbx
jle 0x302ede
movl 0xc(%rsp), %r15d
xorl %r12d, %r12d
movq (%rbx,%r12,8), %rdi
callq 0x2f7dad
movq %rax, %r14
movl 0x6c(%rsp), %esi
movl 0x68(%rsp), %edx
movl 0x64(%rsp), %ecx
movq %rax, %rdi
callq 0x2f80fd
movq %rax, (%r13,%r12,8)
movq %r14, %rdi
callq 0x2f7532
incq %r12
cmpq %r12, %r15
jne 0x302ea9
testl %ebp, %ebp
movq 0x18(%rsp), %r15
js 0x30328f
movl 0xc(%rsp), %eax
testl %eax, %eax
jle 0x302f90
movl %eax, %r14d
xorl %r13d, %r13d
movq %r15, %rbp
xorl %r12d, %r12d
movl %r13d, (%rbp)
movl $0x1, %edi
movl $0x38, %esi
callq 0x30ed0
movq %rax, %rbx
movq %rax, 0x18(%rbp)
movq 0x40(%rsp), %rax
movq (%rax,%r13,8), %rdi
movq 0x10(%rsp), %rax
movq (%rax,%r13,8), %rsi
movq %rbx, %rdx
callq 0x2f8643
testl %eax, %eax
js 0x302f6d
movl (%rbx), %eax
movl 0x4(%rbx), %ecx
shlq $0x20, %rax
leal 0x2(,%rcx,2), %ecx
orq %rax, %rcx
movq 0x8(%rbx), %rax
shrq $0x24, %rax
andl $0x1, %eax
orq %rcx, %rax
movq %rax, 0x8(%rbp)
movq %r12, %rax
incq %r12
movl $0x10, %ecx
jmp 0x302f79
movq $-0x1, %rax
movl $0x8, %ecx
movq %rax, (%rbp,%rcx)
incq %r13
addq $0x20, %rbp
cmpq %r13, %r14
jne 0x302f03
jmp 0x302f93
xorl %r12d, %r12d
movl 0x2c(%rsp), %ebx
leaq 0xbb4c4(%rip), %rsi     # 0x3be462
testb $0x2, %bl
jne 0x302fcb
movq 0x78(%rsp), %r14
movq %r14, %rdi
callq 0x308e0
testb $0x4, %bl
movl 0xc(%rsp), %ebp
movq 0x10(%rsp), %r13
jne 0x302ff1
testl %eax, %eax
je 0x303034
leaq 0x7ce14(%rip), %rsi     # 0x37fddd
jmp 0x302ffc
movq 0x78(%rsp), %rbx
movq %rbx, %rdi
callq 0x308e0
testl %eax, %eax
movl 0xc(%rsp), %ebp
movq 0x10(%rsp), %r13
je 0x303006
leaq 0xbf5a1(%rip), %rsi     # 0x3c258d
movq %rbx, %rdi
jmp 0x302fff
testl %eax, %eax
je 0x30304c
leaq 0xbf594(%rip), %rsi     # 0x3c2590
movq %r14, %rdi
callq 0x2eee0b
jmp 0x303069
movq 0x18cfe3(%rip), %rax    # 0x48fff0
movq (%rax), %rdi
callq 0x2d230
leaq 0xbf571(%rip), %rsi     # 0x3c258d
jmp 0x303062
movq %r15, %rdi
callq 0xab097
movq $0x0, 0x48(%rsp)
jmp 0x302a4a
movq 0x18cfb5(%rip), %rax    # 0x48fff0
movq (%rax), %rdi
callq 0x2d230
leaq 0x7cd93(%rip), %rsi     # 0x37fddd
jmp 0x303062
movq 0x18cf9d(%rip), %rax    # 0x48fff0
movq (%rax), %rdi
callq 0x2d230
leaq 0xbf52e(%rip), %rsi     # 0x3c2590
movl %eax, %edi
callq 0x2ef17d
movq %rax, %rbx
testq %rax, %rax
je 0x30328a
movq %rbx, %rdi
movq 0x30(%rsp), %r14
movq %r14, %rsi
callq 0x2f1aa1
movq %r14, %rdi
callq 0x2f1856
cmpl $0x2, %ebp
movq 0x90(%rsp), %rbp
jb 0x3030b7
movq %rbp, %r14
shrq %r14
decq %r14
movq %r14, %rdi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x301736
addq $-0x1, %r14
jb 0x3030a3
cmpq $-0x1, 0x8(%r15)
movq 0x38(%rsp), %r14
je 0x3031f8
movq 0x18(%r15), %r13
testb $0x1, 0x2c(%rsp)
je 0x303116
movq %r13, %rdi
leaq 0xbb194(%rip), %rsi     # 0x3be270
callq 0x2f0712
testq %rax, %rax
je 0x3030f1
movq %r13, %rdi
movq %rax, %rsi
callq 0x2f088f
movslq (%r15), %rax
movq 0x50(%rsp), %rcx
movl (%rcx,%rax,4), %ecx
incl %ecx
movq (%r14,%rax,8), %r8
movq %r13, %rdi
leaq 0xbb164(%rip), %rsi     # 0x3be270
movl $0x5a, %edx
callq 0x2f0658
movl 0x24(%r13), %edx
movq 0x30(%r13), %rcx
movq %rbx, %rdi
movq %r13, %rsi
callq 0x2f1fb0
movq %r15, %r14
movslq (%r15), %r15
movq 0x40(%rsp), %rax
movq (%rax,%r15,8), %rdi
movq 0x10(%rsp), %rax
movq (%rax,%r15,8), %rsi
movq %r13, %rdx
callq 0x2f8643
testl %eax, %eax
js 0x303181
movl (%r13), %eax
movl 0x4(%r13), %ecx
shlq $0x20, %rax
leal 0x2(,%rcx,2), %ecx
orq %rax, %rcx
movq 0x8(%r13), %rax
shrq $0x24, %rax
andl $0x1, %eax
orq %rcx, %rax
movq %rax, 0x8(%r14)
movq %r12, 0x10(%r14)
incq %r12
movq %r14, %r15
jmp 0x3031ac
cmpl $-0x1, %eax
jne 0x3031d0
movq 0x18(%rsp), %r15
movq $-0x1, 0x8(%r15)
movq 0x30(%r13), %rdi
callq 0x32018
movq %r13, %rdi
callq 0x32018
movq $0x0, 0x18(%r15)
movq 0x10(%rsp), %r13
movq 0x38(%rsp), %r14
xorl %edi, %edi
movq %rbp, %rsi
movq %r15, %rdx
callq 0x301736
cmpq $-0x1, 0x8(%r15)
jne 0x3030c7
jmp 0x3031f8
movq 0x18cde9(%rip), %rax    # 0x48ffc0
movq (%rax), %rdi
movq 0x20(%rsp), %rax
movq (%rax,%r15,8), %rdx
leaq 0xbf3cf(%rip), %rsi     # 0x3c25b9
xorl %eax, %eax
callq 0x31920
movq 0x18(%rsp), %r15
jmp 0x3031ac
testb $0x1, 0x2c(%rsp)
movl 0xc(%rsp), %eax
movq 0x40(%rsp), %r12
je 0x30323f
testl %eax, %eax
movq %r14, %rbp
je 0x303229
movl 0xc(%rsp), %r14d
xorl %r15d, %r15d
movq (%rbp,%r15,8), %rdi
callq 0x32018
incq %r15
cmpq %r15, %r14
jne 0x303217
movq %rbp, %rdi
callq 0x32018
movq 0x50(%rsp), %rdi
callq 0x32018
movl 0xc(%rsp), %eax
testl %eax, %eax
je 0x303264
movl %eax, %r14d
xorl %r15d, %r15d
movq (%r13,%r15,8), %rdi
callq 0x2f8627
movq (%r12,%r15,8), %rdi
callq 0x2eef2d
incq %r15
cmpq %r15, %r14
jne 0x303249
movq %rbx, %rdi
callq 0x2eef2d
movq %r12, %rdi
callq 0x32018
movq 0x18(%rsp), %rdi
callq 0x32018
movq %r13, %rdi
callq 0x32018
xorl %eax, %eax
jmp 0x303294
callq 0xab14e
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0xa8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0xab129
jmp 0x302ede
movq 0x18cd09(%rip), %rax    # 0x48ffc0
movq (%rax), %rdi
leaq 0xbf1e2(%rip), %rsi     # 0x3c24a3
movq 0x70(%rsp), %rdx
xorl %eax, %eax
callq 0x31920
testq %rbx, %rbx
jne 0x302dcc
jmp 0x30328f