	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function media_bay_resume
_media_bay_resume:                      ## @media_bay_resume
	.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	%rdi, %r14
	callq	_macio_get_drvdata
	movq	%rax, %rbx
	movq	(%r14), %rax
	movq	_PM_EVENT_ON@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.1:
	movq	_PMSG_ON@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	%rbx, %r14
	addq	$24, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_set_mb_power
	movq	_MB_POWER_DELAY@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_msleep
	movq	64(%rbx), %rax
	movq	%rbx, %rdi
	callq	*(%rax)
	cmpq	(%rbx), %rax
	jne	LBB0_2
## %bb.3:
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_set_mb_power
	movq	(%rbx), %rax
	movq	%rax, 8(%rbx)
	movq	_MB_STABLE_DELAY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_msecs_to_jiffies
	movq	%rax, 56(%rbx)
	movl	(%r15), %edi
	callq	_msecs_to_jiffies
	movq	%rax, 48(%rbx)
	movq	_MB_POLL_DELAY@GOTPCREL(%rip), %r15
	movq	_mb_empty@GOTPCREL(%rip), %r12
	movq	_mb_up@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_msleep
	movl	40(%rbx), %edi
	callq	_media_bay_step
	movq	16(%rbx), %rax
	cmpq	(%r12), %rax
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	(%r13), %rax
	jne	LBB0_4
LBB0_6:
	movq	$0, 32(%rbx)
	jmp	LBB0_7
LBB0_2:
	movl	40(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_printk
LBB0_7:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_8:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PM_EVENT_ON,8,3                ## @PM_EVENT_ON
	.comm	_PMSG_ON,8,3                    ## @PMSG_ON
	.comm	_MB_POWER_DELAY,4,2             ## @MB_POWER_DELAY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mediabay%d: Content changed during sleep...\n"

	.comm	_MB_STABLE_DELAY,4,2            ## @MB_STABLE_DELAY
	.comm	_MB_POLL_DELAY,4,2              ## @MB_POLL_DELAY
	.comm	_mb_empty,8,3                   ## @mb_empty
	.comm	_mb_up,8,3                      ## @mb_up
	.no_dead_strip	_media_bay_resume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function media_bay_resume
_media_bay_resume:                      ; @media_bay_resume
	.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
	mov	x20, x0
	bl	_macio_get_drvdata
	ldr	x8, [x20]
Lloh0:
	adrp	x9, _PM_EVENT_ON@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PM_EVENT_ON@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_7
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _PMSG_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PMSG_ON@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [x20]
	add	x20, x0, #24
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x19
	mov	w1, #0
	bl	_set_mb_power
Lloh6:
	adrp	x21, _MB_POWER_DELAY@GOTPAGE
Lloh7:
	ldr	x21, [x21, _MB_POWER_DELAY@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_msleep
	ldr	x8, [x19, #64]
	ldr	x8, [x8]
	mov	x0, x19
	blr	x8
	ldr	x8, [x19]
	cmp	x0, x8
	b.ne	LBB0_5
; %bb.2:
	mov	x0, x19
	mov	w1, #1
	bl	_set_mb_power
	ldr	x8, [x19]
	str	x8, [x19, #8]
Lloh8:
	adrp	x8, _MB_STABLE_DELAY@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MB_STABLE_DELAY@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_msecs_to_jiffies
	str	x0, [x19, #56]
	ldr	w0, [x21]
	bl	_msecs_to_jiffies
	str	x0, [x19, #48]
Lloh11:
	adrp	x21, _MB_POLL_DELAY@GOTPAGE
Lloh12:
	ldr	x21, [x21, _MB_POLL_DELAY@GOTPAGEOFF]
Lloh13:
	adrp	x22, _mb_empty@GOTPAGE
Lloh14:
	ldr	x22, [x22, _mb_empty@GOTPAGEOFF]
Lloh15:
	adrp	x23, _mb_up@GOTPAGE
Lloh16:
	ldr	x23, [x23, _mb_up@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_msleep
	ldr	w0, [x19, #40]
	bl	_media_bay_step
	ldr	x8, [x19, #16]
	ldr	x9, [x22]
	ldr	x10, [x23]
	cmp	x8, x9
	ccmp	x8, x10, #4, ne
	b.ne	LBB0_3
; %bb.4:
	str	xzr, [x19, #32]
	b	LBB0_6
LBB0_5:
	ldr	w1, [x19, #40]
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printk
LBB0_6:
	mov	x0, x20
	bl	_mutex_unlock
LBB0_7:
	mov	w0, #0
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PM_EVENT_ON,8,3                ; @PM_EVENT_ON
	.comm	_PMSG_ON,8,3                    ; @PMSG_ON
	.comm	_MB_POWER_DELAY,4,2             ; @MB_POWER_DELAY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mediabay%d: Content changed during sleep...\n"

	.comm	_MB_STABLE_DELAY,4,2            ; @MB_STABLE_DELAY
	.comm	_MB_POLL_DELAY,4,2              ; @MB_POLL_DELAY
	.comm	_mb_empty,8,3                   ; @mb_empty
	.comm	_mb_up,8,3                      ; @mb_up
	.no_dead_strip	_media_bay_resume
.subsections_via_symbols
