	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ahci_handle_port
_ahci_handle_port:                      ## @ahci_handle_port
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_AHCI_P_CMD_ST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_8
## %bb.1:
	movq	%rdi, %rbx
	movl	4(%rdi), %eax
	movl	8(%rdi), %ecx
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	je	LBB0_8
## %bb.2:
	movq	_ATA_S_BUSY@GOTPCREL(%rip), %r14
	movq	_ATA_S_DRQ@GOTPCREL(%rip), %r15
	movq	_AHCI_P_CMD_CCS_MASK@GOTPCREL(%rip), %r12
	movq	_AHCI_P_CMD_CCS_SHIFT@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	incl	%esi
	andl	$31, %esi
	movl	%esi, 12(%rbx)
	movl	%ecx, %edx
	notl	%edx
	andl	%eax, %edx
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %esi
	orl	(%r14), %esi
	testl	%esi, 16(%rbx)
	jne	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	$0, 24(%rbx)
	jne	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	12(%rbx), %esi
	btl	%esi, %edx
	jae	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %eax
	notl	%eax
	andl	(%rbx), %eax
	movl	%eax, (%rbx)
	movzbl	(%r13), %ecx
	movl	%esi, %edx
	shll	%cl, %edx
	orl	%eax, %edx
	movl	%edx, (%rbx)
	movq	%rbx, %rdi
	callq	_ahci_handle_slot
	movl	12(%rbx), %esi
	movl	4(%rbx), %eax
	movl	8(%rbx), %ecx
	jmp	LBB0_7
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AHCI_P_CMD_ST,4,2              ## @AHCI_P_CMD_ST
	.comm	_ATA_S_BUSY,4,2                 ## @ATA_S_BUSY
	.comm	_ATA_S_DRQ,4,2                  ## @ATA_S_DRQ
	.comm	_AHCI_P_CMD_CCS_MASK,4,2        ## @AHCI_P_CMD_CCS_MASK
	.comm	_AHCI_P_CMD_CCS_SHIFT,4,2       ## @AHCI_P_CMD_CCS_SHIFT
	.no_dead_strip	_ahci_handle_port
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ahci_handle_port
_ahci_handle_port:                      ; @ahci_handle_port
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _AHCI_P_CMD_ST@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AHCI_P_CMD_ST@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.1:
	mov	x19, x0
	ldp	w8, w9, [x0, #4]
	bics	w10, w8, w9
	b.eq	LBB0_8
; %bb.2:
Lloh3:
	adrp	x20, _ATA_S_BUSY@GOTPAGE
Lloh4:
	ldr	x20, [x20, _ATA_S_BUSY@GOTPAGEOFF]
Lloh5:
	adrp	x21, _ATA_S_DRQ@GOTPAGE
Lloh6:
	ldr	x21, [x21, _ATA_S_DRQ@GOTPAGEOFF]
Lloh7:
	adrp	x22, _AHCI_P_CMD_CCS_MASK@GOTPAGE
Lloh8:
	ldr	x22, [x22, _AHCI_P_CMD_CCS_MASK@GOTPAGEOFF]
Lloh9:
	adrp	x23, _AHCI_P_CMD_CCS_SHIFT@GOTPAGE
Lloh10:
	ldr	x23, [x23, _AHCI_P_CMD_CCS_SHIFT@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	w10, w1, #1
	and	w10, w10, #0x1f
	str	w10, [x19, #12]
	bics	w10, w8, w9
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x19, #16]
	ldr	w12, [x20]
	ldr	w13, [x21]
	orr	w12, w13, w12
	tst	w12, w11
	b.ne	LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x11, [x19, #24]
	cbnz	x11, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x19, #12]
	lsr	w10, w10, w1
	tbz	w10, #0, LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x22]
	ldr	w9, [x19]
	bic	w8, w9, w8
	str	w8, [x19]
	ldr	w9, [x23]
	lsl	w9, w1, w9
	orr	w8, w9, w8
	str	w8, [x19]
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_ahci_handle_slot
	ldp	w9, w1, [x19, #8]
	ldr	w8, [x19, #4]
	b	LBB0_3
LBB0_8:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_AHCI_P_CMD_ST,4,2              ; @AHCI_P_CMD_ST
	.comm	_ATA_S_BUSY,4,2                 ; @ATA_S_BUSY
	.comm	_ATA_S_DRQ,4,2                  ; @ATA_S_DRQ
	.comm	_AHCI_P_CMD_CCS_MASK,4,2        ; @AHCI_P_CMD_CCS_MASK
	.comm	_AHCI_P_CMD_CCS_SHIFT,4,2       ; @AHCI_P_CMD_CCS_SHIFT
	.no_dead_strip	_ahci_handle_port
.subsections_via_symbols
