// File: /workspace/github_c_makefile_star2_O3/joncampbell123[P]swfhax/c4_swfdump.c
// Function: main
int main(int argc,char **argv) {
	swf_reader *swf;
	swf_tag tag;
	int fd;

	if (argc < 2) {
		fprintf(stderr,"c4_swfdump <file>\n");
		return 1;
	}

	fd = open(argv[1],O_RDONLY);
	if (fd < 0) {
		fprintf(stderr,"Unable to open file %s\n",argv[1]);
		return 1;
	}
	if ((swf=swf_reader_create()) == NULL) {
		fprintf(stderr,"Cannot create SWF reader\n");
		return 1;
	}
	if (swf_reader_assign_fd(swf,fd)) {
		fprintf(stderr,"Cannot assign fd\n");
		return 1;
	}
	swf_reader_assign_fd_ownership(swf);
	if (swf_reader_get_file_header(swf)) {
		fprintf(stderr,"Unable to read file header.\n");
		return 1;
	}

	printf("SWF version %u (%c%c%c), file length %lu\n",
		swf->header.Version,
		swf->header.Signature[0],
		swf->header.Signature[1],
		swf->header.Signature[2],
		(unsigned long)swf->header.FileLength);
	printf("   FrameSize: Nbits=%u (%.3f,%.3f)-(%.3f,%.3f) or in twips (%u,%u)-(%u,%u)\n",
		swf->header.FrameSize.Nbits,
		(double)swf->header.FrameSize.Xmin / SWF_TWIPS_PER_PIXEL,
		(double)swf->header.FrameSize.Ymin / SWF_TWIPS_PER_PIXEL,
		(double)swf->header.FrameSize.Xmax / SWF_TWIPS_PER_PIXEL,
		(double)swf->header.FrameSize.Ymax / SWF_TWIPS_PER_PIXEL,
		swf->header.FrameSize.Xmin,
		swf->header.FrameSize.Ymin,
		swf->header.FrameSize.Xmax,
		swf->header.FrameSize.Ymax);
	printf("   Frame rate: %.3f    Frame count: %lu\n",
		(double)swf->header.FrameRate / 256,
		(unsigned long)swf->header.FrameCount);
	printf("   Header ends at offset %llu\n",
		(unsigned long long)swf->header_end);

	while (swf_reader_read_record(swf,&tag)) {
		printf("Tag %u (%s), length %lu at %llu (data %llu)\n",(unsigned int)tag.record.TagCode,
			swf_TagCode_to_str(tag.record.TagCode),
			(unsigned long)tag.record.Length,
			(unsigned long long)tag.absolute_tag_offset,
			(unsigned long long)tag.absolute_offset);

		/* set read stop, so we can read the bitfields */
		swf->read_stop = swf->next_tag;

		switch (tag.record.TagCode) {
			case swftag_SetBackgroundColor: {
				swf_RGB BackgroundColor;

				swf_reader_read_RGB(swf,&BackgroundColor);
				printf("    BackgroundColor:      ");
				dump_RGB(&BackgroundColor);
				printf("\n");
				dump_tag_raw_remainder(swf);
				} break;
			case swftag_DefineShape:
			case swftag_DefineShape2:
			case swftag_DefineShape3: {
				swf_DefineShape nfo;

				if (swf_reader_read_DefineShape_header(swf,&nfo) == 0) {
					printf("    ShapeId:              %u\n",nfo.ShapeId);
					printf("    ShapeBounds:          (%.3f,%.3f)-(%.3f,%.3f) or (%d,%d)-(%d,%d) twips\n",
						(double)nfo.ShapeBounds.Xmin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Ymin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Xmax / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Ymax / SWF_TWIPS_PER_PIXEL,

						nfo.ShapeBounds.Xmin,
						nfo.ShapeBounds.Ymin,
						nfo.ShapeBounds.Xmax,
						nfo.ShapeBounds.Ymax);

					/* SHAPEWITHSTYLE follows, which means we read a FILLSTYLEARRAY followed by
					 * a LINESTYLEARRAY, followed by a normal SHAPE definition */
					if (dump_FILLSTYLEARRAY(swf,tag.record.TagCode) == 0) {
						if (dump_LINESTYLEARRAY(swf,tag.record.TagCode) == 0) {
							dump_SHAPE(swf,0,tag.record.TagCode);
						}
					}
				}

				dump_tag_raw_remainder(swf);
				} break;
			case swftag_PlaceObject: {
				swf_PlaceObject nfo;

				if (swf_reader_read_PlaceObject(swf,&nfo) == 0) {
					printf("    CharacterId:          %u\n",nfo.CharacterId);
					printf("    Depth:                %u\n",nfo.Depth);
					printf("    Matrix:               ");
					dump_MATRIX(&nfo.Matrix);
					printf("\n");
					/* TODO: CXFORM */
				}
				} break;
			case swftag_RemoveObject: {
				swf_RemoveObject nfo;

				if (swf_reader_read_RemoveObject(swf,&nfo) == 0) {
					printf("    CharacterId:          %u\n",nfo.CharacterId);
					printf("    Depth:                %u\n",nfo.Depth);
				}
				} break;
			case swftag_DefineShape4: {
				swf_DefineShape nfo;

				if (swf_reader_read_DefineShape4_header(swf,&nfo) == 0) {
					printf("    ShapeId:              %u\n",nfo.ShapeId);
					printf("    ShapeBounds:          (%.3f,%.3f)-(%.3f,%.3f) or (%d,%d)-(%d,%d) twips\n",
						(double)nfo.ShapeBounds.Xmin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Ymin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Xmax / SWF_TWIPS_PER_PIXEL,
						(double)nfo.ShapeBounds.Ymax / SWF_TWIPS_PER_PIXEL,

						nfo.ShapeBounds.Xmin,
						nfo.ShapeBounds.Ymin,
						nfo.ShapeBounds.Xmax,
						nfo.ShapeBounds.Ymax);
					printf("    EdgeBounds:           (%.3f,%.3f)-(%.3f,%.3f) or (%d,%d)-(%d,%d) twips\n",
						(double)nfo.EdgeBounds.Xmin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.EdgeBounds.Ymin / SWF_TWIPS_PER_PIXEL,
						(double)nfo.EdgeBounds.Xmax / SWF_TWIPS_PER_PIXEL,
						(double)nfo.EdgeBounds.Ymax / SWF_TWIPS_PER_PIXEL,

						nfo.EdgeBounds.Xmin,
						nfo.EdgeBounds.Ymin,
						nfo.EdgeBounds.Xmax,
						nfo.EdgeBounds.Ymax);
					printf("    UsesFillWindingRule:  %u\n",
						nfo.UsesFillWindingRule);
					printf("    UsesNonScalingStrokes:%u\n",
						nfo.UsesNonScalingStrokes);
					printf("    UsesScalingStrokes:   %u\n",
						nfo.UsesScalingStrokes);

					/* SHAPEWITHSTYLE follows, which means we read a FILLSTYLEARRAY followed by
					 * a LINESTYLEARRAY, followed by a normal SHAPE definition */
					if (dump_FILLSTYLEARRAY(swf,tag.record.TagCode) == 0) {
						if (dump_LINESTYLEARRAY(swf,tag.record.TagCode) == 0) {
							dump_SHAPE(swf,0,tag.record.TagCode);
						}
					}
				}

				dump_tag_raw_remainder(swf);
				} break;
			case swftag_DefineSound: {
				swf_DefineSound nfo;

				if (swf_reader_read_DefineSound(swf,&nfo) == 0) {
					printf("    SoundId:              %u\n",nfo.SoundId);
					printf("    SoundFormat:          %u (%s)\n",nfo.SoundFormat,nfo.SoundFormat_str);
					printf("    SoundRate:            %u (%uHz)\n",nfo.SoundRate,nfo.SoundRate_value);
					printf("    SoundSize:            %u (%u bits)\n",nfo.SoundSize,nfo.SoundSize_value);
					printf("    SoundType:            %u (%u channels)\n",nfo.SoundType,nfo.SoundType_value);
					printf("    SoundSampleCount:     %u\n",nfo.SoundSampleCount);

					if (nfo.SoundFormat == 2/*MP3*/) {
						swf_UI16 t16;

						t16 = swf_reader_read_UI16(swf);
						printf("    SampleCount [MP3]:    %u\n",t16);
					}
				}

				dump_tag_raw_remainder(swf);
				} break;
			case swftag_DefineFont: {
				swf_DefineFont nfo;

				swf_DefineFont_init(&nfo);
				if (swf_reader_read_DefineFont_step1(swf,&nfo) == 0) {
					printf("    FontID:               %u\n",nfo.FontID);
					printf("    nGlyphs:              %u\n",nfo.nGlyphs);
				}
				if (nfo.nGlyphs != 0 && swf_reader_read_DefineFont_alloc_OffsetTable(&nfo) == 0 &&
					swf_reader_read_DefineFont_read_OffsetTable(swf,&nfo) == 0) {
					unsigned int i;
					uint64_t ofs;

					printf("    OffsetTable:\n");
					for (i=0;i < nfo.nGlyphs;i++) {
						ofs = (unsigned long long)nfo.absoluteOffsetTable + (unsigned long long)nfo.OffsetTable[i];
						printf("        %u from start of OffsetTable (%u into GlyphShapeTable or %llu)\n",
							(unsigned int)nfo.OffsetTable[i],
							(unsigned int)(nfo.OffsetTable[i] - nfo._OffsetTableEntry0),
							(unsigned long long)ofs);
					}

					for (i=0;i < nfo.nGlyphs;i++) {
						ofs = (unsigned long long)nfo.absoluteOffsetTable + (unsigned long long)nfo.OffsetTable[i];
						if (swf_reader_seek(swf,ofs) == 0)
							dump_SHAPE(swf,i,tag.record.TagCode);
						else
							fprintf(stderr,"!! Unable to seek to offset (likely reason: non-sequential offsets)\n");
					}
				}

				swf_DefineFont_free(&nfo);
				dump_tag_raw_remainder(swf);
				} break;
			case swftag_SoundStreamHead:
			case swftag_SoundStreamHead2: {
				swf_SoundStreamHead nfo;

				if (swf_reader_read_SoundStreamHead(swf,&nfo) == 0) {
					printf("    PlaybackSoundRate:    %u (%uHz)\n",nfo.PlaybackSoundRate,nfo.PlaybackSoundRate_value);
					printf("    PlaybackSoundSize:    %u (%u bits)\n",nfo.PlaybackSoundSize,nfo.PlaybackSoundSize_value);
					printf("    PlaybackSoundType:    %u (%u channels)\n",nfo.PlaybackSoundType,nfo.PlaybackSoundType_value);
					printf("    StreamSoundCompression: %u (%s)\n",nfo.StreamSoundCompression,nfo.StreamSoundCompression_str);
					printf("    StreamSoundRate:      %u (%uHz)\n",nfo.StreamSoundRate,nfo.StreamSoundRate_value);
					printf("    StreamSoundSize:      %u (%u bits)\n",nfo.StreamSoundSize,nfo.StreamSoundSize_value);
					printf("    StreamSoundType:      %u (%u channels)\n",nfo.StreamSoundType,nfo.StreamSoundType_value);
					printf("    StreamSoundSampleCount: %u\n",nfo.StreamSoundSampleCount);
					if (nfo.LatencySeek_present)
						printf("    LatencySeek:          %u\n",nfo.LatencySeek);
				}

				dump_tag_raw_remainder(swf);
				} break;
			case swftag_FileAttributes: {
				swf_FileAttributes nfo;

				if (swf_reader_read_FileAttributes(swf,&nfo) == 0) {
					printf("    UseDirectBlit:        %u\n",nfo.UseDirectBlit);
					printf("    UseGPU:               %u\n",nfo.UseGPU);
					printf("    HasMetadata:          %u\n",nfo.HasMetadata);
					printf("    ActionScript3:        %u\n",nfo.ActionScript3);
					printf("    UseNetwork:           %u\n",nfo.UseNetwork);
				}

				dump_tag_raw_remainder(swf);
				} break;
			case swftag_Metadata:
				dump_tag_raw_text(swf);
				break;
			default:
				dump_tag_raw(swf,&tag);
				break;
		}

		/* clear read stop */
		swf->read_stop = 0;
	}

	swf = swf_reader_destroy(swf);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
cmpl $0x1, %edi
jle 0x1fae
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x1180
testl %eax, %eax
js 0x1fb5
movl %eax, %r14d
xorl %eax, %eax
callq 0x2ffe
testq %rax, %rax
je 0x1fc3
movq %rax, %rbx
movq %rax, %rdi
movl %r14d, %esi
callq 0x315f
testl %eax, %eax
jne 0x1fca
movq %rbx, %rdi
callq 0x3043
movq %rbx, %rdi
callq 0x31a5
testl %eax, %eax
jne 0x1fd1
movzbl 0x3b(%rbx), %esi
movzbl 0x38(%rbx), %edx
movzbl 0x39(%rbx), %ecx
movzbl 0x3a(%rbx), %r8d
movl 0x3c(%rbx), %r9d
leaq 0x49e5(%rip), %rdi      # 0x60f0
xorl %r13d, %r13d
xorl %eax, %eax
callq 0x1080
movzbl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
movl 0x48(%rbx), %r8d
cvtsi2sd %edx, %xmm0
movsd 0x48dc(%rip), %xmm4     # 0x6008
divsd %xmm4, %xmm0
movl 0x4c(%rbx), %ecx
cvtsi2sd %ecx, %xmm1
divsd %xmm4, %xmm1
cvtsi2sd %r8d, %xmm2
divsd %xmm4, %xmm2
movl 0x50(%rbx), %r9d
cvtsi2sd %r9d, %xmm3
divsd %xmm4, %xmm3
leaq 0x49c2(%rip), %rdi      # 0x611a
movb $0x4, %al
callq 0x1080
movzwl 0x54(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x489e(%rip), %xmm0     # 0x6010
movzwl 0x56(%rbx), %esi
leaq 0x49e9(%rip), %rdi      # 0x6166
movb $0x1, %al
callq 0x1080
movl 0x5c(%rbx), %esi
leaq 0x4a01(%rip), %rdi      # 0x618f
xorl %eax, %eax
callq 0x1080
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x3053
testl %eax, %eax
je 0x1fa4
leaq 0x49fb(%rip), %r14      # 0x61ae
movzwl -0x98(%rbp), %r12d
movl %r12d, %edi
callq 0x29c7
movl -0x94(%rbp), %ecx
movq -0x90(%rbp), %r8
movq -0x88(%rbp), %r9
movq %r14, %rdi
movl %r12d, %esi
movq %rax, %rdx
xorl %eax, %eax
callq 0x1080
movq 0x68(%rbx), %rax
movq %rax, 0x60(%rbx)
movzwl -0x98(%rbp), %eax
cmpl $0x15, %eax
jg 0x1878
addl $-0x2, %eax
cmpl $0x10, %eax
leaq -0x80(%rbp), %r15
ja 0x1e0a
leaq 0x4816(%rip), %rcx      # 0x6028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3907
testl %eax, %eax
jne 0x1db0
movzwl -0x80(%rbp), %esi
leaq 0x4a27(%rip), %rdi      # 0x6260
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x4a33(%rip), %rdi      # 0x627e
xorl %eax, %eax
callq 0x1080
leaq 0x4a43(%rip), %rdi      # 0x629c
xorl %eax, %eax
callq 0x1080
leaq -0x7c(%rbp), %rdi
callq 0x2706
movl $0xa, %edi
callq 0x1040
jmp 0x1db0
cmpl $0x44, %eax
jg 0x1998
cmpl $0x16, %eax
leaq -0x80(%rbp), %r15
je 0x1ac2
cmpl $0x20, %eax
je 0x1ac2
cmpl $0x2d, %eax
jne 0x1e0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x34eb
testl %eax, %eax
jne 0x1da8
movzwl -0x80(%rbp), %esi
andl $0x3, %esi
movzwl -0x7e(%rbp), %edx
leaq 0x4c57(%rip), %rdi      # 0x651c
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
movzbl -0x7c(%rbp), %edx
leaq 0x4c61(%rip), %rdi      # 0x6541
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x3, %esi
andl $0x1, %esi
movzbl -0x7b(%rbp), %edx
leaq 0x4c6e(%rip), %rdi      # 0x6569
xorl %eax, %eax
callq 0x1080
movzbl -0x7f(%rbp), %esi
andl $0xf, %esi
movq -0x70(%rbp), %rdx
leaq 0x4c81(%rip), %rdi      # 0x6595
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x5, %esi
andl $0x3, %esi
movzwl -0x7a(%rbp), %edx
leaq 0x4c8b(%rip), %rdi      # 0x65ba
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x7, %esi
andl $0x1, %esi
movzbl -0x78(%rbp), %edx
leaq 0x4c95(%rip), %rdi      # 0x65df
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0xc, %esi
andl $0x1, %esi
movzbl -0x77(%rbp), %edx
leaq 0x4ca2(%rip), %rdi      # 0x6607
xorl %eax, %eax
callq 0x1080
movzwl -0x76(%rbp), %esi
leaq 0x4cbc(%rip), %rdi      # 0x6633
xorl %eax, %eax
callq 0x1080
testb $0x10, -0x80(%rbp)
je 0x1da8
movzwl -0x74(%rbp), %esi
leaq 0x4cc0(%rip), %rdi      # 0x6653
jmp 0x1da1
cmpl $0x45, %eax
leaq -0x80(%rbp), %r15
leaq 0x52cc(%rip), %r12      # 0x6c72
je 0x1d29
cmpl $0x4d, %eax
je 0x1dd4
cmpl $0x53, %eax
jne 0x1e0a
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b36
testl %eax, %eax
jne 0x1da8
movzwl -0x80(%rbp), %esi
leaq 0x481a(%rip), %rdi      # 0x61f6
xorl %eax, %eax
callq 0x1080
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x4610(%rip), %xmm4     # 0x6008
divsd %xmm4, %xmm0
movl -0x70(%rbp), %edx
cvtsi2sd %edx, %xmm1
divsd %xmm4, %xmm1
cvtsi2sd %ecx, %xmm2
divsd %xmm4, %xmm2
movl -0x6c(%rbp), %r8d
cvtsi2sd %r8d, %xmm3
divsd %xmm4, %xmm3
leaq 0x47f1(%rip), %rdi      # 0x6214
movb $0x4, %al
callq 0x1080
movl -0x64(%rbp), %esi
movl -0x60(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x45c9(%rip), %xmm3     # 0x6008
divsd %xmm3, %xmm0
movl -0x5c(%rbp), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd %xmm3, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm3, %xmm2
movapd %xmm3, %xmm4
movl -0x58(%rbp), %r8d
xorps %xmm3, %xmm3
cvtsi2sd %r8d, %xmm3
divsd %xmm4, %xmm3
leaq 0x4840(%rip), %rdi      # 0x62b7
movb $0x4, %al
callq 0x1080
movzbl -0x54(%rbp), %esi
andl $0x1, %esi
leaq 0x4877(%rip), %rdi      # 0x6303
xorl %eax, %eax
callq 0x1080
movl -0x54(%rbp), %esi
shrl %esi
andl $0x1, %esi
leaq 0x487f(%rip), %rdi      # 0x6321
xorl %eax, %eax
callq 0x1080
movl -0x54(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq 0x4886(%rip), %rdi      # 0x633f
xorl %eax, %eax
callq 0x1080
jmp 0x1b37
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3ae8
testl %eax, %eax
jne 0x1da8
movzwl -0x80(%rbp), %esi
leaq 0x4716(%rip), %rdi      # 0x61f6
xorl %eax, %eax
callq 0x1080
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x450c(%rip), %xmm4     # 0x6008
divsd %xmm4, %xmm0
movl -0x70(%rbp), %edx
xorps %xmm1, %xmm1
cvtsi2sd %edx, %xmm1
divsd %xmm4, %xmm1
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
divsd %xmm4, %xmm2
movl -0x6c(%rbp), %r8d
xorps %xmm3, %xmm3
cvtsi2sd %r8d, %xmm3
divsd %xmm4, %xmm3
leaq 0x46e4(%rip), %rdi      # 0x6214
movb $0x4, %al
callq 0x1080
movzwl -0x98(%rbp), %esi
movq %rbx, %rdi
callq 0x20cd
testl %eax, %eax
jne 0x1da8
movzwl -0x98(%rbp), %esi
movq %rbx, %rdi
callq 0x2176
testl %eax, %eax
jne 0x1da8
movzwl -0x98(%rbp), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x23cf
jmp 0x1da8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3a7d
testl %eax, %eax
jne 0x1db0
movzwl -0x80(%rbp), %esi
leaq 0x46c7(%rip), %rdi      # 0x6260
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x46d3(%rip), %rdi      # 0x627e
xorl %eax, %eax
callq 0x1080
jmp 0x1db0
movq %r15, %rdi
callq 0x378b
movq %rbx, %rdi
movq %r15, %rsi
callq 0x37cb
testl %eax, %eax
jne 0x1bf2
movzwl -0x80(%rbp), %esi
leaq 0x487a(%rip), %rdi      # 0x6453
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x4886(%rip), %rdi      # 0x6471
xorl %eax, %eax
callq 0x1080
cmpw $0x0, -0x7e(%rbp)
je 0x1c1a
leaq -0x80(%rbp), %rdi
callq 0x3844
testl %eax, %eax
jne 0x1c1a
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
callq 0x387d
testl %eax, %eax
je 0x1eff
leaq -0x80(%rbp), %rdi
callq 0x379f
jmp 0x1da8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x2ab2
leaq 0x45a1(%rip), %rdi      # 0x61db
xorl %eax, %eax
callq 0x1080
movzbl -0x80(%rbp), %esi
movzbl -0x7f(%rbp), %edx
movzbl -0x7e(%rbp), %ecx
leaq 0x4ab3(%rip), %rdi      # 0x6707
xorl %eax, %eax
callq 0x1080
movl $0xa, %edi
callq 0x1040
jmp 0x1da8
movq %rbx, %rdi
movq %r15, %rsi
callq 0x33c7
testl %eax, %eax
jne 0x1da8
movzwl -0x80(%rbp), %esi
leaq 0x46d5(%rip), %rdi      # 0x635d
xorl %eax, %eax
callq 0x1080
movzbl -0x70(%rbp), %esi
andl $0xf, %esi
movq -0x78(%rbp), %rdx
leaq 0x46da(%rip), %rdi      # 0x637b
xorl %eax, %eax
callq 0x1080
movl -0x70(%rbp), %esi
shrl $0x4, %esi
andl $0x3, %esi
movzwl -0x6e(%rbp), %edx
leaq 0x46e2(%rip), %rdi      # 0x639e
xorl %eax, %eax
callq 0x1080
movl -0x70(%rbp), %esi
shrl $0x6, %esi
andl $0x1, %esi
movzbl -0x6c(%rbp), %edx
leaq 0x46ec(%rip), %rdi      # 0x63c3
xorl %eax, %eax
callq 0x1080
movzbl -0x70(%rbp), %esi
shrl $0x7, %esi
movzbl -0x6b(%rbp), %edx
leaq 0x46fb(%rip), %rdi      # 0x63eb
xorl %eax, %eax
callq 0x1080
movl -0x68(%rbp), %esi
leaq 0x4716(%rip), %rdi      # 0x6417
xorl %eax, %eax
callq 0x1080
movb -0x70(%rbp), %al
andb $0xf, %al
cmpb $0x2, %al
jne 0x1da8
movq %rbx, %rdi
callq 0x2d92
movzwl %ax, %esi
leaq 0x470e(%rip), %rdi      # 0x6435
jmp 0x1da1
movq %rbx, %rdi
movq %r15, %rsi
callq 0x36c6
testl %eax, %eax
jne 0x1da8
movzbl -0x80(%rbp), %esi
andl $0x1, %esi
leaq 0x492b(%rip), %rdi      # 0x6671
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl %esi
andl $0x1, %esi
leaq 0x4933(%rip), %rdi      # 0x668f
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq 0x493a(%rip), %rdi      # 0x66ad
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x3, %esi
andl $0x1, %esi
leaq 0x4941(%rip), %rdi      # 0x66cb
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x4, %esi
andl $0x1, %esi
leaq 0x4948(%rip), %rdi      # 0x66e9
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
callq 0x1fee
movq $0x0, 0x60(%rbx)
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3053
testl %eax, %eax
jne 0x17b3
jmp 0x1fa4
leaq 0x4f1e(%rip), %rdi      # 0x6cf9
callq 0x1070
movq %rbx, %rdi
movq %r15, %rsi
movl $0x50, %edx
callq 0x2a27
testl %eax, %eax
jle 0x1db0
movl %eax, %eax
movb $0x0, -0x80(%rbp,%rax)
movq %r12, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x1080
jmp 0x1de0
movq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x2a07
testl %eax, %eax
jne 0x1db0
movq %rbx, %rdi
leaq -0x80(%rbp), %rsi
movl $0x10, %edx
callq 0x2a27
testl %eax, %eax
jle 0x1db0
movl %eax, %r12d
leaq 0x4e3e(%rip), %rdi      # 0x6c7e
xorl %eax, %eax
callq 0x1080
movl %r12d, %r14d
cmpl $0xf, %r12d
movl $0xf, %eax
cmovbl %r12d, %eax
movq %r14, -0xa0(%rbp)
negq %r14
addl %r12d, %eax
addl $-0x11, %eax
movq $-0x1, %r13
leaq 0x48b2(%rip), %r15      # 0x6727
movl %eax, %r12d
movzbl -0x7f(%rbp,%r13), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
leaq (%r14,%r13), %rcx
incq %rcx
incq %r13
leal -0x1(%r12), %eax
cmpq $-0x1, %rcx
jne 0x1e75
cmpq $0xe, %r13
leaq 0x440b(%rip), %r14      # 0x62b3
ja 0x1eb9
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
incl %r12d
jne 0x1eaa
xorl %r14d, %r14d
movq -0xa0(%rbp), %r15
movzbl -0x80(%rbp,%r14), %eax
leal -0x20(%rax), %ecx
cmpb $0x5f, %cl
jb 0x1ed6
movl $0x2e, %eax
movzbl %al, %edi
callq 0x1040
incq %r14
cmpq %r14, %r15
jne 0x1ec3
movl $0xa, %edi
callq 0x1040
xorl %r13d, %r13d
leaq 0x42b4(%rip), %r14      # 0x61ae
jmp 0x1db0
leaq 0x4d82(%rip), %rdi      # 0x6c88
callq 0x1070
cmpw $0x0, -0x7e(%rbp)
je 0x1c1a
xorl %r14d, %r14d
leaq 0x456f(%rip), %r12      # 0x648f
movq -0x78(%rbp), %rax
movzwl (%rax,%r14,2), %esi
movq -0x70(%rbp), %rcx
addq %rsi, %rcx
movzwl -0x7c(%rbp), %eax
movl %esi, %edx
subl %eax, %edx
movq %r12, %rdi
xorl %eax, %eax
callq 0x1080
incq %r14
movzwl -0x7e(%rbp), %eax
cmpq %rax, %r14
jb 0x1f20
testw %ax, %ax
leaq 0x4256(%rip), %r14      # 0x61ae
je 0x1c1a
xorl %r12d, %r12d
movq -0x78(%rbp), %rax
movzwl (%rax,%r12,2), %esi
addq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x2a07
testl %eax, %eax
jne 0x1f9d
movzwl -0x98(%rbp), %edx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x23cf
incq %r12
movzwl -0x7e(%rbp), %eax
cmpq %rax, %r12
jb 0x1f61
jmp 0x1c1a
callq 0x121e
jmp 0x1f8c
movq %rbx, %rdi
callq 0x301f
jmp 0x1fdc
callq 0x1292
jmp 0x1fd6
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x126f
jmp 0x1fd6
callq 0x1240
jmp 0x1fd6
callq 0x11c0
jmp 0x1fd6
callq 0x11ef
movl $0x1, %r13d
movl %r13d, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq