	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function iiDownloadBlock
_iiDownloadBlock:                       ## @iiDownloadBlock
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rax
	movq	_I2E_MAGIC@GOTPCREL(%rip), %rcx
	movq	_II_DOWN_BADVALID@GOTPCREL(%rip), %r12
	cmpq	(%rcx), %rax
	jne	LBB0_29
## %bb.1:
	movl	%edx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movl	8(%rdi), %eax
	cmpl	$131, %eax
	je	LBB0_2
## %bb.3:
	cmpl	$130, %eax
	jne	LBB0_4
## %bb.5:
	movl	20(%rbx), %eax
	movq	_MAGIC_LOADFILE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_6
## %bb.7:
	movslq	16(%rbx), %rax
	incq	%rax
	movq	%rax, 24(%r15)
	movl	$131, 8(%r15)
	movl	12(%rbx), %eax
	movl	%eax, 40(%r15)
	movl	8(%rbx), %eax
	movl	%eax, 36(%r15)
	movl	4(%rbx), %eax
	movl	%eax, 32(%r15)
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_2:
	movb	$1, %r13b
LBB0_8:
	movq	_MAX_DLOAD_READ_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_iiWaitForTxEmpty
	movq	_II_DOWN_TIMEOUT@GOTPCREL(%rip), %rcx
	testl	%eax, %eax
	je	LBB0_9
## %bb.10:
	movl	(%rbx), %esi
	movq	_LOADWARE_BLOCK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_iiWriteBuf
	testl	%eax, %eax
	je	LBB0_29
## %bb.11:
	testb	%r13b, %r13b
	jne	LBB0_13
## %bb.12:
	movq	_MAX_DLOAD_START_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_iiWaitForTxEmpty
	testl	%eax, %eax
	je	LBB0_28
LBB0_13:
	decq	24(%r15)
	je	LBB0_15
## %bb.14:
	movq	_II_DOWN_CONTINUING@GOTPCREL(%rip), %r12
	jmp	LBB0_29
LBB0_4:
	movq	_II_DOWN_BADSTATE@GOTPCREL(%rip), %r12
	jmp	LBB0_29
LBB0_9:
	movq	%rcx, %r12
	jmp	LBB0_29
LBB0_6:
	movq	_II_DOWN_BADFILE@GOTPCREL(%rip), %r12
	jmp	LBB0_29
LBB0_15:
	movq	_MAX_DLOAD_READ_TIME@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_iiWaitForTxEmpty
	testl	%eax, %eax
	je	LBB0_28
## %bb.16:
	movq	_MAX_DLOAD_ACK_TIME@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	imulq	$1717986919, %rax, %rbx         ## imm = 0x66666667
	movq	%rbx, %rax
	shrq	$63, %rax
	sarq	$34, %rbx
	addl	%eax, %ebx
	decl	%ebx
	je	LBB0_27
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_I2_HAS_INPUT
	testq	%rax, %rax
	jne	LBB0_19
## %bb.26:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	%r15, %rdi
	movl	$10, %esi
	callq	_iiDelay
	decl	%ebx
	jne	LBB0_18
LBB0_27:
	movq	_II_STATE_BADLOAD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
LBB0_28:
	movq	_II_DOWN_TIMEOUT@GOTPCREL(%rip), %r12
LBB0_29:
	movl	(%r12), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movl	16(%r15), %edi
	callq	_inb
	cmpl	$128, %eax
	jne	LBB0_20
## %bb.21:
	testl	%r14d, %r14d
	jne	LBB0_22
## %bb.23:
	movq	_II_STATE_LOADED@GOTPCREL(%rip), %rax
	jmp	LBB0_24
LBB0_20:
	movq	_II_DOWN_BAD@GOTPCREL(%rip), %r12
	jmp	LBB0_29
LBB0_22:
	movq	_II_STATE_STDLOADED@GOTPCREL(%rip), %rax
LBB0_24:
	movl	(%rax), %eax
	movl	%eax, 8(%r15)
	movq	_POR_DEBUG_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_II_DOWN_GOOD@GOTPCREL(%rip), %r12
	testl	%eax, 12(%r15)
	je	LBB0_29
