	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_validate_cb
_goya_validate_cb:                      ## @goya_validate_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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r12
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	$0, (%rsi)
	cmpq	$0, 8(%rsi)
	jle	LBB0_20
## %bb.1:
	leaq	LJTI0_0(%rip), %r14
	xorl	%ebx, %ebx
	jmp	LBB0_4
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_goya_validate_wreg32
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r13d
	testl	%r13d, %r13d
	jne	LBB0_22
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r12), %rcx
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rbx
	cmpq	%rcx, %r15
	jge	LBB0_20
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movq	(%rax), %r13
	movl	(%r13,%rbx), %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	(%rcx,%rax,8), %rdx
	leaq	(%rdx,%rbx), %r15
	movq	8(%r12), %rcx
	cmpq	%rcx, %r15
	jg	LBB0_21
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	-128(%rax), %esi
	cmpl	$9, %esi
	ja	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	addq	%rbx, %r13
	movslq	(%r14,%rsi,4), %rax
	addq	%r14, %rax
	jmpq	*%rax
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	%rdx, (%r12)
	jmp	LBB0_3
LBB0_8:                                 ##   in Loop: Header=BB0_4 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	%r13d, %r13d
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_17
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_16
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_16
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_goya_validate_dma_pkt_mmu
	jmp	LBB0_10
LBB0_15:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%eax, %eax
	callq	_dev_err
	xorl	%r13d, %r13d
	movq	_EPERM@GOTPCREL(%rip), %rax
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	subl	(%rax), %r13d
	testl	%r13d, %r13d
	je	LBB0_18
	jmp	LBB0_22
LBB0_19:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_goya_validate_dma_pkt_no_mmu
	jmp	LBB0_10
LBB0_20:
	xorl	%r13d, %r13d
	jmp	LBB0_22
LBB0_21:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_22:
	addq	$8, (%r12)
	movl	%r13d, %eax
	addq	$24, %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_7, LBB0_7-LJTI0_0
.set L0_0_set_9, LBB0_9-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
.set L0_0_set_12, LBB0_12-LJTI0_0
.set L0_0_set_13, LBB0_13-LJTI0_0
.set L0_0_set_15, LBB0_15-LJTI0_0
LJTI0_0:
	.long	L0_0_set_7
	.long	L0_0_set_9
	.long	L0_0_set_11
	.long	L0_0_set_2
	.long	L0_0_set_2
	.long	L0_0_set_12
	.long	L0_0_set_2
	.long	L0_0_set_13
	.long	L0_0_set_2
	.long	L0_0_set_15
	.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_validate_cb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_validate_cb
_goya_validate_cb:                      ; @goya_validate_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
	mov	x19, x1
	str	xzr, [x1]
	ldr	x8, [x1, #8]
	cmp	x8, #1
	b.lt	LBB0_18
; %bb.1:
	mov	x20, x2
	mov	x21, x0
	mov	x22, #0
Lloh0:
	adrp	x23, _PACKET_HEADER_PACKET_ID_MASK@GOTPAGE
Lloh1:
	ldr	x23, [x23, _PACKET_HEADER_PACKET_ID_MASK@GOTPAGEOFF]
Lloh2:
	adrp	x24, _PACKET_HEADER_PACKET_ID_SHIFT@GOTPAGE
Lloh3:
	ldr	x24, [x24, _PACKET_HEADER_PACKET_ID_SHIFT@GOTPAGEOFF]
Lloh4:
	adrp	x25, _goya_packet_sizes@GOTPAGE
Lloh5:
	ldr	x25, [x25, _goya_packet_sizes@GOTPAGEOFF]
Lloh6:
	adrp	x26, lJTI0_0@PAGE
Lloh7:
	add	x26, x26, lJTI0_0@PAGEOFF
Lloh8:
	adrp	x28, _EPERM@GOTPAGE
Lloh9:
	ldr	x28, [x28, _EPERM@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x19]
	add	x9, x9, x10
	str	x9, [x19]
	cmp	x22, x8
	b.ge	LBB0_18
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x8, [x8]
	add	x27, x8, x22
	ldr	w0, [x27]
	bl	_le64_to_cpu
	ldr	w8, [x23]
	and	w8, w8, w0
	ldr	w9, [x24]
	asr	w9, w8, w9
	ldr	x8, [x25]
	ldr	x10, [x8, w9, uxtw #3]
	ldr	x8, [x19, #8]
	add	x22, x10, x22
	cmp	x22, x8
	b.gt	LBB0_19
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	sub	w11, w9, #128
	cmp	w11, #9
	b.hi	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	adr	x9, LBB0_2
	ldrb	w12, [x26, x11]
	add	x9, x9, x12, lsl #2
	br	x9
LBB0_6:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
Lloh10:
	adrp	x1, l_.str.1@PAGE
Lloh11:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_7:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	str	x9, [sp]
Lloh12:
	adrp	x1, l_.str.5@PAGE
Lloh13:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_dev_err
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	b	LBB0_15
LBB0_8:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x19
	mov	x2, x27
	bl	_goya_validate_wreg32
	cbz	w0, LBB0_16
	b	LBB0_20
LBB0_9:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
Lloh17:
	adrp	x1, l_.str.4@PAGE
Lloh18:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_10:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x21
	mov	x1, x19
	mov	x2, x27
	cbz	w20, LBB0_17
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	bl	_goya_validate_dma_pkt_mmu
	cbz	w0, LBB0_16
	b	LBB0_20
LBB0_13:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_14:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_dev_err
	ldr	w8, [x28]
LBB0_15:                                ;   in Loop: Header=BB0_3 Depth=1
	neg	w0, w8
	cbnz	w0, LBB0_20
LBB0_16:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x19, #8]
	cmp	x22, x8
	b.lt	LBB0_3
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_3 Depth=1
	bl	_goya_validate_dma_pkt_no_mmu
	cbz	w0, LBB0_16
	b	LBB0_20
LBB0_18:
	mov	w0, #0
	b	LBB0_20
LBB0_19:
	ldr	w0, [x21]
                                        ; kill: def $w9 killed $w9 killed $x9 def $x9
	str	x9, [sp]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh25:
	adrp	x8, _EINVAL@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_20:
	ldr	x8, [x19]
	add	x8, x8, #8
	str	x8, [x19]
	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	Lloh8, Lloh9
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_6-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
	.byte	(LBB0_9-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_10-LBB0_2)>>2
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_11-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_validate_cb
.subsections_via_symbols
