	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_ioctl_media_changed
_cdrom_ioctl_media_changed:             ## @cdrom_ioctl_media_changed
	.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
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_CD_DO_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_cdinfo
	movq	_CDC_MEDIA_CHANGED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_CDC_SELECT_DISC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testl	%eax, %eax
	je	LBB0_13
## %bb.4:
	movq	_CDSL_CURRENT@GOTPCREL(%rip), %rax
	cmpq	%r14, (%rax)
	je	LBB0_13
## %bb.5:
	cmpl	%r14d, (%rbx)
	jbe	LBB0_6
## %bb.7:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%rax, %r15
	movq	%rbx, %rdi
	movq	%rax, %rsi
	callq	_cdrom_read_mech_status
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.10:
	movq	(%r15), %rax
	movl	(%rax,%r14,4), %ebx
LBB0_11:
	movq	%r15, %rdi
	callq	_kfree
	jmp	LBB0_12
LBB0_1:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_13:
	movq	%rbx, %rdi
	movl	$1, %esi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_media_changed                  ## TAILCALL
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CD_DO_IOCTL,4,2                ## @CD_DO_IOCTL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering CDROM_MEDIA_CHANGED\n"

	.comm	_CDC_MEDIA_CHANGED,4,2          ## @CDC_MEDIA_CHANGED
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_CDC_SELECT_DISC,4,2            ## @CDC_SELECT_DISC
	.comm	_CDSL_CURRENT,8,3               ## @CDSL_CURRENT
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_cdrom_ioctl_media_changed
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_ioctl_media_changed
_cdrom_ioctl_media_changed:             ; @cdrom_ioctl_media_changed
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CD_DO_IOCTL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CD_DO_IOCTL@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_cdinfo
Lloh5:
	adrp	x8, _CDC_MEDIA_CHANGED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CDC_MEDIA_CHANGED@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	w0, LBB0_3
; %bb.1:
Lloh8:
	adrp	x8, _CDC_SELECT_DISC@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CDC_SELECT_DISC@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_CDROM_CAN
Lloh11:
	adrp	x8, _CDSL_CURRENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CDSL_CURRENT@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	w0, #0
	ccmp	x8, x19, #4, ne
	b.ne	LBB0_4
; %bb.2:
	mov	x0, x20
	mov	w1, #1
	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	_media_changed
LBB0_3:
Lloh14:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_11
LBB0_4:
	ldr	w8, [x20]
	cmp	w8, w19
	b.ls	LBB0_9
; %bb.5:
Lloh16:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_kmalloc
	cbz	x0, LBB0_10
; %bb.6:
	mov	x21, x0
	mov	x0, x20
	mov	x1, x21
	bl	_cdrom_read_mech_status
	mov	x20, x0
	cbnz	w0, LBB0_8
; %bb.7:
	ldr	x8, [x21]
	ldr	w20, [x8, x19, lsl #2]
LBB0_8:
	mov	x0, x21
	bl	_kfree
	b	LBB0_12
LBB0_9:
Lloh19:
	adrp	x8, _EINVAL@GOTPAGE
Lloh20:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_11
LBB0_10:
Lloh21:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_12:
	mov	x0, x20
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_CD_DO_IOCTL,4,2                ; @CD_DO_IOCTL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering CDROM_MEDIA_CHANGED\n"

	.comm	_CDC_MEDIA_CHANGED,4,2          ; @CDC_MEDIA_CHANGED
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_CDC_SELECT_DISC,4,2            ; @CDC_SELECT_DISC
	.comm	_CDSL_CURRENT,8,3               ; @CDSL_CURRENT
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_cdrom_ioctl_media_changed
.subsections_via_symbols
