	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function handle_atapi_identify
LCPI0_0:
	.long	3                               ## 0x3
	.long	120                             ## 0x78
	.long	120                             ## 0x78
	.long	120                             ## 0x78
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_handle_atapi_identify:                 ## @handle_atapi_identify
	.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	$1040, %rsp                     ## imm = 0x410
	.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)
	cmpl	$0, 16(%rdi)
	je	LBB0_1
## %bb.3:
	leaq	-1072(%rbp), %rdi
	xorl	%esi, %esi
	movl	$1024, %edx                     ## imm = 0x400
	callq	_memset
	movl	$34240, -1072(%rbp)             ## imm = 0x85C0
	leaq	-1032(%rbp), %rdi
	movq	(%rbx), %rsi
	movl	$20, %edx
	callq	_ata_string
	leaq	-980(%rbp), %rdi
	leaq	L_.str(%rip), %rsi
	movl	$8, %edx
	callq	_ata_string
	leaq	-964(%rbp), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	$40, %edx
	callq	_ata_string
	movabsq	$70373039145728, %rax           ## imm = 0x400100000300
	movq	%rax, -876(%rbp)
	movl	$6, -860(%rbp)
	movabsq	$30064771135, %rax              ## imm = 0x70000003F
	movq	%rax, -824(%rbp)
	movl	8(%rbx), %eax
	movq	_ATA_WDMA0@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_5
## %bb.4:
	movl	%eax, %ecx
	andb	$7, %cl
	orb	$8, %cl
	movl	$7, %edx
	btsl	%ecx, %edx
	movl	%edx, -820(%rbp)
LBB0_5:
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [3,120,120,120]
	movaps	%xmm0, -816(%rbp)
	movl	$120, -800(%rbp)
	movq	_ATA_SATA_GEN1@GOTPCREL(%rip), %rcx
	movq	_ATA_SATA_GEN2@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_ATA_SATA_GEN3@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%edx, -768(%rbp)
	movq	_ATA_SS_SPD_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	12(%rbx), %ecx
	sarl	$3, %ecx
	movl	%ecx, -764(%rbp)
	movl	$32, -760(%rbp)
	movq	_ATA_SUPPORT_POWERMGT@GOTPCREL(%rip), %rcx
	movq	_ATA_SUPPORT_PACKET@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movl	$1008, -752(%rbp)               ## imm = 0x3F0
	movq	_ATA_SUPPORT_RESET@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movq	_ATA_SUPPORT_NOP@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	movl	%edx, -744(%rbp)
	movabsq	$70368744194048, %rcx           ## imm = 0x400000004000
	movq	%rcx, -740(%rbp)
	movl	%edx, -732(%rbp)
	movabsq	$545460862976, %rcx             ## imm = 0x7F00004000
	movq	%rcx, -724(%rbp)
	movq	_ATA_UDMA0@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_7
## %bb.6:
	andb	$7, %al
	orb	$8, %al
	movl	$127, %ecx
	btsl	%eax, %ecx
	movl	%ecx, -720(%rbp)
LBB0_7:
	movl	$4128, -184(%rbp)               ## imm = 0x1020
	movl	$165, -52(%rbp)
	leaq	-1072(%rbp), %r12
	movq	%r12, %rdi
	movl	$1024, %esi                     ## imm = 0x400
	callq	_ahci_checksum
	movq	%rbx, %rdi
	callq	_ahci_write_fis_piosetup
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	movq	%r12, %rcx
	movl	$1024, %r8d                     ## imm = 0x400
	callq	_write_prdt
	movq	_ATA_S_DSC@GOTPCREL(%rip), %rax
	movq	_ATA_S_READY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	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_9
## %bb.8:
	addq	$1040, %rsp                     ## imm = 0x410
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	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_9
## %bb.2:
	movq	%rbx, %rdi
	movl	%r15d, %esi
	movq	%r14, %rdx
	addq	$1040, %rsp                     ## imm = 0x410
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ahci_write_fis_d2h             ## TAILCALL
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"001"

