	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_drm_open
_nouveau_drm_open:                      ## @nouveau_drm_open
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_nouveau_drm
	movq	%rax, %r14
	movq	%rsp, -88(%rbp)                 ## 8-byte Spill
	movq	_TASK_COMM_LEN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movl	(%r12), %edi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	movl	%eax, %ebx
	movq	_EACCES@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%ebx, %eax
	jne	LBB0_8
LBB0_2:
	movq	_current@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_get_task_comm
	movl	8(%r15), %edi
	callq	_pid_nr
	leaq	L_.str(%rip), %rdx
	leaq	-80(%rbp), %rdi
	movl	$32, %esi
	movq	%r13, %rcx
	movl	%eax, %r8d
	callq	_snprintf
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r13
	leaq	-80(%rbp), %rsi
	movq	%r14, %rdi
	movq	%rax, %rdx
	callq	_nouveau_cli_init
	testl	%eax, %eax
	je	LBB0_5
## %bb.6:
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_nouveau_cli_fini
	movq	%r13, %rdi
	callq	_kfree
	jmp	LBB0_7
LBB0_3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_5:
	movl	$0, 4(%r13)
	movq	%r13, (%r15)
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rsi
	addq	$4, %rsi
	movq	%r13, %rdi
	callq	_list_add
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_7:
	movl	(%r12), %edi
	callq	_pm_runtime_mark_last_busy
	movl	(%r12), %edi
	callq	_pm_runtime_put_autosuspend
LBB0_8:
	movq	-88(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_TASK_COMM_LEN,4,2              ## @TASK_COMM_LEN
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_current,4,2                    ## @current
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s[%d]"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_nouveau_drm_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_drm_open
_nouveau_drm_open:                      ; @nouveau_drm_open
	.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
	sub	sp, sp, #48
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	bl	_nouveau_drm
	mov	x20, x0
	mov	x24, sp
Lloh3:
	adrp	x8, _TASK_COMM_LEN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TASK_COMM_LEN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	ldr	w0, [x19]
	bl	_pm_runtime_get_sync
	tbz	w0, #31, LBB0_2
; %bb.1:
	mov	x22, x0
Lloh8:
	adrp	x8, _EACCES@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmn	w0, w8
	b.ne	LBB0_8
LBB0_2:
Lloh11:
	adrp	x8, _current@GOTPAGE
Lloh12:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_get_task_comm
	ldr	w0, [x21, #8]
	bl	_pid_nr
	mov	x4, x0
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	sub	x0, x29, #88
	mov	w1, #32
	mov	x3, x23
	bl	_snprintf
Lloh16:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x23, x0
	sub	x1, x29, #88
	mov	x0, x20
	mov	x2, x23
	bl	_nouveau_cli_init
	mov	x22, x0
	cbz	w0, LBB0_6
; %bb.4:
	mov	x0, x23
	bl	_nouveau_cli_fini
	mov	x0, x23
	bl	_kfree
	b	LBB0_7
LBB0_5:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_6:
	str	wzr, [x23, #4]
	str	x23, [x21]
	mov	x0, x20
	bl	_mutex_lock
	add	x1, x20, #4
	mov	x0, x23
	bl	_list_add
	mov	x0, x20
	bl	_mutex_unlock
LBB0_7:
	ldr	w0, [x19]
	bl	_pm_runtime_mark_last_busy
	ldr	w0, [x19]
	bl	_pm_runtime_put_autosuspend
LBB0_8:
	mov	sp, x24
	ldur	x8, [x29, #-56]
Lloh22:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh23:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	mov	x0, x22
	sub	sp, x29, #48
	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_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_TASK_COMM_LEN,4,2              ; @TASK_COMM_LEN
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_current,4,2                    ; @current
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s[%d]"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_nouveau_drm_open
.subsections_via_symbols
