	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_validate_dma_pkt_host
_goya_validate_dma_pkt_host:            ## @goya_validate_dma_pkt_host
	.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
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	12(%rdx), %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movq	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	%r13d, %eax
	movq	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movq	_GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r13d
	movq	_GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %r13d
	addl	$-128, %eax
	cmpl	$3, %eax
	ja	LBB0_4
## %bb.1:
	leaq	LJTI0_0(%rip), %rcx
	movslq	(%rcx,%rax,4), %rax
	addq	%rcx, %rax
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jmpq	*%rax
LBB0_3:
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_dbg
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	8(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, %r15d
	movb	$1, %r13b
	jmp	LBB0_8
LBB0_4:
	movl	(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	jmp	LBB0_5
LBB0_7:
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_dev_dbg
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	4(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, %r15d
	testl	%r13d, %r13d
	sete	%r13b
LBB0_8:
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	12(%r14), %ecx
	movl	16(%r14), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_hl_mem_area_inside_range
	testl	%eax, %eax
	jne	LBB0_14
## %bb.9:
	movl	(%r14), %edi
	movl	(%r12), %ecx
	leaq	L_.str.5(%rip), %rsi
	jmp	LBB0_10
LBB0_11:
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_dbg
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	4(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	8(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, %r15d
	testl	%r13d, %r13d
	sete	%r13b
	jmp	LBB0_12
LBB0_2:
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_dbg
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movl	8(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	4(%r12), %edi
	callq	_le64_to_cpu
	movl	%eax, %r15d
	movb	$1, %r13b
LBB0_12:
	movl	(%r12), %edi
	callq	_le32_to_cpu
	movl	4(%r14), %ecx
	movl	8(%r14), %edx
	movl	%r15d, %edi
	movl	%eax, %esi
	callq	_hl_mem_area_inside_range
	testl	%eax, %eax
	je	LBB0_13
LBB0_14:
	testb	%r13b, %r13b
	je	LBB0_15
## %bb.17:
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	jne	LBB0_20
## %bb.18:
	movq	8(%rsi), %rax
	movq	_GOYA_QUEUE_ID_DMA_1@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_20
## %bb.19:
	movl	(%r14), %edi
	leaq	L_.str.7(%rip), %rsi
LBB0_5:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_6
LBB0_15:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	$16, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_20:
	movq	%r14, %rdi
	movq	%r12, %rdx
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ebx, %r8d
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_goya_pin_memory_before_cs      ## TAILCALL
LBB0_13:
	movl	(%r14), %edi
	movl	(%r12), %ecx
	leaq	L_.str.6(%rip), %rsi
LBB0_10:
	xorl	%ebx, %ebx
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_dev_err
LBB0_6:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %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_3, LBB0_3-LJTI0_0
.set L0_0_set_7, LBB0_7-LJTI0_0
.set L0_0_set_11, LBB0_11-LJTI0_0
.set L0_0_set_2, LBB0_2-LJTI0_0
LJTI0_0:
	.long	L0_0_set_3
	.long	L0_0_set_7
	.long	L0_0_set_11
	.long	L0_0_set_2
	.end_data_region
                                        ## -- End function
	.comm	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK,4,2 ## @GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK
	.comm	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT,4,2 ## @GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT
	.comm	_GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK,4,2 ## @GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK
	.comm	_GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT,4,2 ## @GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA direction is HOST --> DRAM\n"

	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
L_.str.1:                               ## @.str.1
	.asciz	"DMA direction is DRAM --> HOST\n"

	.comm	_DMA_FROM_DEVICE,4,2            ## @DMA_FROM_DEVICE
L_.str.2:                               ## @.str.2
	.asciz	"DMA direction is HOST --> SRAM\n"

L_.str.3:                               ## @.str.3
	.asciz	"DMA direction is SRAM --> HOST\n"

L_.str.4:                               ## @.str.4
	.asciz	"DMA direction is undefined\n"

	.comm	_EFAULT,4,2                     ## @EFAULT
L_.str.5:                               ## @.str.5
	.asciz	"SRAM address 0x%llx + 0x%x is invalid\n"

L_.str.6:                               ## @.str.6
	.asciz	"DRAM address 0x%llx + 0x%x is invalid\n"

	.comm	_GOYA_QUEUE_ID_DMA_1,8,3        ## @GOYA_QUEUE_ID_DMA_1
L_.str.7:                               ## @.str.7
	.asciz	"Can't DMA from host on queue other then 1\n"

	.no_dead_strip	_goya_validate_dma_pkt_host
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_validate_dma_pkt_host
_goya_validate_dma_pkt_host:            ; @goya_validate_dma_pkt_host
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	ldr	w0, [x2, #12]
	bl	_le32_to_cpu
Lloh0:
	adrp	x8, _GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh3:
	adrp	x9, _GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	asr	w8, w8, w9
	sub	w8, w8, #128
	cmp	w8, #3
	b.hi	LBB0_3
; %bb.1:
Lloh6:
	adrp	x9, _GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT@GOTPAGE
Lloh10:
	ldr	x10, [x10, _GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT@GOTPAGEOFF]
	and	w9, w9, w0
Lloh11:
	ldr	w10, [x10]
	asr	w25, w9, w10
Lloh12:
	adrp	x9, lJTI0_0@PAGE
Lloh13:
	add	x9, x9, lJTI0_0@PAGEOFF
	adr	x10, LBB0_2
	ldrb	w11, [x9, x8]
	add	x10, x10, x11, lsl #2
	br	x10
LBB0_2:
	ldr	w0, [x21]
Lloh14:
	adrp	x1, l_.str.3@PAGE
Lloh15:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_dbg
Lloh16:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh18:
	ldr	w22, [x8]
	ldr	w0, [x19, #8]
	bl	_le64_to_cpu
	mov	x23, x0
	ldr	w0, [x19, #4]
	bl	_le64_to_cpu
	mov	x24, x0
	mov	w25, #1
	b	LBB0_5
LBB0_3:
	ldr	w0, [x21]
Lloh19:
	adrp	x1, l_.str.4@PAGE
Lloh20:
	add	x1, x1, l_.str.4@PAGEOFF
	b	LBB0_17
LBB0_4:
	ldr	w0, [x21]
Lloh21:
	adrp	x1, l_.str.2@PAGE
Lloh22:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_dbg
Lloh23:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh25:
	ldr	w22, [x8]
	ldr	w0, [x19, #4]
	bl	_le64_to_cpu
	mov	x23, x0
	ldr	w0, [x19, #8]
	bl	_le64_to_cpu
	mov	x24, x0
	cmp	w25, #0
	cset	w25, eq
LBB0_5:
	ldr	w0, [x19]
	bl	_le32_to_cpu
	mov	x1, x0
	ldp	w3, w2, [x21, #12]
	mov	x0, x24
	bl	_hl_mem_area_inside_range
	cbnz	w0, LBB0_10
; %bb.6:
	ldr	w0, [x21]
	ldr	w8, [x19]
	stp	x24, x8, [sp]
Lloh26:
	adrp	x1, l_.str.5@PAGE
Lloh27:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_17
LBB0_7:
	ldr	w0, [x21]
Lloh28:
	adrp	x1, l_.str@PAGE
Lloh29:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_dbg
Lloh30:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh32:
	ldr	w22, [x8]
	ldr	w0, [x19, #4]
	bl	_le64_to_cpu
	mov	x23, x0
	ldr	w0, [x19, #8]
	bl	_le64_to_cpu
	mov	x24, x0
	cmp	w25, #0
	cset	w25, eq
	b	LBB0_9
LBB0_8:
	ldr	w0, [x21]
Lloh33:
	adrp	x1, l_.str.1@PAGE
Lloh34:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
Lloh35:
	adrp	x8, _DMA_FROM_DEVICE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh37:
	ldr	w22, [x8]
	ldr	w0, [x19, #8]
	bl	_le64_to_cpu
	mov	x23, x0
	ldr	w0, [x19, #4]
	bl	_le64_to_cpu
	mov	x24, x0
	mov	w25, #1
LBB0_9:
	ldr	w0, [x19]
	bl	_le32_to_cpu
	mov	x1, x0
	ldp	w3, w2, [x21, #4]
	mov	x0, x24
	bl	_hl_mem_area_inside_range
	cbz	w0, LBB0_16
LBB0_10:
	tbz	w25, #0, LBB0_14
; %bb.11:
Lloh38:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh39:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh40:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_15
; %bb.12:
	ldr	x8, [x20, #8]
Lloh41:
	adrp	x9, _GOYA_QUEUE_ID_DMA_1@GOTPAGE
Lloh42:
	ldr	x9, [x9, _GOYA_QUEUE_ID_DMA_1@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x8, x9
	b.le	LBB0_15
; %bb.13:
	ldr	w0, [x21]
Lloh44:
	adrp	x1, l_.str.7@PAGE
Lloh45:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_17
LBB0_14:
	mov	w0, #0
	ldr	w8, [x20]
	add	w8, w8, #16
	str	w8, [x20]
	b	LBB0_18
LBB0_15:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	x3, x23
	mov	x4, x22
	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
	b	_goya_pin_memory_before_cs
LBB0_16:
	ldr	w0, [x21]
	ldr	w8, [x19]
	stp	x24, x8, [sp]
Lloh46:
	adrp	x1, l_.str.6@PAGE
Lloh47:
	add	x1, x1, l_.str.6@PAGEOFF
LBB0_17:
	bl	_dev_err
Lloh48:
	adrp	x8, _EFAULT@GOTPAGE
Lloh49:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_18:
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
	.section	__TEXT,__const
lJTI0_0:
	.byte	(LBB0_2-LBB0_2)>>2
	.byte	(LBB0_4-LBB0_2)>>2
	.byte	(LBB0_7-LBB0_2)>>2
	.byte	(LBB0_8-LBB0_2)>>2
                                        ; -- End function
	.comm	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK,4,2 ; @GOYA_PKT_LIN_DMA_CTL_DMA_DIR_MASK
	.comm	_GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT,4,2 ; @GOYA_PKT_LIN_DMA_CTL_DMA_DIR_SHIFT
	.comm	_GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK,4,2 ; @GOYA_PKT_LIN_DMA_CTL_MEMSET_MASK
	.comm	_GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT,4,2 ; @GOYA_PKT_LIN_DMA_CTL_MEMSET_SHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA direction is HOST --> DRAM\n"

	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
l_.str.1:                               ; @.str.1
	.asciz	"DMA direction is DRAM --> HOST\n"

	.comm	_DMA_FROM_DEVICE,4,2            ; @DMA_FROM_DEVICE
l_.str.2:                               ; @.str.2
	.asciz	"DMA direction is HOST --> SRAM\n"

l_.str.3:                               ; @.str.3
	.asciz	"DMA direction is SRAM --> HOST\n"

l_.str.4:                               ; @.str.4
	.asciz	"DMA direction is undefined\n"

	.comm	_EFAULT,4,2                     ; @EFAULT
l_.str.5:                               ; @.str.5
	.asciz	"SRAM address 0x%llx + 0x%x is invalid\n"

l_.str.6:                               ; @.str.6
	.asciz	"DRAM address 0x%llx + 0x%x is invalid\n"

	.comm	_GOYA_QUEUE_ID_DMA_1,8,3        ; @GOYA_QUEUE_ID_DMA_1
l_.str.7:                               ; @.str.7
	.asciz	"Can't DMA from host on queue other then 1\n"

	.no_dead_strip	_goya_validate_dma_pkt_host
.subsections_via_symbols
