	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_DMA
_setup_DMA:                             ## @setup_DMA
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	xorl	%eax, %eax
	callq	_claim_dma_lock
	movq	%rax, %r14
	xorl	%eax, %eax
	callq	_fd_disable_dma
	xorl	%eax, %eax
	callq	_fd_clear_dma_ff
	movq	_raw_cmd@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	(%rax), %rsi
	movq	16(%rax), %rdi
	callq	_fd_cacheflush
	movq	(%rbx), %rax
	movq	_FD_RAW_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	12(%rax), %ecx
	jne	LBB0_1
## %bb.2:
	movq	_DMA_MODE_WRITE@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_DMA_MODE_READ@GOTPCREL(%rip), %rax
LBB0_3:
	movl	(%rax), %edi
	callq	_fd_set_dma_mode
	movq	(%rbx), %rax
	movq	16(%rax), %rdi
	callq	_fd_set_dma_addr
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_fd_set_dma_count
	movq	_FDCS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %eax
	movq	_virtual_dma_port@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	xorl	%eax, %eax
	callq	_fd_enable_dma
	movq	%r14, %rdi
	callq	_release_dma_lock
	xorl	%eax, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_floppy_disable_hlt             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_raw_cmd,8,3                    ## @raw_cmd
	.comm	_FD_RAW_READ,4,2                ## @FD_RAW_READ
	.comm	_DMA_MODE_READ,4,2              ## @DMA_MODE_READ
	.comm	_DMA_MODE_WRITE,4,2             ## @DMA_MODE_WRITE
	.comm	_FDCS,8,3                       ## @FDCS
	.comm	_virtual_dma_port,4,2           ## @virtual_dma_port
	.comm	_cont,8,3                       ## @cont
	.no_dead_strip	_setup_DMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_DMA
_setup_DMA:                             ; @setup_DMA
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	bl	_claim_dma_lock
	mov	x19, x0
	bl	_fd_disable_dma
	bl	_fd_clear_dma_ff
Lloh0:
	adrp	x20, _raw_cmd@GOTPAGE
Lloh1:
	ldr	x20, [x20, _raw_cmd@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	ldr	x1, [x8]
	bl	_fd_cacheflush
	ldr	x8, [x20]
	ldr	w8, [x8, #12]
Lloh2:
	adrp	x9, _FD_RAW_READ@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FD_RAW_READ@GOTPAGEOFF]
Lloh4:
	adrp	x10, _DMA_MODE_READ@GOTPAGE
Lloh5:
	ldr	x10, [x10, _DMA_MODE_READ@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
Lloh7:
	adrp	x11, _DMA_MODE_WRITE@GOTPAGE
Lloh8:
	ldr	x11, [x11, _DMA_MODE_WRITE@GOTPAGEOFF]
	tst	w9, w8
	csel	x8, x11, x10, eq
	ldr	w0, [x8]
	bl	_fd_set_dma_mode
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	bl	_fd_set_dma_addr
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_fd_set_dma_count
Lloh9:
	adrp	x8, _FDCS@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FDCS@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	ldr	w8, [x8, #4]
Lloh12:
	adrp	x9, _virtual_dma_port@GOTPAGE
Lloh13:
	ldr	x9, [x9, _virtual_dma_port@GOTPAGEOFF]
Lloh14:
	str	w8, [x9]
	bl	_fd_enable_dma
	mov	x0, x19
	bl	_release_dma_lock
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_floppy_disable_hlt
	.loh AdrpLdrGotStr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_raw_cmd,8,3                    ; @raw_cmd
	.comm	_FD_RAW_READ,4,2                ; @FD_RAW_READ
	.comm	_DMA_MODE_READ,4,2              ; @DMA_MODE_READ
	.comm	_DMA_MODE_WRITE,4,2             ; @DMA_MODE_WRITE
	.comm	_FDCS,8,3                       ; @FDCS
	.comm	_virtual_dma_port,4,2           ; @virtual_dma_port
	.comm	_cont,8,3                       ; @cont
	.no_dead_strip	_setup_DMA
.subsections_via_symbols
