	.file	"extr_nvram.c_pSeries_nvram_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	pSeries_nvram_read, @function
pSeries_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
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 8[rsp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	eax, DWORD PTR nvram_size[rip]
	test	eax, eax
	je	.L2
	mov	rcx, QWORD PTR RTAS_UNKNOWN_SERVICE[rip]
	cmp	QWORD PTR nvram_fetch[rip], rcx
	je	.L2
	mov	r12d, DWORD PTR [rdx]
	mov	r13, rdx
	xor	r14d, r14d
	cmp	eax, r12d
	jbe	.L1
	mov	edx, r12d
	mov	ecx, eax
	mov	rbx, rsi
	add	rdx, rsi
	cmp	rdx, rcx
	ja	.L20
	xor	esi, esi
	lea	rdi, nvram_lock[rip]
	call	spin_lock_irqsave@PLT
	test	rbx, rbx
	je	.L7
.L6:
	mov	rbp, QWORD PTR 8[rsp]
	lea	r14, 20[rsp]
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L22:
	movsx	rax, DWORD PTR 20[rsp]
	cmp	r15, rax
	jne	.L8
	mov	esi, DWORD PTR nvram_buf[rip]
	mov	rdi, rbp
	mov	rdx, r15
	add	rbp, r15
	add	r12d, r15d
	call	memcpy@PLT
	sub	rbx, r15
	je	.L21
.L10:
	mov	edi, DWORD PTR nvram_buf[rip]
	cmp	QWORD PTR NVRW_CNT[rip], rbx
	mov	r15, rbx
	cmovbe	r15, QWORD PTR NVRW_CNT[rip]
	call	__pa@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 104
	mov	rcx, r14
	mov	r8d, r12d
	push	r15
	.cfi_def_cfa_offset 112
	mov	edx, 2
	mov	r9d, eax
	mov	esi, 3
	mov	rdi, QWORD PTR nvram_fetch[rip]
	call	rtas_call@PLT
	pop	rdx
	.cfi_def_cfa_offset 104
	pop	rcx
	.cfi_def_cfa_offset 96
	test	rax, rax
	je	.L22
.L8:
	xor	esi, esi
	lea	rdi, nvram_lock[rip]
	call	spin_unlock_irqrestore@PLT
	mov	r14d, DWORD PTR EIO[rip]
	neg	r14d
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L23
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	eax, r14d
	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
.L2:
	.cfi_restore_state
	mov	r14d, DWORD PTR ENODEV[rip]
	neg	r14d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L20:
	mov	ebx, eax
	xor	esi, esi
	lea	rdi, nvram_lock[rip]
	sub	ebx, r12d
	call	spin_lock_irqsave@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L21:
	mov	r14d, ebp
	sub	r14d, DWORD PTR 8[rsp]
.L7:
	xor	esi, esi
	lea	rdi, nvram_lock[rip]
	call	spin_unlock_irqrestore@PLT
	mov	DWORD PTR 0[r13], r12d
	jmp	.L1
.L23:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	pSeries_nvram_read, .-pSeries_nvram_read
	.comm	nvram_size,4,4
	.comm	nvram_lock,4,4
	.comm	nvram_fetch,8,8
	.comm	nvram_buf,4,4
	.comm	RTAS_UNKNOWN_SERVICE,8,8
	.comm	NVRW_CNT,8,8
	.comm	ENODEV,4,4
	.comm	EIO,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_nvram.c_pSeries_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	pSeries_nvram_read, %function
pSeries_nvram_read:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	ldr	r3, .L24
	sub	sp, sp, #36
	ldr	r3, [r3]
	str	r2, [sp, #16]
	ldr	r2, .L24+4
	str	r0, [sp, #20]
	cmp	r3, #0
	ldr	r2, [r2]
	str	r2, [sp, #28]
	mov	r2,#0
	beq	.L2
	ldr	r9, .L24+8
	ldr	r2, .L24+12
	mov	r5, r1
	ldr	r2, [r2]
	ldr	r1, [r9]
	cmp	r1, r2
	beq	.L2
	ldr	r2, [sp, #16]
	ldr	r7, [r2]
	cmp	r3, r7
	movls	r5, #0
	bls	.L1
	add	r2, r7, r5
	cmp	r3, r2
	mov	r1, #0
	ldr	r0, .L24+16
	bcc	.L20
	bl	spin_lock_irqsave
	cmp	r5, #0
	beq	.L7
.L6:
	ldr	r6, [sp, #20]
	ldr	fp, .L24+20
	ldr	r8, .L24+24
	b	.L10
.L22:
	ldr	r3, [sp, #24]
	cmp	r4, r3
	bne	.L8
	mov	r0, r6
	mov	r2, r4
	ldr	r1, [r8]
	bl	memcpy
	subs	r5, r5, r4
	add	r7, r7, r4
	add	r6, r6, r4
	beq	.L21
.L10:
	ldr	r4, [fp]
	ldr	r0, [r8]
	cmp	r5, r4
	movcc	r4, r5
	ldr	r10, [r9]
	bl	__pa
	mov	r2, #2
	stmib	sp, {r0, r4}
	mov	r1, #3
	mov	r0, r10
	str	r7, [sp]
	add	r3, sp, #24
	bl	rtas_call
	cmp	r0, #0
	beq	.L22
.L8:
	mov	r1, #0
	ldr	r0, .L24+16
	bl	spin_unlock_irqrestore
	ldr	r3, .L24+28
	ldr	r5, [r3]
	rsb	r5, r5, #0
.L1:
	ldr	r3, .L24+4
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	mov	r0, r5
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r3, .L24+32
	ldr	r5, [r3]
	rsb	r5, r5, #0
	b	.L1
.L20:
	sub	r5, r3, r7
	bl	spin_lock_irqsave
	b	.L6
.L21:
	ldr	r3, [sp, #20]
	sub	r5, r6, r3
.L7:
	mov	r1, #0
	ldr	r0, .L24+16
	bl	spin_unlock_irqrestore
	ldr	r3, [sp, #16]
	str	r7, [r3]
	b	.L1
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	nvram_size
	.word	.LC0
	.word	nvram_fetch
	.word	RTAS_UNKNOWN_SERVICE
	.word	nvram_lock
	.word	NVRW_CNT
	.word	nvram_buf
	.word	EIO
	.word	ENODEV
	.size	pSeries_nvram_read, .-pSeries_nvram_read
	.comm	nvram_size,4,4
	.comm	nvram_lock,4,4
	.comm	nvram_fetch,4,4
	.comm	nvram_buf,4,4
	.comm	RTAS_UNKNOWN_SERVICE,4,4
	.comm	NVRW_CNT,4,4
	.comm	ENODEV,4,4
	.comm	EIO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
