	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_patch_cb
_goya_patch_cb:                         ## @goya_patch_cb
	.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
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	cmpq	$0, (%rsi)
	jle	LBB0_18
## %bb.1:
	movq	%rsi, %r13
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
LBB0_9:                                 ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_dev_err
	xorl	%r15d, %r15d
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_14:                                ##   in Loop: Header=BB0_2 Depth=1
	subl	(%rax), %r15d
	movq	-56(%rbp), %r13                 ## 8-byte Reload
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	testl	%r15d, %r15d
	jne	LBB0_19
LBB0_17:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%r12, %r14
	cmpq	(%r13), %r12
	jge	LBB0_18
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	$0, -72(%rbp)
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movq	(%rcx), %r15
	movq	(%rax), %rbx
	addq	-64(%rbp), %rbx                 ## 8-byte Folded Reload
	movl	(%r15,%r14), %edi
	callq	_le64_to_cpu
                                        ## kill: def $eax killed $eax def $rax
	movq	_PACKET_HEADER_PACKET_ID_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_PACKET_HEADER_PACKET_ID_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	sarl	%cl, %eax
	movq	_goya_packet_sizes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%r13, %rdx
	movq	(%rcx,%rax,8), %r13
	leaq	(%r14,%r13), %r12
	cmpq	(%rdx), %r12
	jg	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-128(%rax), %ecx
	cmpl	$9, %ecx
	ja	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	addq	%r14, %r15
	leaq	LJTI0_0(%rip), %rdx
	movslq	(%rdx,%rcx,4), %rax
	addq	%rdx, %rax
	jmpq	*%rax
LBB0_16:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_memcpy
	addq	%r13, -64(%rbp)                 ## 8-byte Folded Spill
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_17
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	leaq	L_.str.5(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	xorl	%r15d, %r15d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_7:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	%rbx, %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_memcpy
	addq	%r13, -64(%rbp)                 ## 8-byte Folded Spill
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%rbx, %rdx
	callq	_goya_validate_wreg32
	movl	%eax, %r15d
	jmp	LBB0_15
LBB0_12:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_9
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_9
LBB0_6:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	movq	%r15, %rdx
	movq	%rbx, %rcx
	leaq	-72(%rbp), %r8
	callq	_goya_patch_dma_packet
	movl	%eax, %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	-72(%rbp), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	jmp	LBB0_15
LBB0_11:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_9
LBB0_18:
	xorl	%r15d, %r15d
	jmp	LBB0_19
LBB0_3:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_19:
	movl	%r15d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
	.p2align	2, 0x90
	.data_region jt32
.set L0_0_set_8, LBB0_8-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_16, LBB0_16-LJTI0_0
.set L0_0_set_10, LBB0_10-LJTI0_0
.set L0_0_set_6, LBB0_6-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
LJTI0_0:
	.long	L0_0_set_8
	.long	L0_0_set_7
	.long	L0_0_set_12
	.long	L0_0_set_16
	.long	L0_0_set_16
	.long	L0_0_set_10
	.long	L0_0_set_16
	.long	L0_0_set_6
	.long	L0_0_set_16
	.long	L0_0_set_11
	.end_data_region
                                        ## -- End function
	.comm	_PACKET_HEADER_PACKET_ID_MASK,4,2 ## @PACKET_HEADER_PACKET_ID_MASK
	.comm	_PACKET_HEADER_PACKET_ID_SHIFT,4,2 ## @PACKET_HEADER_PACKET_ID_SHIFT
	.comm	_goya_packet_sizes,8,3          ## @goya_packet_sizes
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"packet 0x%x is out of CB boundary\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"User not allowed to use WREG_BULK\n"

	.comm	_EPERM,4,2                      ## @EPERM
L_.str.2:                               ## @.str.2
	.asciz	"User not allowed to use MSG_PROT\n"

L_.str.3:                               ## @.str.3
	.asciz	"User not allowed to use CP_DMA\n"

L_.str.4:                               ## @.str.4
	.asciz	"User not allowed to use STOP\n"

L_.str.5:                               ## @.str.5
	.asciz	"Invalid packet header 0x%x\n"

	.no_dead_strip	_goya_patch_cb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_patch_cb
_goya_patch_cb:                         ; @goya_patch_cb
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x1]
	cmp	x8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x20, x1
	mov	x19, x0
	mov	x22, #0
	mov	x23, #0
