	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function a10_timer_attach
_a10_timer_attach:                      ## @a10_timer_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, %ebx
	callq	_device_get_softc
	movq	%rax, %r14
	movq	_compat_data@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%ebx, %edi
	callq	_ofw_bus_search_compatible
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	movq	_a10_timer_spec@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	8(%r14), %rdx
	movl	%ebx, %edi
	callq	_bus_alloc_resources
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	leaq	L_.str(%rip), %rsi
LBB0_2:
	movl	%ebx, %edi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_3
LBB0_4:
	movl	%ebx, 4(%r14)
	movq	8(%r14), %rax
	movq	_A10_TIMER_IRQRES@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %esi
	movq	_INTR_TYPE_CLK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_a10_timer_irq@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rax
	addq	$16, %rax
	movq	%rax, (%rsp)
	movl	%ebx, %edi
	xorl	%r8d, %r8d
	movq	%r14, %r9
	callq	_bus_setup_intr
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movl	(%r12), %esi
	movq	8(%r14), %rdx
	movl	%ebx, %edi
	callq	_bus_release_resources
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_device_printf
LBB0_3:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_13:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	leaq	-36(%rbp), %rcx
	movl	%ebx, %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_clk_get_by_ofw_index
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	_SYS_TIMER_CLKSRC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%r14)
LBB0_8:
	movq	_bootverbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_9
