	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_do_suspend
_nouveau_do_suspend:                    ## @nouveau_do_suspend
	.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
	movl	%esi, %r14d
	movq	%rdi, %r15
	callq	_nouveau_drm
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_nouveau_svm_suspend
	movq	%rbx, %rdi
	callq	_nouveau_dmem_suspend
	movq	%r15, %rdi
	callq	_nouveau_led_suspend
	cmpq	$0, (%r15)
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_nouveau_fbcon_set_suspend
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_nouveau_display_suspend
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_17
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	leaq	32(%rbx), %rdi
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ttm_bo_evict_mm
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.3:
	callq	_nouveau_channel_idle
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
LBB0_4:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_nouveau_channel_idle
	movl	%eax, %r12d
	testl	%eax, %eax
	jne	LBB0_15
LBB0_6:
	leaq	L_.str.4(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	cmpq	$0, (%rbx)
	je	LBB0_10
## %bb.7:
	movq	%rbx, %rdi
	callq	_nouveau_fence
	cmpq	$0, 8(%rax)
	je	LBB0_10
## %bb.8:
	movq	%rbx, %rdi
	callq	_nouveau_fence
	movq	%rbx, %rdi
	callq	*8(%rax)
	testl	%eax, %eax
	je	LBB0_9
LBB0_10:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	movq	%rbx, %rdi
	addq	$8, %rdi
	callq	_nvif_client_suspend
	testl	%eax, %eax
	je	LBB0_11
## %bb.12:
	movl	%eax, %r12d
	cmpq	$0, (%rbx)
	je	LBB0_15
## %bb.13:
	movq	%rbx, %rdi
	callq	_nouveau_fence
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.14:
	movq	%rbx, %rdi
	callq	_nouveau_fence
	movq	%rbx, %rdi
	callq	*(%rax)
LBB0_15:
	cmpq	$0, (%r15)
	je	LBB0_17
LBB0_16:
	leaq	L_.str.6(%rip), %rsi
	movq	%rbx, %rdi
	callq	_NV_DEBUG
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_nouveau_display_resume
LBB0_17:
	movl	%r12d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	xorl	%r12d, %r12d
	jmp	LBB0_17
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	cmpq	$0, (%r15)
	jne	LBB0_16
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"suspending console...\n"

L_.str.1:                               ## @.str.1
	.asciz	"suspending display...\n"

L_.str.2:                               ## @.str.2
	.asciz	"evicting buffers...\n"

	.comm	_TTM_PL_VRAM,4,2                ## @TTM_PL_VRAM
L_.str.3:                               ## @.str.3
	.asciz	"waiting for kernel channels to go idle...\n"

L_.str.4:                               ## @.str.4
	.asciz	"suspending fence...\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.5:                               ## @.str.5
	.asciz	"suspending object tree...\n"

L_.str.6:                               ## @.str.6
	.asciz	"resuming display...\n"

	.no_dead_strip	_nouveau_do_suspend
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_do_suspend
_nouveau_do_suspend:                    ; @nouveau_do_suspend
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x1
	mov	x20, x0
	bl	_nouveau_drm
	mov	x21, x0
	bl	_nouveau_svm_suspend
	mov	x0, x21
	bl	_nouveau_dmem_suspend
	mov	x0, x20
	bl	_nouveau_led_suspend
	ldr	x8, [x20]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	mov	x0, x20
	mov	w1, #1
	bl	_nouveau_fbcon_set_suspend
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	mov	x0, x20
	mov	x1, x19
	bl	_nouveau_display_suspend
	mov	x22, x0
	cbnz	w0, LBB0_15
LBB0_2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	add	x0, x21, #32
Lloh6:
	adrp	x8, _TTM_PL_VRAM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_ttm_bo_evict_mm
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	ldr	x0, [x21, #24]
	cbz	x0, LBB0_4
; %bb.3:
	bl	_nouveau_channel_idle
	mov	x22, x0
	cbnz	w0, LBB0_13
LBB0_4:
	ldr	x0, [x21, #16]
	cbz	x0, LBB0_6
; %bb.5:
	bl	_nouveau_channel_idle
	mov	x22, x0
	cbnz	w0, LBB0_13
LBB0_6:
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	ldr	x8, [x21]
	cbz	x8, LBB0_9
; %bb.7:
	mov	x0, x21
	bl	_nouveau_fence
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_nouveau_fence
	ldr	x8, [x0, #8]
	mov	x0, x21
	blr	x8
	cbz	w0, LBB0_16
LBB0_9:
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	add	x0, x21, #8
	bl	_nvif_client_suspend
	mov	x22, x0
	cbz	w0, LBB0_15
; %bb.10:
	ldr	x8, [x21]
	cbz	x8, LBB0_13
; %bb.11:
	mov	x0, x21
	bl	_nouveau_fence
	ldr	x8, [x0]
	cbz	x8, LBB0_13
; %bb.12:
	mov	x0, x21
	bl	_nouveau_fence
	ldr	x8, [x0]
	mov	x0, x21
	blr	x8
LBB0_13:
	ldr	x8, [x20]
	cbz	x8, LBB0_15
LBB0_14:
Lloh15:
	adrp	x1, l_.str.6@PAGE
Lloh16:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x21
	bl	_NV_DEBUG
	mov	x0, x20
	mov	x1, x19
	bl	_nouveau_display_resume
LBB0_15:
	mov	x0, x22
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh17:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w22, w8
	ldr	x8, [x20]
	cbnz	x8, LBB0_14
	b	LBB0_15
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"suspending console...\n"

l_.str.1:                               ; @.str.1
	.asciz	"suspending display...\n"

l_.str.2:                               ; @.str.2
	.asciz	"evicting buffers...\n"

	.comm	_TTM_PL_VRAM,4,2                ; @TTM_PL_VRAM
l_.str.3:                               ; @.str.3
	.asciz	"waiting for kernel channels to go idle...\n"

l_.str.4:                               ; @.str.4
	.asciz	"suspending fence...\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.5:                               ; @.str.5
	.asciz	"suspending object tree...\n"

l_.str.6:                               ; @.str.6
	.asciz	"resuming display...\n"

	.no_dead_strip	_nouveau_do_suspend
.subsections_via_symbols
