	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function process_polygon2
_process_polygon2:                      ## @process_polygon2
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r12d
	movl	%edx, %r15d
	movq	%rsi, %r14
	movl	%edi, %ebx
	testb	$1, %r15b
	jne	LBB0_1
## %bb.2:
	testb	$2, %r15b
	jne	LBB0_3
LBB0_4:
	testb	$4, %r15b
	jne	LBB0_5
LBB0_6:
	testb	$8, %r15b
	jne	LBB0_7
LBB0_8:
	testb	$16, %r15b
	jne	LBB0_9
LBB0_10:
	testb	$32, %r15b
	je	LBB0_12
LBB0_11:
	leaq	24(%r14), %rsi
	movl	%ebx, %edi
	callq	_rdp_in_colour
LBB0_12:
	leaq	48(%r14), %r12
	movl	%r15d, %edx
	sarl	$6, %edx
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_rdp_parse_brush
	testl	$2048, %r15d                    ## imm = 0x800
	je	LBB0_14
## %bb.13:
	movl	8(%r14), %esi
	movl	%ebx, %edi
	callq	_in_uint8
LBB0_14:
	testl	$4096, %r15d                    ## imm = 0x1000
	je	LBB0_16
## %bb.15:
	movl	12(%r14), %esi
	movl	%ebx, %edi
	callq	_in_uint8
	movq	16(%r14), %rsi
	movl	12(%r14), %edx
	movl	%ebx, %edi
	callq	_in_uint8a
LBB0_16:
	movslq	12(%r14), %rdi
	callq	_DEBUG
	leaq	L_.str.1(%rip), %rdi
	callq	_DEBUG
	cmpl	$0, 12(%r14)
	jle	LBB0_19