## %bb.25:
	movq	%r15, %rdi
	movl	$700, %esi                      ## imm = 0x2BC
	callq	_iiDelay
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_I2E_MAGIC,8,3                  ## @I2E_MAGIC
	.comm	_II_DOWN_BADVALID,4,2           ## @II_DOWN_BADVALID
	.comm	_MAGIC_LOADFILE,4,2             ## @MAGIC_LOADFILE
	.comm	_II_DOWN_BADFILE,4,2            ## @II_DOWN_BADFILE
	.comm	_II_DOWN_BADSTATE,4,2           ## @II_DOWN_BADSTATE
	.comm	_MAX_DLOAD_READ_TIME,4,2        ## @MAX_DLOAD_READ_TIME
	.comm	_II_DOWN_TIMEOUT,4,2            ## @II_DOWN_TIMEOUT
	.comm	_LOADWARE_BLOCK_SIZE,4,2        ## @LOADWARE_BLOCK_SIZE
	.comm	_MAX_DLOAD_START_TIME,4,2       ## @MAX_DLOAD_START_TIME
	.comm	_II_DOWN_CONTINUING,4,2         ## @II_DOWN_CONTINUING
	.comm	_MAX_DLOAD_ACK_TIME,4,2         ## @MAX_DLOAD_ACK_TIME
	.comm	_II_STATE_STDLOADED,4,2         ## @II_STATE_STDLOADED
	.comm	_II_STATE_LOADED,4,2            ## @II_STATE_LOADED
	.comm	_POR_DEBUG_PORT,4,2             ## @POR_DEBUG_PORT
	.comm	_II_DOWN_GOOD,4,2               ## @II_DOWN_GOOD
	.comm	_II_DOWN_BAD,4,2                ## @II_DOWN_BAD
	.comm	_II_STATE_BADLOAD,4,2           ## @II_STATE_BADLOAD
	.no_dead_strip	_iiDownloadBlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function iiDownloadBlock
