	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_gem_prime_import_sg_table ## -- Begin function etnaviv_gem_prime_import_sg_table
	.p2align	4, 0x90
_etnaviv_gem_prime_import_sg_table:     ## @etnaviv_gem_prime_import_sg_table
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rdi, %r14
	movq	(%rsi), %rax
	movl	(%rax), %edi
	callq	_PAGE_ALIGN
	movq	%rax, %rbx
	movq	_ETNA_BO_WC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_etnaviv_gem_prime_ops@GOTPCREL(%rip), %rcx
	leaq	-32(%rbp), %r8
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_etnaviv_gem_new_private
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	-32(%rbp), %rdi
	addq	$16, %rdi
	movq	_etnaviv_prime_lock_class@GOTPCREL(%rip), %rsi
	callq	_lockdep_set_class
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_3
## %bb.4:
	movq	%rbx, %rax
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rbx
	jmp	LBB0_5
LBB0_1:
	movl	%eax, %edi
	jmp	LBB0_10
LBB0_3:
	movl	%ebx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_5:
	movq	-32(%rbp), %rax
	movq	%r15, 8(%rax)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movl	$8, %esi
	callq	_kvmalloc_array
	movq	-32(%rbp), %rsi
	movl	%eax, 4(%rsi)
	testl	%eax, %eax
	je	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	movl	%ebx, %ecx
	callq	_drm_prime_sg_to_page_addr_arrays
	movq	-32(%rbp), %rsi
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	movl	%eax, %ebx
	jmp	LBB0_9
LBB0_6:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%rsi, %rdi
	callq	_drm_gem_object_put_unlocked
	movl	%ebx, %edi
LBB0_10:
	callq	_ERR_PTR
LBB0_11:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	%r14, %rdi
	callq	_etnaviv_gem_obj_add
	movq	-32(%rbp), %rax
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_ETNA_BO_WC,4,2                 ## @ETNA_BO_WC
	.comm	_etnaviv_gem_prime_ops,4,2      ## @etnaviv_gem_prime_ops
	.comm	_etnaviv_prime_lock_class,4,2   ## @etnaviv_prime_lock_class
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_etnaviv_gem_prime_import_sg_table ; -- Begin function etnaviv_gem_prime_import_sg_table
	.p2align	2
_etnaviv_gem_prime_import_sg_table:     ; @etnaviv_gem_prime_import_sg_table
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x2
	mov	x19, x0
	ldr	x8, [x1]
	ldr	w0, [x8]
	bl	_PAGE_ALIGN
	mov	x21, x0
Lloh0:
	adrp	x8, _ETNA_BO_WC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ETNA_BO_WC@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
Lloh3:
	adrp	x3, _etnaviv_gem_prime_ops@GOTPAGE
Lloh4:
	ldr	x3, [x3, _etnaviv_gem_prime_ops@GOTPAGEOFF]
	add	x4, sp, #8
	mov	x0, x19
	mov	x1, x21
	bl	_etnaviv_gem_new_private
	tbnz	w0, #31, LBB0_6
; %bb.1:
	ldr	x8, [sp, #8]
	add	x0, x8, #16
Lloh5:
	adrp	x1, _etnaviv_prime_lock_class@GOTPAGE
Lloh6:
	ldr	x1, [x1, _etnaviv_prime_lock_class@GOTPAGEOFF]
	bl	_lockdep_set_class
Lloh7:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	ldr	x9, [sp, #8]
	str	x20, [x9, #8]
Lloh10:
	adrp	x9, _GFP_KERNEL@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GFP_KERNEL@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x9]
	udiv	x21, x21, x8
	mov	x0, x21
	mov	w1, #8
	bl	_kvmalloc_array
	ldr	x1, [sp, #8]
	str	w0, [x1, #4]
	cbz	w0, LBB0_4
; %bb.2:
	mov	x8, x0
	mov	x0, x20
	mov	x1, x8
	mov	x2, #0
	mov	x3, x21
	bl	_drm_prime_sg_to_page_addr_arrays
	ldr	x1, [sp, #8]
	cbz	w0, LBB0_8
; %bb.3:
	mov	x20, x0
	b	LBB0_5
LBB0_4:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_5:
	mov	x0, x1
	bl	_drm_gem_object_put_unlocked
	mov	x0, x20
LBB0_6:
	bl	_ERR_PTR
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_8:
	mov	x0, x19
	bl	_etnaviv_gem_obj_add
	ldr	x0, [sp, #8]
	b	LBB0_7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ETNA_BO_WC,4,2                 ; @ETNA_BO_WC
	.comm	_etnaviv_gem_prime_ops,4,2      ; @etnaviv_gem_prime_ops
	.comm	_etnaviv_prime_lock_class,4,2   ; @etnaviv_prime_lock_class
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
