	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_local_rom
_handle_local_rom:                      ## @handle_local_rom
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movq	(%rsi), %rax
	movl	(%rax), %edi
	callq	_HEADER_GET_TCODE
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_TCODE_IS_BLOCK_PACKET
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	(%r14), %rax
	movl	12(%rax), %edi
	callq	_HEADER_GET_DATA_LENGTH
	movl	%eax, %r15d
	jmp	LBB0_3
LBB0_1:
	movl	$4, %r15d
LBB0_3:
	movq	_CSR_CONFIG_ROM@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movslq	%r13d, %rbx
	subq	%rax, %rbx
	leal	(%rbx,%r15), %eax
	movq	_CONFIG_ROM_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_5
## %bb.4:
	movq	(%r14), %rsi
	movq	_RCODE_ADDRESS_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_5:
	movl	%r12d, %edi
	callq	_TCODE_IS_READ_REQUEST
	movq	(%r14), %rsi
	testl	%eax, %eax
	je	LBB0_6
## %bb.8:
	movq	_RCODE_COMPLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	addq	8(%r14), %rbx
	leaq	-56(%rbp), %rdi
	movq	%rbx, %rcx
	movl	%r15d, %r8d
	callq	_fw_fill_response
	jmp	LBB0_9
LBB0_6:
	movq	_RCODE_TYPE_ERROR@GOTPCREL(%rip), %rax
LBB0_7:
	movl	(%rax), %edx
	leaq	-56(%rbp), %rdi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_fw_fill_response
	movq	-48(%rbp), %r14                 ## 8-byte Reload
LBB0_9:
	leaq	-56(%rbp), %rsi
	movq	%r14, %rdi
	callq	_fw_core_handle_response
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CSR_CONFIG_ROM,4,2             ## @CSR_CONFIG_ROM
	.comm	_CONFIG_ROM_SIZE,4,2            ## @CONFIG_ROM_SIZE
	.comm	_RCODE_ADDRESS_ERROR,4,2        ## @RCODE_ADDRESS_ERROR
	.comm	_RCODE_TYPE_ERROR,4,2           ## @RCODE_TYPE_ERROR
	.comm	_RCODE_COMPLETE,4,2             ## @RCODE_COMPLETE
	.no_dead_strip	_handle_local_rom
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_local_rom
_handle_local_rom:                      ; @handle_local_rom
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	w0, [x8]
	bl	_HEADER_GET_TCODE
	mov	x22, x0
	bl	_TCODE_IS_BLOCK_PACKET
	cbz	x0, LBB0_2
; %bb.1:
	ldr	x8, [x20]
	ldr	w0, [x8, #12]
	bl	_HEADER_GET_DATA_LENGTH
	mov	x21, x0
	b	LBB0_3
LBB0_2:
	mov	w21, #4
LBB0_3:
Lloh0:
	adrp	x8, _CSR_CONFIG_ROM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSR_CONFIG_ROM@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	sxtw	x9, w23
	sub	x23, x9, x8
	add	w8, w23, w21
Lloh3:
	adrp	x9, _CONFIG_ROM_SIZE@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CONFIG_ROM_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	cmp	w8, w9
	b.le	LBB0_5
; %bb.4:
	ldr	x1, [x20]
Lloh6:
	adrp	x8, _RCODE_ADDRESS_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RCODE_ADDRESS_ERROR@GOTPAGEOFF]
	b	LBB0_8
LBB0_5:
	mov	x0, x22
	bl	_TCODE_IS_READ_REQUEST
	ldr	x1, [x20]
	cbz	w0, LBB0_7
; %bb.6:
Lloh8:
	adrp	x8, _RCODE_COMPLETE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RCODE_COMPLETE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	ldr	x8, [x19, #8]
	add	x3, x8, x23
	add	x0, sp, #8
	mov	x4, x21
	b	LBB0_9
LBB0_7:
Lloh11:
	adrp	x8, _RCODE_TYPE_ERROR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RCODE_TYPE_ERROR@GOTPAGEOFF]
LBB0_8:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	x3, #0
	mov	w4, #0
LBB0_9:
	bl	_fw_fill_response
	add	x1, sp, #8
	mov	x0, x19
	bl	_fw_core_handle_response
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_CSR_CONFIG_ROM,4,2             ; @CSR_CONFIG_ROM
	.comm	_CONFIG_ROM_SIZE,4,2            ; @CONFIG_ROM_SIZE
	.comm	_RCODE_ADDRESS_ERROR,4,2        ; @RCODE_ADDRESS_ERROR
	.comm	_RCODE_TYPE_ERROR,4,2           ; @RCODE_TYPE_ERROR
	.comm	_RCODE_COMPLETE,4,2             ; @RCODE_COMPLETE
	.no_dead_strip	_handle_local_rom
.subsections_via_symbols