Lloh0:
	adrp	x24, _PACKET_HEADER_PACKET_ID_MASK@GOTPAGE
Lloh1:
	ldr	x24, [x24, _PACKET_HEADER_PACKET_ID_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x25, _PACKET_HEADER_PACKET_ID_SHIFT@GOTPAGE
Lloh3:
	ldr	x25, [x25, _PACKET_HEADER_PACKET_ID_SHIFT@GOTPAGEOFF]
Lloh4:
	adrp	x21, _goya_packet_sizes@GOTPAGE
Lloh5:
	ldr	x21, [x21, _goya_packet_sizes@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x28
	mov	x1, x26
	mov	x2, x27
	bl	_memcpy
	add	x23, x27, x23
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	cmp	x22, x8
	b.ge	LBB0_16
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	xzr, [sp, #8]
	ldp	x9, x8, [x20, #8]
	ldr	x8, [x8]
	add	x26, x8, x22
	ldr	x28, [x9]
	ldr	w0, [x26]
	bl	_le64_to_cpu
	ldr	w8, [x24]
	and	w8, w8, w0
	ldr	w9, [x25]
	asr	w8, w8, w9
	ldr	x9, [x21]
	ldr	x27, [x9, w8, uxtw #3]
	ldr	x9, [x20]
	add	x22, x27, x22
	cmp	x22, x9
	b.gt	LBB0_17
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	sub	w9, w8, #128
	cmp	w9, #9
	b.hi	LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x28, x28, x23
Lloh6:
	adrp	x11, lJTI0_0@PAGE
Lloh7:
	add	x11, x11, lJTI0_0@PAGEOFF
	adr	x8, LBB0_2
	ldrb	w10, [x11, x9]
	add	x8, x8, x10, lsl #2
	br	x8
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
	str	x8, [sp]
Lloh10:
	adrp	x1, l_.str.5@PAGE
Lloh11:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_15
LBB0_9:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x28
	mov	x1, x26
	mov	x2, x27
	bl	_memcpy
	add	x23, x27, x23
	mov	x0, x19
	mov	x1, x20
	mov	x2, x28
	bl	_goya_validate_wreg32
	cbz	w0, LBB0_3
	b	LBB0_18
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x20
	mov	x2, x26
	mov	x3, x28
	bl	_goya_patch_dma_packet
	ldr	x8, [sp, #8]
	add	x23, x8, x23
	cbz	w0, LBB0_3
	b	LBB0_18
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x19]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_dev_err
Lloh20:
	adrp	x8, _EPERM@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x8]
	neg	w0, w8
	cbz	w0, LBB0_3
	b	LBB0_18
LBB0_16:
	mov	w0, #0
	b	LBB0_18
LBB0_17:
	ldr	w0, [x19]
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	str	x8, [sp]
Lloh22:
	adrp	x1, l_.str@PAGE
Lloh23:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh24:
	adrp	x8, _EINVAL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_11-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_12-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_13-LBB0_2)>>2
                                        ; -- End function
	.comm	_PACKET_HEADER_PACKET_ID_MASK,4,2 ; @PACKET_HEADER_PACKET_ID_MASK
	.comm	_PACKET_HEADER_PACKET_ID_SHIFT,4,2 ; @PACKET_HEADER_PACKET_ID_SHIFT
	.comm	_goya_packet_sizes,8,3          ; @goya_packet_sizes
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"packet 0x%x is out of CB boundary\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"User not allowed to use WREG_BULK\n"

	.comm	_EPERM,4,2                      ; @EPERM
l_.str.2:                               ; @.str.2
	.asciz	"User not allowed to use MSG_PROT\n"

l_.str.3:                               ; @.str.3
	.asciz	"User not allowed to use CP_DMA\n"

l_.str.4:                               ; @.str.4
	.asciz	"User not allowed to use STOP\n"

l_.str.5:                               ; @.str.5
	.asciz	"Invalid packet header 0x%x\n"

	.no_dead_strip	_goya_patch_cb
.subsections_via_symbols
