	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function opalflash_attach
_opalflash_attach:                      ## @opalflash_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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%r14d, 24(%rax)
	movl	%r14d, %edi
	callq	_ofw_bus_get_node
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rsi
	leaq	-56(%rbp), %rdx
	movl	%eax, %edi
	movl	$8, %ecx
	callq	_OF_getencprop
	movq	-56(%rbp), %rax
	movq	%rax, 32(%r15)
	leaq	L_.str.1(%rip), %rsi
	leaq	-64(%rbp), %rdx
	movl	%ebx, %edi
	movl	$8, %ecx
	callq	_OF_getencprop
	testq	%rax, %rax
	js	LBB0_1
## %bb.3:
	leaq	L_.str.3(%rip), %rsi
	movl	%ebx, %edi
	callq	_OF_hasprop
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	$1, (%r15)
LBB0_5:
	movq	%r15, %rdi
	callq	_OPALFLASH_LOCK_INIT
	leaq	L_.str.4(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movl	%ebx, %edi
	movl	$16, %ecx
	callq	_OF_getencprop
	testq	%rax, %rax
	js	LBB0_6
## %bb.7:
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_disk_alloc
	movq	%rax, 16(%r15)
	leaq	L_.str.6(%rip), %rcx
	movq	%rcx, (%rax)
	movq	_opalflash_open@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 72(%rax)
	movq	_opalflash_close@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 68(%rax)
	movq	_opalflash_strategy@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 64(%rax)
	movq	_opalflash_ioctl@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 60(%rax)
	movq	_opalflash_getattr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 56(%rax)
	movq	%r15, 48(%rax)
	movq	_DFLTPHYS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 40(%rax)
	movq	-40(%rbp), %rcx
	movq	%rcx, 32(%rax)
	movl	24(%r15), %edi
	callq	_device_get_unit
	movq	16(%r15), %rdi
	movl	%eax, 28(%rdi)
	movq	_FLASH_BLOCKSIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rdi)
	movq	-64(%rbp), %rax
	movq	%rax, 16(%rdi)
	movq	$0, 8(%rdi)
	movq	_DISK_VERSION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_disk_create
	leaq	8(%r15), %rdi
	callq	_bioq_init
	movq	%r15, %rdx
	addq	$4, %rdx
	movq	_opalflash_task@GOTPCREL(%rip), %rdi
	leaq	L_.str.7(%rip), %r9
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_kproc_create
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.5(%rip), %rsi
LBB0_2:
	movl	%r14d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_8:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_10
## %bb.9:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ibm,opal-id"

L_.str.1:                               ## @.str.1
	.asciz	"ibm,flash-block-size"

L_.str.2:                               ## @.str.2
	.asciz	"Cannot determine flash block size.\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.3:                               ## @.str.3
	.asciz	"no-erase"

L_.str.4:                               ## @.str.4
	.asciz	"reg"

L_.str.5:                               ## @.str.5
	.asciz	"Unable to get flash size.\n"

L_.str.6:                               ## @.str.6
	.asciz	"opalflash"

	.comm	_opalflash_open,4,2             ## @opalflash_open
	.comm	_opalflash_close,4,2            ## @opalflash_close
	.comm	_opalflash_strategy,4,2         ## @opalflash_strategy
	.comm	_opalflash_ioctl,4,2            ## @opalflash_ioctl
	.comm	_opalflash_getattr,4,2          ## @opalflash_getattr
	.comm	_DFLTPHYS,4,2                   ## @DFLTPHYS
	.comm	_FLASH_BLOCKSIZE,4,2            ## @FLASH_BLOCKSIZE
	.comm	_DISK_VERSION,4,2               ## @DISK_VERSION
	.comm	_opalflash_task,4,2             ## @opalflash_task
L_.str.7:                               ## @.str.7
	.asciz	"task: OPAL Flash"

	.no_dead_strip	_opalflash_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function opalflash_attach