L_.str.1:                               ## @.str.1
	.asciz	"BHYVE SATA DVD ROM"

	.comm	_ATA_WDMA0,4,2                  ## @ATA_WDMA0
	.comm	_ATA_SATA_GEN1,4,2              ## @ATA_SATA_GEN1
	.comm	_ATA_SATA_GEN2,4,2              ## @ATA_SATA_GEN2
	.comm	_ATA_SATA_GEN3,4,2              ## @ATA_SATA_GEN3
	.comm	_ATA_SS_SPD_MASK,4,2            ## @ATA_SS_SPD_MASK
	.comm	_ATA_SUPPORT_POWERMGT,4,2       ## @ATA_SUPPORT_POWERMGT
	.comm	_ATA_SUPPORT_PACKET,4,2         ## @ATA_SUPPORT_PACKET
	.comm	_ATA_SUPPORT_RESET,4,2          ## @ATA_SUPPORT_RESET
	.comm	_ATA_SUPPORT_NOP,4,2            ## @ATA_SUPPORT_NOP
	.comm	_ATA_UDMA0,4,2                  ## @ATA_UDMA0
	.comm	_ATA_S_DSC,4,2                  ## @ATA_S_DSC
	.no_dead_strip	_handle_atapi_identify
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function handle_atapi_identify
lCPI0_0:
	.long	768                             ; 0x300
	.long	16385                           ; 0x4001
lCPI0_1:
	.long	63                              ; 0x3f
	.long	7                               ; 0x7
