	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_rw_floppy
_setup_rw_floppy:                       ## @setup_rw_floppy
	.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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_raw_cmd@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	movl	(%rax), %ecx
	movq	_FD_RAW_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_FD_RAW_WRITE@GOTPCREL(%rip), %r13
	movl	(%r13), %r15d
	orl	%eax, %r15d
	movq	_FD_RAW_INTR@GOTPCREL(%rip), %rbx
	andl	%ecx, %r15d
	je	LBB0_2
## %bb.1:
	movl	(%rbx), %r15d
LBB0_2:
	orl	%ecx, %r15d
	movq	_FD_RAW_SPIN@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_9
## %bb.3:
	movq	_FD_RAW_NO_MOTOR@GOTPCREL(%rip), %rcx
	testl	%r15d, (%rcx)
	je	LBB0_4
LBB0_9:
	testl	%r15d, %eax
	jne	LBB0_11
LBB0_10:
	testl	%r15d, (%r13)
	jne	LBB0_11
## %bb.12:
	testl	%r15d, (%rbx)
	je	LBB0_14
LBB0_13:
	movq	_main_command_interrupt@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_do_floppy@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_14:
	movq	(%r12), %rax
	cmpl	$0, 4(%rax)
	jle	LBB0_19
## %bb.15:
	movq	%rbx, %r13
	xorl	%ebx, %ebx
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edi
	callq	_output_byte
	orl	%eax, %r14d
	incq	%rbx
	movq	(%r12), %rax
	movslq	4(%rax), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_16
## %bb.17:
	leaq	L_.str(%rip), %rdi
	callq	_debugt
	testl	%r14d, %r14d
	movq	%r13, %rbx
	je	LBB0_20
