	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_set_max_sectors
_ata_set_max_sectors:                   ## @ata_set_max_sectors
	.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	%rbx
	subq	$56, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	(%rdi), %edi
	callq	_ata_id_has_lba48
	movl	%eax, %r15d
	decl	%ebx
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_ata_tf_init
	movq	_ATA_TFLAG_DEVICE@GOTPCREL(%rip), %rax
	movq	_ATA_TFLAG_ISADDR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	orl	-72(%rbp), %ecx
	movl	%ecx, -72(%rbp)
	testl	%r15d, %r15d
	je	LBB0_2
## %bb.1:
	movq	_ATA_CMD_SET_MAX_EXT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_ATA_TFLAG_LBA48@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, -72(%rbp)
	movl	%ebx, %ecx
	shrl	$24, %ecx
	movl	%ecx, -68(%rbp)
	movl	-56(%rbp), %ecx
	jmp	LBB0_3
LBB0_2:
	movq	_ATA_CMD_SET_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%ebx, %ecx
	shrl	$24, %ecx
	andl	$15, %ecx
	orl	-56(%rbp), %ecx
LBB0_3:
	movl	%eax, -32(%rbp)
	movq	_ATA_PROT_NODATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, -36(%rbp)
	movq	_ATA_LBA@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	movl	%ecx, -56(%rbp)
	movzbl	%bl, %eax
	movl	%eax, -52(%rbp)
	movzbl	%bh, %eax
	movl	%eax, -48(%rbp)
	shrl	$16, %ebx
	movzbl	%bl, %eax
	movl	%eax, -44(%rbp)
	movq	_DMA_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$0, (%rsp)
	xorl	%r15d, %r15d
	leaq	-72(%rbp), %rsi
	movq	%r14, %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	%r14, %rdi
	movl	%ebx, %ecx
	callq	_ata_dev_printk
	movq	_AC_ERR_DEV@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_7
## %bb.5:
	movq	_ATA_ABORTED@GOTPCREL(%rip), %rax
	movq	_ATA_IDNF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, -40(%rbp)
	je	LBB0_7
## %bb.6:
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_8:
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
LBB0_9:
	movl	%r15d, %eax
	addq	$56, %rsp
	popq	%rbx
	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_SET_MAX_EXT,4,2        ## @ATA_CMD_SET_MAX_EXT
	.comm	_ATA_TFLAG_LBA48,4,2            ## @ATA_TFLAG_LBA48
	.comm	_ATA_CMD_SET_MAX,4,2            ## @ATA_CMD_SET_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 set max address (err_mask=0x%x)\n"

	.comm	_AC_ERR_DEV,4,2                 ## @AC_ERR_DEV
	.comm	_ATA_ABORTED,4,2                ## @ATA_ABORTED
	.comm	_ATA_IDNF,4,2                   ## @ATA_IDNF
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_ata_set_max_sectors
.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 ata_set_max_sectors
lCPI0_0:
	.long	4294967288                      ; 0xfffffff8
	.long	4294967280                      ; 0xfffffff0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_ata_set_max_sectors:                   ; @ata_set_max_sectors
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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]
	bl	_ata_id_has_lba48
	mov	x21, x0
	sub	w20, w20, #1
	mov	x1, sp
	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]
	orr	w9, w8, w9
	str	w9, [sp]
	cbz	w21, LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _ATA_CMD_SET_MAX_EXT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_CMD_SET_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
	lsr	w10, w20, #24
	stp	w9, w10, [sp]
	ldr	w9, [sp, #16]
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _ATA_CMD_SET_MAX@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ATA_CMD_SET_MAX@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	ubfx	w9, w20, #24, #4
	ldr	w10, [sp, #16]
	orr	w9, w10, w9
LBB0_3:
Lloh15:
	adrp	x10, _ATA_PROT_NODATA@GOTPAGE
Lloh16:
	ldr	x10, [x10, _ATA_PROT_NODATA@GOTPAGEOFF]
Lloh17:
	ldr	w10, [x10]
	ldr	w11, [sp, #36]
	orr	w10, w11, w10
	stp	w10, w8, [sp, #36]
Lloh18:
	adrp	x8, _ATA_LBA@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ATA_LBA@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	orr	w8, w9, w8
	and	w9, w20, #0xff
	stp	w8, w9, [sp, #16]
	dup.2s	v0, w20
Lloh21:
	adrp	x8, lCPI0_0@PAGE
Lloh22:
	ldr	d1, [x8, lCPI0_0@PAGEOFF]
	ushl.2s	v0, v0, v1
	movi	d1, #0x0000ff000000ff
	and.8b	v0, v0, v1
	str	d0, [sp, #24]
Lloh23:
	adrp	x8, _DMA_NONE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DMA_NONE@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
	mov	x1, sp
	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	x20, x0
Lloh26:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh27:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
Lloh29:
	adrp	x2, l_.str@PAGE
Lloh30:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	mov	x3, x20
	bl	_ata_dev_printk
Lloh31:
	adrp	x8, _AC_ERR_DEV@GOTPAGE
Lloh32:
	ldr	x8, [x8, _AC_ERR_DEV@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	cmp	w20, w8
	b.ne	LBB0_7
; %bb.5:
	ldr	w8, [sp, #32]
Lloh34:
	adrp	x9, _ATA_ABORTED@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ATA_ABORTED@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
Lloh37:
	adrp	x10, _ATA_IDNF@GOTPAGE
Lloh38:
	ldr	x10, [x10, _ATA_IDNF@GOTPAGEOFF]
Lloh39:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
Lloh40:
	adrp	x8, _EACCES@GOTPAGE
Lloh41:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:
Lloh42:
	adrp	x8, _EIO@GOTPAGE
Lloh43:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	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	Lloh23, Lloh24, Lloh25
	.loh AdrpAdrp	Lloh21, Lloh23
	.loh AdrpLdr	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGot	Lloh42, Lloh43
	.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_SET_MAX_EXT,4,2        ; @ATA_CMD_SET_MAX_EXT
	.comm	_ATA_TFLAG_LBA48,4,2            ; @ATA_TFLAG_LBA48
	.comm	_ATA_CMD_SET_MAX,4,2            ; @ATA_CMD_SET_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 set max address (err_mask=0x%x)\n"

	.comm	_AC_ERR_DEV,4,2                 ; @AC_ERR_DEV
	.comm	_ATA_ABORTED,4,2                ; @ATA_ABORTED
	.comm	_ATA_IDNF,4,2                   ; @ATA_IDNF
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_ata_set_max_sectors
.subsections_via_symbols