lCPI0_3:
	.long	16384                           ; 0x4000
	.long	127                             ; 0x7f
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4
lCPI0_2:
	.long	3                               ; 0x3
	.long	120                             ; 0x78
	.long	120                             ; 0x78
	.long	120                             ; 0x78
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_handle_atapi_identify:                 ; @handle_atapi_identify
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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 w27, -72
	.cfi_offset w28, -80
	sub	sp, sp, #1040
	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, #-72]
	ldr	w8, [x0, #16]
	cbz	w8, LBB0_7
; %bb.1:
	add	x24, sp, #8
	add	x22, x24, #332
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #1024
	bl	_memset
	mov	w8, #34240
	str	w8, [sp, #8]
	add	x0, x24, #40
	ldr	x1, [x21]
	mov	w2, #20
	bl	_ata_string
	add	x0, x24, #92
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	w23, #8
	mov	w2, #8
	bl	_ata_string
	add	x0, x24, #108
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w2, #40
	bl	_ata_string
Lloh7:
	adrp	x8, lCPI0_0@PAGE
Lloh8:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [sp, #204]
	mov	w8, #6
	str	w8, [sp, #220]
Lloh9:
	adrp	x8, lCPI0_1@PAGE
Lloh10:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [sp, #256]
	ldr	w8, [x21, #8]
Lloh11:
	adrp	x9, _ATA_WDMA0@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ATA_WDMA0@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	bfxil	w23, w8, #0, #3
	mov	w9, #1
	lsl	w9, w9, w23
	orr	w9, w9, #0x7
	str	w9, [sp, #260]
LBB0_3:
Lloh14:
	adrp	x9, lCPI0_2@PAGE
Lloh15:
	ldr	q0, [x9, lCPI0_2@PAGEOFF]
	mov	w9, #120
	str	w9, [sp, #280]
Lloh16:
	adrp	x9, _ATA_SATA_GEN1@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ATA_SATA_GEN1@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
Lloh19:
	adrp	x10, _ATA_SATA_GEN2@GOTPAGE
Lloh20:
	ldr	x10, [x10, _ATA_SATA_GEN2@GOTPAGEOFF]
Lloh21:
	ldr	w10, [x10]
Lloh22:
	adrp	x11, _ATA_SATA_GEN3@GOTPAGE
Lloh23:
	ldr	x11, [x11, _ATA_SATA_GEN3@GOTPAGEOFF]
	orr	w9, w10, w9
Lloh24:
	ldr	w10, [x11]
	orr	w9, w9, w10
	str	w9, [sp, #312]
Lloh25:
	adrp	x9, _ATA_SS_SPD_MASK@GOTPAGE
Lloh26:
	ldr	x9, [x9, _ATA_SS_SPD_MASK@GOTPAGEOFF]
	ldr	w10, [x21, #12]
Lloh27:
	ldr	w9, [x9]
	and	w9, w9, w10
	asr	w9, w9, #3
	str	w9, [sp, #316]
	mov	w9, #32
	str	w9, [sp, #320]
	mov	w9, #1008
	str	w9, [sp, #328]
Lloh28:
	adrp	x9, _ATA_SUPPORT_POWERMGT@GOTPAGE
Lloh29:
	ldr	x9, [x9, _ATA_SUPPORT_POWERMGT@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	adrp	x10, _ATA_SUPPORT_PACKET@GOTPAGE
Lloh32:
	ldr	x10, [x10, _ATA_SUPPORT_PACKET@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh34:
	adrp	x10, _ATA_SUPPORT_RESET@GOTPAGE
Lloh35:
	ldr	x10, [x10, _ATA_SUPPORT_RESET@GOTPAGEOFF]
	add	x11, sp, #9
	stur	q0, [x11, #255]
Lloh36:
	ldr	w10, [x10]
	orr	w9, w9, w10
Lloh37:
	adrp	x10, _ATA_SUPPORT_NOP@GOTPAGE
Lloh38:
	ldr	x10, [x10, _ATA_SUPPORT_NOP@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	orr	w9, w9, w10
	str	w9, [sp, #336]
	movi.2s	v0, #64, lsl #8
	str	d0, [x22]
	str	w9, [sp, #348]
Lloh40:
	adrp	x9, lCPI0_3@PAGE
Lloh41:
	ldr	d0, [x9, lCPI0_3@PAGEOFF]
	str	d0, [x22, #16]
Lloh42:
	adrp	x9, _ATA_UDMA0@GOTPAGE
Lloh43:
	ldr	x9, [x9, _ATA_UDMA0@GOTPAGEOFF]
Lloh44:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
	mov	w9, #8
	bfxil	w9, w8, #0, #3
	mov	w8, #1
	lsl	w8, w8, w9
	orr	w8, w8, #0x7f
	str	w8, [sp, #360]
LBB0_5:
	mov	w8, #4128
	str	w8, [sp, #896]
	mov	w8, #165
	str	w8, [sp, #1028]
	add	x0, sp, #8
	mov	w1, #1024
	bl	_ahci_checksum
	mov	x0, x21
	bl	_ahci_write_fis_piosetup
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	mov	w4, #1024
	bl	_write_prdt
Lloh45:
	adrp	x8, _ATA_S_DSC@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ATA_S_DSC@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
Lloh48:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh49:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
Lloh50:
	ldr	w9, [x9]
	orr	w3, w9, w8
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	bl	_ahci_write_fis_d2h
	ldur	x8, [x29, #-72]
Lloh51:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh52:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh53:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.6:
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_7:
Lloh54:
	adrp	x8, _ATA_E_ABORT@GOTPAGE
Lloh55:
	ldr	x8, [x8, _ATA_E_ABORT@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8]
Lloh57:
	adrp	x9, _ATA_S_READY@GOTPAGE
Lloh58:
	ldr	x9, [x9, _ATA_S_READY@GOTPAGEOFF]
Lloh59:
	ldr	w9, [x9]
Lloh60:
	adrp	x10, _ATA_S_ERROR@GOTPAGE
Lloh61:
	ldr	x10, [x10, _ATA_S_ERROR@GOTPAGEOFF]
Lloh62:
	ldr	w10, [x10]
	ldur	x11, [x29, #-72]
Lloh63:
	adrp	x12, ___stack_chk_guard@GOTPAGE
Lloh64:
	ldr	x12, [x12, ___stack_chk_guard@GOTPAGEOFF]
Lloh65:
	ldr	x12, [x12]
	cmp	x12, x11
	b.ne	LBB0_9
; %bb.8:
	orr	w8, w9, w8, lsl #8
	orr	w3, w8, w10
	mov	x0, x21
	mov	x1, x20
	mov	x2, x19
	add	sp, sp, #1040
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #80             ; 16-byte Folded Reload
	b	_ahci_write_fis_d2h
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdr	Lloh9, Lloh10
	.loh AdrpLdr	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdrp	Lloh40, Lloh42
	.loh AdrpLdr	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdr	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh51, Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh63, Lloh64, Lloh65
	.loh AdrpLdrGotLdr	Lloh60, Lloh61, Lloh62
	.loh AdrpLdrGotLdr	Lloh57, Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.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
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"001"

l_.str.1:                               ; @.str.1
	.asciz	"BHYVE SATA DVD ROM"

	.comm	_ATA_WDMA0,4,2                  ; @ATA_WDMA0
	.comm	_ATA_SATA_GEN1,4,2              ; @ATA_SATA_GEN1
	.comm	_ATA_SATA_GEN2,4,2              ; @ATA_SATA_GEN2
	.comm	_ATA_SATA_GEN3,4,2              ; @ATA_SATA_GEN3
	.comm	_ATA_SS_SPD_MASK,4,2            ; @ATA_SS_SPD_MASK
	.comm	_ATA_SUPPORT_POWERMGT,4,2       ; @ATA_SUPPORT_POWERMGT
	.comm	_ATA_SUPPORT_PACKET,4,2         ; @ATA_SUPPORT_PACKET
	.comm	_ATA_SUPPORT_RESET,4,2          ; @ATA_SUPPORT_RESET
	.comm	_ATA_SUPPORT_NOP,4,2            ; @ATA_SUPPORT_NOP
	.comm	_ATA_UDMA0,4,2                  ; @ATA_UDMA0
	.comm	_ATA_S_DSC,4,2                  ; @ATA_S_DSC
	.no_dead_strip	_handle_atapi_identify
.subsections_via_symbols
