	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ata_scsi_dev_config
_ata_scsi_dev_config:                   ## @ata_scsi_dev_config
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %r14
	movq	32(%rdi), %r15
	movl	24(%rsi), %edi
	callq	_ata_id_has_unload
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_ATA_DFLAG_NO_UNLOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r12)
LBB0_2:
	movl	28(%r12), %esi
	movq	%r15, %rdi
	callq	_blk_queue_max_hw_sectors
	movq	8(%r12), %rax
	movq	_ATA_DEV_ATAPI@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_6
## %bb.3:
	movq	_ATA_SECT_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r14)
	movq	_ATA_DMA_PAD_SZ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	decq	%rsi
	movq	%r15, %rdi
	callq	_blk_queue_update_dma_pad
	movq	_ATAPI_MAX_DRAIN@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	_atapi_drain_needed@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%rbx), %ecx
	movq	%r15, %rdi
	movq	%rax, %rdx
	callq	_blk_queue_dma_drain
	movq	(%r14), %rax
	jmp	LBB0_7
LBB0_6:
	movl	24(%r12), %edi
	callq	_ata_id_logical_sector_size
	movq	%rax, (%r14)
	movl	$1, 8(%r14)
LBB0_7:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jle	LBB0_9
## %bb.8:
	movq	_KERN_WARNING@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r12, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_ata_dev_printk
LBB0_9:
	movq	(%r14), %rsi
	decq	%rsi
	movq	%r15, %rdi
	callq	_blk_queue_update_dma_alignment
	movl	(%r12), %eax
	movq	_ATA_DFLAG_AN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_11
## %bb.10:
	movq	_SDEV_EVT_MEDIA_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	24(%r14), %esi
	callq	_set_bit
	movl	(%r12), %eax
LBB0_11:
	movq	_ATA_DFLAG_NCQ@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_13
## %bb.12:
	movq	16(%r14), %rax
	movq	(%rax), %rbx
	movl	24(%r12), %edi
	callq	_ata_id_queue_depth
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_min
	movq	_ATA_MAX_QUEUE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdi
	decq	%rdi
	movl	%eax, %esi
	callq	_min
	movq	_MSG_SIMPLE_TAG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%r14, %rdi
	movl	%eax, %edx
	callq	_scsi_adjust_queue_depth
LBB0_13:
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_blk_queue_flush_queueable
	movq	%r14, 16(%r12)
	jmp	LBB0_14
