	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function scsi_nextbyte
_scsi_nextbyte:                         ## @scsi_nextbyte
	.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	_scsi_phase@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_SCSI_PHASE_DATAIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_4
## %bb.1:
	movq	_scsi_bufpos@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	incl	%ecx
	movl	%ecx, (%rax)
	movq	_scsi_count@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ecx
	jl	LBB0_14
## %bb.2:
	movq	_SCSI_PHASE_STATUS@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_4:
	movq	_SCSI_PHASE_STATUS@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_D
	movq	_SCSI_PHASE_MSGIN@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rdi
	callq	_scsi_changephase
	movq	_scsi_buffer@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
LBB0_13:
	movl	$0, (%rax)
LBB0_14:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	_SCSI_PHASE_MSGIN@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.15:
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_D
	movq	_SCSI_PHASE_SELECTION@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_scsi_changephase               ## TAILCALL
LBB0_7:
	movq	_SCSI_PHASE_COMMAND@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.8:
	movq	_scsi_byte@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_scsi_buffer@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_scsi_bufpos@GOTPCREL(%rip), %rbx
	movslq	(%rbx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, (%rbx)
	movl	%eax, (%rcx,%rdx,4)
	cmpl	$6, (%rbx)
	jl	LBB0_14
## %bb.9:
	xorl	%eax, %eax
	callq	_scsi_process_command
	movl	$0, (%rbx)
	jmp	LBB0_14
LBB0_10:
	movq	_SCSI_PHASE_DATAOUT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.11:
	movq	_scsi_byte@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_printf
	movl	%eax, %edi
	callq	_D
	movl	(%r14), %eax
	movq	_scsi_buffer@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	movq	_scsi_bufpos@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rdx
	leal	1(%rdx), %esi
	movl	%esi, (%rcx)
	movl	%eax, (%rdi,%rdx,4)
	movl	(%rcx), %eax
	movq	_scsi_count@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jl	LBB0_14
## %bb.12:
	movq	_PBI_SCSI_disk@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$1, %esi
	movl	$256, %edx                      ## imm = 0x100
	callq	_fwrite
	movq	(%rbx), %rdi
	callq	_scsi_changephase
	movq	(%r14), %rax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_scsi_phase,8,3                 ## @scsi_phase
	.comm	_SCSI_PHASE_DATAIN,8,3          ## @SCSI_PHASE_DATAIN
	.comm	_scsi_bufpos,4,2                ## @scsi_bufpos
	.comm	_scsi_count,4,2                 ## @scsi_count
	.comm	_SCSI_PHASE_STATUS,8,3          ## @SCSI_PHASE_STATUS
	.comm	_scsi_buffer,8,3                ## @scsi_buffer
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"SCSI status\n"

	.comm	_SCSI_PHASE_MSGIN,8,3           ## @SCSI_PHASE_MSGIN
L_.str.1:                               ## @.str.1
	.asciz	"SCSI msg\n"

	.comm	_SCSI_PHASE_SELECTION,8,3       ## @SCSI_PHASE_SELECTION
	.comm	_SCSI_PHASE_COMMAND,8,3         ## @SCSI_PHASE_COMMAND
	.comm	_scsi_byte,4,2                  ## @scsi_byte
	.comm	_SCSI_PHASE_DATAOUT,8,3         ## @SCSI_PHASE_DATAOUT
L_.str.2:                               ## @.str.2
	.asciz	"SCSI data out:%2x\n"

	.comm	_PBI_SCSI_disk,4,2              ## @PBI_SCSI_disk
	.no_dead_strip	_scsi_nextbyte
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function scsi_nextbyte
_scsi_nextbyte:                         ; @scsi_nextbyte
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _scsi_phase@GOTPAGE
Lloh1:
	ldr	x8, [x8, _scsi_phase@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _SCSI_PHASE_DATAIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _SCSI_PHASE_DATAIN@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _scsi_bufpos@GOTPAGE
Lloh7:
	ldr	x8, [x8, _scsi_bufpos@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
Lloh8:
	adrp	x8, _scsi_count@GOTPAGE
Lloh9:
	ldr	x8, [x8, _scsi_count@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	cmp	w9, w8
	b.lt	LBB0_7
; %bb.2:
Lloh11:
	adrp	x8, _SCSI_PHASE_STATUS@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SCSI_PHASE_STATUS@GOTPAGEOFF]
	b	LBB0_5
LBB0_3:
Lloh13:
	adrp	x19, _SCSI_PHASE_STATUS@GOTPAGE
Lloh14:
	ldr	x19, [x19, _SCSI_PHASE_STATUS@GOTPAGEOFF]
	ldr	x9, [x19]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.4:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_printf
	bl	_D
Lloh17:
	adrp	x8, _SCSI_PHASE_MSGIN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SCSI_PHASE_MSGIN@GOTPAGEOFF]
LBB0_5:
	ldr	x0, [x8]
	bl	_scsi_changephase
Lloh19:
	adrp	x8, _scsi_buffer@GOTPAGE
Lloh20:
	ldr	x8, [x8, _scsi_buffer@GOTPAGEOFF]
Lloh21:
	ldr	x8, [x8]
LBB0_6:
	str	wzr, [x8]
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_8:
Lloh22:
	adrp	x9, _SCSI_PHASE_MSGIN@GOTPAGE
Lloh23:
	ldr	x9, [x9, _SCSI_PHASE_MSGIN@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.9:
Lloh25:
	adrp	x0, l_.str.1@PAGE
Lloh26:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	bl	_D
Lloh27:
	adrp	x8, _SCSI_PHASE_SELECTION@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SCSI_PHASE_SELECTION@GOTPAGEOFF]
Lloh29:
	ldr	x0, [x8]
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_scsi_changephase
LBB0_10:
Lloh30:
	adrp	x9, _SCSI_PHASE_COMMAND@GOTPAGE
Lloh31:
	ldr	x9, [x9, _SCSI_PHASE_COMMAND@GOTPAGEOFF]
Lloh32:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.11:
Lloh33:
	adrp	x8, _scsi_byte@GOTPAGE
Lloh34:
	ldr	x8, [x8, _scsi_byte@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _scsi_buffer@GOTPAGE
Lloh37:
	ldr	x9, [x9, _scsi_buffer@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
Lloh39:
	adrp	x19, _scsi_bufpos@GOTPAGE
Lloh40:
	ldr	x19, [x19, _scsi_bufpos@GOTPAGEOFF]
	ldrsw	x10, [x19]
	add	w11, w10, #1
	str	w11, [x19]
	str	w8, [x9, x10, lsl #2]
	ldr	w8, [x19]
	cmp	w8, #6
	b.lt	LBB0_7
; %bb.12:
	bl	_scsi_process_command
	str	wzr, [x19]
	b	LBB0_7
LBB0_13:
Lloh41:
	adrp	x9, _SCSI_PHASE_DATAOUT@GOTPAGE
Lloh42:
	ldr	x9, [x9, _SCSI_PHASE_DATAOUT@GOTPAGEOFF]
Lloh43:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.14:
Lloh44:
	adrp	x20, _scsi_byte@GOTPAGE
Lloh45:
	ldr	x20, [x20, _scsi_byte@GOTPAGEOFF]
	ldr	w8, [x20]
	str	x8, [sp]
Lloh46:
	adrp	x0, l_.str.2@PAGE
Lloh47:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_printf
	bl	_D
	ldr	w8, [x20]
Lloh48:
	adrp	x20, _scsi_buffer@GOTPAGE
Lloh49:
	ldr	x20, [x20, _scsi_buffer@GOTPAGEOFF]
Lloh50:
	adrp	x9, _scsi_bufpos@GOTPAGE
Lloh51:
	ldr	x9, [x9, _scsi_bufpos@GOTPAGEOFF]
	ldr	x0, [x20]
	ldrsw	x10, [x9]
	add	w11, w10, #1
	str	w11, [x9]
	str	w8, [x0, x10, lsl #2]
	ldr	w8, [x9]
Lloh52:
	adrp	x9, _scsi_count@GOTPAGE
Lloh53:
	ldr	x9, [x9, _scsi_count@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	cmp	w8, w9
	b.lt	LBB0_7
; %bb.15:
Lloh55:
	adrp	x8, _PBI_SCSI_disk@GOTPAGE
Lloh56:
	ldr	x8, [x8, _PBI_SCSI_disk@GOTPAGEOFF]
Lloh57:
	ldr	w3, [x8]
	mov	w1, #1
	mov	w2, #256
	bl	_fwrite
	ldr	x0, [x19]
	bl	_scsi_changephase
	ldr	x8, [x20]
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGot	Lloh50, Lloh51
	.loh AdrpLdrGot	Lloh48, Lloh49
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_scsi_phase,8,3                 ; @scsi_phase
	.comm	_SCSI_PHASE_DATAIN,8,3          ; @SCSI_PHASE_DATAIN
	.comm	_scsi_bufpos,4,2                ; @scsi_bufpos
	.comm	_scsi_count,4,2                 ; @scsi_count
	.comm	_SCSI_PHASE_STATUS,8,3          ; @SCSI_PHASE_STATUS
	.comm	_scsi_buffer,8,3                ; @scsi_buffer
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"SCSI status\n"

	.comm	_SCSI_PHASE_MSGIN,8,3           ; @SCSI_PHASE_MSGIN
l_.str.1:                               ; @.str.1
	.asciz	"SCSI msg\n"

	.comm	_SCSI_PHASE_SELECTION,8,3       ; @SCSI_PHASE_SELECTION
	.comm	_SCSI_PHASE_COMMAND,8,3         ; @SCSI_PHASE_COMMAND
	.comm	_scsi_byte,4,2                  ; @scsi_byte
	.comm	_SCSI_PHASE_DATAOUT,8,3         ; @SCSI_PHASE_DATAOUT
l_.str.2:                               ; @.str.2
	.asciz	"SCSI data out:%2x\n"

	.comm	_PBI_SCSI_disk,4,2              ; @PBI_SCSI_disk
	.no_dead_strip	_scsi_nextbyte
.subsections_via_symbols
