	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pci_ahci_init
_pci_ahci_init:                         ## @pci_ahci_init
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -136(%rbp)                ## 4-byte Spill
	movq	%rdx, %r12
	movq	%rsi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	$1, %edi
	movl	$40, %esi
	callq	_calloc
	movq	%rax, %r14
	movq	%rax, 8(%rbx)
	movq	%rbx, -160(%rbp)                ## 8-byte Spill
	movq	%rbx, 32(%rax)
	leaq	28(%rax), %rdi
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_pthread_mutex_init
	movq	$0, (%r14)
	movq	_MAX_PORTS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	movl	$32, -132(%rbp)                 ## 4-byte Folded Spill
	jle	LBB0_1
## %bb.2:
	movl	$0, %ebx
	testq	%r12, %r12
	je	LBB0_19
## %bb.3:
	movq	%r14, -152(%rbp)                ## 8-byte Spill
	movl	$32, -132(%rbp)                 ## 4-byte Folded Spill
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	leaq	L_.str(%rip), %rsi
	movl	$3, %edx
	callq	_strncmp
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edx
	callq	_strncmp
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movl	-136(%rbp), %eax                ## 4-byte Reload
	movl	$1, %edx
	cmovel	%edx, %eax
	movl	%eax, -136(%rbp)                ## 4-byte Spill
	leaq	(%rcx,%rcx,2), %rax
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$3, %eax
	movl	$0, -136(%rbp)                  ## 4-byte Folded Spill
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	addq	%rax, %r12
	movq	%r12, %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strstr
	movq	%rax, %r15
	movq	%r12, %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_strstr
	movq	%rax, %r14
	testq	%r15, %r15
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%r15, %r14
	movq	%r15, %rax
	cmovbq	%r14, %rax
	testq	%r14, %r14
	cmoveq	%r15, %rax
	movq	%rax, %r14
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	testq	%r14, %r14
	je	LBB0_11
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movb	$0, (%r14)
	incq	%r14
	cmpb	$0, (%r12)
	je	LBB0_13
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-160(%rbp), %rax                ## 8-byte Reload
	movl	(%rax), %ecx
	movl	4(%rax), %r8d
	leaq	-57(%rbp), %rdi
	movl	$9, %esi
	leaq	L_.str.4(%rip), %rdx
	movq	%rbx, %r15
	movl	%r15d, %r9d
	xorl	%eax, %eax
	callq	_snprintf
	movq	%r12, %rdi
	leaq	-57(%rbp), %rsi
	callq	_blockif_open
	testq	%rax, %rax
	je	LBB0_20
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-152(%rbp), %rbx                ## 8-byte Reload
	movq	16(%rbx), %rcx
	movq	%rax, 16(%rcx,%r13)
	movq	%rbx, 32(%rcx,%r13)
	movl	%r15d, (%rcx,%r13)
	movl	-136(%rbp), %eax                ## 4-byte Reload
	movl	%eax, 4(%rcx,%r13)
	leaq	-140(%rbp), %rdi
	callq	_MD5Init
	movq	%r12, %rdi
	callq	_strlen
	leaq	-140(%rbp), %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	callq	_MD5Update
	leaq	-128(%rbp), %rdi
	leaq	-140(%rbp), %rsi
	callq	_MD5Final
	movq	16(%rbx), %rax
	movslq	24(%rax,%r13), %rdi
	movq	_AHCI_PORT_IDENT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-128(%rbp), %ecx
	movl	-124(%rbp), %r8d
	movl	-120(%rbp), %r9d
	movl	-116(%rbp), %r10d
	movl	-112(%rbp), %r11d
	movl	-108(%rbp), %r12d
	subq	$8, %rsp
	leaq	L_.str.5(%rip), %rdx
	xorl	%eax, %eax
	pushq	%r12
	pushq	%r11
	pushq	%r10
	callq	_snprintf
	addq	$32, %rsp
	movq	16(%rbx), %rdi
	addq	%r13, %rdi
	callq	_pci_ahci_ioreq_init
	movl	$1, %eax
	movl	%r15d, %ecx
	shll	%cl, %eax
	orl	%eax, 4(%rbx)
	movq	16(%rbx), %rax
	movl	-132(%rbp), %ecx                ## 4-byte Reload
	movl	8(%rax,%r13), %eax
	cmpl	%ecx, %eax
	cmovll	%eax, %ecx
	movl	%ecx, -132(%rbp)                ## 4-byte Spill
	jmp	LBB0_16
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r14d, %r14d
	cmpb	$0, (%r12)
	jne	LBB0_14
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %r15
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r15
	movq	_MAX_PORTS@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%r15, %rbx
	cmpq	%rax, %r15
	jge	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	$40, %r13
	movq	%r14, %r12
	testq	%r14, %r14
	jne	LBB0_4