## %bb.12:
	movl	4(%r14), %edi
	movq	_hz@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_stathz@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_device_printf
	movl	(%r14), %edx
	movl	4(%r14), %edi
	leaq	L_.str.4(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
	movl	4(%r14), %edi
	movq	_a10_timer_timecounter@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.5(%rip), %rsi
	xorl	%eax, %eax
	callq	_device_printf
	jmp	LBB0_13
LBB0_10:
	movl	-36(%rbp), %edi
	movq	%r14, %rsi
	callq	_clk_get_freq
	testq	%rax, %rax
	je	LBB0_8
## %bb.11:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_2
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_compat_data,4,2                ## @compat_data
	.comm	_a10_timer_spec,4,2             ## @a10_timer_spec
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_A10_TIMER_IRQRES,8,3           ## @A10_TIMER_IRQRES
	.comm	_INTR_TYPE_CLK,4,2              ## @INTR_TYPE_CLK
	.comm	_a10_timer_irq,4,2              ## @a10_timer_irq
L_.str.1:                               ## @.str.1
	.asciz	"Unable to setup the clock irq handler, err = %d\n"

	.comm	_SYS_TIMER_CLKSRC,4,2           ## @SYS_TIMER_CLKSRC
L_.str.2:                               ## @.str.2
	.asciz	"Cannot get clock source frequency\n"

	.comm	_bootverbose,8,3                ## @bootverbose
L_.str.3:                               ## @.str.3
	.asciz	"clock: hz=%d stathz = %d\n"

	.comm	_hz,4,2                         ## @hz
	.comm	_stathz,4,2                     ## @stathz
L_.str.4:                               ## @.str.4
	.asciz	"event timer clock frequency %ju\n"

L_.str.5:                               ## @.str.5
	.asciz	"timecounter clock frequency %jd\n"

	.comm	_a10_timer_timecounter,16,3     ## @a10_timer_timecounter
	.comm	_a10_timer_delay,4,2            ## @a10_timer_delay
	.no_dead_strip	_a10_timer_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function a10_timer_attach
_a10_timer_attach:                      ; @a10_timer_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
Lloh0:
	adrp	x8, _compat_data@GOTPAGE
Lloh1:
	ldr	x8, [x8, _compat_data@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_ofw_bus_search_compatible
	ldr	w8, [x0]
	str	w8, [x19, #20]
Lloh3:
	adrp	x22, _a10_timer_spec@GOTPAGE
Lloh4:
	ldr	x22, [x22, _a10_timer_spec@GOTPAGEOFF]
	ldr	w1, [x22]
	ldr	x2, [x19, #8]
	mov	x0, x20
	bl	_bus_alloc_resources
	cbz	x0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:
	str	w20, [x19, #4]
Lloh7:
	adrp	x8, _A10_TIMER_IRQRES@GOTPAGE
Lloh8:
	ldr	x8, [x8, _A10_TIMER_IRQRES@GOTPAGEOFF]
	ldr	x9, [x19, #8]
Lloh9:
	ldr	x8, [x8]
	ldr	w1, [x9, x8, lsl #2]
Lloh10:
	adrp	x8, _INTR_TYPE_CLK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _INTR_TYPE_CLK@GOTPAGEOFF]
Lloh12:
	ldr	w2, [x8]
Lloh13:
	adrp	x8, _a10_timer_irq@GOTPAGE
Lloh14:
	ldr	x8, [x8, _a10_timer_irq@GOTPAGEOFF]
Lloh15:
	ldr	w3, [x8]
	add	x6, x19, #16
	mov	x0, x20
	mov	x4, #0
	mov	x5, x19
	bl	_bus_setup_intr
	cbz	w0, LBB0_6
; %bb.3:
	mov	x21, x0
	ldr	w1, [x22]
	ldr	x2, [x19, #8]
	mov	x0, x20
	bl	_bus_release_resources
	str	x21, [sp]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_device_printf
Lloh18:
	adrp	x8, _ENXIO@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
LBB0_5:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_6:
	add	x3, sp, #28
	mov	x0, x20
	mov	w1, #0
	mov	w2, #0
	bl	_clk_get_by_ofw_index
	cbz	x0, LBB0_11
; %bb.7:
Lloh21:
	adrp	x8, _SYS_TIMER_CLKSRC@GOTPAGE
Lloh22:
	ldr	x8, [x8, _SYS_TIMER_CLKSRC@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	w8, [x19]
LBB0_8:
	mov	x0, x19
	bl	_a23_timer_timecounter_setup
Lloh24:
	adrp	x8, _bootverbose@GOTPAGE
Lloh25:
	ldr	x8, [x8, _bootverbose@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w0, [x19, #4]
Lloh27:
	adrp	x8, _hz@GOTPAGE
Lloh28:
	ldr	x8, [x8, _hz@GOTPAGEOFF]
Lloh29:
	adrp	x9, _stathz@GOTPAGE
Lloh30:
	ldr	x9, [x9, _stathz@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	ldr	w9, [x9]
	stp	x8, x9, [sp]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_device_printf
	ldp	w8, w0, [x19]
	str	x8, [sp]
Lloh35:
	adrp	x1, l_.str.4@PAGE
Lloh36:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_device_printf
	ldr	w0, [x19, #4]
Lloh37:
	adrp	x8, _a10_timer_timecounter@GOTPAGE
Lloh38:
	ldr	x8, [x8, _a10_timer_timecounter@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh40:
	adrp	x1, l_.str.5@PAGE
Lloh41:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_device_printf
LBB0_10:
	mov	w0, #0
	b	LBB0_5
LBB0_11:
	ldr	w0, [sp, #28]
	mov	x1, x19
	bl	_clk_get_freq
	cbz	x0, LBB0_8
; %bb.12:
Lloh42:
	adrp	x1, l_.str.2@PAGE
Lloh43:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_4
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpAdd	Lloh42, Lloh43
	.cfi_endproc
                                        ; -- End function
	.comm	_compat_data,4,2                ; @compat_data
	.comm	_a10_timer_spec,4,2             ; @a10_timer_spec
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not allocate resources\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_A10_TIMER_IRQRES,8,3           ; @A10_TIMER_IRQRES
	.comm	_INTR_TYPE_CLK,4,2              ; @INTR_TYPE_CLK
	.comm	_a10_timer_irq,4,2              ; @a10_timer_irq
l_.str.1:                               ; @.str.1
	.asciz	"Unable to setup the clock irq handler, err = %d\n"

	.comm	_SYS_TIMER_CLKSRC,4,2           ; @SYS_TIMER_CLKSRC
l_.str.2:                               ; @.str.2
	.asciz	"Cannot get clock source frequency\n"

	.comm	_bootverbose,8,3                ; @bootverbose
l_.str.3:                               ; @.str.3
	.asciz	"clock: hz=%d stathz = %d\n"

	.comm	_hz,4,2                         ; @hz
	.comm	_stathz,4,2                     ; @stathz
l_.str.4:                               ; @.str.4
	.asciz	"event timer clock frequency %ju\n"

l_.str.5:                               ; @.str.5
	.asciz	"timecounter clock frequency %jd\n"

	.comm	_a10_timer_timecounter,16,3     ; @a10_timer_timecounter
	.comm	_a10_timer_delay,4,2            ; @a10_timer_delay
	.no_dead_strip	_a10_timer_attach
.subsections_via_symbols
