	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_cdrom_select_speed         ## -- Begin function ide_cdrom_select_speed
	.p2align	4, 0x90
_ide_cdrom_select_speed:                ## @ide_cdrom_select_speed
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r14
	movq	%rsp, -72(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	8(%rdi), %r12
	movq	(%r12), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	_ATAPI_CAPABILITIES_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	_BLK_MAX_CDB@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	imull	$177, %r13d, %eax
	testl	%r13d, %r13d
	movl	$65535, %r13d                   ## imm = 0xFFFF
	cmovnel	%eax, %r13d
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	movq	_GPCMD_SET_SPEED@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, (%rbx)
	movl	%r13d, %eax
	shrl	$8, %eax
	movb	%al, 2(%rbx)
	movb	%r13b, 3(%rbx)
	movl	(%r14), %ecx
	movq	_CDC_CD_R@GOTPCREL(%rip), %rdx
	movq	_CDC_CD_RW@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	movq	_CDC_DVD_R@GOTPCREL(%rip), %rdx
	orl	(%rdx), %esi
	notl	%ecx
	testl	%ecx, %esi
	je	LBB0_2
## %bb.1:
	movb	%al, 4(%rbx)
	movb	%r13b, 5(%rbx)
LBB0_2:
	leaq	-80(%rbp), %r9
	movq	%r12, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	$0
	pushq	$0
	callq	_ide_cd_queue_pc
	addq	$16, %rsp
	movq	%r12, %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_ide_cdrom_get_capabilities
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	%r12, %rdi
	movq	%rbx, %rsi
	callq	_ide_cdrom_update_speed
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 4(%r14)
LBB0_4:
	movq	-72(%rbp), %rsp                 ## 8-byte Reload
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_6
## %bb.5:
	xorl	%eax, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ATAPI_CAPABILITIES_PAGE_SIZE,4,2 ## @ATAPI_CAPABILITIES_PAGE_SIZE
	.comm	_BLK_MAX_CDB,4,2                ## @BLK_MAX_CDB
	.comm	_GPCMD_SET_SPEED,1,0            ## @GPCMD_SET_SPEED
	.comm	_CDC_CD_R,4,2                   ## @CDC_CD_R
	.comm	_CDC_CD_RW,4,2                  ## @CDC_CD_RW
	.comm	_CDC_DVD_R,4,2                  ## @CDC_DVD_R
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_cdrom_select_speed         ; -- Begin function ide_cdrom_select_speed
	.p2align	2
_ide_cdrom_select_speed:                ; @ide_cdrom_select_speed
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	sub	sp, sp, #16
	mov	x19, x0
	mov	x23, sp
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
	ldr	x20, [x0, #8]
	ldr	x24, [x20]
Lloh3:
	adrp	x8, _ATAPI_CAPABILITIES_PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ATAPI_CAPABILITIES_PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh8:
	adrp	x8, _BLK_MAX_CDB@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BLK_MAX_CDB@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x9, x2
Lloh11:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh12:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x22, x8, x9
	mov	sp, x22
	mov	w8, #177
	mul	w8, w1, w8
	mov	w9, #65535
	cmp	w1, #0
	csel	w25, w9, w8, eq
	mov	x0, x22
	mov	w1, #0
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memset
Lloh13:
	adrp	x8, _GPCMD_SET_SPEED@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GPCMD_SET_SPEED@GOTPAGEOFF]
	ldrb	w8, [x8]
	strb	w8, [x22]
	lsr	w8, w25, #8
	strb	w8, [x22, #2]
	strb	w25, [x22, #3]
	ldr	w8, [x19]
Lloh15:
	adrp	x9, _CDC_CD_R@GOTPAGE
Lloh16:
	ldr	x9, [x9, _CDC_CD_R@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
Lloh18:
	adrp	x10, _CDC_CD_RW@GOTPAGE
Lloh19:
	ldr	x10, [x10, _CDC_CD_RW@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh21:
	adrp	x10, _CDC_DVD_R@GOTPAGE
Lloh22:
	ldr	x10, [x10, _CDC_DVD_R@GOTPAGEOFF]
Lloh23:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bics	wzr, w9, w8
	b.eq	LBB0_2
; %bb.1:
	rev	w8, w25
	lsr	w8, w8, #16
	strh	w8, [x22, #4]
LBB0_2:
	sub	x5, x29, #80
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	mov	x3, #0
	mov	x4, #0
	mov	w6, #0
	mov	w7, #0
	bl	_ide_cd_queue_pc
	mov	x0, x20
	mov	x1, x21
	bl	_ide_cdrom_get_capabilities
	cbnz	w0, LBB0_4
; %bb.3:
	mov	x0, x20
	mov	x1, x21
	bl	_ide_cdrom_update_speed
	ldr	w8, [x24]
	str	w8, [x19, #4]
LBB0_4:
	mov	sp, x23
	ldur	x8, [x29, #-72]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	mov	w0, #0
	sub	sp, x29, #64
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ATAPI_CAPABILITIES_PAGE_SIZE,4,2 ; @ATAPI_CAPABILITIES_PAGE_SIZE
	.comm	_BLK_MAX_CDB,4,2                ; @BLK_MAX_CDB
	.comm	_GPCMD_SET_SPEED,1,0            ; @GPCMD_SET_SPEED
	.comm	_CDC_CD_R,4,2                   ; @CDC_CD_R
	.comm	_CDC_CD_RW,4,2                  ; @CDC_CD_RW
	.comm	_CDC_DVD_R,4,2                  ; @CDC_DVD_R
.subsections_via_symbols
