	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fd_seek
_fd_seek:                               ## @fd_seek
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %ebx
	andl	$3, %ebx
	movl	%ebx, %edi
	callq	_get_fdc
	movq	_unit@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	%rbx, %r13
	shlq	$4, %r13
	cmpl	%r15d, (%rax,%r13)
	jne	LBB0_2
## %bb.1:
	xorl	%eax, %eax
	callq	_rel_fdc
	jmp	LBB0_14
LBB0_2:
	movl	%ebx, %edi
	callq	_fd_motor_on
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	(%r14), %rax
	cmpl	$0, (%rax,%r13)
	jns	LBB0_6
## %bb.5:
	movl	%ebx, %edi
	callq	_fd_calibrate
	testl	%eax, %eax
	je	LBB0_3
LBB0_6:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, %edi
	callq	_fd_select
	movq	(%r14), %rsi
	movl	(%rsi,%r13), %edi
	movl	%edi, %r12d
	shrl	$31, %r12d
	addl	%edi, %r12d
	sarl	%r12d
	movl	%r15d, %eax
	shrl	$31, %eax
	addl	%r15d, %eax
	sarl	%eax
	subl	%eax, %r12d
	movq	_ciab@GOTPCREL(%rip), %rbx
	movq	_DSKSIDE@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	movq	_DSKDIREC@GOTPCREL(%rip), %rax
	movb	(%rax), %dl
	movb	(%rbx), %al
	orb	%cl, %al
	orb	%dl, %al
	testl	%r12d, %r12d
	notb	%dl
	movzbl	%dl, %edx
	movq	%r14, %r8
	movl	$255, %r14d
	cmovsl	%edx, %r14d
	movl	%r15d, %edx
	movl	%r12d, %r15d
	negl	%r15d
	cmovsl	%r12d, %r15d
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movd	%edx, %xmm0
	pinsrd	$1, %edi, %xmm0
	movdqa	%xmm0, %xmm1
	psrld	$31, %xmm1
	paddd	%xmm0, %xmm1
	psrad	$1, %xmm1
	paddd	%xmm1, %xmm1
	psubd	%xmm1, %xmm0
	movd	%xmm0, %edx
	xorl	%edi, %edi
	cmpl	$1, %edx
	sbbl	%edi, %edi
	notb	%cl
	orb	%cl, %dil
	andb	%al, %r14b
	andb	%dil, %r14b
	movb	%r14b, (%rbx)
	pextrd	$1, %xmm0, %eax
	cmpl	%eax, %edx
	jne	LBB0_8
## %bb.7:
	movq	%r8, %rbx
	jmp	LBB0_9
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_rel_fdc
	jmp	LBB0_15
LBB0_8:
	movq	8(%rsi,%r13), %rax
	movl	8(%rax), %edi
	movq	%r8, %rbx
	callq	_ms_delay
	movq	%rbx, %rax
	movq	(%rbx), %rsi
LBB0_9:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsi,%r13)
	testl	%r12d, %r12d
	je	LBB0_13
## %bb.10:
	movq	_ciab@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_DSKSTEP@GOTPCREL(%rip), %rax
	movzbl	(%rax), %eax
	movl	%eax, %ecx
	notb	%cl
	andb	%r14b, %cl
	movb	%cl, (%r12)
	orb	%al, %r14b
	movl	$1, %edi
	callq	_udelay
	movb	%r14b, (%r12)
	movq	(%rbx), %rax
	movq	8(%rax,%r13), %rax
	movl	4(%rax), %edi
	callq	_ms_delay
	decl	%r15d
	jne	LBB0_11
## %bb.12:
	movq	(%rbx), %rax
	movq	8(%rax,%r13), %rax
	movl	(%rax), %edi
	callq	_ms_delay
LBB0_13:
	xorl	%eax, %eax
	callq	_rel_fdc
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_fd_deselect
LBB0_14:
	movl	$1, %ebx
LBB0_15:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_unit,8,3                       ## @unit
	.comm	_ciab,1,0                       ## @ciab
	.comm	_DSKSIDE,1,0                    ## @DSKSIDE
	.comm	_DSKDIREC,1,0                   ## @DSKDIREC
	.comm	_DSKSTEP,1,0                    ## @DSKSTEP
	.no_dead_strip	_fd_seek
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fd_seek
_fd_seek:                               ; @fd_seek
	.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
	mov	x20, x1
	and	w19, w0, #0x3
	mov	x0, x19
	bl	_get_fdc
