	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opal_nvram_attach
_opal_nvram_attach:                     ## @opal_nvram_attach
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	callq	_ofw_bus_get_node
	movl	%eax, %ebx
	movl	%r14d, %edi
	callq	_device_get_softc
	movq	%rax, %r12
	movl	%r14d, 24(%rax)
	leaq	20(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	movl	$4, %ecx
	callq	_OF_getencprop
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	_NVRAM_BUFSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_M_DEVBUF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_M_WAITOK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movl	$0, (%rsp)
	xorl	%r15d, %r15d
	xorl	%ecx, %ecx
	callq	_contigmalloc
	movq	%rax, 8(%r12)
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movl	%eax, %edi
	callq	_pmap_kextract
	movl	%eax, 16(%r12)
	movq	_opal_nvram_cdevsw@GOTPCREL(%rip), %rdi
	leaq	L_.str.2(%rip), %r9
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$384, %r8d                      ## imm = 0x180
	callq	_make_dev
	movq	%rax, (%r12)
	movq	%r12, (%rax)
	jmp	LBB0_5
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edi
	callq	_device_printf
LBB0_1:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_5:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"#bytes"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_NVRAM_BUFSIZE,4,2              ## @NVRAM_BUFSIZE
	.comm	_M_DEVBUF,4,2                   ## @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ## @M_WAITOK
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"No memory for buffer.\n"

	.comm	_opal_nvram_cdevsw,4,2          ## @opal_nvram_cdevsw
L_.str.2:                               ## @.str.2
	.asciz	"nvram"

	.no_dead_strip	_opal_nvram_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opal_nvram_attach
_opal_nvram_attach:                     ; @opal_nvram_attach
	.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	x20, x0
	bl	_ofw_bus_get_node
	mov	x21, x0
	mov	x0, x20
	bl	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #24]
	add	x2, x0, #20
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	w3, #4
	bl	_OF_getencprop
	tbnz	w0, #31, LBB0_4
; %bb.1:
Lloh2:
	adrp	x8, _NVRAM_BUFSIZE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _NVRAM_BUFSIZE@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
Lloh5:
	adrp	x8, _M_DEVBUF@GOTPAGE
Lloh6:
	ldr	x8, [x8, _M_DEVBUF@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
Lloh8:
	adrp	x8, _M_WAITOK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _M_WAITOK@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh13:
	ldr	w4, [x8]
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w5, [x8]
	mov	w3, #0
	mov	w6, #0
	bl	_contigmalloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_3
; %bb.2:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_pmap_kextract
	str	w0, [x19, #16]
Lloh17:
	adrp	x0, _opal_nvram_cdevsw@GOTPAGE
Lloh18:
	ldr	x0, [x0, _opal_nvram_cdevsw@GOTPAGEOFF]
Lloh19:
	adrp	x5, l_.str.2@PAGE
Lloh20:
	add	x5, x5, l_.str.2@PAGEOFF
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #384
	bl	_make_dev
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	str	x19, [x8]
	b	LBB0_5
LBB0_3:
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_device_printf
LBB0_4:
Lloh23:
	adrp	x8, _ENXIO@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
LBB0_5:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"#bytes"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_NVRAM_BUFSIZE,4,2              ; @NVRAM_BUFSIZE
	.comm	_M_DEVBUF,4,2                   ; @M_DEVBUF
	.comm	_M_WAITOK,4,2                   ; @M_WAITOK
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"No memory for buffer.\n"

	.comm	_opal_nvram_cdevsw,4,2          ; @opal_nvram_cdevsw
l_.str.2:                               ; @.str.2
	.asciz	"nvram"

	.no_dead_strip	_opal_nvram_attach
.subsections_via_symbols
