	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocotp_attach
_ocotp_attach:                          ## @ocotp_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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, %rbx
	movl	%r15d, 8(%rax)
	movl	$0, -28(%rbp)
	movq	_SYS_RES_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-28(%rbp), %rdx
	movl	%r15d, %edi
	callq	_bus_alloc_resource_any
	movq	%rax, (%rbx)
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_ocotp_sc@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	_ocotp_regs@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	xorl	%r14d, %r14d
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.2:
	movq	_ocotp_size@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_pmap_unmapdev
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.5:
	movl	%r15d, %edi
	callq	_ocotp_detach
	jmp	LBB0_6
LBB0_4:
	xorl	%r14d, %r14d
LBB0_6:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_MEMORY,4,2             ## @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_ocotp_sc,8,3                   ## @ocotp_sc
	.comm	_ocotp_regs,8,3                 ## @ocotp_regs
	.comm	_ocotp_size,4,2                 ## @ocotp_size
	.no_dead_strip	_ocotp_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocotp_attach
_ocotp_attach:                          ; @ocotp_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
	str	w19, [x0, #8]
	str	wzr, [sp, #12]
Lloh0:
	adrp	x8, _SYS_RES_MEMORY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_MEMORY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _RF_ACTIVE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RF_ACTIVE@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	add	x2, sp, #12
	mov	x0, x19
	bl	_bus_alloc_resource_any
	str	x0, [x20]
	cbz	x0, LBB0_4
; %bb.1:
Lloh6:
	adrp	x8, _ocotp_sc@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ocotp_sc@GOTPAGEOFF]
Lloh8:
	str	x20, [x8]
Lloh9:
	adrp	x8, _ocotp_regs@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ocotp_regs@GOTPAGEOFF]
Lloh11:
	ldr	x0, [x8]
	cbz	x0, LBB0_3
; %bb.2:
Lloh12:
	adrp	x8, _ocotp_size@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ocotp_size@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_pmap_unmapdev
LBB0_3:
	mov	w20, #0
	b	LBB0_6
LBB0_4:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
Lloh17:
	adrp	x8, _ENXIO@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh19:
	ldr	w20, [x8]
	cbz	w20, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_ocotp_detach
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_MEMORY,4,2             ; @SYS_RES_MEMORY
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Cannot allocate memory resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_ocotp_sc,8,3                   ; @ocotp_sc
	.comm	_ocotp_regs,8,3                 ; @ocotp_regs
	.comm	_ocotp_size,4,2                 ; @ocotp_size
	.no_dead_strip	_ocotp_attach
.subsections_via_symbols
