	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mg_out
_mg_out:                                ## @mg_out
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movl	%ecx, %r12d
	movl	%edx, %r13d
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	movq	(%rax), %r14
	movq	_MG_STAT_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_MG_TMAX_CONF_TO_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_mg_wait
	testq	%rax, %rax
	jne	LBB0_4
## %bb.1:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movl	%r12d, -48(%rbp)                ## 4-byte Spill
	cmpl	$0, (%r14)
	jne	LBB0_3
## %bb.2:
	movq	%rax, 8(%rbx)
	leaq	24(%rbx), %rdi
	movq	_jiffies@GOTPCREL(%rip), %rax
	movq	_HZ@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	leaq	(%rcx,%rcx,2), %rsi
	addq	(%rax), %rsi
	callq	_mod_timer
LBB0_3:
	movq	_MG_RES_SEC@GOTPCREL(%rip), %rax
	addl	(%rax), %r15d
	movq	_MG_REG_SECT_CNT@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	callq	_outb
	movq	_MG_REG_SECT_NUM@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	movl	%r15d, %edi
	callq	_outb
	movl	%r15d, %edi
	shrl	$8, %edi
	movq	_MG_REG_CYL_LOW@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	callq	_outb
	movl	%r15d, %edi
	shrl	$16, %edi
	movq	_MG_REG_CYL_HIGH@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	callq	_outb
	shrl	$24, %r15d
	movq	_ATA_LBA@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_ATA_DEVICE_OBS@GOTPCREL(%rip), %rax
	orl	(%rax), %r15d
	movq	_MG_REG_DRV_HEAD@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	movl	%r15d, %edi
	callq	_outb
	movq	_MG_REG_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%rbx), %rsi
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	callq	_outb
	movq	_MG_ERR_NONE@GOTPCREL(%rip), %rbx
LBB0_4:
	movl	(%rbx), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.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	_jiffies,8,3                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_MG_RES_SEC,8,3                 ## @MG_RES_SEC
	.comm	_MG_REG_SECT_CNT,8,3            ## @MG_REG_SECT_CNT
	.comm	_MG_REG_SECT_NUM,8,3            ## @MG_REG_SECT_NUM
	.comm	_MG_REG_CYL_LOW,8,3             ## @MG_REG_CYL_LOW
	.comm	_MG_REG_CYL_HIGH,8,3            ## @MG_REG_CYL_HIGH
	.comm	_ATA_LBA,4,2                    ## @ATA_LBA
	.comm	_ATA_DEVICE_OBS,4,2             ## @ATA_DEVICE_OBS
	.comm	_MG_REG_DRV_HEAD,8,3            ## @MG_REG_DRV_HEAD
	.comm	_MG_REG_COMMAND,8,3             ## @MG_REG_COMMAND
	.comm	_MG_ERR_NONE,4,2                ## @MG_ERR_NONE
	.no_dead_strip	_mg_out
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mg_out
_mg_out:                                ; @mg_out
	.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	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	ldr	x24, [x8]
Lloh0:
	adrp	x8, _MG_STAT_READY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MG_STAT_READY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _MG_TMAX_CONF_TO_CMD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MG_TMAX_CONF_TO_CMD@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	bl	_mg_wait
	cbnz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x24]
	cbnz	w8, LBB0_3
; %bb.2:
	str	x23, [x19, #8]
	add	x0, x19, #24
Lloh6:
	adrp	x8, _jiffies@GOTPAGE
Lloh7:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
Lloh9:
	adrp	x9, _HZ@GOTPAGE
Lloh10:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh11:
	ldrsw	x9, [x9]
	add	x9, x9, x9, lsl #1
	add	x1, x8, x9
	bl	_mod_timer
LBB0_3:
Lloh12:
	adrp	x8, _MG_RES_SEC@GOTPAGE
Lloh13:
	ldr	x8, [x8, _MG_RES_SEC@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	add	w22, w8, w22
	ldr	x8, [x19, #16]
Lloh15:
	adrp	x9, _MG_REG_SECT_CNT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _MG_REG_SECT_CNT@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x21
	bl	_outb
	ldr	x8, [x19, #16]
Lloh18:
	adrp	x9, _MG_REG_SECT_NUM@GOTPAGE
Lloh19:
	ldr	x9, [x9, _MG_REG_SECT_NUM@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x22
	bl	_outb
	lsr	w0, w22, #8
	ldr	x8, [x19, #16]
Lloh21:
	adrp	x9, _MG_REG_CYL_LOW@GOTPAGE
Lloh22:
	ldr	x9, [x9, _MG_REG_CYL_LOW@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
	lsr	w0, w22, #16
	ldr	x8, [x19, #16]
Lloh24:
	adrp	x9, _MG_REG_CYL_HIGH@GOTPAGE
Lloh25:
	ldr	x9, [x9, _MG_REG_CYL_HIGH@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
Lloh27:
	adrp	x8, _ATA_LBA@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ATA_LBA@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	orr	w8, w8, w22, lsr #24
Lloh30:
	adrp	x9, _ATA_DEVICE_OBS@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ATA_DEVICE_OBS@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w0, w8, w9
	ldr	x8, [x19, #16]
Lloh33:
	adrp	x9, _MG_REG_DRV_HEAD@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MG_REG_DRV_HEAD@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
	ldr	x8, [x19, #16]
Lloh36:
	adrp	x9, _MG_REG_COMMAND@GOTPAGE
Lloh37:
	ldr	x9, [x9, _MG_REG_COMMAND@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	add	x1, x9, x8
	mov	x0, x20
	bl	_outb
Lloh39:
	adrp	x19, _MG_ERR_NONE@GOTPAGE
Lloh40:
	ldr	x19, [x19, _MG_ERR_NONE@GOTPAGEOFF]
LBB0_4:
	ldr	w0, [x19]
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.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	_jiffies,8,3                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_MG_RES_SEC,8,3                 ; @MG_RES_SEC
	.comm	_MG_REG_SECT_CNT,8,3            ; @MG_REG_SECT_CNT
	.comm	_MG_REG_SECT_NUM,8,3            ; @MG_REG_SECT_NUM
	.comm	_MG_REG_CYL_LOW,8,3             ; @MG_REG_CYL_LOW
	.comm	_MG_REG_CYL_HIGH,8,3            ; @MG_REG_CYL_HIGH
	.comm	_ATA_LBA,4,2                    ; @ATA_LBA
	.comm	_ATA_DEVICE_OBS,4,2             ; @ATA_DEVICE_OBS
	.comm	_MG_REG_DRV_HEAD,8,3            ; @MG_REG_DRV_HEAD
	.comm	_MG_REG_COMMAND,8,3             ; @MG_REG_COMMAND
	.comm	_MG_ERR_NONE,4,2                ; @MG_ERR_NONE
	.no_dead_strip	_mg_out
.subsections_via_symbols
