	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_read_native_max_address
_ata_read_native_max_address:           ## @ata_read_native_max_address
	.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	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_ata_id_has_lba48
	movl	%eax, %r15d
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	callq	_ata_tf_init
	movq	_ATA_TFLAG_DEVICE@GOTPCREL(%rip), %rcx
	movq	_ATA_TFLAG_ISADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	orl	-56(%rbp), %eax
	movl	%eax, -56(%rbp)
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movq	_ATA_CMD_READ_NATIVE_MAX_EXT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	movl	%eax, -56(%rbp)
	jmp	LBB0_3
LBB0_2:
	movq	_ATA_CMD_READ_NATIVE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
LBB0_3:
	movl	%ecx, -40(%rbp)
	movq	_ATA_PROT_NODATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -44(%rbp)
	movq	_ATA_LBA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -48(%rbp)
	movq	_DMA_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$0, (%rsp)
	leaq	-56(%rbp), %rsi
	movq	%r12, %rdi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_ata_exec_internal
	testl	%eax, %eax
	je	LBB0_9
## %bb.4:
	movl	%eax, %ebx
	movq	_KERN_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	%ebx, %ecx
	callq	_ata_dev_printk
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_8
## %bb.5:
	movq	_ATA_ABORTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -52(%rbp)
	je	LBB0_8
## %bb.6:
	movq	_EACCES@GOTPCREL(%rip), %rcx
	jmp	LBB0_7
LBB0_8:
	movq	_EIO@GOTPCREL(%rip), %rcx
LBB0_7:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_13
LBB0_9:
	leaq	-56(%rbp), %rdi
	testl	%r15d, %r15d
	je	LBB0_11
## %bb.10:
	callq	_ata_tf_to_lba48
	jmp	LBB0_12
LBB0_11:
	callq	_ata_tf_to_lba
LBB0_12:
	movq	_ATA_HORKAGE_HPA_SIZE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	(%r12), %ecx
	cmpl	$1, %ecx
	adcq	$0, %rax
	movq	%rax, (%r14)
	xorl	%eax, %eax
LBB0_13:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TFLAG_DEVICE,4,2           ## @ATA_TFLAG_DEVICE
	.comm	_ATA_TFLAG_ISADDR,4,2           ## @ATA_TFLAG_ISADDR
	.comm	_ATA_CMD_READ_NATIVE_MAX_EXT,4,2 ## @ATA_CMD_READ_NATIVE_MAX_EXT
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_ATA_CMD_READ_NATIVE_MAX,4,2    ## @ATA_CMD_READ_NATIVE_MAX
	.comm	_ATA_PROT_NODATA,4,2            ## @ATA_PROT_NODATA
	.comm	_ATA_LBA,4,2                    ## @ATA_LBA
	.comm	_DMA_NONE,4,2                   ## @DMA_NONE
	.comm	_KERN_WARNING,4,2               ## @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to read native max address (err_mask=0x%x)\n"

	.comm	_AC_ERR_DEV,4,2                 ## @AC_ERR_DEV
	.comm	_ATA_ABORTED,4,2                ## @ATA_ABORTED
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_EIO,4,2                        ## @EIO
	.comm	_ATA_HORKAGE_HPA_SIZE,4,2       ## @ATA_HORKAGE_HPA_SIZE
	.no_dead_strip	_ata_read_native_max_address
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_read_native_max_address
_ata_read_native_max_address:           ; @ata_read_native_max_address
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x20, x1
	mov	x19, x0
	ldr	w0, [x0, #4]
	bl	_ata_id_has_lba48
	mov	x21, x0
	add	x1, sp, #8
	mov	x0, x19
	bl	_ata_tf_init
Lloh0:
	adrp	x8, _ATA_TFLAG_DEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_TFLAG_DEVICE@GOTPAGEOFF]
