	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_cdrom_packet               ## -- Begin function ide_cdrom_packet
	.p2align	4, 0x90
_ide_cdrom_packet:                      ## @ide_cdrom_packet
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	(%rdi), %r14
	movl	(%rsi), %eax
	movl	%eax, -36(%rbp)
	movl	20(%rsi), %r10d
	testl	%r10d, %r10d
	jg	LBB0_2
## %bb.1:
	movq	_ATAPI_WAIT_PC@GOTPCREL(%rip), %rax
	movl	(%rax), %r10d
	movl	%r10d, 20(%rbx)
LBB0_2:
	movq	8(%rbx), %r8
	movq	_CGC_DATA_WRITE@GOTPCREL(%rip), %r12
	movq	(%r12), %r11
	xorl	%r9d, %r9d
	movl	$0, %r15d
	cmpq	%r11, %r8
	jne	LBB0_4
## %bb.3:
	movq	_REQ_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_4:
	movl	24(%rbx), %edi
	testl	%edi, %edi
	je	LBB0_6
## %bb.5:
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movq	8(%rbx), %r8
	movq	(%r12), %r11
	movl	24(%rbx), %r9d
	movl	20(%rbx), %r10d
LBB0_6:
	xorl	%eax, %eax
	cmpq	$0, 40(%rbx)
	je	LBB0_8
## %bb.7:
	movq	_REQ_QUIET@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_8:
	orl	%r15d, %eax
	movl	28(%rbx), %ecx
	movl	32(%rbx), %esi
	xorl	%edx, %edx
	cmpq	%r11, %r8
	sete	%dl
	leaq	-36(%rbp), %r8
	movq	%r14, %rdi
	pushq	%rax
	pushq	%r10
	callq	_ide_cd_queue_pc
	addq	$16, %rsp
	movl	%eax, 16(%rbx)
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	movl	-36(%rbp), %ecx
	subl	%ecx, (%rbx)
LBB0_10:
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ATAPI_WAIT_PC,4,2              ## @ATAPI_WAIT_PC
	.comm	_CGC_DATA_WRITE,8,3             ## @CGC_DATA_WRITE
	.comm	_REQ_WRITE,4,2                  ## @REQ_WRITE
	.comm	_REQ_QUIET,4,2                  ## @REQ_QUIET
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_cdrom_packet               ; -- Begin function ide_cdrom_packet
	.p2align	2
_ide_cdrom_packet:                      ; @ide_cdrom_packet
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x20, [x0]
	ldr	w8, [x1]
	str	w8, [sp, #12]
	ldr	w6, [x1, #20]
	cmp	w6, #0
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ATAPI_WAIT_PC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ATAPI_WAIT_PC@GOTPAGEOFF]
Lloh2:
	ldr	w6, [x8]
	str	w6, [x19, #20]
LBB0_2:
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x22, _CGC_DATA_WRITE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _CGC_DATA_WRITE@GOTPAGEOFF]
	ldr	x9, [x22]
Lloh5:
	adrp	x10, _REQ_WRITE@GOTPAGE
Lloh6:
	ldr	x10, [x10, _REQ_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w21, w10, wzr, eq
	ldr	w0, [x19, #24]
	cbz	w0, LBB0_4
; %bb.3:
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	ldr	x8, [x19, #8]
	ldr	x9, [x22]
	ldp	w6, w5, [x19, #20]
	b	LBB0_5
LBB0_4:
	mov	w5, #0
LBB0_5:
	ldr	x10, [x19, #40]
Lloh8:
	adrp	x11, _REQ_QUIET@GOTPAGE
Lloh9:
	ldr	x11, [x11, _REQ_QUIET@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	cmp	x10, #0
	csel	w10, wzr, w11, eq
	orr	w7, w10, w21
	cmp	x8, x9
	cset	w2, eq
	ldp	w3, w1, [x19, #28]
	add	x4, sp, #12
	mov	x0, x20
	bl	_ide_cd_queue_pc
	str	w0, [x19, #16]
	cbnz	w0, LBB0_7
; %bb.6:
	ldr	w8, [sp, #12]
	ldr	w9, [x19]
	sub	w8, w9, w8
	str	w8, [x19]
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_ATAPI_WAIT_PC,4,2              ; @ATAPI_WAIT_PC
	.comm	_CGC_DATA_WRITE,8,3             ; @CGC_DATA_WRITE
	.comm	_REQ_WRITE,4,2                  ; @REQ_WRITE
	.comm	_REQ_QUIET,4,2                  ; @REQ_QUIET
.subsections_via_symbols