Lloh0:
	adrp	x21, _unit@GOTPAGE
Lloh1:
	ldr	x21, [x21, _unit@GOTPAGEOFF]
	ldr	x8, [x21]
	lsl	x22, x19, #4
	ldr	w8, [x8, x22]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	bl	_rel_fdc
	b	LBB0_12
LBB0_2:
	mov	x0, x19
	bl	_fd_motor_on
	cbz	w0, LBB0_13
; %bb.3:
	ldr	x8, [x21]
	ldr	w8, [x8, x22]
	tbz	w8, #31, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_fd_calibrate
	cbz	w0, LBB0_13
LBB0_5:
	mov	x0, x19
	bl	_fd_select
	ldr	x8, [x21]
	ldr	w9, [x8, x22]
	cmp	w9, #0
	cinc	w10, w9, lt
	asr	w11, w10, #1
	cmp	w20, #0
	cinc	w12, w20, lt
	and	w13, w20, #0x1
	cneg	w13, w13, lt
	sub	w26, w11, w12, asr #1
Lloh2:
	adrp	x23, _ciab@GOTPAGE
Lloh3:
	ldr	x23, [x23, _ciab@GOTPAGEOFF]
	ldrb	w11, [x23]
Lloh4:
	adrp	x12, _DSKSIDE@GOTPAGE
Lloh5:
	ldr	x12, [x12, _DSKSIDE@GOTPAGEOFF]
	ldrb	w12, [x12]
Lloh6:
	adrp	x14, _DSKDIREC@GOTPAGE
Lloh7:
	ldr	x14, [x14, _DSKDIREC@GOTPAGEOFF]
	ldrb	w14, [x14]
	orr	w11, w12, w11
	orr	w11, w11, w14
	cmp	w13, #0
	mov	w15, #-1
	csinv	w12, w15, w12, eq
	cmp	w26, #0
	csinv	w14, w15, w14, ge
	and	w12, w14, w12
	and	w24, w12, w11
	cneg	w25, w26, mi
	strb	w24, [x23]
	and	w10, w10, #0xfffffffe
	sub	w9, w9, w10
	cmp	w13, w9
	b.eq	LBB0_7
; %bb.6:
	add	x8, x8, x19, lsl #4
	ldr	x8, [x8, #8]
	ldr	w0, [x8, #8]
	bl	_ms_delay
	ldr	x8, [x21]
LBB0_7:
	str	w20, [x8, x22]
	cbz	w26, LBB0_11
; %bb.8:
Lloh8:
	adrp	x20, _DSKSTEP@GOTPAGE
Lloh9:
	ldr	x20, [x20, _DSKSTEP@GOTPAGEOFF]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldrb	w8, [x20]
	bic	w9, w24, w8
	strb	w9, [x23]
	orr	w24, w8, w24
	mov	w0, #1
	bl	_udelay
	strb	w24, [x23]
	ldr	x8, [x21]
	add	x8, x8, x19, lsl #4
	ldr	x8, [x8, #8]
	ldr	w0, [x8, #4]
	bl	_ms_delay
	subs	w25, w25, #1
	b.ne	LBB0_9
; %bb.10:
	ldr	x8, [x21]
	add	x8, x8, x19, lsl #4
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_ms_delay
LBB0_11:
	bl	_rel_fdc
	mov	x0, x19
	bl	_fd_deselect
LBB0_12:
	mov	w0, #1
	b	LBB0_14
LBB0_13:
	bl	_rel_fdc
	mov	w0, #0
LBB0_14:
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_unit,8,3                       ; @unit
	.comm	_ciab,1,0                       ; @ciab
	.comm	_DSKSIDE,1,0                    ; @DSKSIDE
	.comm	_DSKDIREC,1,0                   ; @DSKDIREC
	.comm	_DSKSTEP,1,0                    ; @DSKSTEP
	.no_dead_strip	_fd_seek
.subsections_via_symbols
