	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hd_request
_hd_request:                            ## @hd_request
	.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	_do_hd@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_1
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %edx
	movl	%r13d, %ecx
	xorl	%eax, %eax
	callq	_printk
	xorl	%edi, %edi
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %edi
	callq	_hd_end_request_cur
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	_device_timer@GOTPCREL(%rip), %rdi
	callq	_del_timer
	movq	_hd_req@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	jne	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	_hd_queue@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_blk_fetch_request
	movq	%rax, %rbx
	movq	_hd_req@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	testq	%rbx, %rbx
	je	LBB0_3
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	movq	_reset@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_20
## %bb.5:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	8(%rbx), %rax
	movq	8(%rax), %r12
	movq	%rbx, %rdi
	callq	_blk_rq_pos
	movl	%eax, %r14d
	movq	%rbx, %rdi
	callq	_blk_rq_sectors
	movl	%eax, %r13d
	movq	8(%rbx), %rdi
	callq	_get_capacity
	cmpl	%eax, %r14d
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%r13d, %r15d
	addl	%r14d, %r15d
	movq	8(%rbx), %rdi
	callq	_get_capacity
	cmpl	%eax, %r15d
	ja	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$0, 8(%r12)
	je	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_do_special_op
	testq	%rax, %rax
	jne	LBB0_1
	jmp	LBB0_10
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	movl	%r14d, %eax
	xorl	%edx, %edx
	divl	(%r12)
	movl	%edx, %r14d
	xorl	%edx, %edx
	divl	4(%r12)
	movl	%edx, %r15d
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_blk_fs_request
	testq	%rax, %rax
	je	LBB0_10
## %bb.12:                              ##   in Loop: Header=BB0_1 Depth=1
	incl	%r14d
	movq	%rbx, %rdi
	callq	_rq_data_dir
	cmpl	$128, %eax
	je	LBB0_15
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$129, %eax
	jne	LBB0_19
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	_ATA_CMD_PIO_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_read_intr@GOTPCREL(%rip), %rax
	movq	%rax, (%rsp)
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_hd_out
	movq	_reset@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_1
	jmp	LBB0_10
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	movq	_ATA_CMD_PIO_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_write_intr@GOTPCREL(%rip), %rax
	movq	%rax, (%rsp)
	movq	%r12, %rdi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%r15d, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_hd_out
	movq	_reset@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_1
## %bb.16:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_wait_DRQ
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_1 Depth=1
	xorl	%eax, %eax
	callq	_bad_rw_intr
	jmp	LBB0_1
LBB0_20:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reset_hd                       ## TAILCALL
LBB0_3:
	movq	_do_hd@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	jmp	LBB0_10
LBB0_19:
	leaq	L_.str.1(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_printk
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movl	%ebx, %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hd_end_request_cur             ## TAILCALL
LBB0_18:
	movq	_HD_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%rbx), %esi
	movl	$256, %edx                      ## imm = 0x100
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outsw                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_do_hd,8,3                      ## @do_hd
	.comm	_device_timer,4,2               ## @device_timer
	.comm	_hd_req,8,3                     ## @hd_req
	.comm	_hd_queue,4,2                   ## @hd_queue
	.comm	_reset,8,3                      ## @reset
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: bad access: block=%d, count=%d\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_ATA_CMD_PIO_READ,4,2           ## @ATA_CMD_PIO_READ
	.comm	_read_intr,4,2                  ## @read_intr
	.comm	_ATA_CMD_PIO_WRITE,4,2          ## @ATA_CMD_PIO_WRITE
	.comm	_write_intr,4,2                 ## @write_intr
	.comm	_HD_DATA,4,2                    ## @HD_DATA
L_.str.1:                               ## @.str.1
	.asciz	"unknown hd-command\n"

	.no_dead_strip	_hd_request
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hd_request
_hd_request:                            ; @hd_request
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
Lloh0:
	adrp	x8, _do_hd@GOTPAGE
