	.file	"extr_opal_nvram.c_opal_nvram_attach.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"#bytes"
.LC1:
	.string	"No memory for buffer.\n"
.LC2:
	.string	"nvram"
	.text
	.p2align 4
	.type	opal_nvram_attach, @function
opal_nvram_attach:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, edi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	ofw_bus_get_node@PLT
	mov	edi, ebp
	mov	r12d, eax
	call	device_get_softc@PLT
	mov	ecx, 4
	lea	rsi, .LC0[rip]
	mov	edi, r12d
	mov	DWORD PTR 24[rax], ebp
	lea	rdx, 20[rax]
	mov	rbx, rax
	call	OF_getencprop@PLT
	test	eax, eax
	js	.L6
	sub	rsp, 8
	.cfi_def_cfa_offset 40
	mov	edx, DWORD PTR M_WAITOK[rip]
	xor	ecx, ecx
	mov	r9d, DWORD PTR PAGE_SIZE[rip]
	mov	r8d, DWORD PTR BUS_SPACE_MAXADDR[rip]
	mov	esi, DWORD PTR M_DEVBUF[rip]
	push	0
	.cfi_def_cfa_offset 48
	mov	edi, DWORD PTR NVRAM_BUFSIZE[rip]
	call	contigmalloc@PLT
	mov	QWORD PTR 8[rbx], rax
	pop	rdx
	.cfi_def_cfa_offset 40
	pop	rcx
	.cfi_def_cfa_offset 32
	test	rax, rax
	je	.L8
	mov	edi, eax
	call	pmap_kextract@PLT
	lea	r9, .LC2[rip]
	xor	ecx, ecx
	xor	edx, edx
	mov	DWORD PTR 16[rbx], eax
	mov	r8d, 384
	xor	esi, esi
	lea	rdi, opal_nvram_cdevsw[rip]
	call	make_dev@PLT
	mov	QWORD PTR [rbx], rax
	mov	QWORD PTR [rax], rbx
	xor	eax, eax
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	lea	rsi, .LC1[rip]
	mov	edi, ebp
	call	device_printf@PLT
.L6:
	pop	rbx
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR ENXIO[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	opal_nvram_attach, .-opal_nvram_attach
	.comm	opal_nvram_cdevsw,4,4
	.comm	PAGE_SIZE,4,4
	.comm	NVRAM_BUFSIZE,4,4
	.comm	M_WAITOK,4,4
	.comm	M_DEVBUF,4,4
	.comm	ENXIO,4,4
	.comm	BUS_SPACE_MAXADDR,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_opal_nvram.c_opal_nvram_attach.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"#bytes\000"
	.align	2
.LC1:
	.ascii	"No memory for buffer.\012\000"
	.align	2
.LC2:
	.ascii	"nvram\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	opal_nvram_attach, %function
opal_nvram_attach:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	sub	sp, sp, #16
	mov	r6, r0
	bl	ofw_bus_get_node
	mov	r5, r0
	mov	r0, r6
	bl	device_get_softc
	mov	r4, r0
	mov	r3, #4
	mov	r0, r5
	ldr	r1, .L9
	str	r6, [r4, #16]
	add	r2, r4, #12
	bl	OF_getencprop
	cmp	r0, #0
	blt	.L6
	mov	r5, #0
	ldr	r2, .L9+4
	ldr	r3, .L9+8
	ldr	ip, [r2]
	ldr	r3, [r3]
	ldr	r2, .L9+12
	stm	sp, {r3, ip}
	ldr	r1, .L9+16
	ldr	r0, .L9+20
	str	r5, [sp, #8]
	mov	r3, r5
	ldr	r2, [r2]
	ldr	r1, [r1]
	ldr	r0, [r0]
	bl	contigmalloc
	cmp	r0, r5
	str	r0, [r4, #4]
	beq	.L8
	bl	pmap_kextract
	mov	r1, #384
	ldr	r2, .L9+24
	str	r0, [r4, #8]
	mov	r3, r5
	stm	sp, {r1, r2}
	ldr	r0, .L9+28
	mov	r2, r5
	mov	r1, r5
	bl	make_dev
	mov	r3, r0
	mov	r0, r5
	str	r3, [r4]
	str	r4, [r3]
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L8:
	mov	r0, r6
	ldr	r1, .L9+32
	bl	device_printf
.L6:
	ldr	r3, .L9+36
	ldr	r0, [r3]
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	PAGE_SIZE
	.word	BUS_SPACE_MAXADDR
	.word	M_WAITOK
	.word	M_DEVBUF
	.word	NVRAM_BUFSIZE
	.word	.LC2
	.word	opal_nvram_cdevsw
	.word	.LC1
	.word	ENXIO
	.size	opal_nvram_attach, .-opal_nvram_attach
	.comm	opal_nvram_cdevsw,4,4
	.comm	PAGE_SIZE,4,4
	.comm	NVRAM_BUFSIZE,4,4
	.comm	M_WAITOK,4,4
	.comm	M_DEVBUF,4,4
	.comm	ENXIO,4,4
	.comm	BUS_SPACE_MAXADDR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
