	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_attach_phys    ## -- Begin function i915_gem_object_attach_phys
	.p2align	4, 0x90
_i915_gem_object_attach_phys:           ## @i915_gem_object_attach_phys
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	%esi, 40(%rdi)
	jl	LBB0_1
## %bb.2:
	movq	%rdi, %r15
	movq	32(%rdi), %rax
	xorl	%ebx, %ebx
	cmpq	_i915_gem_phys_ops@GOTPCREL(%rip), %rax
	je	LBB0_18
## %bb.3:
	cmpq	_i915_gem_shmem_ops@GOTPCREL(%rip), %rax
	je	LBB0_4
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_18:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	movq	_I915_GEM_OBJECT_UNBIND_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i915_gem_object_unbind
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_18
## %bb.5:
	leaq	8(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r15), %rax
	movq	_I915_MADV_WILLNEED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.8:
	cmpq	$0, 24(%r15)
	je	LBB0_9
LBB0_6:
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_7:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movq	%r14, %rdi
	callq	_mutex_unlock
	jmp	LBB0_18
LBB0_9:
	cmpq	$0, 16(%r15)
	je	LBB0_11
## %bb.10:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_11:
	movq	%r15, %rdi
	callq	___i915_gem_object_unset_pages
	movq	%rax, %r12
	movq	_i915_gem_phys_ops@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r15)
	movq	%r15, %rdi
	callq	_____i915_gem_object_get_pages
	testl	%eax, %eax
	je	LBB0_12
## %bb.15:
	movl	%eax, %ebx
	movq	_i915_gem_shmem_ops@GOTPCREL(%rip), %rax
	movq	%rax, 32(%r15)
	movq	%r12, %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_17
## %bb.16:
	movl	(%r12), %edi
	callq	_i915_sg_page_sizes
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	___i915_gem_object_set_pages
	jmp	LBB0_17
LBB0_12:
	movq	%r15, %rdi
	callq	___i915_gem_object_pin_pages
	movq	%r12, %rdi
	callq	_IS_ERR_OR_NULL
	testl	%eax, %eax
	jne	LBB0_14
## %bb.13:
	movq	_i915_gem_shmem_ops@GOTPCREL(%rip), %rax
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	*(%rax)
LBB0_14:
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_i915_gem_phys_ops,8,3          ## @i915_gem_phys_ops
	.comm	_i915_gem_shmem_ops,8,3         ## @i915_gem_shmem_ops
	.comm	_I915_GEM_OBJECT_UNBIND_ACTIVE,4,2 ## @I915_GEM_OBJECT_UNBIND_ACTIVE
	.comm	_I915_MADV_WILLNEED,8,3         ## @I915_MADV_WILLNEED
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_object_attach_phys    ; -- Begin function i915_gem_object_attach_phys
	.p2align	2
_i915_gem_object_attach_phys:           ; @i915_gem_object_attach_phys
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	w8, [x0, #40]
	cmp	w8, w1
	b.lt	LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x0, #32]
Lloh0:
	adrp	x24, _i915_gem_phys_ops@GOTPAGE
Lloh1:
	ldr	x24, [x24, _i915_gem_phys_ops@GOTPAGEOFF]
	cmp	x8, x24
	b.eq	LBB0_4
; %bb.2:
Lloh2:
	adrp	x23, _i915_gem_shmem_ops@GOTPAGE
Lloh3:
	ldr	x23, [x23, _i915_gem_shmem_ops@GOTPAGEOFF]
	cmp	x8, x23
	b.eq	LBB0_5
LBB0_3:
Lloh4:
	adrp	x8, _EINVAL@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_11
LBB0_4:
	mov	w21, #0
	b	LBB0_11
LBB0_5:
Lloh7:
	adrp	x8, _I915_GEM_OBJECT_UNBIND_ACTIVE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _I915_GEM_OBJECT_UNBIND_ACTIVE@GOTPAGEOFF]
Lloh9:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i915_gem_object_unbind
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.6:
	add	x19, x20, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20]
Lloh10:
	adrp	x9, _I915_MADV_WILLNEED@GOTPAGE
Lloh11:
	ldr	x9, [x9, _I915_MADV_WILLNEED@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.7:
	ldr	x8, [x20, #24]
	cbz	x8, LBB0_12
LBB0_8:
Lloh13:
	adrp	x8, _EFAULT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_11:
	mov	x0, x21
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	x8, [x20, #16]
	cbz	x8, LBB0_14
; %bb.13:
Lloh15:
	adrp	x8, _EBUSY@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_9
LBB0_14:
	mov	x0, x20
	bl	___i915_gem_object_unset_pages
	mov	x22, x0
	str	x24, [x20, #32]
	mov	x0, x20
	bl	_____i915_gem_object_get_pages
	cbz	w0, LBB0_17
; %bb.15:
	mov	x21, x0
	str	x23, [x20, #32]
	mov	x0, x22
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_10
; %bb.16:
	ldr	w0, [x22]
	bl	_i915_sg_page_sizes
	mov	x2, x0
	mov	x0, x20
	mov	x1, x22
	bl	___i915_gem_object_set_pages
	b	LBB0_10
LBB0_17:
	mov	x0, x20
	bl	___i915_gem_object_pin_pages
	mov	x0, x22
	bl	_IS_ERR_OR_NULL
	cbnz	w0, LBB0_19
; %bb.18:
	ldr	x8, [x23]
	mov	x0, x20
	mov	x1, x22
	blr	x8
LBB0_19:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w21, #0
	b	LBB0_11
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_i915_gem_phys_ops,8,3          ; @i915_gem_phys_ops
	.comm	_i915_gem_shmem_ops,8,3         ; @i915_gem_shmem_ops
	.comm	_I915_GEM_OBJECT_UNBIND_ACTIVE,4,2 ; @I915_GEM_OBJECT_UNBIND_ACTIVE
	.comm	_I915_MADV_WILLNEED,8,3         ; @I915_MADV_WILLNEED
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
