	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahci_handle_read_log
_ahci_handle_read_log:                  ## @ahci_handle_read_log
	.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
	subq	$528, %rsp                      ## imm = 0x210
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	cmpq	$0, 8(%rdi)
	je	LBB0_1
LBB0_6:
	movq	_ATA_E_ABORT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	$8, %ecx
	movq	_ATA_S_READY@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ATA_S_ERROR@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_22
## %bb.7:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	addq	$528, %rsp                      ## imm = 0x210
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ahci_write_fis_d2h             ## TAILCALL
LBB0_1:
	movq	16(%rbx), %rax
	movq	_AHCI_CL_SIZE@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	movslq	%r15d, %rdx
	imulq	%rcx, %rdx
	cmpq	$0, (%rax,%rdx)
	je	LBB0_6
## %bb.2:
	cmpl	$0, 20(%r14)
	jne	LBB0_6
## %bb.3:
	cmpl	$0, 36(%r14)
	jne	LBB0_6
## %bb.4:
	cmpl	$1, 48(%r14)
	jne	LBB0_6
## %bb.5:
	cmpl	$0, 52(%r14)
	jne	LBB0_6
## %bb.8:
	leaq	-560(%rbp), %rdi
	xorl	%esi, %esi
	movl	$512, %edx                      ## imm = 0x200
	callq	_memset
	movl	16(%r14), %eax
	cmpl	$19, %eax
	je	LBB0_12
## %bb.9:
	cmpl	$16, %eax
	je	LBB0_16
## %bb.10:
	testl	%eax, %eax
	jne	LBB0_15
## %bb.11:
	movl	$1, -560(%rbp)
	movl	$1, -496(%rbp)
	movl	$1, -484(%rbp)
	jmp	LBB0_17
LBB0_16:
	movl	4(%rbx), %esi
	leaq	-560(%rbp), %r12
	movq	%r12, %rdi
	movl	$4, %edx
	callq	_memcpy
	movq	%r12, %rdi
	movl	$512, %esi                      ## imm = 0x200
	callq	_ahci_checksum
	jmp	LBB0_17
LBB0_12:
	movl	(%rbx), %edi
	callq	_blockif_candelete
	testq	%rax, %rax
	je	LBB0_17
## %bb.13:
	movl	(%rbx), %edi
	callq	_blockif_is_ro
	testl	%eax, %eax
	jne	LBB0_17
## %bb.14:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, -560(%rbp)
LBB0_17:
	movl	8(%r14), %eax
	movq	_ATA_READ_LOG_EXT@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_19
## %bb.18:
	movq	%rbx, %rdi
	callq	_ahci_write_fis_piosetup
LBB0_19:
	leaq	-560(%rbp), %rcx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movl	$512, %r8d                      ## imm = 0x200
	callq	_write_prdt
	movq	_ATA_S_DSC@GOTPCREL(%rip), %rax
	movq	_ATA_S_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	jmp	LBB0_20
LBB0_15:
	movq	_ATA_E_ABORT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	shll	$8, %ecx
	movq	_ATA_S_READY@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movq	_ATA_S_ERROR@GOTPCREL(%rip), %rax
LBB0_20:
	orl	(%rax), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	callq	_ahci_write_fis_d2h
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-40(%rbp), %rax
	jne	LBB0_22
