	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rmi_f34v7_write_partition_table
_rmi_f34v7_write_partition_table:       ## @rmi_f34v7_write_partition_table
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movl	48(%rdi), %r14d
	movq	_v7_BL_CONFIG_AREA@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	%rax, 40(%rdi)
	movl	4(%rdi), %eax
	imull	%r14d, %eax
	movl	%eax, (%rdi)
	movq	56(%rdi), %rdi
	movq	24(%rbx), %rsi
	callq	_devm_kfree
	movq	56(%rbx), %rdi
	movl	(%rbx), %esi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_devm_kzalloc
	movq	%rax, 24(%rbx)
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	(%rbx), %eax
	movl	%eax, 8(%rbx)
	movq	_v7_CMD_READ_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_rmi_f34v7_read_blocks
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movq	%rbx, %rdi
	callq	_rmi_f34v7_erase_config
	testl	%eax, %eax
	js	LBB0_6
## %bb.4:
	movq	%rbx, %rdi
	callq	_rmi_f34v7_write_flash_config
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:
	movq	(%r15), %rax
	movq	%rax, 40(%rbx)
	movq	24(%rbx), %rax
	movq	%rax, 32(%rbx)
	movl	16(%rbx), %eax
	movl	%eax, (%rbx)
	cltd
	idivl	4(%rbx)
	movl	%eax, 12(%rbx)
	movq	%rbx, %rdi
	callq	_rmi_f34v7_write_config
	movl	%eax, %ecx
	sarl	$31, %ecx
	andl	%ecx, %eax
	jmp	LBB0_6
LBB0_1:
	movl	$0, 8(%rbx)
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_v7_BL_CONFIG_AREA,8,3          ## @v7_BL_CONFIG_AREA
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_v7_CMD_READ_CONFIG,4,2         ## @v7_CMD_READ_CONFIG
	.no_dead_strip	_rmi_f34v7_write_partition_table
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rmi_f34v7_write_partition_table
_rmi_f34v7_write_partition_table:       ; @rmi_f34v7_write_partition_table
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x19, x0
	ldr	w20, [x0, #48]
Lloh0:
	adrp	x21, _v7_BL_CONFIG_AREA@GOTPAGE
Lloh1:
	ldr	x21, [x21, _v7_BL_CONFIG_AREA@GOTPAGEOFF]
	ldr	x8, [x21]
	str	x8, [x0, #40]
	ldr	w8, [x0, #4]
	mul	w8, w8, w20
	str	w8, [x0]
	ldr	x0, [x0, #56]
	ldr	x1, [x19, #24]
	bl	_devm_kfree
	ldr	x0, [x19, #56]
	ldr	w1, [x19]
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	bl	_devm_kzalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x19]
	str	w8, [x19, #8]
Lloh5:
	adrp	x8, _v7_CMD_READ_CONFIG@GOTPAGE
Lloh6:
	ldr	x8, [x8, _v7_CMD_READ_CONFIG@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_rmi_f34v7_read_blocks
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_rmi_f34v7_erase_config
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_rmi_f34v7_write_flash_config
	tbnz	w0, #31, LBB0_6
; %bb.4:
	ldr	x8, [x21]
	ldr	x9, [x19, #24]
	stp	x9, x8, [x19, #32]
	ldr	w8, [x19, #16]
	str	w8, [x19]
	ldr	w9, [x19, #4]
	sdiv	w8, w8, w9
	str	w8, [x19, #12]
	mov	x0, x19
	bl	_rmi_f34v7_write_config
	cmp	w0, #0
	csel	w0, w0, wzr, lt
	b	LBB0_6
LBB0_5:
	str	wzr, [x19, #8]
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_v7_BL_CONFIG_AREA,8,3          ; @v7_BL_CONFIG_AREA
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_v7_CMD_READ_CONFIG,4,2         ; @v7_CMD_READ_CONFIG
	.no_dead_strip	_rmi_f34v7_write_partition_table
.subsections_via_symbols
