// File: /workspace/github_c_makefile_star2_O1/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 0x1fc7
movq %rsi, %rbx
movq 0x8(%rsi), %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x1170
testl %eax, %eax
js 0x1fce
movl %eax, %r14d
xorl %eax, %eax
callq 0x3025
testq %rax, %rax
je 0x1fdc
movq %rax, %rbx
movq %rax, %rdi
movl %r14d, %esi
callq 0x31ab
testl %eax, %eax
jne 0x1fe3
movq %rbx, %rdi
callq 0x3085
movq %rbx, %rdi
callq 0x31f1
testl %eax, %eax
jne 0x1fea
movzbl 0x3b(%rbx), %esi
movzbl 0x38(%rbx), %edx
movzbl 0x39(%rbx), %ecx
movzbl 0x3a(%rbx), %r8d
movl 0x3c(%rbx), %r9d
leaq 0x49f5(%rip), %rdi      # 0x60f0
xorl %eax, %eax
callq 0x1080
movzbl 0x40(%rbx), %esi
movl 0x44(%rbx), %edx
movl 0x48(%rbx), %r8d
cvtsi2sd %edx, %xmm0
movsd 0x48ef(%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 0x49d5(%rip), %rdi      # 0x611a
movb $0x4, %al
callq 0x1080
movzwl 0x54(%rbx), %eax
xorps %xmm0, %xmm0
cvtsi2sd %eax, %xmm0
mulsd 0x48b1(%rip), %xmm0     # 0x6010
movzwl 0x56(%rbx), %esi
leaq 0x49fc(%rip), %rdi      # 0x6166
movb $0x1, %al
callq 0x1080
movl 0x5c(%rbx), %esi
leaq 0x4a14(%rip), %rdi      # 0x618f
xorl %eax, %eax
callq 0x1080
leaq -0x98(%rbp), %rsi
movq %rbx, %rdi
callq 0x3095
testl %eax, %eax
je 0x1fbb
leaq -0x7c(%rbp), %r14
leaq -0x80(%rbp), %r12
leaq 0x4bb5(%rip), %r15      # 0x635d
movq %r12, %r13
movzwl -0x98(%rbp), %r12d
movl %r12d, %edi
callq 0x29ef
movl -0x94(%rbp), %ecx
movq -0x90(%rbp), %r8
movq -0x88(%rbp), %r9
leaq 0x49d8(%rip), %rdi      # 0x61ae
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 0x1872
addl $-0x2, %eax
cmpl $0x10, %eax
ja 0x1e12
movq %r13, %r12
leaq 0x481b(%rip), %rcx      # 0x6028
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3953
testl %eax, %eax
jne 0x1d9d
movzwl -0x80(%rbp), %esi
leaq 0x4a2c(%rip), %rdi      # 0x6260
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x4a38(%rip), %rdi      # 0x627e
xorl %eax, %eax
callq 0x1080
leaq 0x4a48(%rip), %rdi      # 0x629c
xorl %eax, %eax
callq 0x1080
movq %r14, %rdi
callq 0x2731
movl $0xa, %edi
callq 0x1040
jmp 0x1d9d
cmpl $0x44, %eax
jg 0x1991
cmpl $0x16, %eax
movq %r13, %r12
je 0x1ab3
cmpl $0x20, %eax
je 0x1ab3
cmpl $0x2d, %eax
jne 0x1e12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3537
testl %eax, %eax
jne 0x1d95
movzwl -0x80(%rbp), %esi
andl $0x3, %esi
movzwl -0x7e(%rbp), %edx
leaq 0x4c5e(%rip), %rdi      # 0x651c
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
movzbl -0x7c(%rbp), %edx
leaq 0x4c68(%rip), %rdi      # 0x6541
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x3, %esi
andl $0x1, %esi
movzbl -0x7b(%rbp), %edx
leaq 0x4c75(%rip), %rdi      # 0x6569
xorl %eax, %eax
callq 0x1080
movzbl -0x7f(%rbp), %esi
andl $0xf, %esi
movq -0x70(%rbp), %rdx
leaq 0x4c88(%rip), %rdi      # 0x6595
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x5, %esi
andl $0x3, %esi
movzwl -0x7a(%rbp), %edx
leaq 0x4c92(%rip), %rdi      # 0x65ba
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x7, %esi
andl $0x1, %esi
movzbl -0x78(%rbp), %edx
leaq 0x4c9c(%rip), %rdi      # 0x65df
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0xc, %esi
andl $0x1, %esi
movzbl -0x77(%rbp), %edx
leaq 0x4ca9(%rip), %rdi      # 0x6607
xorl %eax, %eax
callq 0x1080
movzwl -0x76(%rbp), %esi
leaq 0x4cc3(%rip), %rdi      # 0x6633
xorl %eax, %eax
callq 0x1080
testb $0x10, -0x80(%rbp)
je 0x1d95
movzwl -0x74(%rbp), %esi
leaq 0x4cc7(%rip), %rdi      # 0x6653
jmp 0x1d8e
cmpl $0x45, %eax
movq %r13, %r12
je 0x1d16
cmpl $0x4d, %eax
je 0x1dc1
cmpl $0x53, %eax
jne 0x1e12
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3b84
testl %eax, %eax
jne 0x1d95
movzwl -0x80(%rbp), %esi
leaq 0x4829(%rip), %rdi      # 0x61f6
xorl %eax, %eax
callq 0x1080
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x461f(%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 0x4800(%rip), %rdi      # 0x6214
movb $0x4, %al
callq 0x1080
movl -0x64(%rbp), %esi
movl -0x60(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x45d8(%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 0x484f(%rip), %rdi      # 0x62b7
movb $0x4, %al
callq 0x1080
movzbl -0x54(%rbp), %esi
andl $0x1, %esi
leaq 0x4886(%rip), %rdi      # 0x6303
xorl %eax, %eax
callq 0x1080
movl -0x54(%rbp), %esi
shrl %esi
andl $0x1, %esi
leaq 0x488e(%rip), %rdi      # 0x6321
xorl %eax, %eax
callq 0x1080
movl -0x54(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq 0x4895(%rip), %rdi      # 0x633f
xorl %eax, %eax
callq 0x1080
jmp 0x1b28
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3b36
testl %eax, %eax
jne 0x1d95
movzwl -0x80(%rbp), %esi
leaq 0x4725(%rip), %rdi      # 0x61f6
xorl %eax, %eax
callq 0x1080
movl -0x78(%rbp), %esi
movl -0x74(%rbp), %ecx
xorps %xmm0, %xmm0
cvtsi2sd %esi, %xmm0
movsd 0x451b(%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 0x46f3(%rip), %rdi      # 0x6214
movb $0x4, %al
callq 0x1080
movzwl -0x98(%rbp), %esi
movq %rbx, %rdi
callq 0x20e7
testl %eax, %eax
jne 0x1d95
movzwl -0x98(%rbp), %esi
movq %rbx, %rdi
callq 0x2190
testl %eax, %eax
jne 0x1d95
movzwl -0x98(%rbp), %edx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x240a
jmp 0x1d95
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3acb
testl %eax, %eax
jne 0x1d9d
movzwl -0x80(%rbp), %esi
leaq 0x46d6(%rip), %rdi      # 0x6260
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x46e2(%rip), %rdi      # 0x627e
xorl %eax, %eax
callq 0x1080
jmp 0x1d9d
movq %r12, %rdi
callq 0x37d7
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3817
testl %eax, %eax
jne 0x1be3
movzwl -0x80(%rbp), %esi
leaq 0x4889(%rip), %rdi      # 0x6453
xorl %eax, %eax
callq 0x1080
movzwl -0x7e(%rbp), %esi
leaq 0x4895(%rip), %rdi      # 0x6471
xorl %eax, %eax
callq 0x1080
cmpw $0x0, -0x7e(%rbp)
je 0x1c09
movq %r13, %rdi
callq 0x3890
testl %eax, %eax
jne 0x1c09
movq %rbx, %rdi
movq %r13, %rsi
callq 0x38c9
testl %eax, %eax
je 0x1f12
movq %r13, %r12
movq %r13, %rdi
callq 0x37eb
jmp 0x1d95
movq %rbx, %rdi
movq %r12, %rsi
callq 0x2ada
leaq 0x45b0(%rip), %rdi      # 0x61db
xorl %eax, %eax
callq 0x1080
movzbl -0x80(%rbp), %esi
movzbl -0x7f(%rbp), %edx
movzbl -0x7e(%rbp), %ecx
leaq 0x4ac2(%rip), %rdi      # 0x6707
xorl %eax, %eax
callq 0x1080
movl $0xa, %edi
callq 0x1040
jmp 0x1d95
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3413
testl %eax, %eax
jne 0x1d95
movzwl -0x80(%rbp), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x1080
movzbl -0x70(%rbp), %esi
andl $0xf, %esi
movq -0x78(%rbp), %rdx
leaq 0x46ed(%rip), %rdi      # 0x637b
xorl %eax, %eax
callq 0x1080
movl -0x70(%rbp), %esi
shrl $0x4, %esi
andl $0x3, %esi
movzwl -0x6e(%rbp), %edx
leaq 0x46f5(%rip), %rdi      # 0x639e
xorl %eax, %eax
callq 0x1080
movl -0x70(%rbp), %esi
shrl $0x6, %esi
andl $0x1, %esi
movzbl -0x6c(%rbp), %edx
leaq 0x46ff(%rip), %rdi      # 0x63c3
xorl %eax, %eax
callq 0x1080
movzbl -0x70(%rbp), %esi
shrl $0x7, %esi
movzbl -0x6b(%rbp), %edx
leaq 0x470e(%rip), %rdi      # 0x63eb
xorl %eax, %eax
callq 0x1080
movl -0x68(%rbp), %esi
leaq 0x4729(%rip), %rdi      # 0x6417
xorl %eax, %eax
callq 0x1080
movb -0x70(%rbp), %al
andb $0xf, %al
cmpb $0x2, %al
jne 0x1d95
movq %rbx, %rdi
callq 0x2db9
movzwl %ax, %esi
leaq 0x4721(%rip), %rdi      # 0x6435
jmp 0x1d8e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x3712
testl %eax, %eax
jne 0x1d95
movzbl -0x80(%rbp), %esi
andl $0x1, %esi
leaq 0x493e(%rip), %rdi      # 0x6671
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl %esi
andl $0x1, %esi
leaq 0x4946(%rip), %rdi      # 0x668f
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq 0x494d(%rip), %rdi      # 0x66ad
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x3, %esi
andl $0x1, %esi
leaq 0x4954(%rip), %rdi      # 0x66cb
xorl %eax, %eax
callq 0x1080
movl -0x80(%rbp), %esi
shrl $0x4, %esi
andl $0x1, %esi
leaq 0x495b(%rip), %rdi      # 0x66e9
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
callq 0x2003
movq $0x0, 0x60(%rbx)
movq %rbx, %rdi
leaq -0x98(%rbp), %rsi
callq 0x3095
testl %eax, %eax
jne 0x17a8
jmp 0x1fbb
leaq 0x4f31(%rip), %rdi      # 0x6cf9
callq 0x1070
movq %rbx, %rdi
movq %r12, %rsi
movl $0x50, %edx
callq 0x2a4f
testl %eax, %eax
leaq 0x4e8c(%rip), %r13      # 0x6c72
jle 0x1d9d
movl %eax, %eax
movb $0x0, -0x80(%rbp,%rax)
movq %r13, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x1080
movq %rbx, %rdi
movq %r12, %rsi
movl $0x50, %edx
callq 0x2a4f
testl %eax, %eax
jg 0x1de8
jmp 0x1d9d
movq -0x88(%rbp), %rsi
movq %rbx, %rdi
callq 0x2a2f
testl %eax, %eax
jne 0x1f0a
movq %rbx, %rdi
movq %r13, %rsi
movl $0x10, %edx
callq 0x2a4f
testl %eax, %eax
jle 0x1f0a
movl %eax, %r12d
leaq 0x4e33(%rip), %rdi      # 0x6c7e
xorl %eax, %eax
callq 0x1080
movq %r12, -0xa0(%rbp)
movl %r12d, %r15d
negq %r15
movq $-0x1, %r14
leaq 0x48ba(%rip), %r12      # 0x6727
movzbl -0x7f(%rbp,%r14), %esi
movq %r12, %rdi
xorl %eax, %eax
callq 0x1080
leaq (%r15,%r14), %rax
incq %rax
incq %r14
cmpq $-0x1, %rax
jne 0x1e6d
movq -0xa0(%rbp), %r12
cmpl $0xf, %r12d
movl $0xf, %r15d
cmovbl %r12d, %r15d
cmpq $0xe, %r14
leaq 0x4406(%rip), %r14      # 0x62b3
ja 0x1ec2
addl $-0x10, %r15d
movq %r14, %rdi
xorl %eax, %eax
callq 0x1080
incl %r15d
jne 0x1eb3
cmpl $0x2, %r12d
movl $0x1, %eax
cmovll %eax, %r12d
xorl %r14d, %r14d
leaq 0x4484(%rip), %r15      # 0x635d
movzbl -0x80(%rbp,%r14), %eax
leal -0x20(%rax), %ecx
cmpb $0x5f, %cl
jb 0x1eec
movl $0x2e, %eax
movzbl %al, %edi
callq 0x1040
incq %r14
cmpq %r14, %r12
jne 0x1ed9
movl $0xa, %edi
callq 0x1040
leaq -0x7c(%rbp), %r14
movq %r13, %r12
jmp 0x1d9d
movq %r14, %r12
leaq 0x4d6c(%rip), %rdi      # 0x6c88
callq 0x1070
cmpw $0x0, -0x7e(%rbp)
leaq 0x4562(%rip), %r15      # 0x648f
je 0x1f60
xorl %r14d, %r14d
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 %r15, %rdi
xorl %eax, %eax
callq 0x1080
incq %r14
movzwl -0x7e(%rbp), %eax
cmpq %rax, %r14
jb 0x1f32
cmpw $0x0, -0x7e(%rbp)
movq %r12, %r14
leaq 0x43ee(%rip), %r15      # 0x635d
je 0x1c09
xorl %r12d, %r12d
movq -0x78(%rbp), %rax
movzwl (%rax,%r12,2), %esi
addq -0x70(%rbp), %rsi
movq %rbx, %rdi
callq 0x2a2f
testl %eax, %eax
jne 0x1fb4
movzwl -0x98(%rbp), %edx
movq %rbx, %rdi
movl %r12d, %esi
callq 0x240a
incq %r12
movzwl -0x7e(%rbp), %eax
cmpq %rax, %r12
jb 0x1f78
jmp 0x1c09
callq 0x120e
jmp 0x1fa3
movq %rbx, %rdi
callq 0x3061
xorl %eax, %eax
jmp 0x1ff4
callq 0x1282
jmp 0x1fef
addq $0x8, %rbx
movq %rbx, %rdi
callq 0x125f
jmp 0x1fef
callq 0x1230
jmp 0x1fef
callq 0x11b0
jmp 0x1fef
callq 0x11df
movl $0x1, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq