	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pata_icside_bmdma_setup
_pata_icside_bmdma_setup:               ## @pata_icside_bmdma_setup
	.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	%rdi, %r15
	movq	24(%rdi), %r14
	movq	16(%r14), %rax
	movq	(%rax), %rbx
	movq	_ATA_TFLAG_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	andl	(%rdi), %r12d
	movl	(%rbx), %edi
	callq	_dma_channel_active
	movl	%eax, %edi
	callq	_BUG_ON
	movq	8(%rbx), %rax
	movq	(%r14), %rcx
	shlq	$4, %rcx
	movl	8(%rax,%rcx), %edi
	movl	16(%rbx), %esi
	callq	_writeb
	movl	(%rbx), %edi
	movq	8(%rbx), %rax
	movq	(%r14), %rcx
	shlq	$4, %rcx
	movq	(%rax,%rcx), %rax
	movq	16(%r15), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	callq	_set_dma_speed
	movl	(%rbx), %edi
	movl	4(%r15), %edx
	movl	8(%r15), %esi
	callq	_set_dma_sg
	movl	(%rbx), %edi
	testl	%r12d, %r12d
	jne	LBB0_1
## %bb.2:
	movq	_DMA_MODE_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_MODE_WRITE@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %esi
	callq	_set_dma_mode
	movq	8(%r14), %rax
	movq	(%rax), %rax
	movq	%r14, %rdi
	movq	%r15, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ## @ATA_TFLAG_WRITE
	.comm	_DMA_MODE_WRITE,4,2             ## @DMA_MODE_WRITE
	.comm	_DMA_MODE_READ,4,2              ## @DMA_MODE_READ
	.no_dead_strip	_pata_icside_bmdma_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pata_icside_bmdma_setup
_pata_icside_bmdma_setup:               ; @pata_icside_bmdma_setup
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	ldr	x20, [x0, #24]
	ldr	x8, [x20, #16]
	ldr	x21, [x8]
	ldr	w22, [x0]
Lloh0:
	adrp	x8, _ATA_TFLAG_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATA_TFLAG_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w23, [x8]
	ldr	w0, [x21]
	bl	_dma_channel_active
	bl	_BUG_ON
	ldr	x8, [x21, #8]
	ldr	x9, [x20]
	add	x8, x8, x9, lsl #4
	ldr	w0, [x8, #8]
	ldr	w1, [x21, #16]
	bl	_writeb
	ldr	w0, [x21]
	ldr	x8, [x21, #8]
	ldr	x9, [x20]
	lsl	x9, x9, #4
	ldr	x8, [x8, x9]
	ldr	x9, [x19, #16]
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	bl	_set_dma_speed
	ldr	w0, [x21]
	ldp	w2, w1, [x19, #4]
	bl	_set_dma_sg
Lloh3:
	adrp	x8, _DMA_MODE_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DMA_MODE_WRITE@GOTPAGEOFF]
	ldr	w0, [x21]
Lloh5:
	adrp	x9, _DMA_MODE_READ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _DMA_MODE_READ@GOTPAGEOFF]
	tst	w23, w22
	csel	x8, x9, x8, eq
	ldr	w1, [x8]
	bl	_set_dma_mode
	ldr	x8, [x20, #8]
	ldr	x2, [x8]
	mov	x0, x20
	mov	x1, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	br	x2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ATA_TFLAG_WRITE,4,2            ; @ATA_TFLAG_WRITE
	.comm	_DMA_MODE_WRITE,4,2             ; @DMA_MODE_WRITE
	.comm	_DMA_MODE_READ,4,2              ; @DMA_MODE_READ
	.no_dead_strip	_pata_icside_bmdma_setup
.subsections_via_symbols
