	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function disk_change
_disk_change:                           ## @disk_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	callq	_FDC
	movq	_UDP@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	_FD_BROKEN_DCL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_1
## %bb.12:
	movq	_FD_DISK_CHANGED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_UTESTF                         ## TAILCALL
LBB0_1:
	movq	_FD_DIR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_fd_inb
	movq	(%r15), %rcx
	xorl	(%rcx), %eax
	testb	$-128, %al
	jne	LBB0_2
## %bb.10:
	movq	_jiffies@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_UDRS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	%eax, 8(%rcx)
	movq	_FD_DISK_NEWCHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_UCLEARF
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_2:
	movq	_FD_VERIFY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_USETF
	movq	_UDRS@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	cmpq	$0, 16(%rax)
	je	LBB0_4
## %bb.3:
	movq	_FD_DISK_CHANGED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_USETF
	movq	(%r14), %rax
LBB0_4:
	movl	$1, %r14d
	cmpq	$0, (%rax)
	js	LBB0_11
## %bb.5:
	movq	(%r15), %rax
	movq	_FTD_MSG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, (%rax)
	je	LBB0_6
## %bb.7:
	movq	_current_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%ebx, %r15
	cmpq	$0, (%rax,%r15,8)
	je	LBB0_9
## %bb.8:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_DPRINT
	jmp	LBB0_9
LBB0_6:
	movslq	%ebx, %r15
LBB0_9:
	movq	_current_type@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$0, (%rax,%r15,8)
	movq	_MAX_DISK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	addl	%r15d, %r15d
	movq	_floppy_sizes@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	%ebx, %edi
	callq	_TOMINOR
	movl	%r15d, (%r12,%rax,4)
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_UDP,8,3                        ## @UDP
	.comm	_FD_BROKEN_DCL,4,2              ## @FD_BROKEN_DCL
	.comm	_FD_DISK_CHANGED,4,2            ## @FD_DISK_CHANGED
	.comm	_FD_DIR,4,2                     ## @FD_DIR
	.comm	_FD_VERIFY,4,2                  ## @FD_VERIFY
	.comm	_UDRS,8,3                       ## @UDRS
	.comm	_FTD_MSG,4,2                    ## @FTD_MSG
	.comm	_current_type,8,3               ## @current_type
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Disk type is undefined after disk change\n"

	.comm	_MAX_DISK_SIZE,4,2              ## @MAX_DISK_SIZE
	.comm	_floppy_sizes,8,3               ## @floppy_sizes
	.comm	_jiffies,4,2                    ## @jiffies
	.comm	_FD_DISK_NEWCHANGE,4,2          ## @FD_DISK_NEWCHANGE
	.comm	_FDCS,8,3                       ## @FDCS
	.comm	_FD_DEBUG,4,2                   ## @FD_DEBUG
	.no_dead_strip	_disk_change
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function disk_change
_disk_change:                           ; @disk_change
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x0
	bl	_FDC
Lloh0:
	adrp	x20, _UDP@GOTPAGE
Lloh1:
	ldr	x20, [x20, _UDP@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh2:
	adrp	x9, _FD_BROKEN_DCL@GOTPAGE
Lloh3:
	ldr	x9, [x9, _FD_BROKEN_DCL@GOTPAGEOFF]
Lloh4:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh5:
	adrp	x8, _FD_DISK_CHANGED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FD_DISK_CHANGED@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_UTESTF
LBB0_2:
Lloh8:
	adrp	x8, _FD_DIR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FD_DIR@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_fd_inb
	ldr	x8, [x20]
	ldr	w8, [x8]
	eor	w8, w8, w0
	tbnz	w8, #7, LBB0_4
; %bb.3:
Lloh11:
	adrp	x8, _jiffies@GOTPAGE
Lloh12:
	ldr	x8, [x8, _jiffies@GOTPAGEOFF]
Lloh13:
	adrp	x9, _UDRS@GOTPAGE
Lloh14:
	ldr	x9, [x9, _UDRS@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	ldr	x9, [x9]
	str	w8, [x9, #8]
Lloh17:
	adrp	x8, _FD_DISK_NEWCHANGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _FD_DISK_NEWCHANGE@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_UCLEARF
	mov	w0, #0
	b	LBB0_13
LBB0_4:
Lloh20:
	adrp	x8, _FD_VERIFY@GOTPAGE
Lloh21:
	ldr	x8, [x8, _FD_VERIFY@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	bl	_USETF
Lloh23:
	adrp	x21, _UDRS@GOTPAGE
Lloh24:
	ldr	x21, [x21, _UDRS@GOTPAGEOFF]
	ldr	x8, [x21]
	ldr	x9, [x8, #16]
	cbz	x9, LBB0_6
; %bb.5:
Lloh25:
	adrp	x8, _FD_DISK_CHANGED@GOTPAGE
Lloh26:
	ldr	x8, [x8, _FD_DISK_CHANGED@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	bl	_USETF
	ldr	x8, [x21]
LBB0_6:
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_12
; %bb.7:
	ldr	x8, [x20]
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _FTD_MSG@GOTPAGE
Lloh29:
	ldr	x9, [x9, _FTD_MSG@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	adrp	x20, _current_type@GOTPAGE
Lloh32:
	ldr	x20, [x20, _current_type@GOTPAGEOFF]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.8:
	ldr	x8, [x20]
	sxtw	x21, w19
	ldr	x8, [x8, w19, sxtw #3]
	cbz	x8, LBB0_11
; %bb.9:
Lloh33:
	adrp	x0, l_.str@PAGE
Lloh34:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DPRINT
	b	LBB0_11
LBB0_10:
	mov	x8, x19
	sxtw	x21, w8
LBB0_11:
	ldr	x8, [x20]
	str	xzr, [x8, x21, lsl #3]
Lloh35:
	adrp	x8, _MAX_DISK_SIZE@GOTPAGE
Lloh36:
	ldr	x8, [x8, _MAX_DISK_SIZE@GOTPAGEOFF]
Lloh37:
	ldr	w8, [x8]
	lsl	w20, w8, #1
Lloh38:
	adrp	x8, _floppy_sizes@GOTPAGE
Lloh39:
	ldr	x8, [x8, _floppy_sizes@GOTPAGEOFF]
Lloh40:
	ldr	x21, [x8]
	mov	x0, x19
	bl	_TOMINOR
	str	w20, [x21, x0, lsl #2]
LBB0_12:
	mov	w0, #1
LBB0_13:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_UDP,8,3                        ; @UDP
	.comm	_FD_BROKEN_DCL,4,2              ; @FD_BROKEN_DCL
	.comm	_FD_DISK_CHANGED,4,2            ; @FD_DISK_CHANGED
	.comm	_FD_DIR,4,2                     ; @FD_DIR
	.comm	_FD_VERIFY,4,2                  ; @FD_VERIFY
	.comm	_UDRS,8,3                       ; @UDRS
	.comm	_FTD_MSG,4,2                    ; @FTD_MSG
	.comm	_current_type,8,3               ; @current_type
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Disk type is undefined after disk change\n"

	.comm	_MAX_DISK_SIZE,4,2              ; @MAX_DISK_SIZE
	.comm	_floppy_sizes,8,3               ; @floppy_sizes
	.comm	_jiffies,4,2                    ; @jiffies
	.comm	_FD_DISK_NEWCHANGE,4,2          ; @FD_DISK_NEWCHANGE
	.comm	_FDCS,8,3                       ; @FDCS
	.comm	_FD_DEBUG,4,2                   ; @FD_DEBUG
	.no_dead_strip	_disk_change
.subsections_via_symbols