## %bb.21:
	addq	$528, %rsp                      ## imm = 0x210
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_AHCI_CL_SIZE,4,2               ## @AHCI_CL_SIZE
	.comm	_ATA_E_ABORT,4,2                ## @ATA_E_ABORT
	.comm	_ATA_S_READY,4,2                ## @ATA_S_READY
	.comm	_ATA_S_ERROR,4,2                ## @ATA_S_ERROR
	.comm	_ATA_READ_LOG_EXT,4,2           ## @ATA_READ_LOG_EXT
	.comm	_ATA_S_DSC,4,2                  ## @ATA_S_DSC
	.no_dead_strip	_ahci_handle_read_log
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ahci_handle_read_log
_ahci_handle_read_log:                  ; @ahci_handle_read_log
	.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
	sub	sp, sp, #528
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
	ldr	x8, [x0, #8]
	cbz	x8, LBB0_3
LBB0_1:
Lloh3:
	adrp	x8, _ATA_E_ABORT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATA_E_ABORT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh7:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
Lloh9:
	adrp	x10, _ATA_S_ERROR@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ATA_S_ERROR@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	ldur	x11, [x29, #-40]
Lloh12:
	adrp	x12, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x12, [x12, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x12, [x12]
	cmp	x12, x11
	b.ne	LBB0_22
; %bb.2:
	orr	w8, w9, w8, lsl #8
	orr	w3, w8, w10
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	add	sp, sp, #528
	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	_ahci_write_fis_d2h
LBB0_3:
Lloh15:
	adrp	x8, _AHCI_CL_SIZE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _AHCI_CL_SIZE@GOTPAGEOFF]
	ldr	x9, [x21, #16]
Lloh17:
	ldrsw	x8, [x8]
	sxtw	x10, w20
	mul	x8, x8, x10
	ldr	x8, [x9, x8]
	cbz	x8, LBB0_1
; %bb.4:
	ldr	w8, [x19, #20]
	cbnz	w8, LBB0_1
; %bb.5:
	ldr	w8, [x19, #36]
	cbnz	w8, LBB0_1
; %bb.6:
	ldr	w8, [x19, #48]
	cmp	w8, #1
	b.ne	LBB0_1
; %bb.7:
	ldr	w8, [x19, #52]
	cbnz	w8, LBB0_1
; %bb.8:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #512
	bl	_memset
	ldr	w8, [x19, #16]
	cmp	w8, #19
	b.eq	LBB0_13
; %bb.9:
	cmp	w8, #16
	b.eq	LBB0_12
; %bb.10:
	cbnz	w8, LBB0_19
; %bb.11:
	mov	w8, #1
	str	w8, [sp, #8]
	str	w8, [sp, #72]
	str	w8, [sp, #84]
	b	LBB0_16
LBB0_12:
	ldr	w1, [x21, #4]
	add	x0, sp, #8
	mov	w2, #4
	bl	_memcpy
	add	x0, sp, #8
	mov	w1, #512
	bl	_ahci_checksum
	b	LBB0_16
LBB0_13:
	ldr	w0, [x21]
	bl	_blockif_candelete
	cbz	x0, LBB0_16
; %bb.14:
	ldr	w0, [x21]
	bl	_blockif_is_ro
	cbnz	w0, LBB0_16
; %bb.15:
	movi.2s	v0, #1
	str	d0, [sp, #8]
LBB0_16:
	ldr	w8, [x19, #8]
Lloh18:
	adrp	x9, _ATA_READ_LOG_EXT@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_READ_LOG_EXT@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_18
; %bb.17:
	mov	x0, x21
	bl	_ahci_write_fis_piosetup
LBB0_18:
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w4, #512
	bl	_write_prdt
Lloh21:
	adrp	x8, _ATA_S_DSC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ATA_S_DSC@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w3, w9, w8
	b	LBB0_20
LBB0_19:
Lloh27:
	adrp	x8, _ATA_E_ABORT@GOTPAGE
Lloh28:
	ldr	x8, [x8, _ATA_E_ABORT@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh31:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w9, w8, lsl #8
Lloh33:
	adrp	x9, _ATA_S_ERROR@GOTPAGE
Lloh34:
	ldr	x9, [x9, _ATA_S_ERROR@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w3, w8, w9
LBB0_20:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_ahci_write_fis_d2h
	ldur	x8, [x29, #-40]
Lloh36:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh37:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_22
; %bb.21:
	add	sp, sp, #528
	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_22:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_AHCI_CL_SIZE,4,2               ; @AHCI_CL_SIZE
	.comm	_ATA_E_ABORT,4,2                ; @ATA_E_ABORT
	.comm	_ATA_S_READY,4,2                ; @ATA_S_READY
	.comm	_ATA_S_ERROR,4,2                ; @ATA_S_ERROR
	.comm	_ATA_READ_LOG_EXT,4,2           ; @ATA_READ_LOG_EXT
	.comm	_ATA_S_DSC,4,2                  ; @ATA_S_DSC
	.no_dead_strip	_ahci_handle_read_log
.subsections_via_symbols
