	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rmi_f34_flash_firmware
_rmi_f34_flash_firmware:                ## @rmi_f34_flash_firmware
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %r15
	movl	12(%rsi), %edi
	callq	_le32_to_cpu
	movl	%eax, %r12d
	movl	8(%r14), %edi
	callq	_le32_to_cpu
	movl	%eax, %r13d
	movq	$0, 8(%rbx)
	leal	(%r12,%r13), %eax
	movl	%eax, (%rbx)
	testl	%r12d, %r12d
	je	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movq	_F34_ERASE_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_F34_ERASE_WAIT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_rmi_f34_command
	testl	%eax, %eax
	jne	LBB0_8
## %bb.2:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_rmi_f34_write_firmware
	testl	%eax, %eax
	jne	LBB0_8
## %bb.3:
	testl	%r13d, %r13d
	jne	LBB0_6
	jmp	LBB0_7
LBB0_4:
	testl	%r13d, %r13d
	je	LBB0_7
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	movq	_F34_ERASE_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_F34_ERASE_WAIT_MS@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_rmi_f34_command
	testl	%eax, %eax
	jne	LBB0_8
LBB0_6:
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%r13d, %edx
	xorl	%eax, %eax
	callq	_dev_info
	movslq	%r12d, %rsi
	shlq	$2, %rsi
	addq	(%r14), %rsi
	movq	%rbx, %rdi
	callq	_rmi_f34_write_config
	testl	%eax, %eax
	jne	LBB0_8
LBB0_7:
	xorl	%eax, %eax
LBB0_8:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Erasing firmware...\n"

	.comm	_F34_ERASE_ALL,4,2              ## @F34_ERASE_ALL
	.comm	_F34_ERASE_WAIT_MS,4,2          ## @F34_ERASE_WAIT_MS
L_.str.1:                               ## @.str.1
	.asciz	"Writing firmware (%d bytes)...\n"

L_.str.2:                               ## @.str.2
	.asciz	"Erasing config...\n"

	.comm	_F34_ERASE_CONFIG,4,2           ## @F34_ERASE_CONFIG
L_.str.3:                               ## @.str.3
	.asciz	"Writing config (%d bytes)...\n"

	.no_dead_strip	_rmi_f34_flash_firmware
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rmi_f34_flash_firmware
_rmi_f34_flash_firmware:                ; @rmi_f34_flash_firmware
	.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	x20, x1
	mov	x19, x0
	ldr	x21, [x0, #16]
	ldr	w0, [x1, #12]
	bl	_le32_to_cpu
	mov	x22, x0
	ldr	w0, [x20, #8]
	bl	_le32_to_cpu
	mov	x23, x0
	str	xzr, [x19, #8]
	add	w8, w0, w22
	str	w8, [x19]
	cbz	w22, LBB0_4
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_info
Lloh2:
	adrp	x8, _F34_ERASE_ALL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _F34_ERASE_ALL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x8, _F34_ERASE_WAIT_MS@GOTPAGE
Lloh6:
	ldr	x8, [x8, _F34_ERASE_WAIT_MS@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_rmi_f34_command
	cbnz	w0, LBB0_8
; %bb.2:
	str	x22, [sp]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_info
	ldr	x1, [x20]
	mov	x0, x19
	bl	_rmi_f34_write_firmware
	cbnz	w0, LBB0_8
; %bb.3:
	cbnz	w23, LBB0_6
	b	LBB0_7
LBB0_4:
	cbz	w23, LBB0_7
; %bb.5:
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x21
	bl	_dev_info
Lloh12:
	adrp	x8, _F34_ERASE_CONFIG@GOTPAGE
Lloh13:
	ldr	x8, [x8, _F34_ERASE_CONFIG@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _F34_ERASE_WAIT_MS@GOTPAGE
Lloh16:
	ldr	x8, [x8, _F34_ERASE_WAIT_MS@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #1
	bl	_rmi_f34_command
	cbnz	w0, LBB0_8
LBB0_6:
	str	x23, [sp]
Lloh18:
	adrp	x1, l_.str.3@PAGE
Lloh19:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_dev_info
	ldr	x8, [x20]
	add	x1, x8, w22, sxtw #2
	mov	x0, x19
	bl	_rmi_f34_write_config
	cbnz	w0, LBB0_8
LBB0_7:
	mov	w0, #0
LBB0_8:
	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	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Erasing firmware...\n"

	.comm	_F34_ERASE_ALL,4,2              ; @F34_ERASE_ALL
	.comm	_F34_ERASE_WAIT_MS,4,2          ; @F34_ERASE_WAIT_MS
l_.str.1:                               ; @.str.1
	.asciz	"Writing firmware (%d bytes)...\n"

l_.str.2:                               ; @.str.2
	.asciz	"Erasing config...\n"

	.comm	_F34_ERASE_CONFIG,4,2           ; @F34_ERASE_CONFIG
l_.str.3:                               ; @.str.3
	.asciz	"Writing config (%d bytes)...\n"

	.no_dead_strip	_rmi_f34_flash_firmware
.subsections_via_symbols
