	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function imx_wdog_attach
_imx_wdog_attach:                       ## @imx_wdog_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	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	callq	_device_get_softc
	movq	%rax, %r15
	movl	%ebx, 4(%rax)
	movq	_imx_wdog_spec@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	16(%r15), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_11
LBB0_2:
	leaq	24(%r15), %r14
	movl	%ebx, %edi
	callq	_device_get_nameunit
	movq	_MTX_DEF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_mtx_init
	movl	4(%r15), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_ofw_bus_has_prop
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_WDOG_CR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_WDOG_CR_WDT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	callq	_RD2
	orl	%eax, %ebx
	movq	%r15, %rdi
	movl	%r14d, %esi
	movl	%ebx, %edx
	callq	_WR2
	movl	4(%r15), %edi
	movq	16(%r15), %rax
	movq	_IRQRES@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_INTR_TYPE_MISC@GOTPCREL(%rip), %rsi
	movq	_INTR_MPSAFE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rsi), %edx
	movl	(%rax,%rcx,4), %esi
	movq	_imx_wdog_intr@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rax
	addq	$8, %rax
	movq	%rax, (%rsp)
	xorl	%r8d, %r8d
	movq	%r15, %r9
	callq	_bus_setup_intr
	movq	_WDOG_ICR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_WDOG_ICR_WIE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	callq	_WR2
LBB0_4:
	movq	_WDOG_MCR_REG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_RD2
	movq	_WDOG_MCR_PDE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_6
## %bb.5:
	movl	$1, (%r15)
LBB0_6:
	movq	_watchdog_list@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_imx_watchdog@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	callq	_EVENTHANDLER_REGISTER
	movl	4(%r15), %edi
	callq	_ofw_bus_get_node
	leaq	L_.str.3(%rip), %rsi
	leaq	-28(%rbp), %rdx
	movl	%eax, %edi
	movl	$4, %ecx
	callq	_OF_getencprop
	cmpl	$4, %eax
	jne	LBB0_10
## %bb.7:
	movl	-28(%rbp), %edx
	leal	-129(%rdx), %eax
	cmpl	$-129, %eax
	ja	LBB0_9
