	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function i915_gem_map_dma_buf
_i915_gem_map_dma_buf:                  ## @i915_gem_map_dma_buf
	.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	%esi, %r14d
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_dma_buf_to_obj
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_i915_gem_object_pin_pages
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movq	(%r13), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%r15, %rdi
	callq	_sg_alloc_table
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
LBB0_10:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	%r13, %rdi
	callq	_i915_gem_object_unpin_pages
LBB0_12:
	movl	%ebx, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR_PTR                        ## TAILCALL
LBB0_4:
	movq	(%r13), %rax
	movq	8(%r15), %rbx
	cmpl	$0, (%rax)
	jle	LBB0_8
## %bb.5:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	8(%rax), %r14
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	callq	_sg_page
	movl	(%r14), %edx
	movq	%rbx, %rdi
	movl	%eax, %esi
	xorl	%ecx, %ecx
	callq	_sg_set_page
	movq	%rbx, %rdi
	callq	_sg_next
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_sg_next
	movq	%rax, %r14
	incl	%r15d
	movq	(%r13), %rax
	cmpl	(%rax), %r15d
	jl	LBB0_6
## %bb.7:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	8(%r15), %rbx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
LBB0_8:
	movl	(%r12), %edi
	movl	(%r15), %edx
	movq	%rbx, %rsi
	movl	%r14d, %ecx
	callq	_dma_map_sg
	testl	%eax, %eax
	je	LBB0_9
## %bb.13:
	movq	%r15, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_sg_free_table
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_i915_gem_map_dma_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function i915_gem_map_dma_buf
_i915_gem_map_dma_buf:                  ; @i915_gem_map_dma_buf
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x22, x0
	ldr	w0, [x0, #4]
	bl	_dma_buf_to_obj
	mov	x19, x0
	bl	_i915_gem_object_pin_pages
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.1:
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x21, x0
	ldr	x8, [x19]
	ldr	w1, [x8]
	ldr	w2, [x23]
	bl	_sg_alloc_table
	mov	x23, x0
	cbz	w0, LBB0_7
LBB0_3:
	mov	x0, x21
	bl	_kfree
	b	LBB0_5
LBB0_4:
Lloh2:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_5:
	mov	x0, x19
	bl	_i915_gem_object_unpin_pages
LBB0_6:
	mov	x0, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR_PTR
LBB0_7:
	ldr	x8, [x19]
	ldr	x23, [x21, #8]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_11
; %bb.8:
	mov	w25, #0
	ldr	x24, [x8, #8]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x24
	bl	_sg_page
	mov	x1, x0
	ldr	w2, [x24]
	mov	x0, x23
	mov	w3, #0
	bl	_sg_set_page
	mov	x0, x23
	bl	_sg_next
	mov	x23, x0
	mov	x0, x24
	bl	_sg_next
	mov	x24, x0
	add	w25, w25, #1
	ldr	x8, [x19]
	ldr	w8, [x8]
	cmp	w25, w8
	b.lt	LBB0_9
; %bb.10:
	ldr	x23, [x21, #8]
LBB0_11:
	ldr	w0, [x22]
	ldr	w2, [x21]
	mov	x1, x23
	mov	x3, x20
	bl	_dma_map_sg
	cbz	w0, LBB0_13
; %bb.12:
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_13:
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w23, w8
	mov	x0, x21
	bl	_sg_free_table
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_i915_gem_map_dma_buf
.subsections_via_symbols
