	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gdrom_spicommand
_gdrom_spicommand:                      ## @gdrom_spicommand
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r14
	movq	_GDROM_ALTSTATUS_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_ctrl_outb
	movzbl	%bl, %edi
	movq	_GDROM_BCL_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ctrl_outb
	movzbl	%bh, %edi
	movq	_GDROM_BCH_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ctrl_outb
	movq	_GDROM_INTSEC_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_ctrl_outb
	movq	_GDROM_SECNUM_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_ctrl_outb
	movq	_GDROM_ERROR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_ctrl_outb
	xorl	%eax, %eax
	callq	_gdrom_wait_clrbusy
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movq	_jiffies@GOTPCREL(%rip), %r15
	movq	_GDROM_DEFAULT_TIMEOUT@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	addq	(%r15), %rbx
	movq	_GDROM_COM_PACKET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GDROM_STATUSCOMMAND_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_ctrl_outb
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_gdrom_data_request
	testl	%eax, %eax
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	(%r15), %rdi
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%eax, %eax
	callq	_cpu_relax
	jmp	LBB0_2
LBB0_5:
	movq	(%r15), %rdi
	incq	%rbx
	movq	%rbx, %rsi
	callq	_time_before
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movq	_GDROM_DATA_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_PHYSADDR
	movl	%eax, %edi
	movq	%r14, %rsi
	movl	$6, %edx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_outsw                          ## TAILCALL
LBB0_7:
	xorl	%edi, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_gdrom_getsense                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_GDROM_ALTSTATUS_REG,4,2        ## @GDROM_ALTSTATUS_REG
	.comm	_GDROM_BCL_REG,4,2              ## @GDROM_BCL_REG
	.comm	_GDROM_BCH_REG,4,2              ## @GDROM_BCH_REG
	.comm	_GDROM_INTSEC_REG,4,2           ## @GDROM_INTSEC_REG
	.comm	_GDROM_SECNUM_REG,4,2           ## @GDROM_SECNUM_REG
	.comm	_GDROM_ERROR_REG,4,2            ## @GDROM_ERROR_REG
	.comm	_jiffies,8,3                    ## @jiffies
	.comm	_GDROM_DEFAULT_TIMEOUT,8,3      ## @GDROM_DEFAULT_TIMEOUT
	.comm	_GDROM_COM_PACKET,4,2           ## @GDROM_COM_PACKET
	.comm	_GDROM_STATUSCOMMAND_REG,4,2    ## @GDROM_STATUSCOMMAND_REG
	.comm	_GDROM_DATA_REG,4,2             ## @GDROM_DATA_REG
	.no_dead_strip	_gdrom_spicommand
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gdrom_spicommand
_gdrom_spicommand:                      ; @gdrom_spicommand
	.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, _GDROM_ALTSTATUS_REG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GDROM_ALTSTATUS_REG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_ctrl_outb
	and	w0, w20, #0xff
Lloh3:
	adrp	x8, _GDROM_BCL_REG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GDROM_BCL_REG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_ctrl_outb
	ubfx	w0, w20, #8, #8
Lloh6:
	adrp	x8, _GDROM_BCH_REG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GDROM_BCH_REG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_ctrl_outb
Lloh9:
	adrp	x8, _GDROM_INTSEC_REG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GDROM_INTSEC_REG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_ctrl_outb
Lloh12:
	adrp	x8, _GDROM_SECNUM_REG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GDROM_SECNUM_REG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_ctrl_outb
Lloh15:
	adrp	x8, _GDROM_ERROR_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _GDROM_ERROR_REG@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_ctrl_outb
	bl	_gdrom_wait_clrbusy
	cbz	w0, LBB0_6
; %bb.1:
Lloh18:
	adrp	x21, _jiffies@GOTPAGE
Lloh19:
	ldr	x21, [x21, _jiffies@GOTPAGEOFF]
	ldr	x8, [x21]
Lloh20:
	adrp	x9, _GDROM_DEFAULT_TIMEOUT@GOTPAGE
Lloh21:
	ldr	x9, [x9, _GDROM_DEFAULT_TIMEOUT@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	add	x20, x9, x8
Lloh23:
	adrp	x8, _GDROM_COM_PACKET@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GDROM_COM_PACKET@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
Lloh26:
	adrp	x8, _GDROM_STATUSCOMMAND_REG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _GDROM_STATUSCOMMAND_REG@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	bl	_ctrl_outb
	bl	_gdrom_data_request
	cbnz	w0, LBB0_4
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x21]
	mov	x1, x20
	bl	_time_before
	cbz	x0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	bl	_cpu_relax
	bl	_gdrom_data_request
	cbz	w0, LBB0_2
LBB0_4:
	ldr	x0, [x21]
	add	x1, x20, #1
	bl	_time_before
	cbz	x0, LBB0_7
; %bb.5:
Lloh29:
	adrp	x8, _GDROM_DATA_REG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GDROM_DATA_REG@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	bl	_PHYSADDR
	mov	x1, x19
	mov	w2, #6
	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	_outsw
LBB0_6:
	mov	x0, #0
LBB0_7:
	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	_gdrom_getsense
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_GDROM_ALTSTATUS_REG,4,2        ; @GDROM_ALTSTATUS_REG
	.comm	_GDROM_BCL_REG,4,2              ; @GDROM_BCL_REG
	.comm	_GDROM_BCH_REG,4,2              ; @GDROM_BCH_REG
	.comm	_GDROM_INTSEC_REG,4,2           ; @GDROM_INTSEC_REG
	.comm	_GDROM_SECNUM_REG,4,2           ; @GDROM_SECNUM_REG
	.comm	_GDROM_ERROR_REG,4,2            ; @GDROM_ERROR_REG
	.comm	_jiffies,8,3                    ; @jiffies
	.comm	_GDROM_DEFAULT_TIMEOUT,8,3      ; @GDROM_DEFAULT_TIMEOUT
	.comm	_GDROM_COM_PACKET,4,2           ; @GDROM_COM_PACKET
	.comm	_GDROM_STATUSCOMMAND_REG,4,2    ; @GDROM_STATUSCOMMAND_REG
	.comm	_GDROM_DATA_REG,4,2             ; @GDROM_DATA_REG
	.no_dead_strip	_gdrom_spicommand
.subsections_via_symbols
