// File: /workspace/github_cpp_makefile_star2_O2/MikuAuahDark[P]midi2sif/src/midi2sif.cpp
// Function: midi2sif(_IO_FILE*)
std::vector<SIFBeatmap> midi2sif(FILE* midi_stream)
{
	char temp_buffer[32];

	if(fread(temp_buffer, 1, 4, midi_stream) != 4)
	{
		unexpected_eof:
		throw std::runtime_error("Unexpected EOF");
	}

	if(memcmp(temp_buffer, "MThd", 4))
		throw std::runtime_error("Not MIDI");

	if(fread(temp_buffer, 1, 4, midi_stream) != 4)
		goto unexpected_eof;

	if((STR2DWORD_BE(temp_buffer)) != 6)
		throw std::runtime_error("Header size not 6");

	uint32_t mtrk_count;
	uint32_t ppqn;
	double tempo = 120.0;
	std::map<uint32_t, std::vector<EventInformation> > raw_event_list;

	if(fread(temp_buffer, 1, 6, midi_stream) != 6)
		goto unexpected_eof;

	mtrk_count = STR2WORD_BE(temp_buffer + 2);
	ppqn = STR2WORD_BE(temp_buffer + 4);

	if(ppqn > 32767)
		throw std::runtime_error("MTC is not supported");

	for(uint32_t i = 0; i < mtrk_count; i++)
	{
		if(fread(temp_buffer, 1, 8, midi_stream) != 8)
			goto unexpected_eof;

		size_t mtrk_len = STR2DWORD_BE(temp_buffer + 4);
		uint32_t timing_total = 0;

		if(memcmp(temp_buffer, "MTrk", 4))
		{
			while(mtrk_len > 0)
			{
				size_t res = fread(temp_buffer, 1, std::min(mtrk_len, size_t(32)), midi_stream);

				if(res == 0)
					goto unexpected_eof;

				mtrk_len -= res;
			}

			continue;
		}

		while(mtrk_len > 0)
		{
			uint32_t timing = ReadVarInt(midi_stream, &mtrk_len);
			int32_t event_byte = fgetc(midi_stream);
			int32_t event_type = event_byte >> 4;

			if(event_byte == EOF)
				goto unexpected_eof;

			mtrk_len--;
			timing_total += timing;

			if(event_type == 8)
			{
				int32_t notepos = fgetc(midi_stream);

				if(notepos == EOF || fgetc(midi_stream) == EOF)
					goto unexpected_eof;

				mtrk_len -= 2;

				EventInformation temp(timing_total, false, notepos, event_byte & 0xF);
				InsertEvent(raw_event_list, temp);
			}
			else if(event_type == 9)
			{
				int32_t notepos = fgetc(midi_stream);

				if(notepos == EOF || fgetc(midi_stream) == EOF)
					goto unexpected_eof;
				
				mtrk_len -= 2;

				EventInformation temp(timing_total, true, notepos, event_byte & 0xF);
				InsertEvent(raw_event_list, temp);
			}
			else if(event_byte == 255)
			{
				int32_t meta_id = fgetc(midi_stream);

				if(meta_id == EOF)
					goto unexpected_eof;

				mtrk_len--;

				size_t data_size = ReadVarInt(midi_stream, &mtrk_len);
				char* data = new char[data_size];

				if(fread(data, 1, data_size, midi_stream) != data_size)
				{
					delete[] data;
					goto unexpected_eof;
				}

				mtrk_len -= data_size;

				EventInformation temp(timing_total, meta_id, std::string(data, data_size));
				InsertEvent(raw_event_list, temp);

				delete[] data;
			}
			else if(event_byte == 240 || event_byte == 247)
			{
				int32_t temp;

				do
				{
					temp = fgetc(midi_stream);

					if(temp == EOF)
						goto unexpected_eof;

					mtrk_len--;
				}
				while(temp != 247);
			}
			else if(fread(temp_buffer, 1, 2, midi_stream) != 2)
				goto unexpected_eof;
			else
				mtrk_len -= 2;
		}
	}

	size_t lowest_tick = 0xFFFFFFFFU;
	size_t highest_tick = 0;

	std::vector<EventInformation> event_list;

	for(std::map<uint32_t, std::vector<EventInformation> >::iterator i = raw_event_list.begin(); i != raw_event_list.end(); i++)
	{
		size_t tick = i->first;
		std::vector<EventInformation>& eis = i->second;

		lowest_tick = std::min(tick, lowest_tick);
		highest_tick = std::max(tick, highest_tick);

		while(eis.size() > 0)
		{
			event_list.push_back(eis.back());
			eis.pop_back();
		}
	}

	std::sort(event_list.begin(), event_list.end());

	int32_t top_index = 0;
	int32_t bottom_index = 127;

	for(std::vector<EventInformation>::iterator i = event_list.begin(); i != event_list.end(); i++)
	{
		EventInformation& x = *i;

		if(x.pos != (-1))
		{
			top_index = std::max(top_index, x.pos);
			bottom_index = std::min(bottom_index, x.pos);
		}
	}

	int32_t mid_index = top_index - bottom_index + 1;

	if(mid_index > 9 || mid_index % 2 == 0)
		throw std::runtime_error("Failed to analyze note position. Make sure you only use 9 note keys or odd amount of note keys");

	if(mid_index != 9 && mid_index % 2 == 1)
	{
		mid_index = (top_index + bottom_index) / 2;
		top_index = mid_index + 4;
		bottom_index = mid_index - 4;
	}

	std::vector<SIFBeatmap> sif_beatmap;
	std::map<SIFBeatmap::NotePos, TemporaryLNQueue> longnote_queue;
	double current_timing_sec = 0.0;
	double add_timing_sec = 60.0 / ppqn / tempo;

	for(size_t tick = lowest_tick; tick <= highest_tick; tick++)
	{
		EventInformation ei = *event_list.begin();

		while(tick >= ei.tick)
		{
			event_list.erase(event_list.begin());

			if(ei.meta == 81)
			{
				tempo = 0.0;

				for(std::string::iterator i = ei.data.begin(); i != ei.data.end(); i++)
					tempo = tempo * 256.0 + uint8_t(*i);

				tempo = floor(600000000 / tempo) / 10;
				add_timing_sec = 60.0 / ppqn / tempo;
			}
			else if(ei.pos != (-1))
			{
				SIFBeatmap::NotePos position = SIFBeatmap::NotePos(ei.pos - bottom_index + 1);
				SIFBeatmap::Attribute attri = SIFBeatmap::Attribute(ei.channel >> 2);
				SIFBeatmap::EffectType effect = SIFBeatmap::EffectType((ei.channel & 0x3) + 1);

				if(attri > 0)
				{
					if(ei.note_on)
					{
						if(effect == SIFBeatmap::LONG_NOTE)
						{
							if(longnote_queue.count(position))
							{
								char temp[32];

								sprintf(temp, "another note in pos %d is in queue", int(position));
								throw std::runtime_error(temp);
							}
							else
								longnote_queue[position] = TemporaryLNQueue(current_timing_sec, attri, position);
						}
						else
						{
							SIFBeatmap beatmap = {current_timing_sec, attri, effect, 2.0, position};
							sif_beatmap.push_back(beatmap);
						}
					}
					else if(ei.note_on == false && effect == SIFBeatmap::LONG_NOTE)
					{
						if(longnote_queue.count(position))
						{
							TemporaryLNQueue queue = longnote_queue[position];
							longnote_queue.erase(longnote_queue.find(position));

							SIFBeatmap beatmap = {queue.timing_sec, attri, SIFBeatmap::LONG_NOTE, current_timing_sec - queue.timing_sec, position};
							sif_beatmap.push_back(beatmap);
						}
						else
						{
							char temp[32];

							sprintf(temp, "queue for pos %d is empty", int(position));
							throw std::runtime_error(temp);
						}
					}
				}
			}

			if(event_list.size() > 0)
				ei = *event_list.begin();
			else
				ei.tick = 0xFFFFFFFFU;
		}

		current_timing_sec += add_timing_sec;
	}

	std::sort(sif_beatmap.begin(), sif_beatmap.end());

	return sif_beatmap;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %r14, %rcx
callq 0x2230
cmpq $0x4, %rax
jne 0x2d73
cmpl $0x6468544d, 0x60(%rsp) # imm = 0x6468544D
jne 0x2dd5
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x4
popq %rdx
movq %r14, %rcx
callq 0x2230
cmpq $0x4, %rax
jne 0x2d73
movl 0x60(%rsp), %eax
bswapl %eax
cmpl $0x6, %eax
jne 0x2df1
leaq 0x110(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x6
popq %rdx
movq %r14, %rcx
callq 0x2230
cmpq $0x6, %rax
jne 0x2d66
movl 0x64(%rsp), %ecx
shll $0x8, %ecx
testw %cx, %cx
js 0x2e0d
leaq 0x60(%rsp), %rdx
movzbl 0x5(%rdx), %eax
orl %eax, %ecx
movl %ecx, 0x10(%rsp)
movzwl 0x2(%rdx), %eax
rolw $0x8, %ax
movzwl %ax, %eax
movl %eax, 0x38(%rsp)
xorl %ebx, %ebx
cmpl 0x38(%rsp), %ebx
je 0x2897
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x8
popq %rdx
movq %r14, %rcx
callq 0x2230
cmpq $0x8, %rax
jne 0x2d66
movl 0x60(%rsp), %eax
movl 0x64(%rsp), %edx
bswapl %edx
movq %rdx, 0x80(%rsp)
cmpl $0x6b72544d, %eax       # imm = 0x6B72544D
movl %ebx, %r15d
jne 0x284f
xorl %r13d, %r13d
testq %rdx, %rdx
je 0x2890
movq %r14, %rdi
leaq 0x80(%rsp), %rsi
callq 0x23cc
movl %eax, %ebp
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
movl %eax, %ebx
decq 0x80(%rsp)
sarl $0x4, %eax
addl %ebp, %r13d
cmpl $0x9, %eax
je 0x26a6
cmpl $0x8, %eax
jne 0x271e
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
movl %eax, %ebp
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
addq $-0x2, 0x80(%rsp)
andl $0xf, %ebx
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
xorl %edx, %edx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x3328
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
callq 0x2447
jmp 0x2701
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
movl %eax, %ebp
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
addq $-0x2, 0x80(%rsp)
andl $0xf, %ebx
leaq 0xb0(%rsp), %r12
movq %r12, %rdi
movl %r13d, %esi
pushq $0x1
popq %rdx
movl %ebp, %ecx
movl %ebx, %r8d
callq 0x3328
leaq 0x108(%rsp), %rdi
movq %r12, %rsi
callq 0x2447
leaq 0xc0(%rsp), %rdi
callq 0x20b0
movq 0x80(%rsp), %rdx
movl %r15d, %ebx
jmp 0x2600
cmpl $0xf0, %ebx
je 0x273a
cmpl $0xff, %ebx
je 0x275c
cmpl $0xf7, %ebx
jne 0x2824
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
decq 0x80(%rsp)
cmpl $0xf7, %eax
jne 0x273a
jmp 0x270e
movq %r14, %rdi
callq 0x2240
cmpl $-0x1, %eax
je 0x2d66
movl %eax, %r12d
decq 0x80(%rsp)
movq %r14, %rdi
leaq 0x80(%rsp), %rsi
callq 0x23cc
movl %eax, %ebp
movq %rbp, %rdi
callq 0x2030
movq %rax, %rbx
movl %r12d, 0x18(%rsp)
movq %rax, %rdi
pushq $0x1
popq %rsi
movq %rbp, %rdx
movq %r14, %rcx
callq 0x2230
cmpq %rbp, %rax
jne 0x2d5e
subq %rbp, 0x80(%rsp)
leaq 0x148(%rsp), %rax
movq %rax, 0x138(%rsp)
movq %rbx, %rdx
addq %rbp, %rdx
leaq 0x138(%rsp), %r12
movq %r12, %rdi
movq %rbx, %rsi
callq 0x35a6
leaq 0xb0(%rsp), %rbp
movq %rbp, %rdi
movl %r13d, %esi
movl 0x18(%rsp), %edx
movq %r12, %rcx
callq 0x3386
movq %r12, %rdi
callq 0x20b0
leaq 0x108(%rsp), %rdi
movq %rbp, %rsi
callq 0x2447
movq %rbx, %rdi
callq 0x21e0
jmp 0x2701
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x2
popq %rdx
movq %r14, %rcx
callq 0x2230
cmpq $0x2, %rax
jne 0x2d66
addq $-0x2, 0x80(%rsp)
jmp 0x270e
testq %rdx, %rdx
je 0x2890
cmpq $0x20, %rdx
pushq $0x20
popq %rax
cmovaeq %rax, %rdx
leaq 0x60(%rsp), %rdi
pushq $0x1
popq %rsi
movq %r14, %rcx
callq 0x2230
testq %rax, %rax
je 0x2d66
movq 0x80(%rsp), %rdx
subq %rax, %rdx
movq %rdx, 0x80(%rsp)
movl %r15d, %ebx
jmp 0x284f
incl %ebx
jmp 0x25b6
xorpd %xmm0, %xmm0
leaq 0x20(%rsp), %rbx
andq $0x0, 0x10(%rbx)
movapd %xmm0, (%rbx)
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
movq 0x120(%rsp), %r14
xorl %r12d, %r12d
leaq 0x110(%rsp), %rax
cmpq %rax, %r14
je 0x290a
movl 0x20(%r14), %eax
leaq 0x28(%r14), %r15
cmpq %rax, %r13
cmovaeq %rax, %r13
cmpq %rax, %r12
cmovbeq %rax, %r12
movq 0x30(%r14), %rsi
cmpq 0x28(%r14), %rsi
je 0x28fd
addq $-0x40, %rsi
movq %rbx, %rdi
callq 0x3210
movq %r15, %rdi
callq 0x33d8
jmp 0x28dd
movq %r14, %rdi
callq 0x2100
movq %rax, %r14
jmp 0x28ba
movq %r12, 0xf0(%rsp)
movq 0x20(%rsp), %rdi
movq 0x28(%rsp), %rsi
callq 0x3e17
movq 0x20(%rsp), %rax
movq 0x28(%rsp), %rdx
xorl %ecx, %ecx
pushq $0x7f
popq %rbp
movl 0x10(%rsp), %r9d
cmpq %rdx, %rax
je 0x295d
movl 0x30(%rax), %esi
cmpl %esi, %ecx
movl %esi, %edi
cmovgl %ecx, %edi
cmpl %ebp, %esi
movl %ebp, %r8d
cmovll %esi, %r8d
cmpl $-0x1, %esi
cmovnel %r8d, %ebp
cmovnel %edi, %ecx
addq $0x40, %rax
jmp 0x2935
movl %ecx, %esi
subl %ebp, %esi
cmpl $0x8, %esi
jg 0x2da3
incl %esi
pushq $0x2
popq %rdi
movl %esi, %eax
cltd
idivl %edi
testl %edx, %edx
je 0x2da3
cmpl $0x9, %esi
sete %al
cmpl $0x1, %edx
setne %dl
orb %al, %dl
jne 0x2998
addl %ebp, %ecx
movl %ecx, %eax
cltd
idivl %edi
movl %eax, %ebp
addl $-0x4, %ebp
movq 0x8(%rsp), %rax
xorpd %xmm0, %xmm0
andq $0x0, 0x10(%rax)
leaq 0x88(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
movzwl %r9w, %eax
cvtsi2sd %eax, %xmm1
movq 0x8(%rsp), %rax
movsd 0x3630(%rip), %xmm2     # 0x6008
divsd %xmm1, %xmm2
movsd %xmm2, 0x38(%rsp)
divsd 0x3626(%rip), %xmm2     # 0x6010
movsd %xmm2, 0x18(%rsp)
movupd %xmm0, (%rax)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xb0(%rsp), %rbx
leaq 0x20(%rsp), %r15
leaq 0x80(%rsp), %r12
cmpq 0xf0(%rsp), %r13
ja 0x2c80
movq 0x20(%rsp), %rsi
movq %rbx, %rdi
callq 0x33f0
movq %r13, 0xf8(%rsp)
movl 0xb0(%rsp), %eax
cmpq %rax, %r13
jb 0x2c54
movq 0x20(%rsp), %rsi
movq %r15, %rdi
callq 0x342a
cmpl $0x51, 0xb8(%rsp)
jne 0x2a95
movq 0xc0(%rsp), %rax
movq 0xc8(%rsp), %rcx
xorpd %xmm1, %xmm1
xorl %edx, %edx
cmpq %rdx, %rcx
je 0x2b34
movzbl (%rax,%rdx), %esi
cvtsi2sd %esi, %xmm0
mulsd 0x358c(%rip), %xmm1     # 0x6018
addsd %xmm0, %xmm1
incq %rdx
jmp 0x2a73
movl 0xe0(%rsp), %eax
cmpl $-0x1, %eax
je 0x2b5d
subl %ebp, %eax
incl %eax
movl %eax, 0x4(%rsp)
movl 0xe4(%rsp), %ecx
movl %ecx, %r14d
sarl $0x2, %r14d
testl %r14d, %r14d
jle 0x2b5d
andl $0x3, %ecx
incl %ecx
cmpb $0x1, 0xe8(%rsp)
jne 0x2b83
cmpl $0x3, %ecx
jne 0x2c18
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3430
testq %rax, %rax
jne 0x2d13
movq %r15, %r13
movl %ebp, %r15d
movq %rbx, %rbp
movl 0x4(%rsp), %ebx
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x344a
movsd 0x10(%rsp), %xmm0
movsd %xmm0, (%rax)
movl %r14d, 0x8(%rax)
movl %ebx, 0xc(%rax)
movq %rbp, %rbx
movl %r15d, %ebp
movq %r13, %r15
movq 0xf8(%rsp), %r13
jmp 0x2b5d
movsd 0x34e4(%rip), %xmm0     # 0x6020
divsd %xmm1, %xmm0
callq 0x2270
divsd 0x34db(%rip), %xmm0     # 0x6028
movsd 0x38(%rsp), %xmm1
divsd %xmm0, %xmm1
movsd %xmm1, 0x18(%rsp)
movq 0x20(%rsp), %rsi
cmpq %rsi, 0x28(%rsp)
je 0x2b76
movq %rbx, %rdi
callq 0x34be
jmp 0x2a36
orl $-0x1, 0xb0(%rsp)
jmp 0x2a36
cmpl $0x3, %ecx
jne 0x2b5d
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x3430
testq %rax, %rax
je 0x2cc8
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x344a
movsd (%rax), %xmm0
movsd %xmm0, 0x100(%rsp)
movq %r12, %rdi
leaq 0x4(%rsp), %rsi
callq 0x4a80
movq %r12, %rdi
movq %rax, %rsi
callq 0x4ab4
movsd 0x100(%rsp), %xmm1
movsd %xmm1, 0x40(%rsp)
movl %r14d, 0x48(%rsp)
movl $0x3, 0x4c(%rsp)
movsd 0x10(%rsp), %xmm0
subsd %xmm1, %xmm0
movsd %xmm0, 0x50(%rsp)
movl 0x4(%rsp), %eax
movl %eax, 0x58(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3498
jmp 0x2b5d
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x40(%rsp)
movl %r14d, 0x48(%rsp)
movl %ecx, 0x4c(%rsp)
movabsq $0x4000000000000000, %rcx # imm = 0x4000000000000000
movq %rcx, 0x50(%rsp)
movl %eax, 0x58(%rsp)
movq 0x8(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0x3498
jmp 0x2b5d
movsd 0x10(%rsp), %xmm0
addsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x20b0
incq %r13
movq 0x8(%rsp), %rax
jmp 0x2a13
movq (%rax), %rdi
movq 0x8(%rax), %rsi
movq %rax, %rbx
callq 0x4b02
leaq 0x80(%rsp), %rdi
callq 0x363c
leaq 0x20(%rsp), %rdi
callq 0x3306
leaq 0x108(%rsp), %rdi
callq 0x3694
movq %rbx, %rax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%rsp), %edx
leaq 0x3426(%rip), %rsi      # 0x60f9
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2080
movq 0x72f9(%rip), %rsi      # 0x9ff8
movq 0x72ca(%rip), %rdx      # 0x9fd0
movq %r14, %rdi
callq 0x2280
jmp 0x2e3d
movl 0x4(%rsp), %edx
leaq 0x33b8(%rip), %rsi      # 0x60d6
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2050
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2080
movq 0x72ae(%rip), %rsi      # 0x9ff8
movq 0x727f(%rip), %rdx      # 0x9fd0
movq %r14, %rdi
callq 0x2280
jmp 0x2e3d
movq %rbx, %rdi
callq 0x21e0
leaq 0x108(%rsp), %rdi
callq 0x3694
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x32b3(%rip), %rsi      # 0x6038
movq %rax, %rdi
callq 0x2080
movq 0x7264(%rip), %rsi      # 0x9ff8
movq 0x7235(%rip), %rdx      # 0x9fd0
movq %r14, %rdi
callq 0x2280
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x32c2(%rip), %rsi      # 0x6077
movq %rax, %rdi
callq 0x2080
movq 0x7234(%rip), %rsi      # 0x9ff8
movq 0x7205(%rip), %rdx      # 0x9fd0
movq %r14, %rdi
callq 0x2280
jmp 0x2e3d
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x3260(%rip), %rsi      # 0x6047
movq %rax, %rdi
callq 0x2080
jmp 0x2d8d
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x324d(%rip), %rsi      # 0x6050
movq %rax, %rdi
callq 0x2080
jmp 0x2d8d
pushq $0x10
popq %rdi
callq 0x20c0
movq %rax, %r14
leaq 0x3243(%rip), %rsi      # 0x6062
movq %rax, %rdi
callq 0x2080
movq 0x71ca(%rip), %rsi      # 0x9ff8
movq 0x719b(%rip), %rdx      # 0x9fd0
movq %r14, %rdi
callq 0x2280
jmp 0x2ec4
movq %rax, %rbx
movq %r14, %rdi
callq 0x2120
jmp 0x2f01
jmp 0x2f10
jmp 0x2f10
jmp 0x2e88
jmp 0x2ef4
movq %rax, %rbx
movq %r14, %rdi
callq 0x2120
jmp 0x2ef7
jmp 0x2ef4
jmp 0x2ecb
jmp 0x2e7b
jmp 0x2ecb
movq %rax, %rbx
movq %r14, %rdi
callq 0x2120
jmp 0x2ece
movq %rax, %rbx
jmp 0x2edb
jmp 0x2ec4
jmp 0x2eb0
movq %rax, %rbx
leaq 0x138(%rsp), %rdi
jmp 0x2ebb
jmp 0x2ec4
jmp 0x2ec4
jmp 0x2ecb
jmp 0x2ecb
jmp 0x2ecb
jmp 0x2ecb
jmp 0x2ecb
jmp 0x2eb0
jmp 0x2ec4
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20b0
jmp 0x2f01
jmp 0x2ec4
movq %rax, %rbx
jmp 0x2f01
jmp 0x2ecb
movq %rax, %rbx
leaq 0xc0(%rsp), %rdi
callq 0x20b0
leaq 0x80(%rsp), %rdi
callq 0x363c
movq 0x8(%rsp), %rdi
callq 0x45c0
jmp 0x2ef7
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0x3306
leaq 0x108(%rsp), %rdi
callq 0x3694
jmp 0x2f1b
movq %rax, %rbx
movq %r14, %rdi
callq 0x2120
movq %rbx, %rdi
callq 0x2290