LBB0_18:
	movq	-152(%rbp), %r14                ## 8-byte Reload
	xorl	%r13d, %r13d
	jmp	LBB0_19
LBB0_1:
	xorl	%ebx, %ebx
LBB0_19:
	movl	-132(%rbp), %esi                ## 4-byte Reload
	decl	%esi
	movq	_DEF_PORTS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%eax, %ebx
	cmovgl	%ebx, %eax
	movl	%eax, (%r14)
	movq	_AHCI_CAP_64BIT@GOTPCREL(%rip), %rcx
	decl	%eax
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SNCQ@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SSNTF@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SMPS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SSS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SALP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SAL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_ISS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movq	_AHCI_CAP_SCLO@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	$3, %edx
	shll	%cl, %edx
	orl	%edx, %eax
	movq	_AHCI_CAP_PMD@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_SSC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_PSC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_AHCI_CAP_NCS_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shll	%cl, %esi
	orl	%esi, %eax
	movq	_AHCI_CAP_SXS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, 8(%r14)
	movl	$66304, 12(%r14)                ## imm = 0x10300
	movq	_AHCI_CAP2_APST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r14)
	movq	%r14, %rdi
	callq	_ahci_reset
	movq	_PCIR_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-160(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdi
	movl	$10273, %edx                    ## imm = 0x2821
	callq	_pci_set_cfgdata16
	movq	_PCIR_VENDOR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$32902, %edx                    ## imm = 0x8086
	callq	_pci_set_cfgdata16
	movq	_PCIR_CLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCIC_STORAGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pci_set_cfgdata8
	movq	_PCIR_SUBCLASS@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCIS_STORAGE_SATA@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pci_set_cfgdata8
	movq	_PCIR_PROGIF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCIP_STORAGE_SATA_AHCI_1_0@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_pci_set_cfgdata8
	movl	(%r14), %edi
	movl	$16, %esi
	callq	_MIN
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_flsl
	leal	-1(%rbx), %ecx
	xorl	%edx, %edx
	testl	%ecx, %ebx
	sete	%dl
	subl	%edx, %eax
	movl	%eax, %ecx
	movl	$1, %esi
	shll	%cl, %esi
	movq	%r15, %rdi
	callq	_pci_emul_add_msicap
	movq	_PCIBAR_MEM32@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_AHCI_OFFSET@GOTPCREL(%rip), %rax
	movslq	(%r14), %rsi
	movq	_AHCI_STEP@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	imulq	%rsi, %rcx
	addq	(%rax), %rcx
	movq	%r15, %rdi
	movl	$5, %esi
	callq	_pci_emul_alloc_bar
	movq	%r15, %rdi
	callq	_pci_lintr_request
LBB0_26:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_28
## %bb.27:
	movl	%r13d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	movq	-152(%rbp), %r12                ## 8-byte Reload
	movl	%r15d, (%r12)
	testl	%r15d, %r15d
	je	LBB0_25
## %bb.21:
	movl	$16, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_22 Depth=1
	incq	%rbx
	movslq	%r15d, %rax
	addq	$40, %r14
	cmpq	%rax, %rbx
	jge	LBB0_25
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movq	(%rax,%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=1
	callq	_blockif_close
	movl	(%r12), %r15d
	jmp	LBB0_24
LBB0_25:
	movq	%r12, %rdi
	callq	_free
	movl	$1, %r13d
	jmp	LBB0_26
LBB0_28:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_PORTS,4,2                  ## @MAX_PORTS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"hd:"

L_.str.1:                               ## @.str.1
	.asciz	"cd:"

L_.str.2:                               ## @.str.2
	.asciz	",hd:"

L_.str.3:                               ## @.str.3
	.asciz	",cd:"

L_.str.4:                               ## @.str.4
	.asciz	"%d:%d:%d"

	.comm	_AHCI_PORT_IDENT,4,2            ## @AHCI_PORT_IDENT
L_.str.5:                               ## @.str.5
	.asciz	"BHYVE-%02X%02X-%02X%02X-%02X%02X"

	.comm	_DEF_PORTS,4,2                  ## @DEF_PORTS
	.comm	_AHCI_CAP_64BIT,4,2             ## @AHCI_CAP_64BIT
	.comm	_AHCI_CAP_SNCQ,4,2              ## @AHCI_CAP_SNCQ
	.comm	_AHCI_CAP_SSNTF,4,2             ## @AHCI_CAP_SSNTF
	.comm	_AHCI_CAP_SMPS,4,2              ## @AHCI_CAP_SMPS
	.comm	_AHCI_CAP_SSS,4,2               ## @AHCI_CAP_SSS
	.comm	_AHCI_CAP_SALP,4,2              ## @AHCI_CAP_SALP
	.comm	_AHCI_CAP_SAL,4,2               ## @AHCI_CAP_SAL
	.comm	_AHCI_CAP_SCLO,4,2              ## @AHCI_CAP_SCLO
	.comm	_AHCI_CAP_ISS_SHIFT,4,2         ## @AHCI_CAP_ISS_SHIFT
	.comm	_AHCI_CAP_PMD,4,2               ## @AHCI_CAP_PMD
	.comm	_AHCI_CAP_SSC,4,2               ## @AHCI_CAP_SSC
	.comm	_AHCI_CAP_PSC,4,2               ## @AHCI_CAP_PSC
	.comm	_AHCI_CAP_NCS_SHIFT,4,2         ## @AHCI_CAP_NCS_SHIFT
	.comm	_AHCI_CAP_SXS,4,2               ## @AHCI_CAP_SXS
	.comm	_AHCI_CAP2_APST,4,2             ## @AHCI_CAP2_APST
	.comm	_PCIR_DEVICE,4,2                ## @PCIR_DEVICE
	.comm	_PCIR_VENDOR,4,2                ## @PCIR_VENDOR
	.comm	_PCIR_CLASS,4,2                 ## @PCIR_CLASS
	.comm	_PCIC_STORAGE,4,2               ## @PCIC_STORAGE
	.comm	_PCIR_SUBCLASS,4,2              ## @PCIR_SUBCLASS
	.comm	_PCIS_STORAGE_SATA,4,2          ## @PCIS_STORAGE_SATA
	.comm	_PCIR_PROGIF,4,2                ## @PCIR_PROGIF
	.comm	_PCIP_STORAGE_SATA_AHCI_1_0,4,2 ## @PCIP_STORAGE_SATA_AHCI_1_0
	.comm	_PCIBAR_MEM32,4,2               ## @PCIBAR_MEM32
	.comm	_AHCI_OFFSET,8,3                ## @AHCI_OFFSET
	.comm	_AHCI_STEP,4,2                  ## @AHCI_STEP
	.comm	_dbg,4,2                        ## @dbg
	.no_dead_strip	_pci_ahci_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pci_ahci_init
_pci_ahci_init:                         ; @pci_ahci_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #208
	.cfi_def_cfa_offset 208
	stp	x28, x27, [sp, #112]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #128]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #144]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #160]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #176]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #192]            ; 16-byte Folded Spill
	add	x29, sp, #192
	.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
	mov	x22, x3
	mov	x23, x2
	mov	x20, x1
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	mov	w0, #1
	mov	w1, #40
	bl	_calloc
	mov	x19, x0
	str	x0, [x20, #8]
	str	x20, [x0, #32]
	add	x0, x0, #28
	mov	x1, #0
	bl	_pthread_mutex_init
	str	xzr, [x19]
Lloh3:
	adrp	x25, _MAX_PORTS@GOTPAGE
Lloh4:
	ldr	x25, [x25, _MAX_PORTS@GOTPAGEOFF]
	ldr	w8, [x25]
	cmp	w8, #1
	ccmp	x23, #0, #4, ge
	b.ne	LBB0_5
; %bb.1:
	mov	w21, #0
	mov	w24, #32
LBB0_2:
Lloh5:
	adrp	x8, _DEF_PORTS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DEF_PORTS@GOTPAGEOFF]
	sub	w9, w24, #1
Lloh7:
	ldr	w8, [x8]
	cmp	w21, w8
	csel	w8, w21, w8, gt
Lloh8:
	adrp	x10, _AHCI_CAP_64BIT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AHCI_CAP_64BIT@GOTPAGEOFF]
	str	w8, [x19]
Lloh10:
	ldr	w10, [x10]
Lloh11:
	adrp	x11, _AHCI_CAP_SNCQ@GOTPAGE
Lloh12:
	ldr	x11, [x11, _AHCI_CAP_SNCQ@GOTPAGEOFF]
Lloh13:
	adrp	x12, _AHCI_CAP_SSNTF@GOTPAGE
Lloh14:
	ldr	x12, [x12, _AHCI_CAP_SSNTF@GOTPAGEOFF]
Lloh15:
	ldr	w11, [x11]
Lloh16:
	ldr	w12, [x12]
Lloh17:
	adrp	x13, _AHCI_CAP_SMPS@GOTPAGE
Lloh18:
	ldr	x13, [x13, _AHCI_CAP_SMPS@GOTPAGEOFF]
Lloh19:
	adrp	x14, _AHCI_CAP_SSS@GOTPAGE
Lloh20:
	ldr	x14, [x14, _AHCI_CAP_SSS@GOTPAGEOFF]
Lloh21:
	ldr	w13, [x13]
Lloh22:
	ldr	w14, [x14]
Lloh23:
	adrp	x15, _AHCI_CAP_SALP@GOTPAGE
Lloh24:
	ldr	x15, [x15, _AHCI_CAP_SALP@GOTPAGEOFF]
Lloh25:
	adrp	x16, _AHCI_CAP_SAL@GOTPAGE
Lloh26:
	ldr	x16, [x16, _AHCI_CAP_SAL@GOTPAGEOFF]
Lloh27:
	ldr	w15, [x15]
Lloh28:
	ldr	w16, [x16]
Lloh29:
	adrp	x17, _AHCI_CAP_SCLO@GOTPAGE
Lloh30:
	ldr	x17, [x17, _AHCI_CAP_SCLO@GOTPAGEOFF]
Lloh31:
	adrp	x0, _AHCI_CAP_ISS_SHIFT@GOTPAGE
Lloh32:
	ldr	x0, [x0, _AHCI_CAP_ISS_SHIFT@GOTPAGEOFF]
Lloh33:
	ldr	w17, [x17]
Lloh34:
	ldr	w0, [x0]
	mov	w1, #3
	lsl	w0, w1, w0
Lloh35:
	adrp	x1, _AHCI_CAP_PMD@GOTPAGE
Lloh36:
	ldr	x1, [x1, _AHCI_CAP_PMD@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x1]
Lloh38:
	adrp	x2, _AHCI_CAP_SSC@GOTPAGE
Lloh39:
	ldr	x2, [x2, _AHCI_CAP_SSC@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x2]
Lloh41:
	adrp	x3, _AHCI_CAP_PSC@GOTPAGE
Lloh42:
	ldr	x3, [x3, _AHCI_CAP_PSC@GOTPAGEOFF]
Lloh43:
	adrp	x4, _AHCI_CAP_NCS_SHIFT@GOTPAGE
Lloh44:
	ldr	x4, [x4, _AHCI_CAP_NCS_SHIFT@GOTPAGEOFF]
Lloh45:
	ldr	w4, [x4]
	lsl	w9, w9, w4
Lloh46:
	adrp	x4, _AHCI_CAP_SXS@GOTPAGE
Lloh47:
	ldr	x4, [x4, _AHCI_CAP_SXS@GOTPAGEOFF]
Lloh48:
	ldr	w3, [x3]
Lloh49:
	ldr	w4, [x4]
	sub	w8, w8, #1
	orr	w8, w8, w10
	orr	w8, w8, w11
	orr	w8, w8, w12
	orr	w8, w8, w13
	orr	w8, w8, w14
	orr	w8, w8, w15
	orr	w8, w8, w16
	orr	w8, w8, w17
	orr	w8, w8, w0
	orr	w8, w8, w1
	orr	w8, w8, w2
	orr	w8, w8, w3
	orr	w8, w8, w9
	orr	w8, w8, w4
	mov	w9, #768
	movk	w9, #1, lsl #16
	stp	w8, w9, [x19, #8]
Lloh50:
	adrp	x8, _AHCI_CAP2_APST@GOTPAGE
Lloh51:
	ldr	x8, [x8, _AHCI_CAP2_APST@GOTPAGEOFF]
Lloh52:
	ldr	w8, [x8]
	str	w8, [x19, #24]
	mov	x0, x19
	bl	_ahci_reset
Lloh53:
	adrp	x8, _PCIR_DEVICE@GOTPAGE
Lloh54:
	ldr	x8, [x8, _PCIR_DEVICE@GOTPAGEOFF]
Lloh55:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #10273
	bl	_pci_set_cfgdata16
Lloh56:
	adrp	x8, _PCIR_VENDOR@GOTPAGE
Lloh57:
	ldr	x8, [x8, _PCIR_VENDOR@GOTPAGEOFF]
Lloh58:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #32902
	bl	_pci_set_cfgdata16
Lloh59:
	adrp	x8, _PCIR_CLASS@GOTPAGE
Lloh60:
	ldr	x8, [x8, _PCIR_CLASS@GOTPAGEOFF]
Lloh61:
	ldr	w1, [x8]
Lloh62:
	adrp	x8, _PCIC_STORAGE@GOTPAGE
Lloh63:
	ldr	x8, [x8, _PCIC_STORAGE@GOTPAGEOFF]
Lloh64:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_pci_set_cfgdata8
Lloh65:
	adrp	x8, _PCIR_SUBCLASS@GOTPAGE
Lloh66:
	ldr	x8, [x8, _PCIR_SUBCLASS@GOTPAGEOFF]
Lloh67:
	ldr	w1, [x8]
Lloh68:
	adrp	x8, _PCIS_STORAGE_SATA@GOTPAGE
Lloh69:
	ldr	x8, [x8, _PCIS_STORAGE_SATA@GOTPAGEOFF]
Lloh70:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_pci_set_cfgdata8
Lloh71:
	adrp	x8, _PCIR_PROGIF@GOTPAGE
Lloh72:
	ldr	x8, [x8, _PCIR_PROGIF@GOTPAGEOFF]
Lloh73:
	ldr	w1, [x8]
Lloh74:
	adrp	x8, _PCIP_STORAGE_SATA_AHCI_1_0@GOTPAGE
Lloh75:
	ldr	x8, [x8, _PCIP_STORAGE_SATA_AHCI_1_0@GOTPAGEOFF]
Lloh76:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_pci_set_cfgdata8
	ldr	w0, [x19]
	mov	w1, #16
	bl	_MIN
	mov	x21, x0
	bl	_flsl
	sub	w8, w21, #1
	tst	w21, w8
	cset	w8, eq
	sub	w8, w0, w8
	mov	w9, #1
	lsl	w1, w9, w8
	mov	x0, x20
	bl	_pci_emul_add_msicap
Lloh77:
	adrp	x8, _PCIBAR_MEM32@GOTPAGE
Lloh78:
	ldr	x8, [x8, _PCIBAR_MEM32@GOTPAGEOFF]
Lloh79:
	ldr	w2, [x8]
Lloh80:
	adrp	x8, _AHCI_OFFSET@GOTPAGE
Lloh81:
	ldr	x8, [x8, _AHCI_OFFSET@GOTPAGEOFF]
Lloh82:
	ldr	x8, [x8]
	ldrsw	x9, [x19]
Lloh83:
	adrp	x10, _AHCI_STEP@GOTPAGE
Lloh84:
	ldr	x10, [x10, _AHCI_STEP@GOTPAGEOFF]
Lloh85:
	ldrsw	x10, [x10]
	madd	x3, x10, x9, x8
	mov	x0, x20
	mov	w1, #5
	bl	_pci_emul_alloc_bar
	mov	x0, x20
	bl	_pci_lintr_request
	mov	w0, #0
LBB0_3:
	ldur	x8, [x29, #-88]
Lloh86:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh87:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh88:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.4:
	ldp	x29, x30, [sp, #192]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #176]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #160]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #144]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #128]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #112]            ; 16-byte Folded Reload
	add	sp, sp, #208
	ret
LBB0_5:
	mov	x26, #0
	mov	x21, #0
	mov	w24, #32
	b	LBB0_8
LBB0_6:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	str	x0, [x8, #16]
	str	x19, [x8, #32]
	stp	w21, w22, [x8]
	add	x0, sp, #24
	bl	_MD5Init
	mov	x0, x27
	bl	_strlen
	mov	x2, x0
	add	x0, sp, #24
	mov	x1, x27
	bl	_MD5Update
	add	x0, sp, #28
	add	x1, sp, #24
	bl	_MD5Final
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	ldrsw	x0, [x8, #24]
Lloh89:
	adrp	x8, _AHCI_PORT_IDENT@GOTPAGE
Lloh90:
	ldr	x8, [x8, _AHCI_PORT_IDENT@GOTPAGEOFF]
Lloh91:
	ldr	w1, [x8]
	ldp	w3, w4, [sp, #28]
	ldp	w5, w8, [sp, #36]
	ldp	w9, w10, [sp, #44]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh92:
	adrp	x2, l_.str.5@PAGE
Lloh93:
	add	x2, x2, l_.str.5@PAGEOFF
	bl	_snprintf
	ldr	x8, [x19, #16]
	add	x0, x8, x26
	bl	_pci_ahci_ioreq_init
	mov	w8, #1
	lsl	w8, w8, w21
	ldr	w9, [x19, #4]
	orr	w8, w9, w8
	str	w8, [x19, #4]
	ldr	x8, [x19, #16]
	add	x8, x8, x26
	ldr	w8, [x8, #8]
	cmp	w8, w24
	csel	w24, w8, w24, lt
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	add	x21, x21, #1
	ldrsw	x8, [x25]
	add	x26, x26, #40
	cmp	x21, x8
	ccmp	x23, #0, #4, lt
	b.eq	LBB0_2
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
Lloh94:
	adrp	x1, l_.str@PAGE
Lloh95:
	add	x1, x1, l_.str@PAGEOFF
	mov	w2, #3
	bl	_strncmp
	cbz	x0, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x23
Lloh96:
	adrp	x1, l_.str.1@PAGE
Lloh97:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #3
	bl	_strncmp
	cmp	x0, #0
	mov	w8, #3
	csel	x8, x8, xzr, eq
	csinc	w22, w22, wzr, ne
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	w22, #0
	mov	w8, #3
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x27, x23, x8
	mov	x0, x27
Lloh98:
	adrp	x1, l_.str.2@PAGE
Lloh99:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strstr
	mov	x28, x0
	mov	x0, x27
Lloh100:
	adrp	x1, l_.str.3@PAGE
Lloh101:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_strstr
	mov	x23, x0
	cbz	x28, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	cmp	x23, x28
	ccmp	x23, #0, #4, lo
	csel	x23, x23, x28, ne
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	x23, LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	strb	wzr, [x23], #1
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w8, [x27]
	cbz	w8, LBB0_7
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
	ldp	w3, w4, [x20]
	add	x0, sp, #95
	mov	w1, #9
Lloh102:
	adrp	x2, l_.str.4@PAGE
Lloh103:
	add	x2, x2, l_.str.4@PAGEOFF
	mov	x5, x21
	bl	_snprintf
	add	x1, sp, #95
	mov	x0, x27
	bl	_blockif_open
	cbnz	x0, LBB0_6
; %bb.17:
	str	w21, [x19]
	cbz	w21, LBB0_22
; %bb.18:
	mov	x20, #0
	mov	w22, #16
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_20 Depth=1
	add	x20, x20, #1
	add	x22, x22, #40
	cmp	x20, w21, sxtw
	b.ge	LBB0_22
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x22]
	cbz	x0, LBB0_19
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	bl	_blockif_close
	ldr	w21, [x19]
	b	LBB0_19
LBB0_22:
	mov	x0, x19
	bl	_free
	mov	w0, #1
	b	LBB0_3
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh49
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh48
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh33
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh21
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh86, Lloh87, Lloh88
	.loh AdrpAdd	Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh91
	.loh AdrpAdd	Lloh94, Lloh95
	.loh AdrpAdd	Lloh96, Lloh97
	.loh AdrpAdd	Lloh100, Lloh101
	.loh AdrpAdd	Lloh98, Lloh99
	.loh AdrpAdd	Lloh102, Lloh103
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_PORTS,4,2                  ; @MAX_PORTS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"hd:"

l_.str.1:                               ; @.str.1
	.asciz	"cd:"

l_.str.2:                               ; @.str.2
	.asciz	",hd:"

l_.str.3:                               ; @.str.3
	.asciz	",cd:"

l_.str.4:                               ; @.str.4
	.asciz	"%d:%d:%d"

	.comm	_AHCI_PORT_IDENT,4,2            ; @AHCI_PORT_IDENT
l_.str.5:                               ; @.str.5
	.asciz	"BHYVE-%02X%02X-%02X%02X-%02X%02X"

	.comm	_DEF_PORTS,4,2                  ; @DEF_PORTS
	.comm	_AHCI_CAP_64BIT,4,2             ; @AHCI_CAP_64BIT
	.comm	_AHCI_CAP_SNCQ,4,2              ; @AHCI_CAP_SNCQ
	.comm	_AHCI_CAP_SSNTF,4,2             ; @AHCI_CAP_SSNTF
	.comm	_AHCI_CAP_SMPS,4,2              ; @AHCI_CAP_SMPS
	.comm	_AHCI_CAP_SSS,4,2               ; @AHCI_CAP_SSS
	.comm	_AHCI_CAP_SALP,4,2              ; @AHCI_CAP_SALP
	.comm	_AHCI_CAP_SAL,4,2               ; @AHCI_CAP_SAL
	.comm	_AHCI_CAP_SCLO,4,2              ; @AHCI_CAP_SCLO
	.comm	_AHCI_CAP_ISS_SHIFT,4,2         ; @AHCI_CAP_ISS_SHIFT
	.comm	_AHCI_CAP_PMD,4,2               ; @AHCI_CAP_PMD
	.comm	_AHCI_CAP_SSC,4,2               ; @AHCI_CAP_SSC
	.comm	_AHCI_CAP_PSC,4,2               ; @AHCI_CAP_PSC
	.comm	_AHCI_CAP_NCS_SHIFT,4,2         ; @AHCI_CAP_NCS_SHIFT
	.comm	_AHCI_CAP_SXS,4,2               ; @AHCI_CAP_SXS
	.comm	_AHCI_CAP2_APST,4,2             ; @AHCI_CAP2_APST
	.comm	_PCIR_DEVICE,4,2                ; @PCIR_DEVICE
	.comm	_PCIR_VENDOR,4,2                ; @PCIR_VENDOR
	.comm	_PCIR_CLASS,4,2                 ; @PCIR_CLASS
	.comm	_PCIC_STORAGE,4,2               ; @PCIC_STORAGE
	.comm	_PCIR_SUBCLASS,4,2              ; @PCIR_SUBCLASS
	.comm	_PCIS_STORAGE_SATA,4,2          ; @PCIS_STORAGE_SATA
	.comm	_PCIR_PROGIF,4,2                ; @PCIR_PROGIF
	.comm	_PCIP_STORAGE_SATA_AHCI_1_0,4,2 ; @PCIP_STORAGE_SATA_AHCI_1_0
	.comm	_PCIBAR_MEM32,4,2               ; @PCIBAR_MEM32
	.comm	_AHCI_OFFSET,8,3                ; @AHCI_OFFSET
	.comm	_AHCI_STEP,4,2                  ; @AHCI_STEP
	.comm	_dbg,4,2                        ; @dbg
	.no_dead_strip	_pci_ahci_init
.subsections_via_symbols
