	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mip4_bl_get_address
_mip4_bl_get_address:                   ## @mip4_bl_get_address
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MIP4_R0_BOOT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -56(%rbp)
	movq	_MIP4_R1_BOOT_BUF_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)
	movl	$8, -128(%rbp)
	leaq	-56(%rbp), %rax
	movq	%rax, -120(%rbp)
	movl	$0, -112(%rbp)
	movq	(%rdi), %rax
	movl	8(%rax), %ecx
	movl	%ecx, -108(%rbp)
	movl	$16, -104(%rbp)
	leaq	-80(%rbp), %rdx
	movq	%rdx, -96(%rbp)
	movq	_I2C_M_RD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, -88(%rbp)
	movl	%ecx, -84(%rbp)
	movl	4(%rax), %ebx
	leaq	-128(%rbp), %r13
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	movl	%ebx, %edi
	movq	%r13, %rsi
	movl	%eax, %edx
	callq	_i2c_transfer
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_ARRAY_SIZE
	cmpl	%eax, %r12d
	jne	LBB0_1
## %bb.2:
	leaq	-80(%rbp), %rdi
	callq	_get_unaligned_le16
	movl	%eax, (%r14)
	movq	(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_3
LBB0_1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	testl	%r12d, %r12d
	cmovsl	%r12d, %ebx
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
LBB0_3:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_5
## %bb.4:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MIP4_R0_BOOT,4,2               ## @MIP4_R0_BOOT
	.comm	_MIP4_R1_BOOT_BUF_ADDR,4,2      ## @MIP4_R1_BOOT_BUF_ADDR
	.comm	_I2C_M_RD,4,2                   ## @I2C_M_RD
	.comm	_EIO,4,2                        ## @EIO
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to retrieve bootloader buffer address: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Bootloader buffer address %#04x\n"

	.no_dead_strip	_mip4_bl_get_address
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mip4_bl_get_address
_mip4_bl_get_address:                   ; @mip4_bl_get_address
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _MIP4_R0_BOOT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MIP4_R0_BOOT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _MIP4_R1_BOOT_BUF_ADDR@GOTPAGE
Lloh7:
	ldr	x9, [x9, _MIP4_R1_BOOT_BUF_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w8, w9, [x29, #-48]
	mov	w8, #8
	str	w8, [sp]
	sub	x8, x29, #48
	str	x8, [sp, #8]
	str	wzr, [sp, #16]
	ldr	x8, [x0]
	ldr	w9, [x8, #8]
	mov	w10, #16
	stp	w9, w10, [sp, #20]
	add	x10, sp, #48
	str	x10, [sp, #32]
Lloh9:
	adrp	x10, _I2C_M_RD@GOTPAGE
Lloh10:
	ldr	x10, [x10, _I2C_M_RD@GOTPAGEOFF]
Lloh11:
	ldr	w10, [x10]
	stp	w10, w9, [sp, #40]
	ldr	w21, [x8, #4]
	mov	x0, sp
	bl	_ARRAY_SIZE
	mov	x2, x0
	mov	x1, sp
	mov	x0, x21
	bl	_i2c_transfer
	mov	x21, x0
	mov	x0, sp
	bl	_ARRAY_SIZE
	cmp	w21, w0
	b.ne	LBB0_2
; %bb.1:
	add	x0, sp, #48
	bl	_get_unaligned_le16
	mov	x2, x0
	str	w0, [x20]
	ldr	x0, [x19]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	mov	w20, #0
	b	LBB0_3
LBB0_2:
Lloh14:
	adrp	x8, _EIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	w21, #0
	csneg	w20, w21, w8, lt
	ldr	x0, [x19]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_err
LBB0_3:
	ldur	x8, [x29, #-40]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_5
; %bb.4:
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_5:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_MIP4_R0_BOOT,4,2               ; @MIP4_R0_BOOT
	.comm	_MIP4_R1_BOOT_BUF_ADDR,4,2      ; @MIP4_R1_BOOT_BUF_ADDR
	.comm	_I2C_M_RD,4,2                   ; @I2C_M_RD
	.comm	_EIO,4,2                        ; @EIO
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to retrieve bootloader buffer address: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Bootloader buffer address %#04x\n"

	.no_dead_strip	_mip4_bl_get_address
.subsections_via_symbols