## %bb.18:
	movq	_cont@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%eax, %eax
	callq	*8(%rcx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_reset_fdc                      ## TAILCALL
LBB0_19:
	leaq	L_.str(%rip), %rdi
	callq	_debugt
LBB0_20:
	testl	%r15d, (%rbx)
	je	LBB0_23
## %bb.21:
	movq	_FD_RAW_NEED_DISK@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_22
## %bb.24:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fd_watchdog                    ## TAILCALL
LBB0_4:
	movq	_DRS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_DP@GOTPCREL(%rip), %rcx
	movq	%rcx, %rbx
	movq	(%rcx), %rcx
	movq	(%rcx), %r14
	addq	(%rax), %r14
	movq	8(%rcx), %rsi
	movq	_jiffies@GOTPCREL(%rip), %rax
	addq	(%rax), %rsi
	movq	%r14, %rdi
	callq	_time_after
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	(%rbx), %rax
	subq	8(%rax), %r14
	movq	_floppy_start@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	jmp	LBB0_7
LBB0_23:
	xorl	%eax, %eax
	callq	_result
	movq	_inr@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_cont@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmpq	*(%rcx)                         ## TAILCALL
LBB0_5:
	leaq	_setup_rw_floppy(%rip), %rsi
LBB0_7:
	movq	%r14, %rdi
	callq	_fd_wait_for_completion
	testq	%rax, %rax
	je	LBB0_8
LBB0_22:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	_FD_RAW_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_FD_RAW_INTR@GOTPCREL(%rip), %rbx
	testl	%r15d, %eax
	je	LBB0_10
LBB0_11:
	xorl	%eax, %eax
	callq	_setup_DMA
	testl	%r15d, (%rbx)
	jne	LBB0_13
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_raw_cmd,8,3                    ## @raw_cmd
	.comm	_FD_RAW_READ,4,2                ## @FD_RAW_READ
	.comm	_FD_RAW_WRITE,4,2               ## @FD_RAW_WRITE
	.comm	_FD_RAW_INTR,4,2                ## @FD_RAW_INTR
	.comm	_FD_RAW_SPIN,4,2                ## @FD_RAW_SPIN
	.comm	_FD_RAW_NO_MOTOR,4,2            ## @FD_RAW_NO_MOTOR
	.comm	_DRS,8,3                        ## @DRS
	.comm	_DP,8,3                         ## @DP
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_floppy_start,8,3               ## @floppy_start
	.comm	_main_command_interrupt,4,2     ## @main_command_interrupt
	.comm	_do_floppy,4,2                  ## @do_floppy
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"rw_command: "

	.comm	_cont,8,3                       ## @cont
	.comm	_inr,4,2                        ## @inr
	.comm	_FD_RAW_NEED_DISK,4,2           ## @FD_RAW_NEED_DISK
	.no_dead_strip	_setup_rw_floppy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_rw_floppy
_setup_rw_floppy:                       ; @setup_rw_floppy
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
Lloh0:
	adrp	x22, _raw_cmd@GOTPAGE
Lloh1:
	ldr	x22, [x22, _raw_cmd@GOTPAGEOFF]
	ldr	x8, [x22]
	ldr	w9, [x8]
Lloh2:
	adrp	x24, _FD_RAW_READ@GOTPAGE
Lloh3:
	ldr	x24, [x24, _FD_RAW_READ@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh4:
	adrp	x23, _FD_RAW_WRITE@GOTPAGE
Lloh5:
	ldr	x23, [x23, _FD_RAW_WRITE@GOTPAGEOFF]
	ldr	w10, [x23]
	orr	w10, w10, w8
Lloh6:
	adrp	x21, _FD_RAW_INTR@GOTPAGE
Lloh7:
	ldr	x21, [x21, _FD_RAW_INTR@GOTPAGEOFF]
	ldr	w11, [x21]
	tst	w10, w9
	csel	w10, wzr, w11, eq
	orr	w20, w10, w9
Lloh8:
	adrp	x9, _FD_RAW_SPIN@GOTPAGE
Lloh9:
	ldr	x9, [x9, _FD_RAW_SPIN@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w20, w9
	b.eq	LBB0_2
; %bb.1:
Lloh11:
	adrp	x9, _FD_RAW_NO_MOTOR@GOTPAGE
Lloh12:
	ldr	x9, [x9, _FD_RAW_NO_MOTOR@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w20
	b.eq	LBB0_4
LBB0_2:
	tst	w8, w20
	b.ne	LBB0_9
LBB0_3:
	ldr	w8, [x23]
	tst	w8, w20
	b.ne	LBB0_9
	b	LBB0_10
LBB0_4:
Lloh14:
	adrp	x8, _DRS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _DRS@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	ldr	x8, [x8]
Lloh17:
	adrp	x25, _DP@GOTPAGE
Lloh18:
	ldr	x25, [x25, _DP@GOTPAGEOFF]
	ldr	x9, [x25]
	ldp	x10, x9, [x9]
	add	x19, x10, x8
Lloh19:
	adrp	x8, _jiffies@GOTPAGE
Lloh20:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	add	x1, x9, x8
	mov	x0, x19
	bl	_time_after
	cbz	x0, LBB0_6
; %bb.5:
	ldr	x8, [x25]
	ldr	x8, [x8, #8]
	sub	x19, x19, x8
Lloh22:
	adrp	x8, _floppy_start@GOTPAGE
Lloh23:
	ldr	x8, [x8, _floppy_start@GOTPAGEOFF]
Lloh24:
	ldr	x1, [x8]
	b	LBB0_7
LBB0_6:
Lloh25:
	adrp	x1, _setup_rw_floppy@PAGE
Lloh26:
	add	x1, x1, _setup_rw_floppy@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_fd_wait_for_completion
	cbnz	x0, LBB0_21
; %bb.8:
	ldr	w8, [x24]
	tst	w8, w20
	b.eq	LBB0_3
LBB0_9:
	bl	_setup_DMA
LBB0_10:
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_12
; %bb.11:
Lloh27:
	adrp	x8, _main_command_interrupt@GOTPAGE
Lloh28:
	ldr	x8, [x8, _main_command_interrupt@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
Lloh30:
	adrp	x9, _do_floppy@GOTPAGE
Lloh31:
	ldr	x9, [x9, _do_floppy@GOTPAGEOFF]
Lloh32:
	str	w8, [x9]
LBB0_12:
	ldr	x8, [x22]
	ldr	w9, [x8, #4]
	cmp	w9, #1
	b.lt	LBB0_17
; %bb.13:
	mov	x23, #0
	mov	w19, #0
LBB0_14:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x8, #8]
	ldr	w0, [x8, x23, lsl #2]
	bl	_output_byte
	orr	w19, w0, w19
	add	x23, x23, #1
	ldr	x8, [x22]
	ldrsw	x9, [x8, #4]
	cmp	x23, x9
	b.lt	LBB0_14
; %bb.15:
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debugt
	cbz	w19, LBB0_18
; %bb.16:
Lloh35:
	adrp	x8, _cont@GOTPAGE
Lloh36:
	ldr	x8, [x8, _cont@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	ldr	x8, [x8, #8]
	blr	x8
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_reset_fdc
LBB0_17:
Lloh38:
	adrp	x0, l_.str@PAGE
Lloh39:
	add	x0, x0, l_.str@PAGEOFF
	bl	_debugt
LBB0_18:
	ldr	w8, [x21]
	tst	w8, w20
	b.eq	LBB0_22
; %bb.19:
Lloh40:
	adrp	x8, _FD_RAW_NEED_DISK@GOTPAGE
Lloh41:
	ldr	x8, [x8, _FD_RAW_NEED_DISK@GOTPAGEOFF]
Lloh42:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_21
; %bb.20:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_fd_watchdog
LBB0_21:
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_22:
	bl	_result
Lloh43:
	adrp	x8, _inr@GOTPAGE
Lloh44:
	ldr	x8, [x8, _inr@GOTPAGEOFF]
Lloh45:
	str	w0, [x8]
Lloh46:
	adrp	x8, _cont@GOTPAGE
Lloh47:
	ldr	x8, [x8, _cont@GOTPAGEOFF]
Lloh48:
	ldr	x8, [x8]
	ldr	x0, [x8]
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	br	x0
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotStr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotStr	Lloh43, Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_raw_cmd,8,3                    ; @raw_cmd
	.comm	_FD_RAW_READ,4,2                ; @FD_RAW_READ
	.comm	_FD_RAW_WRITE,4,2               ; @FD_RAW_WRITE
	.comm	_FD_RAW_INTR,4,2                ; @FD_RAW_INTR
	.comm	_FD_RAW_SPIN,4,2                ; @FD_RAW_SPIN
	.comm	_FD_RAW_NO_MOTOR,4,2            ; @FD_RAW_NO_MOTOR
	.comm	_DRS,8,3                        ; @DRS
	.comm	_DP,8,3                         ; @DP
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_floppy_start,8,3               ; @floppy_start
	.comm	_main_command_interrupt,4,2     ; @main_command_interrupt
	.comm	_do_floppy,4,2                  ; @do_floppy
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"rw_command: "

	.comm	_cont,8,3                       ; @cont
	.comm	_inr,4,2                        ; @inr
	.comm	_FD_RAW_NEED_DISK,4,2           ; @FD_RAW_NEED_DISK
	.no_dead_strip	_setup_rw_floppy
.subsections_via_symbols
