	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function check_change
_check_change:                          ## @check_change
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	_check_change.drive(%rip), %eax
	leal	1(%rax), %ecx
	movq	_UD@GOTPCREL(%rip), %r15
	movl	4(%r15), %edx
	testl	%edx, %edx
	cmovel	%edx, %ecx
	xorl	%edx, %edx
	testl	%eax, %eax
	cmovgl	%edx, %ecx
	movl	%ecx, _check_change.drive(%rip)
	callq	_local_irq_save
	xorl	%eax, %eax
	callq	_stdma_islocked
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	_sound_ym@GOTPCREL(%rip), %r14
	movl	$14, (%r14)
	movq	_DSKDRVNONE@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	orb	$14, %al
	cmpl	$0, _check_change.drive(%rip)
	jne	LBB0_2
## %bb.3:
	movq	_DSKDRV0@GOTPCREL(%rip), %rcx
	jmp	LBB0_4
LBB0_2:
	movq	_DSKDRV1@GOTPCREL(%rip), %rcx
LBB0_4:
	movb	(%rcx), %cl
	notb	%cl
	andb	%cl, %al
	movb	%al, 4(%r14)
	movq	_FDCREG_STATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_FDC_READ
	movq	_FDCSTAT_WPROT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	andl	(%rcx), %eax
	setne	%bl
	movb	$14, 4(%r14)
	cmpl	%ebx, (%r15)
	je	LBB0_6
## %bb.5:
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_DPRINT
	movl	%ebx, (%r15)
	movl	_check_change.drive(%rip), %edi
	movq	_changed_floppies@GOTPCREL(%rip), %rsi
	callq	_set_bit
LBB0_6:
	callq	_local_irq_restore
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_start_check_change_timer       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_check_change.drive,4,2 ## @check_change.drive
	.comm	_UD,8,2                         ## @UD
	.comm	_sound_ym,8,2                   ## @sound_ym
	.comm	_DSKDRVNONE,1,0                 ## @DSKDRVNONE
	.comm	_DSKDRV0,1,0                    ## @DSKDRV0
	.comm	_DSKDRV1,1,0                    ## @DSKDRV1
	.comm	_FDCREG_STATUS,4,2              ## @FDCREG_STATUS
	.comm	_FDCSTAT_WPROT,4,2              ## @FDCSTAT_WPROT
	.comm	_changed_floppies,4,2           ## @changed_floppies
	.no_dead_strip	_check_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function check_change
_check_change:                          ; @check_change
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
Lloh0:
	adrp	x20, _UD@GOTPAGE
Lloh1:
	ldr	x20, [x20, _UD@GOTPAGEOFF]
	adrp	x19, _check_change.drive@PAGE
	ldr	w8, [x19, _check_change.drive@PAGEOFF]
	ldr	w9, [x20, #4]
	cmp	w9, #0
	ccmp	w8, #1, #0, ne
	csinc	w8, wzr, w8, ge
	str	w8, [x19, _check_change.drive@PAGEOFF]
	bl	_local_irq_save
	bl	_stdma_islocked
	cbnz	w0, LBB0_3
; %bb.1:
Lloh2:
	adrp	x22, _sound_ym@GOTPAGE
Lloh3:
	ldr	x22, [x22, _sound_ym@GOTPAGEOFF]
	mov	w23, #14
	str	w23, [x22]
Lloh4:
	adrp	x8, _DSKDRVNONE@GOTPAGE
Lloh5:
	ldr	x8, [x8, _DSKDRVNONE@GOTPAGEOFF]
	ldrb	w8, [x8]
	orr	w8, w8, #0xe
	ldr	w9, [x19, _check_change.drive@PAGEOFF]
Lloh6:
	adrp	x10, _DSKDRV0@GOTPAGE
Lloh7:
	ldr	x10, [x10, _DSKDRV0@GOTPAGEOFF]
Lloh8:
	adrp	x11, _DSKDRV1@GOTPAGE
Lloh9:
	ldr	x11, [x11, _DSKDRV1@GOTPAGEOFF]
	cmp	w9, #0
	csel	x9, x10, x11, eq
	ldrb	w9, [x9]
	bic	w8, w8, w9
	strb	w8, [x22, #4]
Lloh10:
	adrp	x8, _FDCREG_STATUS@GOTPAGE
Lloh11:
	ldr	x8, [x8, _FDCREG_STATUS@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_FDC_READ
Lloh13:
	adrp	x8, _FDCSTAT_WPROT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FDCSTAT_WPROT@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	ands	w8, w8, w0
	cset	w21, ne
	strb	w23, [x22, #4]
	ldr	w9, [x20]
	cmp	w9, w21
	b.eq	LBB0_3
; %bb.2:
	cmp	w8, #0
	cset	w0, ne
	bl	_DPRINT
	str	w21, [x20]
	ldr	w0, [x19, _check_change.drive@PAGEOFF]
Lloh16:
	adrp	x1, _changed_floppies@GOTPAGE
Lloh17:
	ldr	x1, [x1, _changed_floppies@GOTPAGEOFF]
	bl	_set_bit
LBB0_3:
	bl	_local_irq_restore
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_start_check_change_timer
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_check_change.drive,4,2 ; @check_change.drive
	.comm	_UD,8,2                         ; @UD
	.comm	_sound_ym,8,2                   ; @sound_ym
	.comm	_DSKDRVNONE,1,0                 ; @DSKDRVNONE
	.comm	_DSKDRV0,1,0                    ; @DSKDRV0
	.comm	_DSKDRV1,1,0                    ; @DSKDRV1
	.comm	_FDCREG_STATUS,4,2              ; @FDCREG_STATUS
	.comm	_FDCSTAT_WPROT,4,2              ; @FDCSTAT_WPROT
	.comm	_changed_floppies,4,2           ; @changed_floppies
	.no_dead_strip	_check_change
.subsections_via_symbols