_opalflash_attach:                      ; @opalflash_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	bl	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #24]
	mov	x0, x20
	bl	_ofw_bus_get_node
	mov	x21, x0
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #8
	mov	w3, #8
	bl	_OF_getencprop
	ldr	x8, [sp, #8]
	str	x8, [x19, #32]
Lloh5:
	adrp	x1, l_.str.1@PAGE
Lloh6:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x2, sp, #16
	mov	x0, x21
	mov	w3, #8
	bl	_OF_getencprop
	tbnz	x0, #63, LBB0_5
; %bb.1:
Lloh7:
	adrp	x1, l_.str.3@PAGE
Lloh8:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x21
	bl	_OF_hasprop
	cbnz	w0, LBB0_3
; %bb.2:
	mov	w8, #1
	str	w8, [x19]
LBB0_3:
	mov	x0, x19
	bl	_OPALFLASH_LOCK_INIT
Lloh9:
	adrp	x1, l_.str.4@PAGE
Lloh10:
	add	x1, x1, l_.str.4@PAGEOFF
	add	x2, sp, #24
	mov	x0, x21
	mov	w3, #16
	bl	_OF_getencprop
	tbnz	x0, #63, LBB0_6
; %bb.4:
	bl	_disk_alloc
Lloh11:
	adrp	x8, l_.str.6@PAGE
Lloh12:
	add	x8, x8, l_.str.6@PAGEOFF
	str	x0, [x19, #16]
	str	x8, [x0]
Lloh13:
	adrp	x8, _opalflash_open@GOTPAGE
Lloh14:
	ldr	x8, [x8, _opalflash_open@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	str	w8, [x0, #72]
Lloh16:
	adrp	x8, _opalflash_close@GOTPAGE
Lloh17:
	ldr	x8, [x8, _opalflash_close@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x9, _opalflash_strategy@GOTPAGE
Lloh20:
	ldr	x9, [x9, _opalflash_strategy@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #64]
Lloh22:
	adrp	x8, _opalflash_ioctl@GOTPAGE
Lloh23:
	ldr	x8, [x8, _opalflash_ioctl@GOTPAGEOFF]
Lloh24:
	adrp	x9, _opalflash_getattr@GOTPAGE
Lloh25:
	ldr	x9, [x9, _opalflash_getattr@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #56]
Lloh28:
	adrp	x8, _DFLTPHYS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _DFLTPHYS@GOTPAGEOFF]
	str	x19, [x0, #48]
Lloh30:
	ldr	w8, [x8]
	str	w8, [x0, #40]
	ldr	x8, [sp, #32]
	str	x8, [x0, #32]
	ldr	w0, [x19, #24]
	bl	_device_get_unit
	ldr	x8, [x19, #16]
Lloh31:
	adrp	x9, _FLASH_BLOCKSIZE@GOTPAGE
Lloh32:
	ldr	x9, [x9, _FLASH_BLOCKSIZE@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	stp	w9, w0, [x8, #24]
	ldr	x9, [sp, #16]
	stp	xzr, x9, [x8, #8]
Lloh34:
	adrp	x9, _DISK_VERSION@GOTPAGE
Lloh35:
	ldr	x9, [x9, _DISK_VERSION@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_disk_create
	add	x0, x19, #8
	bl	_bioq_init
	add	x2, x19, #4
Lloh37:
	adrp	x0, _opalflash_task@GOTPAGE
Lloh38:
	ldr	x0, [x0, _opalflash_task@GOTPAGEOFF]
Lloh39:
	adrp	x5, l_.str.7@PAGE
Lloh40:
	add	x5, x5, l_.str.7@PAGEOFF
	mov	x1, x19
	mov	w3, #0
	mov	w4, #0
	bl	_kproc_create
	mov	w0, #0
	b	LBB0_8
LBB0_5:
Lloh41:
	adrp	x1, l_.str.2@PAGE
Lloh42:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:
Lloh43:
	adrp	x1, l_.str.5@PAGE
Lloh44:
	add	x1, x1, l_.str.5@PAGEOFF
LBB0_7:
	mov	x0, x20
	bl	_device_printf
Lloh45:
	adrp	x8, _ENXIO@GOTPAGE
Lloh46:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
LBB0_8:
	ldr	x8, [sp, #40]
Lloh48:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh49:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.9:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh26
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpAdd	Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ibm,opal-id"

l_.str.1:                               ; @.str.1
	.asciz	"ibm,flash-block-size"

l_.str.2:                               ; @.str.2
	.asciz	"Cannot determine flash block size.\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.3:                               ; @.str.3
	.asciz	"no-erase"

l_.str.4:                               ; @.str.4
	.asciz	"reg"

l_.str.5:                               ; @.str.5
	.asciz	"Unable to get flash size.\n"

l_.str.6:                               ; @.str.6
	.asciz	"opalflash"

	.comm	_opalflash_open,4,2             ; @opalflash_open
	.comm	_opalflash_close,4,2            ; @opalflash_close
	.comm	_opalflash_strategy,4,2         ; @opalflash_strategy
	.comm	_opalflash_ioctl,4,2            ; @opalflash_ioctl
	.comm	_opalflash_getattr,4,2          ; @opalflash_getattr
	.comm	_DFLTPHYS,4,2                   ; @DFLTPHYS
	.comm	_FLASH_BLOCKSIZE,4,2            ; @FLASH_BLOCKSIZE
	.comm	_DISK_VERSION,4,2               ; @DISK_VERSION
	.comm	_opalflash_task,4,2             ; @opalflash_task
l_.str.7:                               ; @.str.7
	.asciz	"task: OPAL Flash"

	.no_dead_strip	_opalflash_attach
.subsections_via_symbols
