	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function goya_pin_memory_before_cs
_goya_pin_memory_before_cs:             ## @goya_pin_memory_before_cs
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movl	%ecx, %r13d
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	(%rdx), %edi
	callq	_le32_to_cpu
	movl	4(%r14), %ecx
	leaq	-48(%rbp), %r8
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_hl_userptr_is_pinned
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	-48(%rbp), %rax
LBB0_9:
	movq	8(%rax), %rsi
	movq	%r12, %rdi
	callq	_goya_get_dma_desc_list_size
	addl	%eax, (%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_2:
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	(%rbx), %edi
	callq	_le32_to_cpu
	movq	-48(%rbp), %rcx
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%eax, %edx
	callq	_hl_pin_host_memory
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_7
## %bb.5:
	movq	-48(%rbp), %rdi
	addq	$16, %rdi
	movl	4(%r14), %esi
	callq	_list_add_tail
	movq	8(%r12), %rax
	movq	-48(%rbp), %rcx
	movq	8(%rcx), %rcx
	movl	(%rcx), %edx
	movl	4(%rcx), %esi
	movq	%r12, %rdi
	movl	%r15d, %ecx
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:
	movl	%eax, %ebx
	movl	(%r12), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movq	-48(%rbp), %rsi
	movq	%r12, %rdi
	callq	_hl_unpin_host_memory
LBB0_7:
	movq	-48(%rbp), %rdi
	callq	_kfree
	jmp	LBB0_10
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	-48(%rbp), %rax
	movl	$1, (%rax)
	movl	%r15d, 4(%rax)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to map sgt with DMA region\n"

	.no_dead_strip	_goya_pin_memory_before_cs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function goya_pin_memory_before_cs
_goya_pin_memory_before_cs:             ; @goya_pin_memory_before_cs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x21, x4
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x2]
	bl	_le32_to_cpu
	mov	x2, x0
	ldr	w3, [x20, #4]
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x22
	bl	_hl_userptr_is_pinned
	cbz	x0, LBB0_3
; %bb.1:
	ldr	x8, [sp, #8]
LBB0_2:
	ldr	x1, [x8, #8]
	mov	x0, x19
	bl	_goya_get_dma_desc_list_size
	mov	w22, #0
	ldr	w8, [x20]
	add	w8, w8, w0
	str	w8, [x20]
	b	LBB0_9
LBB0_3:
Lloh0:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	str	x0, [sp, #8]
	cbz	x0, LBB0_8
; %bb.4:
	ldr	w0, [x23]
	bl	_le32_to_cpu
	mov	x2, x0
	ldr	x3, [sp, #8]
	mov	x0, x19
	mov	x1, x22
	bl	_hl_pin_host_memory
	mov	x22, x0
	cbnz	w0, LBB0_7
; %bb.5:
	ldr	x8, [sp, #8]
	add	x0, x8, #16
	ldr	w1, [x20, #4]
	bl	_list_add_tail
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	ldr	x9, [x9, #8]
	ldp	w2, w1, [x9]
	mov	x0, x19
	mov	x3, x21
	blr	x8
	cbz	w0, LBB0_10
; %bb.6:
	mov	x22, x0
	ldr	w0, [x19]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_hl_unpin_host_memory
LBB0_7:
	ldr	x0, [sp, #8]
	bl	_kfree
	b	LBB0_9
LBB0_8:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_10:
	ldr	x8, [sp, #8]
	mov	w9, #1
	stp	w9, w21, [x8]
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to map sgt with DMA region\n"

	.no_dead_strip	_goya_pin_memory_before_cs
.subsections_via_symbols
