// File: /workspace/github_c_makefile_star2_O0/Joy-Division[P]tools-zoe/mdx-parser.c
// Function: main
int main( int argc, char **argv ) {
	
	if ( argc < 3 ) {
		printf("Not enough args!\nUse: %s MDX-file game\n", argv[0]);
		printf("supported games are:\n%d (MGS1)\n%d (ZoE1 and MGS2HD)\n", mgs1, zoe1);
		return 1;
	}
	
	
	FILE *f, *o;
	char outputname[512] = {0};
	unsigned int game, tracklistsize, numtracks;
	unsigned int cursong, curtrack;
	unsigned int event, param0, param1, param2, note, velocity, length, snap;
	uint32_t numsongs, songoffset, *tracklist;
	uint32_t curtoken;
	game = strtoul(argv[2], NULL, 10);
	if(!(game<NUMWVXGAMES)) {
		printf("Unsupported game %d!\nRun without args to see supported types.\n", game);
		return 1;
	}
	
	
	switch(game) {
		case mgs1: {
			tracklistsize = 0x60;
			tracklist = malloc(0x60);
			break;
		}
		case zoe1: {
			tracklistsize = 0x80;
			tracklist = malloc(0x80);
			break;
		}
	}
	numtracks = tracklistsize / 4;
	
	if( !(f = fopen( argv[1], "rb" ))) {
		printf("Couldnt open file %s\n", argv[1]);
		return 1;
	}
	
	fseek(f, 0, SEEK_SET);
	fread(&numsongs, 4, 1, f);
	printf("Number of songs in MDX: %d\n", numsongs);
	
	for(cursong = 0;cursong < numsongs;cursong++) {
		fseek(f, 4+(4*cursong), SEEK_SET);
		fread(&songoffset, 4, 1, f);
		printf("Song %d - Offset: %08x\n", cursong, songoffset);
		fseek(f, songoffset, SEEK_SET);
		fread(tracklist, tracklistsize, 1, f);
		for(curtrack = 0;curtrack < numtracks;curtrack++) {
			sprintf(outputname, "song%05d-track%05d.bin", cursong, curtrack);
			curtoken = 0;
			if( !(o = fopen( outputname, "wb" ))) {
				printf("Couldnt open file %s\n", outputname);
				return 1;
			}
			printf("Song %d - Track %02d - Offset: %08x\n", cursong, curtrack, tracklist[curtrack]);
			fseek(f, tracklist[curtrack], SEEK_SET);
			
			/* smf stuffs */
			//~ track = smf_track_new();
			
			while(curtoken != 0xFFFE0000) {
				printf("\t");
				fread(&curtoken, 4, 1, f);
				
				event = curtoken >> 24;
				param0 = (curtoken >> 16) & 0xFF;
				param1 = (curtoken >> 8) & 0xFF;
				param2 = curtoken & 0xFF;
				
				if(event < 0x80 ) {
					/* possible midi note */
					note = event;
					snap = param0;
					length = param1;
					velocity = param2;
					printf("Encountered note %x(%s)\n", note, midinotes[note]);
					printf("\tsnap %x - length %x - velocity %x\n", snap, length, velocity);
				}
				else {
					switch(event) {
						case 0xD0: {
							printf("Encountered Tempo event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD1: {
							printf("Encountered Decrease event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD2: {
							printf("Encountered Instrument A event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD3: {
							printf("Encountered Instrument B event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD4: {
							printf("Encountered Instrument C event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD5: {
							printf("Encountered Change Master Volume event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD6: {
							printf("Encountered Fade out event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD7: {
							printf("Encountered Change Channel Volume event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xD8: {
							printf("Encountered Fade out note event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xDD: {
							printf("Encountered Pan event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						/*
						case 0xDE: {
							printf("Encountered Pan1 event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						*/
						
						case 0xDF: {
							printf("Encountered Pitch event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE0: {
							printf("Encountered Pitch note when changed event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE3: {
							printf("Encountered Modulation event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE5: {
							printf("Encountered Swirl up note event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE6: {
							printf("Encountered Pitch bend on change event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE7: {
							printf("Encountered Set Loop Start (MEMORY A) event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xE8: {
							printf("Encountered Set Loop End (MEMORY A) (repeat PARAM0 times) event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xE9: {
							printf("Encountered Set Loop Start (MEMORY B) event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xEA: {
							printf("Encountered Set Loop End (MEMORY B) (repeat PARAM0 times) event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xEB: {
							printf("Encountered Set Loop Start event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xEC: {
							printf("Encountered Set Loop End event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xED: {
							printf("Encountered Set Loop Start (0xED) event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xEE: {
							printf("Encountered Set Loop End (0xEE) (two per 0xED) event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						case 0xF2: {
							printf("Encountered Silence A event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xF3: {
							printf("Encountered Silence B event at %08x, parameters %02x %02x %02x\n", (unsigned int)ftell(f)-4, param0, param1, param2);
							break;
						}
						
						case 0xFF: {
							printf("Encountered End Of Track event at %08x, complete event %08x\n", (unsigned int)ftell(f)-4, curtoken);
							break;
						}
						
						default: {
							printf("Unknown event %x at %08x\n", curtoken, (unsigned int)ftell(f)-4);
							break;
						}
					}
				}
				fwrite(&curtoken, 4, 1, o);
			}
			fclose(o);
		}
	}
	
	printf("Done.\n");
	
	fclose(f);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x3, -0x8(%rbp)
jge 0x2705
movq -0x10(%rbp), %rax
movq (%rax), %rsi
leaq 0x1c0b(%rip), %rdi      # 0x42e8
movb $0x0, %al
callq 0x2060
leaq 0x1c25(%rip), %rdi      # 0x4310
xorl %esi, %esi
movl $0x1, %edx
movb $0x0, %al
callq 0x2060
movl $0x1, -0x4(%rbp)
jmp 0x305d
leaq -0x220(%rbp), %rdi
xorl %esi, %esi
movl $0x200, %edx            # imm = 0x200
callq 0x2070
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
movl $0xa, %edx
callq 0x20c0
movl %eax, -0x224(%rbp)
cmpl $0x2, -0x224(%rbp)
jb 0x275d
movl -0x224(%rbp), %esi
leaq 0x1bfb(%rip), %rdi      # 0x4345
movb $0x0, %al
callq 0x2060
movl $0x1, -0x4(%rbp)
jmp 0x305d
movl -0x224(%rbp), %eax
movl %eax, -0x270(%rbp)
testl %eax, %eax
je 0x277c
jmp 0x276f
movl -0x270(%rbp), %eax
subl $0x1, %eax
je 0x2799
jmp 0x27b4
movl $0x60, -0x228(%rbp)
movl $0x60, %edi
callq 0x2090
movq %rax, -0x268(%rbp)
jmp 0x27b4
movl $0x80, -0x228(%rbp)
movl $0x80, %edi
callq 0x2090
movq %rax, -0x268(%rbp)
movl -0x228(%rbp), %eax
shrl $0x2, %eax
movl %eax, -0x22c(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0x1bb2(%rip), %rsi      # 0x4384
callq 0x20b0
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x2803
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x182d(%rip), %rdi      # 0x401d
movb $0x0, %al
callq 0x2060
movl $0x1, -0x4(%rbp)
jmp 0x305d
movq -0x18(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x20a0
movq -0x18(%rbp), %rcx
leaq -0x258(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2040
movl -0x258(%rbp), %esi
leaq 0x1b4e(%rip), %rdi      # 0x4387
movb $0x0, %al
callq 0x2060
movl $0x0, -0x230(%rbp)
movl -0x230(%rbp), %eax
cmpl -0x258(%rbp), %eax
jae 0x303f
movq -0x18(%rbp), %rdi
movl -0x230(%rbp), %eax
shll $0x2, %eax
addl $0x4, %eax
movl %eax, %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x20a0
movq -0x18(%rbp), %rcx
leaq -0x25c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2040
movl -0x230(%rbp), %esi
movl -0x25c(%rbp), %edx
leaq 0x1aff(%rip), %rdi      # 0x43a3
movb $0x0, %al
callq 0x2060
movq -0x18(%rbp), %rdi
movl -0x25c(%rbp), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x20a0
movq -0x268(%rbp), %rdi
movl -0x228(%rbp), %eax
movl %eax, %esi
movq -0x18(%rbp), %rcx
movl $0x1, %edx
callq 0x2040
movl $0x0, -0x234(%rbp)
movl -0x234(%rbp), %eax
cmpl -0x22c(%rbp), %eax
jae 0x3029
leaq -0x220(%rbp), %rdi
movl -0x230(%rbp), %edx
movl -0x234(%rbp), %ecx
leaq 0x1aaa(%rip), %rsi      # 0x43bb
movb $0x0, %al
callq 0x20d0
movl $0x0, -0x26c(%rbp)
leaq -0x220(%rbp), %rdi
leaq 0x16ea(%rip), %rsi      # 0x401a
callq 0x20b0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x2960
leaq -0x220(%rbp), %rsi
leaq 0x16d0(%rip), %rdi      # 0x401d
movb $0x0, %al
callq 0x2060
movl $0x1, -0x4(%rbp)
jmp 0x305d
movl -0x230(%rbp), %esi
movl -0x234(%rbp), %edx
movq -0x268(%rbp), %rax
movl -0x234(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
leaq 0x1a4f(%rip), %rdi      # 0x43d2
movb $0x0, %al
callq 0x2060
movq -0x18(%rbp), %rdi
movq -0x268(%rbp), %rax
movl -0x234(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, %esi
xorl %edx, %edx
callq 0x20a0
cmpl $0xfffe0000, -0x26c(%rbp) # imm = 0xFFFE0000
je 0x300c
leaq 0x1a39(%rip), %rdi      # 0x43f7
movb $0x0, %al
callq 0x2060
movq -0x18(%rbp), %rcx
leaq -0x26c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x2040
movl -0x26c(%rbp), %eax
shrl $0x18, %eax
movl %eax, -0x238(%rbp)
movl -0x26c(%rbp), %eax
shrl $0x10, %eax
andl $0xff, %eax
movl %eax, -0x23c(%rbp)
movl -0x26c(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, -0x240(%rbp)
movl -0x26c(%rbp), %eax
andl $0xff, %eax
movl %eax, -0x244(%rbp)
cmpl $0x80, -0x238(%rbp)
jae 0x2aaf
movl -0x238(%rbp), %eax
movl %eax, -0x248(%rbp)
movl -0x23c(%rbp), %eax
movl %eax, -0x254(%rbp)
movl -0x240(%rbp), %eax
movl %eax, -0x250(%rbp)
movl -0x244(%rbp), %eax
movl %eax, -0x24c(%rbp)
movl -0x248(%rbp), %esi
movl -0x248(%rbp), %eax
movl %eax, %ecx
leaq 0x3618(%rip), %rax      # 0x6090
movq (%rax,%rcx,8), %rdx
leaq 0x1976(%rip), %rdi      # 0x43f9
movb $0x0, %al
callq 0x2060
movl -0x254(%rbp), %esi
movl -0x250(%rbp), %edx
movl -0x24c(%rbp), %ecx
leaq 0x196f(%rip), %rdi      # 0x4412
movb $0x0, %al
callq 0x2060
jmp 0x2fed
movl -0x238(%rbp), %eax
addl $0xffffff30, %eax       # imm = 0xFFFFFF30
movl %eax, %ecx
movq %rcx, -0x278(%rbp)
subl $0x2f, %eax
ja 0x2fbd
movq -0x278(%rbp), %rax
leaq 0x157e(%rip), %rcx      # 0x4058
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x192b(%rip), %rdi      # 0x4436
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1933(%rip), %rdi      # 0x4472
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x193e(%rip), %rdi      # 0x44b1
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x194d(%rip), %rdi      # 0x44f4
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x195c(%rip), %rdi      # 0x4537
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x196b(%rip), %rdi      # 0x457a
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1982(%rip), %rdi      # 0x45c5
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x198d(%rip), %rdi      # 0x4604
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x19a5(%rip), %rdi      # 0x4650
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x19c2(%rip), %rdi      # 0x4694
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x19c2(%rip), %rdi      # 0x46c8
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x19ca(%rip), %rdi      # 0x4704
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x19e4(%rip), %rdi      # 0x4752
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x19f1(%rip), %rdi      # 0x4793
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1a01(%rip), %rdi      # 0x47d7
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1a25(%rip), %rdi      # 0x4822
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1a3b(%rip), %rdi      # 0x486c
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1a78(%rip), %rdi      # 0x48d0
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1a8e(%rip), %rdi      # 0x491a
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1acb(%rip), %rdi      # 0x497e
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1ae3(%rip), %rdi      # 0x49bd
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1af9(%rip), %rdi      # 0x49fa
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1b18(%rip), %rdi      # 0x4a40
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1b37(%rip), %rdi      # 0x4a93
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x23c(%rbp), %edx
movl -0x240(%rbp), %ecx
movl -0x244(%rbp), %r8d
leaq 0x1b43(%rip), %rdi      # 0x4ad3
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movq -0x18(%rbp), %rdi
callq 0x2080
movl %eax, %esi
subl $0x4, %esi
movl -0x26c(%rbp), %edx
leaq 0x1b5f(%rip), %rdi      # 0x4b13
movb $0x0, %al
callq 0x2060
jmp 0x2feb
movl -0x26c(%rbp), %eax
movl %eax, -0x27c(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2080
movl -0x27c(%rbp), %esi
movl %eax, %edx
subl $0x4, %edx
leaq 0x1b6c(%rip), %rdi      # 0x4b50
movb $0x0, %al
callq 0x2060
jmp 0x2fed
movq -0x20(%rbp), %rcx
leaq -0x26c(%rbp), %rdi
movl $0x4, %esi
movl $0x1, %edx
callq 0x20e0
jmp 0x29a7
movq -0x20(%rbp), %rdi
callq 0x2050
movl -0x234(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x234(%rbp)
jmp 0x28e5
jmp 0x302b
movl -0x230(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x230(%rbp)
jmp 0x284a
leaq 0x1b24(%rip), %rdi      # 0x4b6a
movb $0x0, %al
callq 0x2060
movq -0x18(%rbp), %rdi
callq 0x2050
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq