	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_mmap_ioctl            ## -- Begin function i915_gem_mmap_ioctl
	.p2align	4, 0x90
_i915_gem_mmap_ioctl:                   ## @i915_gem_mmap_ioctl
	.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
	movq	%rdx, %rbx
	movl	(%rsi), %eax
	movq	_I915_MMAP_WC@GOTPCREL(%rip), %r12
	movl	(%r12), %ecx
	movl	%ecx, %edx
	notl	%edx
	testl	%edx, %eax
	je	LBB0_3
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_24:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	%rsi, %r15
	testl	%eax, %ecx
	je	LBB0_6
## %bb.4:
	movq	_X86_FEATURE_PAT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_boot_cpu_has
	testl	%eax, %eax
	je	LBB0_5
LBB0_6:
	movl	24(%r15), %esi
	movq	%rbx, %rdi
	callq	_i915_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	movq	%rax, %r14
	cmpl	$0, (%rax)
	je	LBB0_9
## %bb.11:
	movl	16(%r15), %esi
	movl	20(%r15), %edi
	movq	8(%r14), %rdx
	callq	_range_overflows
	testq	%rax, %rax
	je	LBB0_14
## %bb.12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_7:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_9:
	movq	_ENXIO@GOTPCREL(%rip), %rax
LBB0_10:
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
	jmp	LBB0_13
LBB0_14:
	movl	(%r14), %edi
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	16(%r15), %edx
	movl	20(%r15), %r9d
	xorl	%esi, %esi
	callq	_vm_mmap
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_IS_ERR_VALUE
	testq	%rax, %rax
	je	LBB0_15
LBB0_13:
	movq	%r14, %rdi
	callq	_i915_gem_object_put
	jmp	LBB0_24
LBB0_15:
	movl	(%r12), %eax
	testl	%eax, (%r15)
	je	LBB0_23
## %bb.16:
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_down_write_killable
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	movq	_EINTR@GOTPCREL(%rip), %rax
	jmp	LBB0_10
LBB0_18:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_find_vma
	testq	%rax, %rax
	je	LBB0_21
## %bb.19:
	movq	%rax, %r13
	movl	(%r14), %esi
	movl	16(%r15), %ecx
	movq	%rax, %rdi
	movq	%rbx, %rdx
	callq	___vma_matches
	testq	%rax, %rax
	je	LBB0_21
## %bb.20:
	movl	(%r13), %edi
	callq	_vm_get_page_prot
	movl	%eax, %edi
	callq	_pgprot_writecombine
	movl	%eax, 4(%r13)
	jmp	LBB0_22
LBB0_21:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subq	(%rax), %rbx
LBB0_22:
	movq	%r12, %rdi
	callq	_up_write
	movq	%rbx, %rdi
	callq	_IS_ERR_VALUE
	testq	%rax, %rax
	jne	LBB0_13
LBB0_23:
	movq	%r14, %rdi
	callq	_i915_gem_object_put
	movq	%rbx, 8(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_I915_MMAP_WC,4,2               ## @I915_MMAP_WC
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_X86_FEATURE_PAT,4,2            ## @X86_FEATURE_PAT
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ENXIO,8,3                      ## @ENXIO
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_current,8,3                    ## @current
	.comm	_EINTR,8,3                      ## @EINTR
	.comm	_ENOMEM,8,3                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_i915_gem_mmap_ioctl            ; -- Begin function i915_gem_mmap_ioctl
	.p2align	2
_i915_gem_mmap_ioctl:                   ; @i915_gem_mmap_ioctl
	.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, [x1]
Lloh0:
	adrp	x22, _I915_MMAP_WC@GOTPAGE
Lloh1:
	ldr	x22, [x22, _I915_MMAP_WC@GOTPAGEOFF]
	ldr	w9, [x22]
	bics	wzr, w8, w9
	b.eq	LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_3:
	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_4:
	mov	x20, x2
	mov	x19, x1
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
Lloh4:
	adrp	x8, _X86_FEATURE_PAT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _X86_FEATURE_PAT@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	bl	_boot_cpu_has
	cbz	w0, LBB0_11
LBB0_6:
	ldr	w1, [x19, #24]
	mov	x0, x20
	bl	_i915_gem_object_lookup
	cbz	x0, LBB0_10
; %bb.7:
	mov	x20, x0
	ldr	w8, [x0]
	cbz	w8, LBB0_12
; %bb.8:
	ldp	w1, w0, [x19, #16]
	ldr	x2, [x20, #8]
	bl	_range_overflows
	cbz	x0, LBB0_14
; %bb.9:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_15
LBB0_10:
Lloh10:
	adrp	x8, _ENOENT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_2
LBB0_11:
Lloh12:
	adrp	x8, _ENODEV@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_2
LBB0_12:
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
LBB0_13:
	ldr	x8, [x8]
	neg	x21, x8
	b	LBB0_15
LBB0_14:
	ldr	w0, [x20]
Lloh16:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh20:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh22:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh24:
	ldr	w4, [x8]
	ldp	w2, w5, [x19, #16]
	mov	w1, #0
	bl	_vm_mmap
	mov	x21, x0
	bl	_IS_ERR_VALUE
	cbz	x0, LBB0_16
LBB0_15:
	mov	x0, x20
	bl	_i915_gem_object_put
	b	LBB0_3
LBB0_16:
	ldr	w8, [x19]
	ldr	w9, [x22]
	tst	w9, w8
	b.eq	LBB0_24
; %bb.17:
Lloh25:
	adrp	x8, _current@GOTPAGE
Lloh26:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x22, [x8]
	mov	x0, x22
	bl	_down_write_killable
	cbz	x0, LBB0_19
; %bb.18:
Lloh28:
	adrp	x8, _EINTR@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
	b	LBB0_13
LBB0_19:
	mov	x0, x22
	mov	x1, x21
	bl	_find_vma
	cbz	x0, LBB0_22
; %bb.20:
	mov	x23, x0
	ldr	w1, [x20]
	ldr	w3, [x19, #16]
	mov	x2, x21
	bl	___vma_matches
	cbz	x0, LBB0_22
; %bb.21:
	ldr	w0, [x23]
	bl	_vm_get_page_prot
	bl	_pgprot_writecombine
	str	w0, [x23, #4]
	b	LBB0_23
LBB0_22:
Lloh30:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	neg	x21, x8
LBB0_23:
	mov	x0, x22
	bl	_up_write
	mov	x0, x21
	bl	_IS_ERR_VALUE
	cbnz	x0, LBB0_15
LBB0_24:
	mov	x0, x20
	bl	_i915_gem_object_put
	str	x21, [x19, #8]
	mov	w21, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_I915_MMAP_WC,4,2               ; @I915_MMAP_WC
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_X86_FEATURE_PAT,4,2            ; @X86_FEATURE_PAT
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ENXIO,8,3                      ; @ENXIO
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_current,8,3                    ; @current
	.comm	_EINTR,8,3                      ; @EINTR
	.comm	_ENOMEM,8,3                     ; @ENOMEM
.subsections_via_symbols
