// File: /workspace/github_c_makefile_star2_O2/joncampbell123[P]swfhax/c4_swfdump.c
// Function: dump_SHAPE
static void dump_SHAPE(swf_reader *swf,unsigned int i,unsigned int tag_code) {
	swf_SHAPE_reading r;

	if (swf_reader_read_SHAPE_beginning(swf,&r) == 0) {
		printf("        SHAPE[%u]: NumFillBits=%u NumLineBits=%u\n",
				i,r.NumFillBits,r.NumLineBits);

		while (swf_reader_read_SHAPE_record(swf,&r) == 0) {
			printf("          %s TypeFlag=%u\n",
					r.ShapeRecord_str,
					r.ShapeRecordTypeFlag);

			if (r.ShapeRecord_type == swf_shrec_EndShapeRecord)
				break;
			else if (r.ShapeRecord_type == swf_shrec_StyleChangeRecord) {
				printf("            StateNewStyles: %u\n",
						r.shrec.style.StyleChangeRecord.StateNewStyles?1:0);
				printf("            StateLineStyle: %u\n",
						r.shrec.style.StyleChangeRecord.StateLineStyle?1:0);
				printf("            StateFillStyle1: %u\n",
						r.shrec.style.StyleChangeRecord.StateFillStyle1?1:0);
				printf("            StateFillStyle0: %u\n",
						r.shrec.style.StyleChangeRecord.StateFillStyle0?1:0);
				printf("            StateMoveTo: %u\n",
						r.shrec.style.StyleChangeRecord.StateMoveTo?1:0);
				if (r.shrec.style.StyleChangeRecord.StateMoveTo) {
					printf("            MoveBits: %u\n",
							r.shrec.style.StyleChangeRecord.MoveBits);
					printf("            Move DeltaX/DeltaY: %.3f, %.3f (%d, %d twips)\n",
							(double)r.shrec.style.StyleChangeRecord.MoveDeltaX /
							SWF_TWIPS_PER_PIXEL,
							(double)r.shrec.style.StyleChangeRecord.MoveDeltaY /
							SWF_TWIPS_PER_PIXEL,
							r.shrec.style.StyleChangeRecord.MoveDeltaX,
							r.shrec.style.StyleChangeRecord.MoveDeltaY);
				}
				if (r.shrec.style.StyleChangeRecord.StateFillStyle1)
					printf("            FillStyle1: %u\n",
							r.shrec.style.StyleChangeRecord.FillStyle1);
				if (r.shrec.style.StyleChangeRecord.StateFillStyle0)
					printf("            FillStyle0: %u\n",
							r.shrec.style.StyleChangeRecord.FillStyle0);
				if (r.shrec.style.StyleChangeRecord.StateLineStyle)
					printf("            LineStyle: %u\n",
							r.shrec.style.StyleChangeRecord.LineStyle);

				if (r.shrec.style.StyleChangeRecord.StateNewStyles) {
					printf("        Style Change...\n");
					if (dump_FILLSTYLEARRAY(swf,tag_code)) break;
					if (dump_LINESTYLEARRAY(swf,tag_code)) break;
					/* NumFillBits and NumLineBits follow */
					if (swf_reader_read_SHAPE_beginning(swf,&r)) break;
					printf("        SHAPE[%u]: NumFillBits=%u NumLineBits=%u\n",
						i,r.NumFillBits,r.NumLineBits);
				}
			}
			else if (r.ShapeRecord_type == swf_shrec_StraightEdgeRecord) {
				printf("            NumBits: %u\n",
						r.shrec.edge.StraightEdgeRecord.NumBits);
				printf("            GeneralLineFlag: %u\n",
						r.shrec.edge.StraightEdgeRecord.GeneralLineFlag);
				if (!r.shrec.edge.StraightEdgeRecord.GeneralLineFlag)
					printf("            VertLineFlag: %u\n",
							r.shrec.edge.StraightEdgeRecord.VertLineFlag);
				printf("            DeltaX/Y: %.3f, %.3f (or %d, %d)\n",
						(double)r.shrec.edge.StraightEdgeRecord.DeltaX /
						SWF_TWIPS_PER_PIXEL,
						(double)r.shrec.edge.StraightEdgeRecord.DeltaY /
						SWF_TWIPS_PER_PIXEL,
						r.shrec.edge.StraightEdgeRecord.DeltaX,
						r.shrec.edge.StraightEdgeRecord.DeltaY);
			}
			else if (r.ShapeRecord_type == swf_shrec_CurvedEdgeRecord) {
				printf("            NumBits: %u\n",
						r.shrec.edge.CurvedEdgeRecord.NumBits);
				printf("            Control DeltaX/Y: %.3f, %.3f (or %d, %d)\n",
						(double)r.shrec.edge.CurvedEdgeRecord.ControlDeltaX /
						SWF_TWIPS_PER_PIXEL,
						(double)r.shrec.edge.CurvedEdgeRecord.ControlDeltaY /
						SWF_TWIPS_PER_PIXEL,
						r.shrec.edge.CurvedEdgeRecord.ControlDeltaX,
						r.shrec.edge.CurvedEdgeRecord.ControlDeltaY);
				printf("            Anchor DeltaX/Y: %.3f, %.3f (or %d, %d)\n",
						(double)r.shrec.edge.CurvedEdgeRecord.AnchorDeltaX /
						SWF_TWIPS_PER_PIXEL,
						(double)r.shrec.edge.CurvedEdgeRecord.AnchorDeltaY /
						SWF_TWIPS_PER_PIXEL,
						r.shrec.edge.CurvedEdgeRecord.AnchorDeltaX,
						r.shrec.edge.CurvedEdgeRecord.AnchorDeltaY);
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %edx, %ebx
movl %esi, -0x54(%rbp)
movq %rdi, %r15
leaq -0x50(%rbp), %rsi
callq 0x33b9
testl %eax, %eax
je 0x1f9d
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x50(%rbp), %r12
movzwl (%r12), %ecx
movl %ecx, %edx
andl $0xf, %edx
shrl $0x4, %ecx
andl $0xf, %ecx
leaq 0x39be(%rip), %rdi      # 0x5976
movl -0x54(%rbp), %esi
xorl %eax, %eax
callq 0x1080
leaq 0x39df(%rip), %r13      # 0x59a8
leaq 0x309c(%rip), %r14      # 0x506c
movq %r15, %rdi
movq %r12, %rsi
callq 0x3410
testl %eax, %eax
jne 0x1f8e
movq -0x48(%rbp), %rsi
movl -0x50(%rbp), %edx
shrl $0x8, %edx
andl $0x1, %edx
movq %r13, %rdi
xorl %eax, %eax
callq 0x1080
movzbl -0x40(%rbp), %eax
cmpq $0x3, %rax
ja 0x1fd0
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movzwl -0x3c(%rbp), %esi
andl $0x1, %esi
leaq 0x39ab(%rip), %rdi      # 0x59c2
xorl %eax, %eax
callq 0x1080
movl -0x3c(%rbp), %esi
shrl %esi
andl $0x1, %esi
leaq 0x39b5(%rip), %rdi      # 0x59e2
xorl %eax, %eax
callq 0x1080
movl -0x3c(%rbp), %esi
shrl $0x2, %esi
andl $0x1, %esi
leaq 0x39be(%rip), %rdi      # 0x5a02
xorl %eax, %eax
callq 0x1080
movl -0x3c(%rbp), %esi
shrl $0x3, %esi
andl $0x1, %esi
leaq 0x39c8(%rip), %rdi      # 0x5a23
xorl %eax, %eax
callq 0x1080
movl -0x3c(%rbp), %esi
shrl $0x4, %esi
andl $0x1, %esi
leaq 0x39d2(%rip), %rdi      # 0x5a44
xorl %eax, %eax
callq 0x1080
movzwl -0x3c(%rbp), %esi
testb $0x10, %sil
je 0x20c7
shrl $0x5, %esi
andl $0x1f, %esi
leaq 0x39d1(%rip), %rdi      # 0x5a61
xorl %eax, %eax
callq 0x1080
movl -0x38(%rbp), %esi
movl -0x34(%rbp), %edx
cvtsi2sd %esi, %xmm0
movsd 0x2f5f(%rip), %xmm2     # 0x5008
divsd %xmm2, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
leaq 0x39bf(%rip), %rdi      # 0x5a7b
movb $0x2, %al
callq 0x1080
movzwl -0x3c(%rbp), %esi
testb $0x4, %sil
je 0x20e3
movzwl -0x2e(%rbp), %esi
leaq 0x39de(%rip), %rdi      # 0x5ab6
xorl %eax, %eax
callq 0x1080
movzwl -0x3c(%rbp), %esi
testb $0x8, %sil
je 0x20ff
movzwl -0x30(%rbp), %esi
leaq 0x39de(%rip), %rdi      # 0x5ad2
xorl %eax, %eax
callq 0x1080
movzwl -0x3c(%rbp), %esi
testb $0x2, %sil
je 0x211b
movzwl -0x2c(%rbp), %esi
leaq 0x39de(%rip), %rdi      # 0x5aee
xorl %eax, %eax
callq 0x1080
movzwl -0x3c(%rbp), %esi
testb $0x1, %sil
je 0x1fd0
leaq 0x3bb5(%rip), %rdi      # 0x5ce1
callq 0x1070
movq %r15, %rdi
movl %ebx, %esi
callq 0x1c89
testl %eax, %eax
jne 0x1f8e
movq %r15, %rdi
movl %ebx, %esi
callq 0x1d32
testl %eax, %eax
jne 0x1f8e
movq %r15, %rdi
movq %r12, %rsi
callq 0x33b9
testl %eax, %eax
jne 0x1f8e
movzwl -0x50(%rbp), %ecx
movl %ecx, %edx
andl $0xf, %edx
shrl $0x4, %ecx
andl $0xf, %ecx
leaq 0x37f8(%rip), %rdi      # 0x5976
movl -0x54(%rbp), %esi
xorl %eax, %eax
callq 0x1080
jmp 0x1fd0
movl -0x3c(%rbp), %esi
shrl %esi
andl $0x1f, %esi
leaq 0x396d(%rip), %rdi      # 0x5b09
xorl %eax, %eax
callq 0x1080
movl -0x38(%rbp), %esi
movl -0x34(%rbp), %edx
cvtsi2sd %esi, %xmm0
movsd 0x2e53(%rip), %xmm2     # 0x5008
divsd %xmm2, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
leaq 0x39c7(%rip), %rdi      # 0x5b8f
movb $0x2, %al
callq 0x1080
movl -0x30(%rbp), %esi
movl -0x2c(%rbp), %edx
cvtsi2sd %esi, %xmm0
movsd 0x2e27(%rip), %xmm2     # 0x5008
divsd %xmm2, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
leaq 0x39d1(%rip), %rdi      # 0x5bc5
jmp 0x2263
movl -0x3c(%rbp), %esi
shrl %esi
andl $0x1f, %esi
leaq 0x3904(%rip), %rdi      # 0x5b09
xorl %eax, %eax
callq 0x1080
movl -0x3c(%rbp), %esi
shrl $0x6, %esi
andl $0x1, %esi
leaq 0x3906(%rip), %rdi      # 0x5b22
xorl %eax, %eax
callq 0x1080
movzbl -0x3c(%rbp), %esi
testb $0x40, %sil
jne 0x223e
shrl $0x7, %esi
leaq 0x390c(%rip), %rdi      # 0x5b43
xorl %eax, %eax
callq 0x1080
movl -0x38(%rbp), %esi
movl -0x34(%rbp), %edx
cvtsi2sd %esi, %xmm0
movsd 0x2db8(%rip), %xmm2     # 0x5008
divsd %xmm2, %xmm0
cvtsi2sd %edx, %xmm1
divsd %xmm2, %xmm1
leaq 0x38fe(%rip), %rdi      # 0x5b61
movb $0x2, %al
callq 0x1080
jmp 0x1fd0