	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_fdc
_set_fdc:                               ## @set_fdc
	.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
	testl	%edi, %edi
	js	LBB0_3
## %bb.1:
	movl	%edi, %ebx
	movq	_N_DRIVE@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	jle	LBB0_3
## %bb.2:
	movl	%ebx, %edi
	callq	_FDC
	movq	_fdc@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_current_drive@GOTPCREL(%rip), %rcx
	movl	%ebx, (%rcx)
	cmpl	$2, %eax
	jb	LBB0_5
LBB0_10:
	leaq	L_.str(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_printk                         ## TAILCALL
LBB0_3:
	movq	_fdc@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	$2, %eax
	jae	LBB0_10
LBB0_5:
	movl	%eax, %edi
	movl	$-1, %esi
	movl	$8, %edx
	callq	_set_dor
	movq	_FDCS@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	cmpl	$2, (%rax)
	jne	LBB0_7
## %bb.6:
	movl	$1, %edi
	callq	_reset_fdc_info
LBB0_7:
	movq	_FD_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fd_inb
	movq	_STATUS_READY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_9
## %bb.8:
	movq	(%rbx), %rax
	movl	$1, 4(%rax)
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_N_DRIVE,4,2                    ## @N_DRIVE
	.comm	_fdc,4,2                        ## @fdc
	.comm	_current_drive,4,2              ## @current_drive
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad fdc value\n"

	.comm	_FDCS,8,3                       ## @FDCS
	.comm	_FD_STATUS,4,2                  ## @FD_STATUS
	.comm	_STATUS_READY,8,3               ## @STATUS_READY
	.no_dead_strip	_set_fdc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_fdc
_set_fdc:                               ; @set_fdc
	.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
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x19, x0
Lloh0:
	adrp	x8, _N_DRIVE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _N_DRIVE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.le	LBB0_4
; %bb.2:
	mov	x0, x19
	bl	_FDC
Lloh3:
	adrp	x8, _fdc@GOTPAGE
Lloh4:
	ldr	x8, [x8, _fdc@GOTPAGEOFF]
Lloh5:
	str	w0, [x8]
Lloh6:
	adrp	x8, _current_drive@GOTPAGE
Lloh7:
	ldr	x8, [x8, _current_drive@GOTPAGEOFF]
Lloh8:
	str	w19, [x8]
	cmp	w0, #2
	b.lo	LBB0_5
LBB0_3:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_printk
LBB0_4:
Lloh11:
	adrp	x8, _fdc@GOTPAGE
Lloh12:
	ldr	x8, [x8, _fdc@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
	cmp	w0, #2
	b.hs	LBB0_3
LBB0_5:
	mov	w1, #-1
	mov	w2, #8
	bl	_set_dor
Lloh14:
	adrp	x19, _FDCS@GOTPAGE
Lloh15:
	ldr	x19, [x19, _FDCS@GOTPAGEOFF]
	ldr	x8, [x19]
	ldr	w8, [x8]
	cmp	w8, #2
	b.ne	LBB0_7
; %bb.6:
	mov	w0, #1
	bl	_reset_fdc_info
LBB0_7:
Lloh16:
	adrp	x8, _FD_STATUS@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FD_STATUS@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_fd_inb
Lloh19:
	adrp	x8, _STATUS_READY@GOTPAGE
Lloh20:
	ldr	x8, [x8, _STATUS_READY@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.8:
	ldr	x8, [x19]
	mov	w9, #1
	str	w9, [x8, #4]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_N_DRIVE,4,2                    ; @N_DRIVE
	.comm	_fdc,4,2                        ; @fdc
	.comm	_current_drive,4,2              ; @current_drive
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad fdc value\n"

	.comm	_FDCS,8,3                       ; @FDCS
	.comm	_FD_STATUS,4,2                  ; @FD_STATUS
	.comm	_STATUS_READY,8,3               ; @STATUS_READY
	.no_dead_strip	_set_fdc
.subsections_via_symbols