Lloh1:
	ldr	x8, [x8, _do_hd@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
LBB0_1:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_2:
Lloh3:
	adrp	x19, _device_timer@GOTPAGE
Lloh4:
	ldr	x19, [x19, _device_timer@GOTPAGEOFF]
Lloh5:
	adrp	x21, _hd_req@GOTPAGE
Lloh6:
	ldr	x21, [x21, _hd_req@GOTPAGEOFF]
Lloh7:
	adrp	x20, _reset@GOTPAGE
Lloh8:
	ldr	x20, [x20, _reset@GOTPAGEOFF]
Lloh9:
	adrp	x22, l_.str@PAGE
Lloh10:
	add	x22, x22, l_.str@PAGEOFF
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23, #8]
	ldr	w8, [x8]
	stp	x26, x25, [sp, #8]
	str	x8, [sp]
	mov	x0, x22
	bl	_printk
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w0, w8
	bl	_hd_end_request_cur
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_del_timer
	ldr	x23, [x21]
	cbnz	x23, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh14:
	adrp	x8, _hd_queue@GOTPAGE
Lloh15:
	ldr	x8, [x8, _hd_queue@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_blk_fetch_request
	mov	x23, x0
	str	x0, [x21]
	cbz	x0, LBB0_19
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x20]
	cbnz	x8, LBB0_18
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x23, #8]
	ldr	x24, [x8, #8]
	mov	x0, x23
	bl	_blk_rq_pos
	mov	x26, x0
	mov	x0, x23
	bl	_blk_rq_sectors
	mov	x25, x0
	ldr	x0, [x23, #8]
	bl	_get_capacity
	cmp	w26, w0
	b.hs	LBB0_3
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w27, w25, w26
	ldr	x0, [x23, #8]
	bl	_get_capacity
	cmp	w27, w0
	b.hi	LBB0_3
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #8]
	cbz	x8, LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	mov	x1, x23
	bl	_do_special_op
	cbnz	x0, LBB0_4
	b	LBB0_1
LBB0_11:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w27, w28, [x24]
	mov	x0, x23
	bl	_blk_fs_request
	cbz	x0, LBB0_1
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	udiv	w8, w26, w27
	msub	w9, w8, w27, w26
	add	w27, w9, #1
	udiv	w26, w8, w28
	msub	w28, w26, w28, w8
	mov	x0, x23
	bl	_rq_data_dir
	cmp	w0, #128
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	w0, #129
	b.ne	LBB0_20
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
Lloh17:
	adrp	x8, _ATA_CMD_PIO_READ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ATA_CMD_PIO_READ@GOTPAGEOFF]
Lloh19:
	ldr	w5, [x8]
	mov	x0, x24
	mov	x1, x25
	mov	x2, x27
	mov	x3, x28
	mov	x4, x26
Lloh20:
	adrp	x6, _read_intr@GOTPAGE
Lloh21:
	ldr	x6, [x6, _read_intr@GOTPAGEOFF]
	bl	_hd_out
	ldr	x8, [x20]
	cbnz	x8, LBB0_4
	b	LBB0_1
LBB0_15:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh22:
	adrp	x8, _ATA_CMD_PIO_WRITE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ATA_CMD_PIO_WRITE@GOTPAGEOFF]
Lloh24:
	ldr	w5, [x8]
	mov	x0, x24
	mov	x1, x25
	mov	x2, x27
	mov	x3, x28
	mov	x4, x26
Lloh25:
	adrp	x6, _write_intr@GOTPAGE
Lloh26:
	ldr	x6, [x6, _write_intr@GOTPAGEOFF]
	bl	_hd_out
	ldr	x8, [x20]
	cbnz	x8, LBB0_4
; %bb.16:                               ;   in Loop: Header=BB0_4 Depth=1
	bl	_wait_DRQ
	cbz	w0, LBB0_21
; %bb.17:                               ;   in Loop: Header=BB0_4 Depth=1
	bl	_bad_rw_intr
	b	LBB0_4
LBB0_18:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_reset_hd
LBB0_19:
Lloh27:
	adrp	x8, _do_hd@GOTPAGE
Lloh28:
	ldr	x8, [x8, _do_hd@GOTPAGEOFF]
Lloh29:
	str	xzr, [x8]
	b	LBB0_1
LBB0_20:
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printk
Lloh32:
	adrp	x8, _EIO@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_hd_end_request_cur
LBB0_21:
Lloh35:
	adrp	x8, _HD_DATA@GOTPAGE
Lloh36:
	ldr	x8, [x8, _HD_DATA@GOTPAGEOFF]
Lloh37:
	ldr	w0, [x8]
	ldr	w1, [x23]
	mov	w2, #256
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_outsw
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotStr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_do_hd,8,3                      ; @do_hd
	.comm	_device_timer,4,2               ; @device_timer
	.comm	_hd_req,8,3                     ; @hd_req
	.comm	_hd_queue,4,2                   ; @hd_queue
	.comm	_reset,8,3                      ; @reset
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: bad access: block=%d, count=%d\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_ATA_CMD_PIO_READ,4,2           ; @ATA_CMD_PIO_READ
	.comm	_read_intr,4,2                  ; @read_intr
	.comm	_ATA_CMD_PIO_WRITE,4,2          ; @ATA_CMD_PIO_WRITE
	.comm	_write_intr,4,2                 ; @write_intr
	.comm	_HD_DATA,4,2                    ; @HD_DATA
l_.str.1:                               ; @.str.1
	.asciz	"unknown hd-command\n"

	.no_dead_strip	_hd_request
.subsections_via_symbols
