	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_ioctl_select_disc
_cdrom_ioctl_select_disc:               ## @cdrom_ioctl_select_disc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_CD_DO_IOCTL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_cdinfo
	movq	_CDC_SELECT_DISC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_CDROM_CAN
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	_CDSL_CURRENT@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_7
## %bb.4:
	movq	_CDSL_NONE@GOTPCREL(%rip), %rax
	cmpq	%rbx, (%rax)
	je	LBB0_7
## %bb.5:
	cmpl	%ebx, (%r14)
	jle	LBB0_6
LBB0_7:
	movq	8(%r14), %rax
	movq	(%rax), %rax
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmpq	*%rax                           ## TAILCALL
LBB0_1:
	movq	_ENOSYS@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_8:
	movq	_CD_CHANGER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_cdinfo
	movq	%r14, %rdi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_cdrom_select_disc              ## TAILCALL
LBB0_6:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	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_SELECT_DISC\n"

	.comm	_CDC_SELECT_DISC,4,2            ## @CDC_SELECT_DISC
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_CDSL_CURRENT,8,3               ## @CDSL_CURRENT
	.comm	_CDSL_NONE,8,3                  ## @CDSL_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_CD_CHANGER,4,2                 ## @CD_CHANGER
L_.str.1:                               ## @.str.1
	.asciz	"Using generic cdrom_select_disc()\n"

	.no_dead_strip	_cdrom_ioctl_select_disc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdrom_ioctl_select_disc
_cdrom_ioctl_select_disc:               ; @cdrom_ioctl_select_disc
	.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
	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_SELECT_DISC@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CDC_SELECT_DISC@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	bl	_CDROM_CAN
	cbz	w0, LBB0_5
; %bb.1:
Lloh8:
	adrp	x8, _CDSL_CURRENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CDSL_CURRENT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _CDSL_NONE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _CDSL_NONE@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x19
	ccmp	x9, x19, #4, ne
	b.eq	LBB0_3
; %bb.2:
	ldr	w8, [x20]
	cmp	w8, w19
	b.le	LBB0_7
LBB0_3:
	ldr	x8, [x20, #8]
	ldr	x2, [x8]
	cbz	x2, LBB0_6
; %bb.4:
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	br	x2
LBB0_5:
Lloh14:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
Lloh16:
	adrp	x8, _CD_CHANGER@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CD_CHANGER@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
Lloh19:
	adrp	x1, l_.str.1@PAGE
Lloh20:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_cdinfo
	mov	x0, x20
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_cdrom_select_disc
LBB0_7:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 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 AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.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_SELECT_DISC\n"

	.comm	_CDC_SELECT_DISC,4,2            ; @CDC_SELECT_DISC
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_CDSL_CURRENT,8,3               ; @CDSL_CURRENT
	.comm	_CDSL_NONE,8,3                  ; @CDSL_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_CD_CHANGER,4,2                 ; @CD_CHANGER
l_.str.1:                               ; @.str.1
	.asciz	"Using generic cdrom_select_disc()\n"

	.no_dead_strip	_cdrom_ioctl_select_disc
.subsections_via_symbols
