	.file	"extr_if_bce.c_bce_nvram_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	bce_nvram_read, @function
bce_nvram_read:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13d, esi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	ebx, ecx
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	edi, DWORD PTR BCE_VERBOSE_NVRAM[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	call	DBENTER@PLT
	test	ebx, ebx
	jne	.L41
.L2:
	mov	edi, DWORD PTR BCE_VERBOSE_NVRAM[rip]
	call	DBEXIT@PLT
	mov	eax, ebx
.L1:
	mov	rsi, QWORD PTR 40[rsp]
	xor	rsi, QWORD PTR fs:40
	jne	.L42
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L41:
	.cfi_restore_state
	mov	rdi, r12
	call	bce_acquire_nvram_lock@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L17
	mov	rdi, r12
	call	bce_enable_nvram_access@PLT
	mov	r8d, r13d
	and	r8d, 3
	jne	.L43
.L3:
	mov	r14d, ebx
	and	r14d, 3
	je	.L7
	mov	eax, 4
	add	ebx, 4
	sub	eax, r14d
	and	ebx, -4
	mov	r14d, eax
.L7:
	cmp	ebx, 4
	je	.L44
	test	ebx, ebx
	jle	.L18
	test	r8d, r8d
	mov	rdx, rbp
	mov	esi, r13d
	mov	rdi, r12
	cmove	r15d, DWORD PTR BCE_NVM_COMMAND_FIRST[rip]
	add	rbp, 16
	mov	ecx, r15d
	lea	r15d, 4[r13]
	call	bce_nvram_read_dword@PLT
	test	eax, eax
	jne	.L38
	cmp	ebx, 8
	jle	.L12
	add	ebx, r13d
	.p2align 4,,10
	.p2align 3
.L13:
	mov	rdx, rbp
	mov	esi, r15d
	xor	ecx, ecx
	mov	rdi, r12
	call	bce_nvram_read_dword@PLT
	add	r15d, 4
	mov	edx, ebx
	add	rbp, 16
	sub	edx, r15d
	cmp	edx, 4
	jle	.L12
	test	eax, eax
	je	.L13
.L38:
	mov	ebx, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L17:
	mov	ebx, eax
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L43:
	mov	r14d, 4
	mov	ecx, DWORD PTR BCE_NVM_COMMAND_FIRST[rip]
	and	r13d, -4
	sub	r14d, r8d
	cmp	ebx, r14d
	jg	.L4
	or	ecx, DWORD PTR BCE_NVM_COMMAND_LAST[rip]
	mov	r14d, ebx
.L4:
	lea	rdx, 16[rsp]
	mov	esi, r13d
	mov	rdi, r12
	mov	DWORD PTR 12[rsp], r8d
	mov	DWORD PTR 8[rsp], ecx
	mov	QWORD PTR [rsp], rdx
	call	bce_nvram_read_dword@PLT
	test	eax, eax
	jne	.L1
	movsx	r8, DWORD PTR 12[rsp]
	mov	rdx, QWORD PTR [rsp]
	mov	rdi, rbp
	add	r13d, 4
	sub	ebx, r14d
	lea	rsi, [rdx+r8*4]
	mov	edx, r14d
	call	memcpy@PLT
	mov	ecx, DWORD PTR 8[rsp]
	movsx	rax, r14d
	lea	rbp, 0[rbp+rax*4]
	mov	r8d, ecx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L44:
	mov	ecx, DWORD PTR BCE_NVM_COMMAND_LAST[rip]
	test	r8d, r8d
	je	.L45
.L9:
	lea	r15, 16[rsp]
	mov	esi, r13d
	mov	rdi, r12
	mov	rdx, r15
	call	bce_nvram_read_dword@PLT
	mov	edx, 4
	mov	rsi, r15
	mov	rdi, rbp
	sub	edx, r14d
	mov	ebx, eax
	call	memcpy@PLT
.L10:
	mov	rdi, r12
	call	bce_disable_nvram_access@PLT
	mov	rdi, r12
	call	bce_release_nvram_lock@PLT
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L45:
	or	ecx, DWORD PTR BCE_NVM_COMMAND_FIRST[rip]
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L18:
	xor	ebx, ebx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L12:
	test	eax, eax
	jne	.L38
	lea	r13, 16[rsp]
	mov	ecx, DWORD PTR BCE_NVM_COMMAND_LAST[rip]
	mov	esi, r15d
	mov	rdi, r12
	mov	rdx, r13
	call	bce_nvram_read_dword@PLT
	mov	edx, 4
	mov	rsi, r13
	mov	rdi, rbp
	sub	edx, r14d
	mov	ebx, eax
	call	memcpy@PLT
	jmp	.L10
.L42:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	bce_nvram_read, .-bce_nvram_read
	.comm	BCE_VERBOSE_NVRAM,4,4
	.comm	BCE_NVM_COMMAND_LAST,4,4
	.comm	BCE_NVM_COMMAND_FIRST,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_if_bce.c_bce_nvram_read.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	bce_nvram_read, %function
bce_nvram_read:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r4, r3
	ldr	r8, .L39
	ldr	r3, .L39+4
	sub	sp, sp, #36
	mov	r6, r0
	ldr	r0, [r8]
	mov	r7, r1
	mov	r5, r2
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	DBENTER
	cmp	r4, #0
	bne	.L34
.L2:
	ldr	r0, [r8]
	bl	DBEXIT
	mov	r0, r4
.L1:
	ldr	r3, .L39+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L35
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L34:
	mov	r0, r6
	bl	bce_acquire_nvram_lock
	subs	r10, r0, #0
	movne	r4, r10
	bne	.L2
	and	r9, r7, #3
	mov	r0, r6
	bl	bce_enable_nvram_access
	cmp	r9, #0
	mov	r3, r9
	bne	.L36
.L3:
	ands	r9, r4, #3
	addne	r4, r4, #4
	bicne	r4, r4, #3
	rsbne	r9, r9, #4
	cmp	r4, #4
	beq	.L37
	cmp	r4, #0
	movle	r4, #0
	ble	.L10
	cmp	r3, #0
	ldreq	r3, .L39+8
	mov	r2, r5
	ldreq	r10, [r3]
	mov	r1, r7
	mov	r3, r10
	mov	r0, r6
	bl	bce_nvram_read_dword
	cmp	r4, #8
	movle	r3, #0
	movgt	r3, #1
	cmp	r0, #0
	movne	r3, #0
	cmp	r3, #0
	add	r5, r5, #16
	add	r10, r7, #4
	beq	.L12
	add	r4, r4, r7
.L13:
	mov	r3, #0
	mov	r2, r5
	mov	r1, r10
	mov	r0, r6
	bl	bce_nvram_read_dword
	add	r10, r10, #4
	sub	r3, r4, r10
	cmp	r3, #4
	movle	r3, #0
	movgt	r3, #1
	cmp	r0, #0
	movne	r3, #0
	cmp	r3, #0
	add	r5, r5, #16
	bne	.L13
.L12:
	cmp	r0, #0
	movne	r4, r0
	beq	.L38
.L10:
	mov	r0, r6
	bl	bce_disable_nvram_access
	mov	r0, r6
	bl	bce_release_nvram_lock
	b	.L2
.L36:
	rsb	fp, r9, #4
	cmp	r4, fp
	ldrle	r2, .L39+12
	ldr	r3, .L39+8
	ldrle	r2, [r2]
	ldr	r3, [r3]
	bic	r7, r7, #3
	orrle	r3, r3, r2
	mov	r1, r7
	mov	r0, r6
	add	r2, sp, #12
	movle	fp, r4
	str	r3, [sp, #4]
	bl	bce_nvram_read_dword
	cmp	r0, #0
	bne	.L1
	add	r3, sp, #12
	mov	r0, r5
	add	r1, r3, r9, lsl #2
	mov	r2, fp
	bl	memcpy
	add	r7, r7, #4
	ldr	r3, [sp, #4]
	sub	r4, r4, fp
	add	r5, r5, fp, lsl #2
	b	.L3
.L37:
	mov	r1, r7
	ldr	r2, .L39+12
	cmp	r3, #0
	ldr	r3, [r2]
	ldreq	r2, .L39+8
	ldreq	r2, [r2]
	orreq	r3, r3, r2
.L32:
	add	r2, sp, #12
	mov	r0, r6
	bl	bce_nvram_read_dword
	add	r1, sp, #12
	mov	r4, r0
	rsb	r2, r9, #4
	mov	r0, r5
	bl	memcpy
	b	.L10
.L38:
	ldr	r3, .L39+12
	mov	r1, r10
	ldr	r3, [r3]
	b	.L32
.L35:
	bl	__stack_chk_fail
.L40:
	.align	2
.L39:
	.word	BCE_VERBOSE_NVRAM
	.word	.LC0
	.word	BCE_NVM_COMMAND_FIRST
	.word	BCE_NVM_COMMAND_LAST
	.size	bce_nvram_read, .-bce_nvram_read
	.comm	BCE_VERBOSE_NVRAM,4,4
	.comm	BCE_NVM_COMMAND_LAST,4,4
	.comm	BCE_NVM_COMMAND_FIRST,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
