	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdrom_preparedisk_cmd
_gdrom_preparedisk_cmd:                 ## @gdrom_preparedisk_cmd
	.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	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	(%rax), %rax
	movl	$112, (%rax)
	movl	$31, 8(%rax)
	movq	$0, 8(%rbx)
	movq	_gd@GOTPCREL(%rip), %r14
	movl	$1, (%r14)
	movl	8(%r14), %edi
	movq	%rbx, %rsi
	callq	_gdrom_packetcommand
	movq	_command_queue@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	cmpl	$0, (%r14)
	movl	(%rax), %edi
	sete	%sil
	movq	_GDROM_DEFAULT_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_wait_event_interruptible_timeout
	movl	$0, (%r14)
	movq	%rbx, %rdi
	callq	_kfree
	xorl	%ebx, %ebx
	testb	$1, 4(%r14)
	je	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	xorl	%edi, %edi
	callq	_gdrom_getsense
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_4:
	subl	(%rax), %ebx
LBB0_5:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_gd,12,2                        ## @gd
	.comm	_command_queue,4,2              ## @command_queue
	.comm	_GDROM_DEFAULT_TIMEOUT,4,2      ## @GDROM_DEFAULT_TIMEOUT
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_gdrom_preparedisk_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdrom_preparedisk_cmd
_gdrom_preparedisk_cmd:                 ; @gdrom_preparedisk_cmd
	.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
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #16
	bl	_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0]
	mov	w9, #112
	str	w9, [x8]
	mov	w9, #31
	str	w9, [x8, #8]
	str	xzr, [x0, #8]
Lloh3:
	adrp	x20, _gd@GOTPAGE
Lloh4:
	ldr	x20, [x20, _gd@GOTPAGEOFF]
	mov	w8, #1
	str	w8, [x20]
	ldr	w0, [x20, #8]
	mov	x1, x19
	bl	_gdrom_packetcommand
Lloh5:
	adrp	x8, _command_queue@GOTPAGE
Lloh6:
	ldr	x8, [x8, _command_queue@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	w8, [x20]
	cmp	w8, #0
	cset	w1, eq
Lloh8:
	adrp	x8, _GDROM_DEFAULT_TIMEOUT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _GDROM_DEFAULT_TIMEOUT@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	bl	_wait_event_interruptible_timeout
	str	wzr, [x20]
	mov	x0, x19
	bl	_kfree
	mov	w0, #0
	ldrb	w8, [x20, #4]
	tbz	w8, #0, LBB0_5
; %bb.2:
	mov	x0, #0
	bl	_gdrom_getsense
Lloh11:
	adrp	x8, _EIO@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_gd,12,2                        ; @gd
	.comm	_command_queue,4,2              ; @command_queue
	.comm	_GDROM_DEFAULT_TIMEOUT,4,2      ; @GDROM_DEFAULT_TIMEOUT
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_gdrom_preparedisk_cmd
.subsections_via_symbols
