// File: /workspace/github_c_makefile_star2_O2/lh3[P]minigraph/ggen.c
// Function: ggen_map
static maprst_t *ggen_map(const mg_idx_t *gi, const mg_mapopt_t *opt, const char *fn, int n_threads)
{
	mg_bseq_file_t *fp;
	maprst_t *r;
	step_t s;
	int i;

	fp = mg_bseq_open(fn);
	if (fp == 0) return 0;

	KCALLOC(0, r, 1);
	r->seq = mg_bseq_read(fp, 1ULL<<62, 0, 0, 0, &r->n_seq);
	mg_bseq_close(fp);
	if (mg_verbose >= 3)
		fprintf(stderr, "[M::%s::%.3f*%.2f] loaded file \"%s\"\n", __func__,
				realtime() - mg_realtime0, cputime() / (realtime() - mg_realtime0), fn);
	for (i = 0; i < r->n_seq; ++i) {
		r->seq[i].rid = i;
		mg_toupper(r->seq[i].l_seq, r->seq[i].seq);
	}
	KCALLOC(0, r->gcs, r->n_seq);

	s.gi = gi, s.opt = opt, s.r = r;
	KCALLOC(0, s.buf, n_threads);
	for (i = 0; i < n_threads; ++i) s.buf[i] = mg_tbuf_init();
	kt_for(n_threads, worker_for, &s, r->n_seq);
	if (mg_verbose >= 3)
		fprintf(stderr, "[M::%s::%.3f*%.2f] mapped %d sequence(s) to the graph\n", __func__,
				realtime() - mg_realtime0, cputime() / (realtime() - mg_realtime0), r->n_seq);
	for (i = 0; i < n_threads; ++i) mg_tbuf_destroy(s.buf[i]);
	free(s.buf);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %ecx, %ebp
movq %rdx, %r12
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rdi
callq 0xcd00
testq %rax, %rax
je 0x2077e
movq %rax, %r13
movq %rbx, 0x10(%rsp)
xorl %r14d, %r14d
pushq $0x1
popq %rsi
pushq $0x18
popq %rdx
xorl %edi, %edi
callq 0x24f0
movq %rax, %rbx
movabsq $0x4000000000000000, %rsi # imm = 0x4000000000000000
movq %r13, %rdi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
movq %rax, %r9
callq 0xce0f
movq %rax, 0x8(%rbx)
movq %r13, %rdi
callq 0xcda3
leaq 0xdd85(%rip), %rax      # 0x2e400
cmpl $0x3, (%rax)
jge 0x20792
xorl %eax, %eax
movslq (%rbx), %rsi
cmpq %rsi, %rax
jge 0x206d5
movq 0x8(%rbx), %rdx
imulq $0x28, %rax, %rsi
movl %eax, 0x4(%rdx,%rsi)
movl (%rdx,%rsi), %ecx
movq 0x10(%rdx,%rsi), %rdx
testl %ecx, %ecx
cmovlel %r14d, %ecx
xorl %esi, %esi
cmpq %rsi, %rcx
je 0x206d0
movzbl (%rdx,%rsi), %edi
leal -0x7b(%rdi), %r8d
leal -0x20(%rdi), %r9d
cmpb $-0x1a, %r8b
movzbl %r9b, %r8d
cmovbl %edi, %r8d
movb %r8b, (%rdx,%rsi)
incq %rsi
jmp 0x206aa
incq %rax
jmp 0x20686
xorl %r13d, %r13d
pushq $0x8
popq %r12
xorl %edi, %edi
movq %r12, %rdx
callq 0x24f0
movq %rax, 0x10(%rbx)
movq %r15, 0x30(%rsp)
movq 0x10(%rsp), %rax
movq %rax, 0x28(%rsp)
movq %rbx, 0x40(%rsp)
movslq %ebp, %r15
xorl %edi, %edi
movq %r15, %rsi
movq %r12, %rdx
callq 0x24f0
movq %rax, %r14
movq %rax, 0x38(%rsp)
testl %r15d, %r15d
movl $0x0, %r15d
cmovgl %ebp, %r15d
cmpq %r13, %r15
je 0x20736
callq 0x19570
movq %rax, (%r14,%r13,8)
incq %r13
jmp 0x20723
movslq (%rbx), %rcx
leaq 0x655(%rip), %rsi       # 0x20d95
leaq 0x28(%rsp), %rdx
movl %ebp, %edi
callq 0x2968
leaq 0xdcad(%rip), %rax      # 0x2e400
cmpl $0x3, (%rax)
jge 0x20801
xorl %r14d, %r14d
movq 0x38(%rsp), %rdi
cmpq %r14, %r15
je 0x20777
movq (%rdi,%r14,8), %rdi
callq 0x19598
incq %r14
jmp 0x2075f
callq 0x2040
jmp 0x20780
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0xd85f(%rip), %rax      # 0x2dff8
movq (%rax), %rax
movq %rax, 0x8(%rsp)
callq 0x37fd
leaq 0xded3(%rip), %r13      # 0x2e680
subsd (%r13), %xmm0
movsd %xmm0, 0x20(%rsp)
callq 0x3794
movsd %xmm0, 0x18(%rsp)
callq 0x37fd
subsd (%r13), %xmm0
movsd 0x18(%rsp), %xmm1
divsd %xmm0, %xmm1
leaq 0x4efe(%rip), %rsi      # 0x256de
leaq 0x4f1c(%rip), %rdx      # 0x25703
movq 0x8(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
movq %r12, %rcx
movb $0x2, %al
callq 0x2210
jmp 0x20684
movq 0xd7f0(%rip), %rax      # 0x2dff8
movq (%rax), %r14
callq 0x37fd
leaq 0xde69(%rip), %r12      # 0x2e680
subsd (%r12), %xmm0
movsd %xmm0, 0x10(%rsp)
callq 0x3794
movsd %xmm0, 0x8(%rsp)
callq 0x37fd
subsd (%r12), %xmm0
movsd 0x8(%rsp), %xmm1
divsd %xmm0, %xmm1
movl (%rbx), %ecx
leaq 0x4ec0(%rip), %rsi      # 0x2570c
leaq 0x4eb0(%rip), %rdx      # 0x25703
movq %r14, %rdi
movsd 0x10(%rsp), %xmm0
movb $0x2, %al
callq 0x2210
jmp 0x2075c