	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_open_ioctl             ## -- Begin function drm_gem_open_ioctl
	.p2align	4, 0x90
_drm_gem_open_ioctl:                    ## @drm_gem_open_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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rdi), %rax
	movq	_DRIVER_GEM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_1
## %bb.3:
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_spin_lock
	leaq	4(%rbx), %rdi
	movl	8(%r15), %esi
	callq	_idr_find
	testq	%rax, %rax
	je	LBB0_7
## %bb.4:
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_drm_gem_object_reference
	movq	%rbx, %rdi
	callq	_spin_unlock
	leaq	-36(%rbp), %rdx
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_drm_gem_handle_create
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_drm_gem_object_unreference_unlocked
	testl	%ebx, %ebx
	jne	LBB0_6
## %bb.5:
	movl	-36(%rbp), %eax
	movl	%eax, 4(%r15)
	movl	(%r12), %eax
	movl	%eax, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_6
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	movq	%rbx, %rdi
	callq	_spin_unlock
	movq	_ENOENT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRIVER_GEM,4,2                 ## @DRIVER_GEM
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_ENOENT,4,2                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_open_ioctl             ; -- Begin function drm_gem_open_ioctl
	.p2align	2
_drm_gem_open_ioctl:                    ; @drm_gem_open_ioctl
	.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
	ldr	x8, [x0, #8]
	ldr	w8, [x8]
Lloh0:
	adrp	x9, _DRIVER_GEM@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRIVER_GEM@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.1:
	mov	x20, x2
	mov	x19, x1
	mov	x21, x0
	bl	_spin_lock
	add	x0, x21, #4
	ldr	w1, [x19, #8]
	bl	_idr_find
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	bl	_drm_gem_object_reference
	mov	x0, x21
	bl	_spin_unlock
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x22
	bl	_drm_gem_handle_create
	mov	x20, x0
	mov	x0, x22
	bl	_drm_gem_object_unreference_unlocked
	cbnz	w20, LBB0_7
; %bb.3:
	ldr	w8, [sp, #12]
	ldr	w9, [x22]
	stp	w9, w8, [x19]
	b	LBB0_7
LBB0_4:
Lloh3:
	adrp	x8, _ENODEV@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
	mov	x0, x21
	bl	_spin_unlock
Lloh5:
	adrp	x8, _ENOENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_7:
	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	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_DRIVER_GEM,4,2                 ; @DRIVER_GEM
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_ENOENT,4,2                     ; @ENOENT
.subsections_via_symbols