_iiDownloadBlock:                       ; @iiDownloadBlock
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _I2E_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _I2E_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.1:
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	ldr	w8, [x0, #8]
	cmp	w8, #131
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #130
	b.ne	LBB0_13
; %bb.3:
	ldr	w8, [x21, #20]
Lloh3:
	adrp	x9, _MAGIC_LOADFILE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _MAGIC_LOADFILE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_14
; %bb.4:
	mov	w22, #0
	ldp	w9, w8, [x21, #12]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	add	x8, x8, #1
	str	x8, [x19, #24]
	mov	w8, #131
	str	w8, [x19, #8]
	str	w9, [x19, #40]
	ldur	d0, [x21, #4]
	str	d0, [x19, #32]
	b	LBB0_6
LBB0_5:
	mov	w22, #1
LBB0_6:
Lloh6:
	adrp	x23, _MAX_DLOAD_READ_TIME@GOTPAGE
Lloh7:
	ldr	x23, [x23, _MAX_DLOAD_READ_TIME@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_iiWaitForTxEmpty
	cbz	w0, LBB0_20
; %bb.7:
	ldr	w1, [x21]
Lloh8:
	adrp	x8, _LOADWARE_BLOCK_SIZE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _LOADWARE_BLOCK_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_iiWriteBuf
	cbz	w0, LBB0_12
; %bb.8:
	tbnz	w22, #0, LBB0_10
; %bb.9:
Lloh11:
	adrp	x8, _MAX_DLOAD_START_TIME@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAX_DLOAD_START_TIME@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_iiWaitForTxEmpty
	cbz	w0, LBB0_20
LBB0_10:
	ldr	x8, [x19, #24]
	subs	x8, x8, #1
	str	x8, [x19, #24]
	b.eq	LBB0_15
; %bb.11:
Lloh14:
	adrp	x8, _II_DOWN_CONTINUING@GOTPAGE
Lloh15:
	ldr	x8, [x8, _II_DOWN_CONTINUING@GOTPAGEOFF]
	b	LBB0_21
LBB0_12:
Lloh16:
	adrp	x8, _II_DOWN_BADVALID@GOTPAGE
Lloh17:
	ldr	x8, [x8, _II_DOWN_BADVALID@GOTPAGEOFF]
	b	LBB0_21
LBB0_13:
Lloh18:
	adrp	x8, _II_DOWN_BADSTATE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _II_DOWN_BADSTATE@GOTPAGEOFF]
	b	LBB0_21
LBB0_14:
Lloh20:
	adrp	x8, _II_DOWN_BADFILE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _II_DOWN_BADFILE@GOTPAGEOFF]
	b	LBB0_21
LBB0_15:
	ldr	w1, [x23]
	mov	x0, x19
	bl	_iiWaitForTxEmpty
	cbz	w0, LBB0_20
; %bb.16:
Lloh22:
	adrp	x8, _MAX_DLOAD_ACK_TIME@GOTPAGE
Lloh23:
	ldr	x8, [x8, _MAX_DLOAD_ACK_TIME@GOTPAGEOFF]
Lloh24:
	ldrsw	x8, [x8]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
	add	w8, w8, w9
	subs	w21, w8, #1
	b.eq	LBB0_19
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_I2_HAS_INPUT
	cbnz	x0, LBB0_22
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x19
	mov	w1, #10
	bl	_iiDelay
	subs	w21, w21, #1
	b.ne	LBB0_17
LBB0_19:
Lloh25:
	adrp	x8, _II_STATE_BADLOAD@GOTPAGE
Lloh26:
	ldr	x8, [x8, _II_STATE_BADLOAD@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	str	w8, [x19, #8]
LBB0_20:
Lloh28:
	adrp	x8, _II_DOWN_TIMEOUT@GOTPAGE
Lloh29:
	ldr	x8, [x8, _II_DOWN_TIMEOUT@GOTPAGEOFF]
LBB0_21:
	ldr	w0, [x8]
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_22:
	ldr	w0, [x19, #16]
	bl	_inb
	cmp	w0, #128
	b.ne	LBB0_26
; %bb.23:
Lloh30:
	adrp	x8, _II_STATE_STDLOADED@GOTPAGE
Lloh31:
	ldr	x8, [x8, _II_STATE_STDLOADED@GOTPAGEOFF]
Lloh32:
	adrp	x9, _II_STATE_LOADED@GOTPAGE
Lloh33:
	ldr	x9, [x9, _II_STATE_LOADED@GOTPAGEOFF]
	cmp	w20, #0
	csel	x8, x9, x8, eq
	ldr	w8, [x8]
	str	w8, [x19, #8]
	ldr	w8, [x19, #12]
Lloh34:
	adrp	x9, _POR_DEBUG_PORT@GOTPAGE
Lloh35:
	ldr	x9, [x9, _POR_DEBUG_PORT@GOTPAGEOFF]
Lloh36:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
; %bb.24:
	mov	x0, x19
	mov	w1, #700
	bl	_iiDelay
LBB0_25:
Lloh37:
	adrp	x8, _II_DOWN_GOOD@GOTPAGE
Lloh38:
	ldr	x8, [x8, _II_DOWN_GOOD@GOTPAGEOFF]
	b	LBB0_21
LBB0_26:
Lloh39:
	adrp	x8, _II_DOWN_BAD@GOTPAGE
Lloh40:
	ldr	x8, [x8, _II_DOWN_BAD@GOTPAGEOFF]
	b	LBB0_21
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGot	Lloh39, Lloh40
	.cfi_endproc
                                        ; -- End function
	.comm	_I2E_MAGIC,8,3                  ; @I2E_MAGIC
	.comm	_II_DOWN_BADVALID,4,2           ; @II_DOWN_BADVALID
	.comm	_MAGIC_LOADFILE,4,2             ; @MAGIC_LOADFILE
	.comm	_II_DOWN_BADFILE,4,2            ; @II_DOWN_BADFILE
	.comm	_II_DOWN_BADSTATE,4,2           ; @II_DOWN_BADSTATE
	.comm	_MAX_DLOAD_READ_TIME,4,2        ; @MAX_DLOAD_READ_TIME
	.comm	_II_DOWN_TIMEOUT,4,2            ; @II_DOWN_TIMEOUT
	.comm	_LOADWARE_BLOCK_SIZE,4,2        ; @LOADWARE_BLOCK_SIZE
	.comm	_MAX_DLOAD_START_TIME,4,2       ; @MAX_DLOAD_START_TIME
	.comm	_II_DOWN_CONTINUING,4,2         ; @II_DOWN_CONTINUING
	.comm	_MAX_DLOAD_ACK_TIME,4,2         ; @MAX_DLOAD_ACK_TIME
	.comm	_II_STATE_STDLOADED,4,2         ; @II_STATE_STDLOADED
	.comm	_II_STATE_LOADED,4,2            ; @II_STATE_LOADED
	.comm	_POR_DEBUG_PORT,4,2             ; @POR_DEBUG_PORT
	.comm	_II_DOWN_GOOD,4,2               ; @II_DOWN_GOOD
	.comm	_II_DOWN_BAD,4,2                ; @II_DOWN_BAD
	.comm	_II_STATE_BADLOAD,4,2           ; @II_STATE_BADLOAD
	.no_dead_strip	_iiDownloadBlock
.subsections_via_symbols