## %bb.17:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r14), %rax
	movslq	(%rax,%rbx,4), %rdi
	callq	_DEBUG
	incq	%rbx
	movslq	12(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_18
LBB0_19:
	leaq	L_.str.3(%rip), %rdi
	callq	_DEBUG
	movl	(%r14), %esi
	leal	-17(%rsi), %eax
	cmpl	$-17, %eax
	ja	LBB0_20
## %bb.37:
	leaq	L_.str.4(%rip), %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	xorl	%eax, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_error                          ## TAILCALL
LBB0_1:
	leaq	40(%r14), %rsi
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_rdp_in_coord
	testb	$2, %r15b
	je	LBB0_4
LBB0_3:
	leaq	32(%r14), %rsi
	movl	%ebx, %edi
	movl	%r12d, %edx
	callq	_rdp_in_coord
	testb	$4, %r15b
	je	LBB0_6
LBB0_5:
	movl	(%r14), %esi
	movl	%ebx, %edi
	callq	_in_uint8
	testb	$8, %r15b
	je	LBB0_8
LBB0_7:
	movl	4(%r14), %esi
	movl	%ebx, %edi
	callq	_in_uint8
	testb	$16, %r15b
	je	LBB0_10
LBB0_9:
	leaq	28(%r14), %rsi
	movl	%ebx, %edi
	callq	_rdp_in_colour
	testb	$32, %r15b
	jne	LBB0_11
	jmp	LBB0_12
LBB0_20:
	leaq	-52(%rbp), %rdi
	movq	%r12, %rsi
	callq	_setup_brush
	movl	8(%r14), %edi
	shll	$4, %edi
	addl	$16, %edi
	callq	_xmalloc
	movq	%rax, %rbx
	movl	8(%r14), %edx
	shll	$4, %edx
	addl	$16, %edx
	xorl	%r12d, %r12d
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movups	32(%r14), %xmm0
	movups	%xmm0, (%rbx)
	movl	8(%r14), %ecx
	leal	-1(%rcx), %edx
	leal	2(%rcx), %eax
	testl	%edx, %edx
	cmovnsl	%edx, %eax
	sarl	$2, %eax
	incl	%eax
	movl	%eax, -44(%rbp)
	testl	%ecx, %ecx
	jle	LBB0_33
## %bb.21:
	cmpl	12(%r14), %eax
	jge	LBB0_33
## %bb.22:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leaq	24(%rbx), %r13
	movl	$1, %eax
	xorl	%ebx, %ebx
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r12
	decl	%eax
	testb	$3, %al
	jne	LBB0_25
## %bb.24:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	16(%r14), %rax
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	movslq	%edx, %rcx
	incl	%edx
	movl	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	(%rax,%rcx,4), %ebx
LBB0_25:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	%ebx, %r15d
	notl	%r15d
	testb	$-128, %r15b
	je	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	16(%r14), %rdi
	leaq	-44(%rbp), %rsi
	callq	_parse_delta
	movq	%rax, (%r13)
LBB0_27:                                ##   in Loop: Header=BB0_23 Depth=1
	testb	$64, %r15b
	je	LBB0_29
## %bb.28:                              ##   in Loop: Header=BB0_23 Depth=1
	movq	16(%r14), %rdi
	leaq	-44(%rbp), %rsi
	callq	_parse_delta
	movq	%rax, -8(%r13)
LBB0_29:                                ##   in Loop: Header=BB0_23 Depth=1
	movl	8(%r14), %ecx
	cmpq	$254, %r12
	ja	LBB0_32
## %bb.30:                              ##   in Loop: Header=BB0_23 Depth=1
	movslq	%ecx, %rax
	cmpq	%rax, %r12
	jge	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_23 Depth=1
	shll	$2, %ebx
	movl	-44(%rbp), %edx
	addq	$16, %r13
	leaq	1(%r12), %rax
	cmpl	12(%r14), %edx
	jl	LBB0_23
LBB0_32:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_33:
	cmpl	%ecx, %r12d
	jne	LBB0_35
## %bb.34:
	movl	(%r14), %edi
	movl	4(%r14), %esi
	decl	%edi
	incl	%ecx
	movl	28(%r14), %r9d
	movl	24(%r14), %eax
	movl	%eax, (%rsp)
	leaq	-52(%rbp), %r8
	movq	%rbx, %rdx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_ui_polygon
	jmp	LBB0_36
LBB0_35:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_error
LBB0_36:
	movq	%rbx, %rdi
	callq	_xfree
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"Data: "

L_.str.3:                               ## @.str.3
	.asciz	"\n"

L_.str.4:                               ## @.str.4
	.asciz	"bad ROP2 0x%x\n"

L_.str.5:                               ## @.str.5
	.asciz	"polygon2 parse error\n"

	.no_dead_strip	_process_polygon2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function process_polygon2
_process_polygon2:                      ; @process_polygon2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x3
	mov	x22, x2
	mov	x19, x1
	mov	x20, x0
	tbnz	w2, #0, LBB0_16
; %bb.1:
	tbnz	w22, #1, LBB0_17
LBB0_2:
	tbnz	w22, #2, LBB0_18
LBB0_3:
	tbnz	w22, #3, LBB0_19
LBB0_4:
	tbnz	w22, #4, LBB0_20
LBB0_5:
	tbz	w22, #5, LBB0_7
LBB0_6:
	add	x1, x19, #24
	mov	x0, x20
	bl	_rdp_in_colour
LBB0_7:
	add	x21, x19, #48
	asr	w2, w22, #6
	mov	x0, x20
	mov	x1, x21
	bl	_rdp_parse_brush
	tbz	w22, #11, LBB0_9
; %bb.8:
	ldr	w1, [x19, #8]
	mov	x0, x20
	bl	_in_uint8
LBB0_9:
	tbz	w22, #12, LBB0_11
; %bb.10:
	ldr	w1, [x19, #12]
	mov	x0, x20
	bl	_in_uint8
	ldr	x1, [x19, #16]
	ldr	w2, [x19, #12]
	mov	x0, x20
	bl	_in_uint8a
LBB0_11:
	ldrsw	x0, [x19, #12]
	bl	_DEBUG
Lloh0:
	adrp	x0, l_.str.1@PAGE
Lloh1:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DEBUG
	ldr	w8, [x19, #12]
	cmp	w8, #1
	b.lt	LBB0_14
; %bb.12:
	mov	x20, #0
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldrsw	x0, [x8, x20, lsl #2]
	bl	_DEBUG
	add	x20, x20, #1
	ldrsw	x8, [x19, #12]
	cmp	x20, x8
	b.lt	LBB0_13
LBB0_14:
Lloh2:
	adrp	x0, l_.str.3@PAGE
Lloh3:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DEBUG
	ldr	w8, [x19]
	sub	w9, w8, #17
	cmn	w9, #17
	b.hi	LBB0_21
; %bb.15:
	str	x8, [sp]
Lloh4:
	adrp	x0, l_.str.4@PAGE
Lloh5:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_error
	b	LBB0_39
LBB0_16:
	add	x1, x19, #40
	mov	x0, x20
	mov	x2, x21
	bl	_rdp_in_coord
	tbz	w22, #1, LBB0_2
LBB0_17:
	add	x1, x19, #32
	mov	x0, x20
	mov	x2, x21
	bl	_rdp_in_coord
	tbz	w22, #2, LBB0_3
LBB0_18:
	ldr	w1, [x19]
	mov	x0, x20
	bl	_in_uint8
	tbz	w22, #3, LBB0_4
LBB0_19:
	ldr	w1, [x19, #4]
	mov	x0, x20
	bl	_in_uint8
	tbz	w22, #4, LBB0_5
LBB0_20:
	add	x1, x19, #28
	mov	x0, x20
	bl	_rdp_in_colour
	tbnz	w22, #5, LBB0_6
	b	LBB0_7
LBB0_21:
	add	x0, sp, #8
	mov	x1, x21
	bl	_setup_brush
	ldr	w8, [x19, #8]
	lsl	w8, w8, #4
	add	w0, w8, #16
	bl	_xmalloc
	mov	x20, x0
	ldr	w8, [x19, #8]
	lsl	w8, w8, #4
	add	w2, w8, #16
	mov	w1, #0
	bl	_memset
	ldr	w8, [x19, #8]
	subs	w9, w8, #1
	add	w10, w8, #2
	cmp	w9, #0
	csel	w9, w10, w9, lt
	ldp	x11, x10, [x19, #32]
	stp	x11, x10, [x20]
	asr	w9, w9, #2
	add	w9, w9, #1
	str	w9, [sp, #12]
	cmp	w8, #1
	b.lt	LBB0_33
; %bb.22:
	ldr	w10, [x19, #12]
	cmp	w9, w10
	b.ge	LBB0_36
; %bb.23:
	mov	w24, #0
	mov	w23, #0
	add	x22, x20, #24
	mov	w9, #1
LBB0_24:                                ; =>This Inner Loop Header: Depth=1
	mov	x21, x9
	sub	w8, w21, #1
	tst	w8, #0x3
	b.eq	LBB0_31
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=1
	mvn	w25, w24
	tbnz	w25, #7, LBB0_32
LBB0_26:                                ;   in Loop: Header=BB0_24 Depth=1
	tbz	w25, #6, LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_24 Depth=1
	ldr	x0, [x19, #16]
	add	x1, sp, #12
	bl	_parse_delta
	stur	x0, [x22, #-8]
LBB0_28:                                ;   in Loop: Header=BB0_24 Depth=1
	ldr	w8, [x19, #8]
	cmp	x21, #254
	b.hi	LBB0_34
; %bb.29:                               ;   in Loop: Header=BB0_24 Depth=1
	sxtw	x9, w8
	cmp	x21, x9
	b.ge	LBB0_34
; %bb.30:                               ;   in Loop: Header=BB0_24 Depth=1
	lsl	w24, w24, #2
	ldr	w10, [sp, #12]
	ldr	w11, [x19, #12]
	add	x22, x22, #16
	add	x9, x21, #1
	cmp	w10, w11
	b.lt	LBB0_24
	b	LBB0_34
LBB0_31:                                ;   in Loop: Header=BB0_24 Depth=1
	ldr	x8, [x19, #16]
	ldr	w24, [x8, w23, sxtw #2]
	add	w23, w23, #1
	mvn	w25, w24
	tbz	w25, #7, LBB0_26
LBB0_32:                                ;   in Loop: Header=BB0_24 Depth=1
	ldr	x0, [x19, #16]
	add	x1, sp, #12
	bl	_parse_delta
	str	x0, [x22]
	tbnz	w25, #6, LBB0_27
	b	LBB0_28
LBB0_33:
	mov	w21, #0
LBB0_34:
	cmp	w21, w8
	b.ne	LBB0_37
LBB0_35:
	ldp	w9, w1, [x19]
	sub	w0, w9, #1
	add	w3, w8, #1
	ldp	w6, w5, [x19, #24]
	add	x4, sp, #8
	mov	x2, x20
	bl	_ui_polygon
	b	LBB0_38
LBB0_36:
	mov	w21, #0
	cmp	w21, w8
	b.eq	LBB0_35
LBB0_37:
Lloh6:
	adrp	x0, l_.str.5@PAGE
Lloh7:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_error
LBB0_38:
	mov	x0, x20
	bl	_xfree
LBB0_39:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"Data: "

l_.str.3:                               ; @.str.3
	.asciz	"\n"

l_.str.4:                               ; @.str.4
	.asciz	"bad ROP2 0x%x\n"

l_.str.5:                               ; @.str.5
	.asciz	"polygon2 parse error\n"

	.no_dead_strip	_process_polygon2
.subsections_via_symbols
