	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_create_mmap_offset     ## -- Begin function drm_gem_create_mmap_offset
	.p2align	4, 0x90
_drm_gem_create_mmap_offset:            ## @drm_gem_create_mmap_offset
	.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
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	movq	(%rax), %r15
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kzalloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	__DRM_GEM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movl	(%rbx), %ecx
	movl	%ecx, (%rax)
	movq	%rbx, 8(%rax)
	leaq	4(%r15), %rdi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r12
	movl	%ecx, %eax
	cltd
	idivl	(%r12)
	xorl	%r14d, %r14d
	movl	%eax, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_drm_mm_search_free
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_6
## %bb.2:
	movq	%rax, %rdi
	movl	(%rbx), %eax
	cltd
	idivl	(%r12)
	xorl	%r14d, %r14d
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_drm_mm_get_block
	movq	%rax, 16(%rbx)
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movl	(%rax), %eax
	leaq	24(%rbx), %rsi
	movl	%eax, 24(%rbx)
	movq	%r15, %rdi
	callq	_drm_ht_insert_item
	testl	%eax, %eax
	je	LBB0_10
## %bb.4:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	16(%rbx), %rdi
	callq	_drm_mm_put_block
	movl	%r15d, %r14d
	jmp	LBB0_9
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_10
LBB0_6:
	movl	4(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DRM_ERROR
	movq	_ENOSPC@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
LBB0_8:
	subl	(%rax), %r14d
LBB0_9:
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	$0, 8(%rbx)
LBB0_10:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	__DRM_GEM,4,2                   ## @_DRM_GEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate offset for bo %d\n"

	.comm	_ENOSPC,4,2                     ## @ENOSPC
L_.str.1:                               ## @.str.1
	.asciz	"failed to add to map hash\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_create_mmap_offset     ; -- Begin function drm_gem_create_mmap_offset
	.p2align	2
_drm_gem_create_mmap_offset:            ; @drm_gem_create_mmap_offset
	.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	x19, x0
	ldr	x8, [x0, #32]
	ldr	x20, [x8]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kzalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.1:
Lloh3:
	adrp	x8, __DRM_GEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, __DRM_GEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	str	w8, [x0, #16]
	ldr	w8, [x19]
	str	w8, [x0]
	str	x19, [x0, #8]
	add	x0, x20, #4
Lloh6:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w9, [x21]
	sdiv	w1, w8, w9
	mov	w2, #0
	mov	w3, #0
	bl	_drm_mm_search_free
	str	x0, [x19, #16]
	cbz	x0, LBB0_6
; %bb.2:
	ldr	w8, [x19]
	ldr	w9, [x21]
	sdiv	w1, w8, w9
	mov	w2, #0
	bl	_drm_mm_get_block
	str	x0, [x19, #16]
	cbz	x0, LBB0_7
; %bb.3:
	ldr	w8, [x0]
	mov	x1, x19
	str	w8, [x1, #24]!
	mov	x0, x20
	bl	_drm_ht_insert_item
	mov	x20, x0
	cbz	w0, LBB0_10
; %bb.4:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DRM_ERROR
	ldr	x0, [x19, #16]
	bl	_drm_mm_put_block
	b	LBB0_9
LBB0_5:
Lloh10:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh11:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_10
LBB0_6:
	ldr	w8, [x19, #4]
	str	x8, [sp]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
Lloh15:
	adrp	x8, _ENOSPC@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ENOSPC@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_9:
	ldr	x0, [x19, #8]
	bl	_kfree
	str	xzr, [x19, #8]
LBB0_10:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	__DRM_GEM,4,2                   ; @_DRM_GEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate offset for bo %d\n"

	.comm	_ENOSPC,4,2                     ; @ENOSPC
l_.str.1:                               ; @.str.1
	.asciz	"failed to add to map hash\n"

.subsections_via_symbols