## %bb.8:
	movl	4(%r15), %edi
	leaq	L_.str.4(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_device_printf
	movl	$128, -28(%rbp)
	movl	$128, %edx
LBB0_9:
	movq	%r15, %rdi
	movl	%edx, %esi
	callq	_imx_wdog_enable
	movl	4(%r15), %edi
	movl	-28(%rbp), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
LBB0_10:
	movl	4(%r15), %edi
	callq	_device_busy
LBB0_11:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_imx_wdog_spec,4,2              ## @imx_wdog_spec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
L_.str.1:                               ## @.str.1
	.asciz	"imx_wdt"

	.comm	_MTX_DEF,4,2                    ## @MTX_DEF
L_.str.2:                               ## @.str.2
	.asciz	"fsl,ext-reset-output"

	.comm	_WDOG_CR_REG,4,2                ## @WDOG_CR_REG
	.comm	_WDOG_CR_WDT,4,2                ## @WDOG_CR_WDT
	.comm	_IRQRES,8,3                     ## @IRQRES
	.comm	_INTR_TYPE_MISC,4,2             ## @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ## @INTR_MPSAFE
	.comm	_imx_wdog_intr,4,2              ## @imx_wdog_intr
	.comm	_WDOG_ICR_REG,4,2               ## @WDOG_ICR_REG
	.comm	_WDOG_ICR_WIE,4,2               ## @WDOG_ICR_WIE
	.comm	_WDOG_MCR_REG,4,2               ## @WDOG_MCR_REG
	.comm	_WDOG_MCR_PDE,4,2               ## @WDOG_MCR_PDE
	.comm	_watchdog_list,4,2              ## @watchdog_list
	.comm	_imx_watchdog,4,2               ## @imx_watchdog
L_.str.3:                               ## @.str.3
	.asciz	"timeout-sec"

L_.str.4:                               ## @.str.4
	.asciz	"ERROR: bad timeout-sec property value %u, using 128\n"

L_.str.5:                               ## @.str.5
	.asciz	"watchdog enabled using timeout-sec property value %u\n"

	.no_dead_strip	_imx_wdog_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function imx_wdog_attach
_imx_wdog_attach:                       ; @imx_wdog_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	_device_get_softc
	mov	x19, x0
	str	w20, [x0, #4]
Lloh0:
	adrp	x8, _imx_wdog_spec@GOTPAGE
Lloh1:
	ldr	x8, [x8, _imx_wdog_spec@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	x2, [x0, #16]
	mov	x0, x20
	bl	_bus_alloc_resources
	cbz	x0, LBB0_2
; %bb.1:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	bl	_device_printf
Lloh5:
	adrp	x8, _ENXIO@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	b	LBB0_11
LBB0_2:
	add	x21, x19, #24
	mov	x0, x20
	bl	_device_get_nameunit
	mov	x1, x0
Lloh8:
	adrp	x8, _MTX_DEF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MTX_DEF@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x2, l_.str.1@PAGE
Lloh12:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_mtx_init
	ldr	w0, [x19, #4]
Lloh13:
	adrp	x1, l_.str.2@PAGE
Lloh14:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_ofw_bus_has_prop
	cbz	x0, LBB0_4
; %bb.3:
Lloh15:
	adrp	x8, _WDOG_CR_REG@GOTPAGE
Lloh16:
	ldr	x8, [x8, _WDOG_CR_REG@GOTPAGEOFF]
Lloh17:
	ldr	w20, [x8]
Lloh18:
	adrp	x8, _WDOG_CR_WDT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _WDOG_CR_WDT@GOTPAGEOFF]
Lloh20:
	ldr	w21, [x8]
	mov	x0, x19
	mov	x1, x20
	bl	_RD2
	orr	w2, w0, w21
	mov	x0, x19
	mov	x1, x20
	bl	_WR2
	ldr	x8, [x19, #16]
Lloh21:
	adrp	x9, _IRQRES@GOTPAGE
Lloh22:
	ldr	x9, [x9, _IRQRES@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	ldr	w1, [x8, x9, lsl #2]
	ldr	w0, [x19, #4]
Lloh24:
	adrp	x8, _INTR_TYPE_MISC@GOTPAGE
Lloh25:
	ldr	x8, [x8, _INTR_TYPE_MISC@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
Lloh27:
	adrp	x9, _INTR_MPSAFE@GOTPAGE
Lloh28:
	ldr	x9, [x9, _INTR_MPSAFE@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh30:
	adrp	x8, _imx_wdog_intr@GOTPAGE
Lloh31:
	ldr	x8, [x8, _imx_wdog_intr@GOTPAGEOFF]
Lloh32:
	ldr	w3, [x8]
	add	x6, x19, #8
	mov	x4, #0
	mov	x5, x19
	bl	_bus_setup_intr
Lloh33:
	adrp	x8, _WDOG_ICR_REG@GOTPAGE
Lloh34:
	ldr	x8, [x8, _WDOG_ICR_REG@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
Lloh36:
	adrp	x8, _WDOG_ICR_WIE@GOTPAGE
Lloh37:
	ldr	x8, [x8, _WDOG_ICR_WIE@GOTPAGEOFF]
Lloh38:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_WR2
LBB0_4:
Lloh39:
	adrp	x8, _WDOG_MCR_REG@GOTPAGE
Lloh40:
	ldr	x8, [x8, _WDOG_MCR_REG@GOTPAGEOFF]
Lloh41:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_RD2
Lloh42:
	adrp	x8, _WDOG_MCR_PDE@GOTPAGE
Lloh43:
	ldr	x8, [x8, _WDOG_MCR_PDE@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_6
; %bb.5:
	mov	w8, #1
	str	w8, [x19]
LBB0_6:
Lloh45:
	adrp	x8, _watchdog_list@GOTPAGE
Lloh46:
	ldr	x8, [x8, _watchdog_list@GOTPAGEOFF]
Lloh47:
	ldr	w0, [x8]
Lloh48:
	adrp	x8, _imx_watchdog@GOTPAGE
Lloh49:
	ldr	x8, [x8, _imx_watchdog@GOTPAGEOFF]
Lloh50:
	ldr	w1, [x8]
	mov	x2, x19
	mov	w3, #0
	bl	_EVENTHANDLER_REGISTER
	ldr	w0, [x19, #4]
	bl	_ofw_bus_get_node
Lloh51:
	adrp	x1, l_.str.3@PAGE
Lloh52:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #12
	mov	w3, #4
	bl	_OF_getencprop
	cmp	w0, #4
	b.ne	LBB0_10
; %bb.7:
	ldr	w1, [sp, #12]
	sub	w8, w1, #129
	cmn	w8, #129
	b.hi	LBB0_9
; %bb.8:
	ldr	w0, [x19, #4]
	str	x1, [sp]
Lloh53:
	adrp	x1, l_.str.4@PAGE
Lloh54:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_device_printf
	mov	w1, #128
	str	w1, [sp, #12]
LBB0_9:
	mov	x0, x19
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_imx_wdog_enable
	ldr	w0, [x19, #4]
	ldr	w8, [sp, #12]
	str	x8, [sp]
Lloh55:
	adrp	x1, l_.str.5@PAGE
Lloh56:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_device_printf
LBB0_10:
	ldr	w0, [x19, #4]
	bl	_device_busy
	mov	w0, #0
LBB0_11:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpAdd	Lloh53, Lloh54
	.loh AdrpAdd	Lloh55, Lloh56
	.cfi_endproc
                                        ; -- End function
	.comm	_imx_wdog_spec,4,2              ; @imx_wdog_spec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
l_.str.1:                               ; @.str.1
	.asciz	"imx_wdt"

	.comm	_MTX_DEF,4,2                    ; @MTX_DEF
l_.str.2:                               ; @.str.2
	.asciz	"fsl,ext-reset-output"

	.comm	_WDOG_CR_REG,4,2                ; @WDOG_CR_REG
	.comm	_WDOG_CR_WDT,4,2                ; @WDOG_CR_WDT
	.comm	_IRQRES,8,3                     ; @IRQRES
	.comm	_INTR_TYPE_MISC,4,2             ; @INTR_TYPE_MISC
	.comm	_INTR_MPSAFE,4,2                ; @INTR_MPSAFE
	.comm	_imx_wdog_intr,4,2              ; @imx_wdog_intr
	.comm	_WDOG_ICR_REG,4,2               ; @WDOG_ICR_REG
	.comm	_WDOG_ICR_WIE,4,2               ; @WDOG_ICR_WIE
	.comm	_WDOG_MCR_REG,4,2               ; @WDOG_MCR_REG
	.comm	_WDOG_MCR_PDE,4,2               ; @WDOG_MCR_PDE
	.comm	_watchdog_list,4,2              ; @watchdog_list
	.comm	_imx_watchdog,4,2               ; @imx_watchdog
l_.str.3:                               ; @.str.3
	.asciz	"timeout-sec"

l_.str.4:                               ; @.str.4
	.asciz	"ERROR: bad timeout-sec property value %u, using 128\n"

l_.str.5:                               ; @.str.5
	.asciz	"watchdog enabled using timeout-sec property value %u\n"

	.no_dead_strip	_imx_wdog_attach
.subsections_via_symbols
