	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdrom_select_disc
_cdrom_select_disc:                     ## @cdrom_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r15
	movq	_CD_CHANGER@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	8(%r15), %rax
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	*(%rax)
	movq	_CDSL_NONE@GOTPCREL(%rip), %rax
	cmpl	%r14d, (%rax)
	jne	LBB0_4
## %bb.14:
	movl	$3, (%r15)
	movq	%r15, %rdi
	movl	$-1, %esi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cdrom_load_unload              ## TAILCALL
LBB0_1:
	movq	_EDRIVE_CANT_DO_THIS@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_4:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r12
	movq	%r15, %rdi
	movq	%rax, %rsi
	callq	_cdrom_read_mech_status
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_13
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	(%r12), %ebx
	movq	%r12, %rdi
	callq	_kfree
	cmpl	$1, 4(%r15)
	movq	_CDSL_CURRENT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jg	LBB0_10
## %bb.9:
	movq	_keeplocked@GOTPCREL(%rip), %rcx
	cmpq	$0, (%rcx)
	jne	LBB0_10
## %bb.12:
	cmpl	%r14d, %eax
	cmovnel	%r14d, %ebx
	movl	$3, (%r15)
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_cdrom_load_unload
	testl	%eax, %eax
	cmovnel	%eax, %ebx
	jmp	LBB0_13
LBB0_10:
	cmpl	%r14d, %eax
	je	LBB0_13
## %bb.11:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	jmp	LBB0_2
	.cfi_endproc
                                        ## -- End function
	.comm	_CD_CHANGER,4,2                 ## @CD_CHANGER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entering cdrom_select_disc()\n"

	.comm	_CDC_SELECT_DISC,4,2            ## @CDC_SELECT_DISC
	.comm	_EDRIVE_CANT_DO_THIS,4,2        ## @EDRIVE_CANT_DO_THIS
	.comm	_CDSL_NONE,4,2                  ## @CDSL_NONE
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_keeplocked,8,3                 ## @keeplocked
	.comm	_CDSL_CURRENT,4,2               ## @CDSL_CURRENT
	.comm	_EBUSY,4,2                      ## @EBUSY
	.no_dead_strip	_cdrom_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_select_disc
_cdrom_select_disc:                     ; @cdrom_select_disc
	.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	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, _CD_CHANGER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CD_CHANGER@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_3
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x8, [x8]
	mov	x0, x19
	mov	x1, x20
	blr	x8
Lloh8:
	adrp	x8, _CDSL_NONE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CDSL_NONE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w8, w20
	b.ne	LBB0_4
; %bb.2:
	mov	w8, #3
	str	w8, [x19]
	mov	x0, x19
	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	_cdrom_load_unload
LBB0_3:
Lloh11:
	adrp	x8, _EDRIVE_CANT_DO_THIS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EDRIVE_CANT_DO_THIS@GOTPAGEOFF]
	b	LBB0_8
LBB0_4:
Lloh13:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kmalloc
	cbz	x0, LBB0_7
; %bb.5:
	mov	x22, x0
	mov	x0, x19
	mov	x1, x22
	bl	_cdrom_read_mech_status
	cbz	w0, LBB0_10
; %bb.6:
	mov	x21, x0
	mov	x0, x22
	bl	_kfree
	b	LBB0_9
LBB0_7:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_9:
	mov	x0, x21
	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
LBB0_10:
	ldr	w21, [x22]
	mov	x0, x22
	bl	_kfree
	ldr	w9, [x19, #4]
Lloh18:
	adrp	x8, _CDSL_CURRENT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _CDSL_CURRENT@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cmp	w9, #1
	b.gt	LBB0_13
; %bb.11:
Lloh21:
	adrp	x9, _keeplocked@GOTPAGE
Lloh22:
	ldr	x9, [x9, _keeplocked@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cbnz	x9, LBB0_13
; %bb.12:
	cmp	w8, w20
	csel	w20, w21, w20, eq
	mov	w8, #3
	str	w8, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_cdrom_load_unload
	cmp	w0, #0
	csel	w21, w20, w0, eq
	b	LBB0_9
LBB0_13:
	cmp	w8, w20
	b.eq	LBB0_9
; %bb.14:
Lloh24:
	adrp	x8, _EBUSY@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
	b	LBB0_8
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_CD_CHANGER,4,2                 ; @CD_CHANGER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entering cdrom_select_disc()\n"

	.comm	_CDC_SELECT_DISC,4,2            ; @CDC_SELECT_DISC
	.comm	_EDRIVE_CANT_DO_THIS,4,2        ; @EDRIVE_CANT_DO_THIS
	.comm	_CDSL_NONE,4,2                  ; @CDSL_NONE
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_keeplocked,8,3                 ; @keeplocked
	.comm	_CDSL_CURRENT,4,2               ; @CDSL_CURRENT
	.comm	_EBUSY,4,2                      ; @EBUSY
	.no_dead_strip	_cdrom_select_disc
.subsections_via_symbols
