	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mg_write_intr
_mg_write_intr:                         ## @mg_write_intr
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	32(%rdi), %r14
	movq	_MG_REG_STATUS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	16(%r15), %rdi
	callq	_inb
	movl	%eax, %ebx
	movq	_ATA_BUSY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_1
LBB0_4:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	callq	_mg_dump_status
	movq	%r15, %rdi
	callq	_mg_bad_rw_intr
LBB0_7:
	movl	8(%r15), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mg_request                     ## TAILCALL
LBB0_1:
	movl	%ebx, %edi
	callq	_MG_READY_OK
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movq	%r14, %rdi
	callq	_blk_rq_sectors
	cmpl	$2, %eax
	jl	LBB0_5
## %bb.3:
	movq	_ATA_DRQ@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_4
LBB0_5:
	movq	_MG_SECTOR_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_mg_end_request
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_mg_write_one
	movq	%r14, %rdi
	callq	_blk_rq_pos
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_blk_rq_sectors
	movl	(%r14), %ecx
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_MG_DBG
	leaq	_mg_write_intr(%rip), %rax
	movq	%rax, (%r15)
	leaq	24(%r15), %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
	movq	_MG_CMD_WR_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MG_REG_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outb                           ## TAILCALL
LBB0_6:
	movq	_MG_CMD_WR_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_MG_REG_COMMAND@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	16(%r15), %rsi
	callq	_outb
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_MG_REG_STATUS,8,3              ## @MG_REG_STATUS
	.comm	_ATA_BUSY,4,2                   ## @ATA_BUSY
	.comm	_ATA_DRQ,4,2                    ## @ATA_DRQ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mg_write_intr"

	.comm	_MG_SECTOR_SIZE,4,2             ## @MG_SECTOR_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"sector %ld, remaining=%ld, buffer=0x%p\n"

	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_HZ,4,2                         ## @HZ
	.comm	_MG_CMD_WR_CONF,4,2             ## @MG_CMD_WR_CONF
	.comm	_MG_REG_COMMAND,8,3             ## @MG_REG_COMMAND
	.no_dead_strip	_mg_write_intr
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mg_write_intr
_mg_write_intr:                         ; @mg_write_intr
	.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, x0
	ldr	x20, [x0, #32]
	ldr	x8, [x0, #16]
Lloh0:
	adrp	x9, _MG_REG_STATUS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _MG_REG_STATUS@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x0, x9, x8
	bl	_inb
	mov	x21, x0
Lloh3:
	adrp	x8, _ATA_BUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_BUSY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
LBB0_1:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	mov	x2, x19
	bl	_mg_dump_status
	mov	x0, x19
	bl	_mg_bad_rw_intr
LBB0_2:
	ldr	w0, [x19, #8]
	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
	b	_mg_request
LBB0_3:
	mov	x0, x21
	bl	_MG_READY_OK
	cbz	w0, LBB0_1
; %bb.4:
	mov	x0, x20
	bl	_blk_rq_sectors
	cmp	w0, #2
	b.lt	LBB0_6
; %bb.5:
Lloh8:
	adrp	x8, _ATA_DRQ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ATA_DRQ@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_1
LBB0_6:
Lloh11:
	adrp	x8, _MG_SECTOR_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MG_SECTOR_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #0
	bl	_mg_end_request
	cbz	w0, LBB0_8
; %bb.7:
	mov	x0, x19
	mov	x1, x20
	bl	_mg_write_one
	mov	x0, x20
	bl	_blk_rq_pos
	mov	x21, x0
	mov	x0, x20
	bl	_blk_rq_sectors
	mov	x2, x0
	ldr	w3, [x20]
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_MG_DBG
Lloh16:
	adrp	x8, _mg_write_intr@PAGE
Lloh17:
	add	x8, x8, _mg_write_intr@PAGEOFF
	str	x8, [x19]
	add	x0, x19, #24
Lloh18:
	adrp	x8, _jiffies@GOTPAGE
Lloh19:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh20:
	ldr	x8, [x8]
Lloh21:
	adrp	x9, _HZ@GOTPAGE
Lloh22:
	ldr	x9, [x9, _HZ@GOTPAGEOFF]
Lloh23:
	ldrsw	x9, [x9]
	add	x9, x9, x9, lsl #1
	add	x1, x8, x9
	bl	_mod_timer
Lloh24:
	adrp	x8, _MG_CMD_WR_CONF@GOTPAGE
Lloh25:
	ldr	x8, [x8, _MG_CMD_WR_CONF@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
Lloh27:
	adrp	x9, _MG_REG_COMMAND@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MG_REG_COMMAND@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	add	x1, x9, x8
	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
	b	_outb
LBB0_8:
Lloh30:
	adrp	x8, _MG_CMD_WR_CONF@GOTPAGE
Lloh31:
	ldr	x8, [x8, _MG_CMD_WR_CONF@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	x8, [x19, #16]
Lloh33:
	adrp	x9, _MG_REG_COMMAND@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MG_REG_COMMAND@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_outb
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_MG_REG_STATUS,8,3              ; @MG_REG_STATUS
	.comm	_ATA_BUSY,4,2                   ; @ATA_BUSY
	.comm	_ATA_DRQ,4,2                    ; @ATA_DRQ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mg_write_intr"

	.comm	_MG_SECTOR_SIZE,4,2             ; @MG_SECTOR_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"sector %ld, remaining=%ld, buffer=0x%p\n"

	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_HZ,4,2                         ; @HZ
	.comm	_MG_CMD_WR_CONF,4,2             ; @MG_CMD_WR_CONF
	.comm	_MG_REG_COMMAND,8,3             ; @MG_REG_COMMAND
	.no_dead_strip	_mg_write_intr
.subsections_via_symbols
