// File: /workspace/github_c_makefile_star2_O3/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 0x27a3(%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 0x2a27
movzbl (%r15), %ecx
movb %cl, 0x4(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl $0x12, %ecx
jg 0x4434
testl %ecx, %ecx
je 0x4460
cmpl $0x10, %ecx
je 0x4485
cmpl $0x12, %ecx
jne 0x4552
leaq 0x2fc1(%rip), %rax      # 0x73f3
jmp 0x448c
leal -0x40(%rcx), %edx
cmpl $0x3, %edx
ja 0x44b6
leaq 0x28f5(%rip), %rax      # 0x6d38
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
jmpq *%rcx
leaq 0x2fc2(%rip), %rax      # 0x7415
movq %rax, 0x8(%rbx)
leaq -0x1c(%rbp), %r15
jmp 0x451e
leaq 0x2f66(%rip), %rax      # 0x73cd
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
testb $0x1, (%rbx)
jne 0x455d
movq %r14, %rdi
callq 0x2bdb
jmp 0x4550
leaq 0x2f4c(%rip), %rax      # 0x73d8
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x3981
movzbl (%rbx), %edx
addq $0x2c, %rbx
andl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4063
jmp 0x4550
cmpl $0x13, %ecx
jne 0x4552
leaq 0x2f27(%rip), %rax      # 0x73ed
movq %rax, 0x8(%rbx)
leaq 0x10(%rbx), %rsi
movq %r14, %rdi
callq 0x3981
movzbl (%rbx), %edx
addq $0x2c, %rbx
andl $0x1, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3f63
jmp 0x4550
leaq 0x2f14(%rip), %rax      # 0x7408
movq %rax, 0x8(%rbx)
leaq -0x20(%rbp), %r15
jmp 0x451e
leaq 0x2f26(%rip), %rax      # 0x742b
movq %rax, 0x8(%rbx)
leaq -0x22(%rbp), %r15
jmp 0x451e
leaq 0x2f22(%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 0x2a27
movzwl (%r15), %eax
movw %ax, 0x10(%rbx)
addq $0x14, %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3981
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
callq 0x2b36
jmp 0x4550