	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_get_media_event          ## -- Begin function cdrom_get_media_event
	.p2align	4, 0x90
_cdrom_get_media_event:                 ## @cdrom_get_media_event
	.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
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_CGC_DATA_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-56(%rbp), %r15
	leaq	-40(%rbp), %rsi
	movq	%r15, %rdi
	movl	$8, %edx
	callq	_init_cdrom_command
	movq	_GPCMD_GET_EVENT_STATUS_NOTIFICATION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-56(%rbp), %rcx
	movl	%eax, (%rcx)
	movl	$1, 4(%rcx)
	movl	$16, 16(%rcx)
	movl	$8, 32(%rcx)
	movl	$1, -48(%rbp)
	movq	(%rbx), %rax
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	movl	$1, %ebx
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movl	-24(%rbp), %edi
	callq	_be16_to_cpu
	cmpl	$4, %eax
	jb	LBB0_5
## %bb.2:
	cmpq	$0, -32(%rbp)
	jne	LBB0_5
## %bb.3:
	cmpl	$4, -40(%rbp)
	jne	LBB0_5
## %bb.4:
	leaq	-16(%rbp), %rsi
	movq	%r14, %rdi
	movl	$4, %edx
	callq	_memcpy
	xorl	%ebx, %ebx
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CGC_DATA_READ,4,2              ## @CGC_DATA_READ
	.comm	_GPCMD_GET_EVENT_STATUS_NOTIFICATION,4,2 ## @GPCMD_GET_EVENT_STATUS_NOTIFICATION
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cdrom_get_media_event          ; -- Begin function cdrom_get_media_event
	.p2align	2
_cdrom_get_media_event:                 ; @cdrom_get_media_event
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x8, _CGC_DATA_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CGC_DATA_READ@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	w22, #8
	mov	x0, sp
	add	x1, sp, #16
	mov	w2, #8
	bl	_init_cdrom_command
Lloh6:
	adrp	x8, _GPCMD_GET_EVENT_STATUS_NOTIFICATION@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GPCMD_GET_EVENT_STATUS_NOTIFICATION@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x9, [sp]
	mov	w20, #1
	stp	w8, w20, [x9]
	mov	w8, #16
	str	w8, [x9, #16]
	str	w22, [x9, #32]
	str	w20, [sp, #8]
	ldr	x8, [x21]
	ldr	x8, [x8]
	mov	x1, sp
	mov	x0, x21
	blr	x8
	cbnz	x0, LBB0_6
; %bb.1:
	ldr	w0, [sp, #32]
	bl	_be16_to_cpu
	cmp	w0, #4
	b.lo	LBB0_5
; %bb.2:
	ldr	x8, [sp, #24]
	cbnz	x8, LBB0_5
; %bb.3:
	ldr	w8, [sp, #16]
	cmp	w8, #4
	b.ne	LBB0_5
; %bb.4:
	add	x8, sp, #16
	add	x1, x8, #24
	mov	x0, x19
	mov	w2, #4
	bl	_memcpy
	mov	w20, #0
	b	LBB0_6
LBB0_5:
	mov	w20, #1
LBB0_6:
	ldr	x8, [sp, #24]
Lloh9:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh10:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh11:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_CGC_DATA_READ,4,2              ; @CGC_DATA_READ
	.comm	_GPCMD_GET_EVENT_STATUS_NOTIFICATION,4,2 ; @GPCMD_GET_EVENT_STATUS_NOTIFICATION
.subsections_via_symbols