Lloh2:
	adrp	x9, _ATA_TFLAG_ISADDR@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ATA_TFLAG_ISADDR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [sp, #8]
	orr	w9, w8, w9
	str	w9, [sp, #8]
	cbz	w21, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _ATA_CMD_READ_NATIVE_MAX_EXT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_CMD_READ_NATIVE_MAX_EXT@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x10, _ATA_TFLAG_LBA48@GOTPAGE
Lloh10:
	ldr	x10, [x10, _ATA_TFLAG_LBA48@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	orr	w9, w10, w9
	str	w9, [sp, #8]
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _ATA_CMD_READ_NATIVE_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATA_CMD_READ_NATIVE_MAX@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
LBB0_3:
	str	w8, [sp, #24]
Lloh15:
	adrp	x8, _ATA_PROT_NODATA@GOTPAGE
Lloh16:
	ldr	x8, [x8, _ATA_PROT_NODATA@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldp	w10, w9, [sp, #16]
	orr	w8, w9, w8
Lloh18:
	adrp	x9, _ATA_LBA@GOTPAGE
Lloh19:
	ldr	x9, [x9, _ATA_LBA@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	orr	w9, w10, w9
	stp	w9, w8, [sp, #16]
Lloh21:
	adrp	x8, _DMA_NONE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _DMA_NONE@GOTPAGEOFF]
Lloh23:
	ldr	w3, [x8]
	add	x1, sp, #8
	mov	x0, x19
	mov	x2, #0
	mov	x4, #0
	mov	w5, #0
	mov	w6, #0
	bl	_ata_exec_internal
	cbz	w0, LBB0_9
; %bb.4:
	mov	x22, x0
Lloh24:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh25:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
Lloh27:
	adrp	x2, l_.str@PAGE
Lloh28:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x22
	bl	_ata_dev_printk
Lloh29:
	adrp	x8, _AC_ERR_DEV@GOTPAGE
Lloh30:
	ldr	x8, [x8, _AC_ERR_DEV@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [sp, #12]
Lloh32:
	adrp	x9, _ATA_ABORTED@GOTPAGE
Lloh33:
	ldr	x9, [x9, _ATA_ABORTED@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh35:
	adrp	x8, _EACCES@GOTPAGE
Lloh36:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh37:
	adrp	x8, _EIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_13
LBB0_9:
	add	x0, sp, #8
	cbz	w21, LBB0_11
; %bb.10:
	bl	_ata_tf_to_lba48
	b	LBB0_12
LBB0_11:
	bl	_ata_tf_to_lba
LBB0_12:
	mov	x8, x0
	mov	w0, #0
	ldr	w9, [x19]
Lloh39:
	adrp	x10, _ATA_HORKAGE_HPA_SIZE@GOTPAGE
Lloh40:
	ldr	x10, [x10, _ATA_HORKAGE_HPA_SIZE@GOTPAGEOFF]
Lloh41:
	ldr	w10, [x10]
	tst	w10, w9
	cinc	x8, x8, eq
	str	x8, [x20]
LBB0_13:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_DEVICE,4,2           ; @ATA_TFLAG_DEVICE
	.comm	_ATA_TFLAG_ISADDR,4,2           ; @ATA_TFLAG_ISADDR
	.comm	_ATA_CMD_READ_NATIVE_MAX_EXT,4,2 ; @ATA_CMD_READ_NATIVE_MAX_EXT
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_ATA_CMD_READ_NATIVE_MAX,4,2    ; @ATA_CMD_READ_NATIVE_MAX
	.comm	_ATA_PROT_NODATA,4,2            ; @ATA_PROT_NODATA
	.comm	_ATA_LBA,4,2                    ; @ATA_LBA
	.comm	_DMA_NONE,4,2                   ; @DMA_NONE
	.comm	_KERN_WARNING,4,2               ; @KERN_WARNING
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to read native max address (err_mask=0x%x)\n"

	.comm	_AC_ERR_DEV,4,2                 ; @AC_ERR_DEV
	.comm	_ATA_ABORTED,4,2                ; @ATA_ABORTED
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_EIO,4,2                        ; @EIO
	.comm	_ATA_HORKAGE_HPA_SIZE,4,2       ; @ATA_HORKAGE_HPA_SIZE
	.no_dead_strip	_ata_read_native_max_address
.subsections_via_symbols
