// File: /workspace/github_c_makefile_star2_O1/joncampbell123[P]swfhax/swf.c
// Function: swf_reader_read_FILLSTYLE
int swf_reader_read_FILLSTYLE(swf_reader *swf,swf_FILLSTYLEARRAY_read *nfo) {
	nfo->FillStyleType_str = "";
	nfo->FillStyleType = swf_reader_read_UI8(swf);
	switch (nfo->FillStyleType) {
		case swf_fillstyle_solid:
			nfo->FillStyleType_str = "solid fill";
			if (nfo->color_rgba) swf_reader_read_RGBA(swf,&nfo->fsinfo.solid.Color);
			else swf_reader_read_RGB_as_RGBA(swf,&nfo->fsinfo.solid.Color);
			break;
		case swf_fillstyle_linear_gradient_fill:
			nfo->FillStyleType_str = "linear gradient fill";
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.gradient.GradientMatrix);
			swf_reader_read_GRADIENT(swf,&nfo->fsinfo.gradient.Gradient,nfo->color_rgba);
			break;
		case swf_fillstyle_radial_gradient_fill:
			nfo->FillStyleType_str = "radial gradient fill";
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.gradient.GradientMatrix);
			swf_reader_read_GRADIENT(swf,&nfo->fsinfo.gradient.Gradient,nfo->color_rgba);
			break;
		case swf_fillstyle_focal_radial_gradient_fill:
			nfo->FillStyleType_str = "focal radial gradient fill";
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.gradient.GradientMatrix);
			swf_reader_read_FOCALGRADIENT(swf,&nfo->fsinfo.gradient.Gradient,nfo->color_rgba);
			break;
		case swf_fillstyle_repeating_bitmap_fill:
			nfo->FillStyleType_str = "repeating bitmap fill";
			nfo->fsinfo.bitmap.BitmapId = swf_reader_read_UI16(swf);
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.bitmap.BitmapMatrix);
			break;
		case swf_fillstyle_clipped_bitmap_fill:
			nfo->FillStyleType_str = "clipped bitmap fill";
			nfo->fsinfo.bitmap.BitmapId = swf_reader_read_UI16(swf);
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.bitmap.BitmapMatrix);
			break;
		case swf_fillstyle_non_smoothed_repeating_bitmap_fill:
			nfo->FillStyleType_str = "non-smoothed repeating bitmap fill";
			nfo->fsinfo.bitmap.BitmapId = swf_reader_read_UI16(swf);
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.bitmap.BitmapMatrix);
			break;
		case swf_fillstyle_non_smoothed_clipped_bitmap_fill:
			nfo->FillStyleType_str = "non-smoothed clipped bitmap fill";
			nfo->fsinfo.bitmap.BitmapId = swf_reader_read_UI16(swf);
			swf_reader_read_MATRIX(swf,&nfo->fsinfo.bitmap.BitmapMatrix);
			break;
		default:
			return -1;
	};

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x276d(%rip), %rax      # 0x6b8e
movq %rax, 0x8(%rsi)
xorl %eax, %eax
leaq -0x19(%rbp), %r15
movb %al, (%r15)
movb %al, 0x59(%rdi)
movq %r15, %rsi
movl $0x1, %edx
callq 0x2a4f
movzbl (%r15), %ecx
movb %cl, 0x4(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x12, %ecx
jg 0x446a
testl %ecx, %ecx
je 0x4496
cmpl $0x10, %ecx
je 0x44bb
cmpl $0x12, %ecx
jne 0x4588
leaq 0x2f8b(%rip), %rax      # 0x73f3
jmp 0x44c2
leal -0x40(%rcx), %edx
cmpl $0x3, %edx
ja 0x44ec
leaq 0x28bf(%rip), %rax      # 0x6d38
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2f8c(%rip), %rax      # 0x7415
movq %rax, 0x8(%rbx)
leaq -0x1c(%rbp), %r15
jmp 0x4554
leaq 0x2f30(%rip), %rax      # 0x73cd
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
testb $0x1, (%rbx)
jne 0x4593
movq %r14, %rdi
callq 0x2c03
jmp 0x4586
leaq 0x2f16(%rip), %rax      # 0x73d8
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x39cd
movzbl (%rbx), %edx
addq $0x2c, %rbx
andl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x409c
jmp 0x4586
cmpl $0x13, %ecx
jne 0x4588
leaq 0x2ef1(%rip), %rax      # 0x73ed
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x39cd
movzbl (%rbx), %edx
addq $0x2c, %rbx
andl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3f9c
jmp 0x4586
leaq 0x2ede(%rip), %rax      # 0x7408
movq %rax, 0x8(%rbx)
leaq -0x20(%rbp), %r15
jmp 0x4554
leaq 0x2ef0(%rip), %rax      # 0x742b
movq %rax, 0x8(%rbx)
leaq -0x22(%rbp), %r15
jmp 0x4554
leaq 0x2eec(%rip), %rax      # 0x7438
movq %rax, 0x8(%rbx)
leaq -0x1e(%rbp), %r15
movw $0x0, (%r15)
movb $0x0, 0x59(%r14)
movq %r14, %rdi
movq %r15, %rsi
movl $0x2, %edx
callq 0x2a4f
movzwl (%r15), %eax
movw %ax, 0x10(%rbx)
addq $0x14, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x39cd
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x2b5e
jmp 0x4586