	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mg_resume
_mg_resume:                             ## @mg_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %r15
	movq	8(%r15), %r14
	movq	_MG_STAT_READY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	_MG_TMAX_CONF_TO_CMD@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_mg_wait
	testq	%rax, %rax
	jne	LBB0_1
## %bb.2:
	movq	_MG_CMD_WAKEUP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MG_REG_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	callq	_outb
	movl	$1, %edi
	callq	_msleep
	movl	(%r12), %esi
	movl	(%rbx), %edx
	movq	%r14, %rdi
	callq	_mg_wait
	testq	%rax, %rax
	je	LBB0_3
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%ebx, %ebx
	cmpl	$0, (%r15)
	jne	LBB0_5
## %bb.4:
	movq	_MG_REG_DRV_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r14), %rsi
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_outb
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.comm	_MG_STAT_READY,4,2              ## @MG_STAT_READY
	.comm	_MG_TMAX_CONF_TO_CMD,4,2        ## @MG_TMAX_CONF_TO_CMD
	.comm	_EIO,4,2                        ## @EIO
	.comm	_MG_CMD_WAKEUP,4,2              ## @MG_CMD_WAKEUP
	.comm	_MG_REG_COMMAND,8,3             ## @MG_REG_COMMAND
	.comm	_MG_REG_DRV_CTRL,8,3            ## @MG_REG_DRV_CTRL
	.no_dead_strip	_mg_resume
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mg_resume
_mg_resume:                             ; @mg_resume
	.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
	ldr	x20, [x0]
	ldr	x19, [x20, #8]
Lloh0:
	adrp	x21, _MG_STAT_READY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _MG_STAT_READY@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x22, _MG_TMAX_CONF_TO_CMD@GOTPAGE
Lloh3:
	ldr	x22, [x22, _MG_TMAX_CONF_TO_CMD@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_mg_wait
	cbnz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x8, _MG_CMD_WAKEUP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MG_CMD_WAKEUP@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
	ldr	x8, [x19]
Lloh7:
	adrp	x9, _MG_REG_COMMAND@GOTPAGE
Lloh8:
	ldr	x9, [x9, _MG_REG_COMMAND@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
	mov	w0, #1
	bl	_msleep
	ldr	w1, [x21]
	ldr	w2, [x22]
	mov	x0, x19
	bl	_mg_wait
	cbz	x0, LBB0_4
LBB0_2:
Lloh10:
	adrp	x8, _EIO@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_3:
	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_4:
	ldr	w8, [x20]
	cbnz	w8, LBB0_6
; %bb.5:
	ldr	x8, [x19]
Lloh13:
	adrp	x9, _MG_REG_DRV_CTRL@GOTPAGE
Lloh14:
	ldr	x9, [x9, _MG_REG_DRV_CTRL@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	w0, #0
	bl	_outb
LBB0_6:
	mov	w0, #0
	b	LBB0_3
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_MG_STAT_READY,4,2              ; @MG_STAT_READY
	.comm	_MG_TMAX_CONF_TO_CMD,4,2        ; @MG_TMAX_CONF_TO_CMD
	.comm	_EIO,4,2                        ; @EIO
	.comm	_MG_CMD_WAKEUP,4,2              ; @MG_CMD_WAKEUP
	.comm	_MG_REG_COMMAND,8,3             ; @MG_REG_COMMAND
	.comm	_MG_REG_DRV_CTRL,8,3            ; @MG_REG_DRV_CTRL
	.no_dead_strip	_mg_resume
.subsections_via_symbols