LBB0_4:
	movq	_KERN_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_ata_dev_printk
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_DFLAG_NO_UNLOAD,4,2        ## @ATA_DFLAG_NO_UNLOAD
	.comm	_ATA_DEV_ATAPI,8,3              ## @ATA_DEV_ATAPI
	.comm	_ATA_SECT_SIZE,8,3              ## @ATA_SECT_SIZE
	.comm	_ATA_DMA_PAD_SZ,8,3             ## @ATA_DMA_PAD_SZ
	.comm	_ATAPI_MAX_DRAIN,4,2            ## @ATAPI_MAX_DRAIN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_KERN_ERR,4,2                   ## @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"drain buffer allocation failed\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_atapi_drain_needed,4,2         ## @atapi_drain_needed
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_KERN_WARNING,4,2               ## @KERN_WARNING
L_.str.1:                               ## @.str.1
	.asciz	"sector_size=%u > PAGE_SIZE, PIO may malfunction\n"

	.comm	_ATA_DFLAG_AN,4,2               ## @ATA_DFLAG_AN
	.comm	_SDEV_EVT_MEDIA_CHANGE,4,2      ## @SDEV_EVT_MEDIA_CHANGE
	.comm	_ATA_DFLAG_NCQ,4,2              ## @ATA_DFLAG_NCQ
	.comm	_ATA_MAX_QUEUE,8,3              ## @ATA_MAX_QUEUE
	.comm	_MSG_SIMPLE_TAG,4,2             ## @MSG_SIMPLE_TAG
	.no_dead_strip	_ata_scsi_dev_config
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ata_scsi_dev_config
_ata_scsi_dev_config:                   ; @ata_scsi_dev_config
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x1
	mov	x20, x0
	ldr	x21, [x0, #32]
	ldr	w0, [x1, #24]
	bl	_ata_id_has_unload
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ATA_DFLAG_NO_UNLOAD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_DFLAG_NO_UNLOAD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19]
	orr	w8, w9, w8
	str	w8, [x19]
LBB0_2:
	ldr	w1, [x19, #28]
	mov	x0, x21
	bl	_blk_queue_max_hw_sectors
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _ATA_DEV_ATAPI@GOTPAGE
Lloh4:
	ldr	x9, [x9, _ATA_DEV_ATAPI@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
Lloh6:
	adrp	x8, _ATA_SECT_SIZE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ATA_SECT_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x20]
Lloh9:
	adrp	x8, _ATA_DMA_PAD_SZ@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ATA_DMA_PAD_SZ@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	sub	x1, x8, #1
	mov	x0, x21
	bl	_blk_queue_update_dma_pad
Lloh12:
	adrp	x22, _ATAPI_MAX_DRAIN@GOTPAGE
Lloh13:
	ldr	x22, [x22, _ATAPI_MAX_DRAIN@GOTPAGEOFF]
	ldr	w0, [x22]
	ldr	w8, [x21]
Lloh14:
	adrp	x9, _GFP_KERNEL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _GFP_KERNEL@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_kmalloc
	cbz	x0, LBB0_13
; %bb.4:
	mov	x2, x0
Lloh17:
	adrp	x8, _atapi_drain_needed@GOTPAGE
Lloh18:
	ldr	x8, [x8, _atapi_drain_needed@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	ldr	w3, [x22]
	mov	x0, x21
	bl	_blk_queue_dma_drain
	ldr	x0, [x20]
	b	LBB0_6
LBB0_5:
	ldr	w0, [x19, #24]
	bl	_ata_id_logical_sector_size
	str	x0, [x20]
	mov	w8, #1
	str	w8, [x20, #8]
LBB0_6:
Lloh20:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.le	LBB0_8
; %bb.7:
Lloh23:
	adrp	x8, _KERN_WARNING@GOTPAGE
Lloh24:
	ldr	x8, [x8, _KERN_WARNING@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	str	x0, [sp]
Lloh26:
	adrp	x2, l_.str.1@PAGE
Lloh27:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
LBB0_8:
	ldr	x8, [x20]
	sub	x1, x8, #1
	mov	x0, x21
	bl	_blk_queue_update_dma_alignment
	ldr	w8, [x19]
Lloh28:
	adrp	x9, _ATA_DFLAG_AN@GOTPAGE
Lloh29:
	ldr	x9, [x9, _ATA_DFLAG_AN@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.9:
Lloh31:
	adrp	x8, _SDEV_EVT_MEDIA_CHANGE@GOTPAGE
Lloh32:
	ldr	x8, [x8, _SDEV_EVT_MEDIA_CHANGE@GOTPAGEOFF]
Lloh33:
	ldr	w0, [x8]
	ldr	w1, [x20, #24]
	bl	_set_bit
	ldr	w8, [x19]
LBB0_10:
Lloh34:
	adrp	x9, _ATA_DFLAG_NCQ@GOTPAGE
Lloh35:
	ldr	x9, [x9, _ATA_DFLAG_NCQ@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_12
; %bb.11:
	ldr	x8, [x20, #16]
	ldr	x22, [x8]
	ldr	w0, [x19, #24]
	bl	_ata_id_queue_depth
	mov	x1, x0
	mov	x0, x22
	bl	_min
	mov	x1, x0
Lloh37:
	adrp	x8, _ATA_MAX_QUEUE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ATA_MAX_QUEUE@GOTPAGEOFF]
Lloh39:
	ldr	x8, [x8]
	sub	x0, x8, #1
	bl	_min
	mov	x2, x0
Lloh40:
	adrp	x8, _MSG_SIMPLE_TAG@GOTPAGE
Lloh41:
	ldr	x8, [x8, _MSG_SIMPLE_TAG@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_scsi_adjust_queue_depth
LBB0_12:
	mov	x0, x21
	mov	w1, #0
	bl	_blk_queue_flush_queueable
	mov	w0, #0
	str	x20, [x19, #16]
	b	LBB0_14
LBB0_13:
Lloh43:
	adrp	x8, _KERN_ERR@GOTPAGE
Lloh44:
	ldr	x8, [x8, _KERN_ERR@GOTPAGEOFF]
Lloh45:
	ldr	w1, [x8]
Lloh46:
	adrp	x2, l_.str@PAGE
Lloh47:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_ata_dev_printk
Lloh48:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh49:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh50:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_14:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_DFLAG_NO_UNLOAD,4,2        ; @ATA_DFLAG_NO_UNLOAD
	.comm	_ATA_DEV_ATAPI,8,3              ; @ATA_DEV_ATAPI
	.comm	_ATA_SECT_SIZE,8,3              ; @ATA_SECT_SIZE
	.comm	_ATA_DMA_PAD_SZ,8,3             ; @ATA_DMA_PAD_SZ
	.comm	_ATAPI_MAX_DRAIN,4,2            ; @ATAPI_MAX_DRAIN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_KERN_ERR,4,2                   ; @KERN_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"drain buffer allocation failed\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_atapi_drain_needed,4,2         ; @atapi_drain_needed
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_KERN_WARNING,4,2               ; @KERN_WARNING
l_.str.1:                               ; @.str.1
	.asciz	"sector_size=%u > PAGE_SIZE, PIO may malfunction\n"

	.comm	_ATA_DFLAG_AN,4,2               ; @ATA_DFLAG_AN
	.comm	_SDEV_EVT_MEDIA_CHANGE,4,2      ; @SDEV_EVT_MEDIA_CHANGE
	.comm	_ATA_DFLAG_NCQ,4,2              ; @ATA_DFLAG_NCQ
	.comm	_ATA_MAX_QUEUE,8,3              ; @ATA_MAX_QUEUE
	.comm	_MSG_SIMPLE_TAG,4,2             ; @MSG_SIMPLE_TAG
	.no_dead_strip	_ata_scsi_dev_config
.subsections_via_symbols
