	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_attach_phys_object    ## -- Begin function i915_gem_attach_phys_object
	.p2align	4, 0x90
_i915_gem_attach_phys_object:           ## @i915_gem_attach_phys_object
	.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	%ecx, %r15d
	movl	%edx, %ebx
	movq	%rsi, %r12
	movq	%rdi, %r13
	movl	12(%rsi), %edi
	callq	_file_inode
	movq	_I915_MAX_PHYS_OBJECT@GOTPCREL(%rip), %rcx
	cmpl	%ebx, (%rcx)
	jge	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_2:
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	(%r13), %rcx
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movl	%r15d, %r14d
	xorl	%r15d, %r15d
	cmpl	%ebx, (%rax)
	je	LBB0_13
## %bb.4:
	movq	%r13, %rdi
	movq	%r12, %rsi
	movq	%rcx, %r15
	callq	_i915_gem_detach_phys_object
	movq	%r15, %rcx
	movl	%r14d, %r15d
LBB0_5:
	movq	(%rcx), %rax
	movslq	%ebx, %r14
	movq	-8(%rax,%r14,8), %rax
	testq	%rax, %rax
	je	LBB0_6
LBB0_8:
	movq	%rax, (%r12)
	movq	%r12, 16(%rax)
	movl	8(%r12), %eax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jle	LBB0_12
## %bb.9:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	callq	_shmem_read_mapping_page
	movq	%rax, %r13
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	jne	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_KM_USER0@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_kmap_atomic
	movq	%rax, %r14
	movq	(%r12), %rax
	movq	8(%rax), %rax
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%edx, %ecx
	imull	%ebx, %ecx
	movslq	%ecx, %rdi
	addq	(%rax), %rdi
	movq	%r14, %rsi
	callq	_memcpy
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_kunmap_atomic
	movq	%r13, %rdi
	callq	_mark_page_accessed
	movq	%r13, %rdi
	callq	_page_cache_release
	incl	%ebx
	cmpl	%ebx, -48(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_10
LBB0_12:
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_6:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movl	8(%r12), %edx
	movq	%r13, %rdi
	movl	%ebx, %esi
	movl	%r15d, %ecx
	callq	_i915_gem_init_phys_object
	testl	%eax, %eax
	je	LBB0_7
## %bb.14:
	movl	%eax, %r15d
	movl	8(%r12), %edx
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_DRM_ERROR
LBB0_13:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_7:
	decq	%r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rax
	movq	(%rax,%r14,8), %rax
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_MAX_PHYS_OBJECT,4,2       ## @I915_MAX_PHYS_OBJECT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to init phys object %d size: %zu\n"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_KM_USER0,4,2                   ## @KM_USER0
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_attach_phys_object    ; -- Begin function i915_gem_attach_phys_object
	.p2align	2
_i915_gem_attach_phys_object:           ; @i915_gem_attach_phys_object
	.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	x22, x3
	mov	x21, x2
	mov	x19, x1
	mov	x23, x0
	ldr	w0, [x1, #12]
	bl	_file_inode
Lloh0:
	adrp	x8, _I915_MAX_PHYS_OBJECT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I915_MAX_PHYS_OBJECT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w21
	b.ge	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_11
LBB0_2:
	ldr	x20, [x0]
	ldr	x24, [x23]
	ldr	x8, [x19]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w8, [x8]
	cmp	w8, w21
	b.eq	LBB0_10
; %bb.4:
	mov	x0, x23
	mov	x1, x19
	bl	_i915_gem_detach_phys_object
LBB0_5:
	ldr	x8, [x24]
	sub	w25, w21, #1
	ldr	x8, [x8, w25, sxtw #3]
	cbz	x8, LBB0_12
LBB0_6:
	str	x8, [x19]
	str	x19, [x8, #16]
	ldr	w8, [x19, #8]
Lloh6:
	adrp	x24, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x24, [x24, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x24]
	sdiv	w25, w8, w9
	cmp	w25, #1
	b.lt	LBB0_10
; %bb.7:
	mov	w21, #0
Lloh8:
	adrp	x26, _KM_USER0@GOTPAGE
Lloh9:
	ldr	x26, [x26, _KM_USER0@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	mov	x1, x21
	bl	_shmem_read_mapping_page
	mov	x22, x0
	bl	_IS_ERR
	cbnz	x0, LBB0_14
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w1, [x26]
	mov	x0, x22
	bl	_kmap_atomic
	mov	x23, x0
	ldr	x8, [x19]
	ldr	x8, [x8, #8]
	ldr	x8, [x8]
	ldr	w2, [x24]
	mul	w9, w2, w21
	add	x0, x8, w9, sxtw
	mov	x1, x23
	bl	_memcpy
	ldr	w1, [x26]
	mov	x0, x23
	bl	_kunmap_atomic
	mov	x0, x22
	bl	_mark_page_accessed
	mov	x0, x22
	bl	_page_cache_release
	add	w21, w21, #1
	cmp	w25, w21
	b.ne	LBB0_8
LBB0_10:
	mov	w22, #0
LBB0_11:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
	ldr	w2, [x19, #8]
	mov	x0, x23
	mov	x1, x21
	mov	x3, x22
	bl	_i915_gem_init_phys_object
	cbz	w0, LBB0_15
; %bb.13:
	mov	x22, x0
	ldr	w2, [x19, #8]
Lloh10:
	adrp	x0, l_.str@PAGE
Lloh11:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_DRM_ERROR
	b	LBB0_11
LBB0_14:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PTR_ERR
LBB0_15:
	sxtw	x8, w25
	ldr	x9, [x24]
	ldr	x8, [x9, x8, lsl #3]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_MAX_PHYS_OBJECT,4,2       ; @I915_MAX_PHYS_OBJECT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to init phys object %d size: %zu\n"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_KM_USER0,4,2                   ; @KM_USER0
.subsections_via_symbols
