	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fd_calibrate
_fd_calibrate:                          ## @fd_calibrate
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_SUD@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	js	LBB0_1
## %bb.4:
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_fd_calibrate_done              ## TAILCALL
LBB0_1:
	movq	_FDCSPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ATARIHW_PRESENT
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	_dma_wd@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
LBB0_3:
	leaq	L_.str(%rip), %rdi
	callq	_DPRINT
	movq	_fd_calibrate_done@GOTPCREL(%rip), %rdi
	callq	_SET_IRQ_HANDLER
	movq	_FDCREG_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_FDCCMD_RESTORE@GOTPCREL(%rip), %rax
	movl	8(%rbx), %esi
	orl	(%rax), %esi
	callq	_FDC_WRITE
	movq	_NeedSeek@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	movq	_MotorOn@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_start_timeout                  ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SUD,16,3                       ## @SUD
	.comm	_FDCSPEED,4,2                   ## @FDCSPEED
	.comm	_dma_wd,8,3                     ## @dma_wd
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"fd_calibrate\n"

	.comm	_FDCREG_CMD,4,2                 ## @FDCREG_CMD
	.comm	_FDCCMD_RESTORE,4,2             ## @FDCCMD_RESTORE
	.comm	_NeedSeek,4,2                   ## @NeedSeek
	.comm	_MotorOn,4,2                    ## @MotorOn
	.no_dead_strip	_fd_calibrate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fd_calibrate
_fd_calibrate:                          ; @fd_calibrate
	.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
Lloh0:
	adrp	x19, _SUD@GOTPAGE
Lloh1:
	ldr	x19, [x19, _SUD@GOTPAGEOFF]
	ldr	x8, [x19]
	tbnz	x8, #63, LBB0_2
; %bb.1:
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_fd_calibrate_done
LBB0_2:
Lloh2:
	adrp	x8, _FDCSPEED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FDCSPEED@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	bl	_ATARIHW_PRESENT
	cbz	x0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _dma_wd@GOTPAGE
Lloh6:
	ldr	x8, [x8, _dma_wd@GOTPAGEOFF]
Lloh7:
	str	xzr, [x8]
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT
Lloh10:
	adrp	x0, _fd_calibrate_done@GOTPAGE
Lloh11:
	ldr	x0, [x0, _fd_calibrate_done@GOTPAGEOFF]
	bl	_SET_IRQ_HANDLER
Lloh12:
	adrp	x8, _FDCREG_CMD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _FDCREG_CMD@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _FDCCMD_RESTORE@GOTPAGE
Lloh16:
	ldr	x8, [x8, _FDCCMD_RESTORE@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w1, w9, w8
	bl	_FDC_WRITE
Lloh18:
	adrp	x8, _NeedSeek@GOTPAGE
Lloh19:
	ldr	x8, [x8, _NeedSeek@GOTPAGEOFF]
	mov	w9, #1
Lloh20:
	str	w9, [x8]
Lloh21:
	adrp	x8, _MotorOn@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MotorOn@GOTPAGEOFF]
Lloh23:
	str	w9, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_start_timeout
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotStr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_SUD,16,3                       ; @SUD
	.comm	_FDCSPEED,4,2                   ; @FDCSPEED
	.comm	_dma_wd,8,3                     ; @dma_wd
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"fd_calibrate\n"

	.comm	_FDCREG_CMD,4,2                 ; @FDCREG_CMD
	.comm	_FDCCMD_RESTORE,4,2             ; @FDCCMD_RESTORE
	.comm	_NeedSeek,4,2                   ; @NeedSeek
	.comm	_MotorOn,4,2                    ; @MotorOn
	.no_dead_strip	_fd_calibrate
.subsections_via_symbols
