	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function atrtc_attach
_atrtc_attach:                          ## @atrtc_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	callq	_device_get_softc
	movq	%rax, %r14
	movq	_SYS_RES_IOPORT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	80(%r14), %rdx
	movq	_IO_RTC@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leal	1(%rcx), %r8d
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	%r15d, %edi
                                        ## kill: def $ecx killed $ecx killed $rcx
	movl	$2, %r9d
	callq	_bus_alloc_resource
	movq	%rax, 72(%r14)
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	%r15d, %edi
	callq	_device_printf
LBB0_2:
	xorl	%eax, %eax
	callq	_atrtc_start
	movl	%r15d, %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_clock_register
	movq	%r14, %rdi
	movl	$4, %esi
	callq	_bzero
	movq	_atrtcclock_disable@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_16
## %bb.3:
	movl	%r15d, %edi
	callq	_device_get_name
	movl	%eax, %ebx
	movl	%r15d, %edi
	callq	_device_get_unit
	leaq	L_.str.1(%rip), %rdx
	leaq	-48(%rbp), %rcx
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_resource_int_value
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	cmpl	$0, -48(%rbp)
	je	LBB0_16
LBB0_5:
	leaq	64(%r14), %rbx
	movq	$0, 64(%r14)
	movq	_SYS_RES_IRQ@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-44(%rbp), %rcx
	movl	%r15d, %edi
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_bus_get_resource
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	cmpl	$8, -44(%rbp)
	je	LBB0_10
## %bb.7:
	leaq	-44(%rbp), %r12
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	incq	%rdx
	movq	%rdx, (%rbx)
	movl	(%r13), %esi
	movl	%r15d, %edi
	movq	%r12, %rcx
	xorl	%r8d, %r8d
	callq	_bus_get_resource
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	cmpl	$8, -44(%rbp)
	jne	LBB0_8
LBB0_10:
	movl	(%r13), %esi
	movq	_RF_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	%r15d, %edi
	movq	%rbx, %rdx
	movl	$8, %ecx
	movl	$8, %r8d
	movl	$1, %r9d
	callq	_bus_alloc_resource
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_11
## %bb.13:
	movq	_INTR_TYPE_CLK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_rtc_intr@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	%r14, %rsi
	addq	$56, %rsi
	movq	%rsi, (%rsp)
	movl	%r15d, %edi
	movq	%rax, %rsi
	xorl	%r8d, %r8d
	movq	%r14, %r9
	callq	_bus_setup_intr
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.3(%rip), %rsi
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.2(%rip), %rsi
LBB0_12:
	movl	%r15d, %edi
	callq	_device_printf
	jmp	LBB0_16
LBB0_15:
	movq	48(%r14), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_bus_bind_intr
	leaq	L_.str.4(%rip), %rax
	movq	%rax, (%r14)
	movq	_ET_FLAGS_PERIODIC@GOTPCREL(%rip), %rax
	movq	_ET_FLAGS_POW2DIV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movl	%ecx, 8(%r14)
	movq	$0, 40(%r14)
	movabsq	$2251799813718016, %rax         ## imm = 0x8000000008000
	movq	%rax, 12(%r14)
	movl	$-2147483648, 20(%r14)          ## imm = 0x80000000
	movq	_rtc_start@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r14)
	movq	_rtc_stop@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r14)
	movl	%r15d, 24(%r14)
	movq	%r14, %rdi
	callq	_et_register
LBB0_16:
	xorl	%eax, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SYS_RES_IOPORT,4,2             ## @SYS_RES_IOPORT
	.comm	_IO_RTC,4,2                     ## @IO_RTC
	.comm	_RF_ACTIVE,4,2                  ## @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Warning: Couldn't map I/O.\n"

	.comm	_atrtcclock_disable,4,2         ## @atrtcclock_disable
L_.str.1:                               ## @.str.1
	.asciz	"clock"

	.comm	_SYS_RES_IRQ,4,2                ## @SYS_RES_IRQ
L_.str.2:                               ## @.str.2
	.asciz	"Can't map interrupt.\n"

	.comm	_INTR_TYPE_CLK,4,2              ## @INTR_TYPE_CLK
	.comm	_rtc_intr,4,2                   ## @rtc_intr
L_.str.3:                               ## @.str.3
	.asciz	"Can't setup interrupt.\n"

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

	.comm	_ET_FLAGS_PERIODIC,4,2          ## @ET_FLAGS_PERIODIC
	.comm	_ET_FLAGS_POW2DIV,4,2           ## @ET_FLAGS_POW2DIV
	.comm	_rtc_start,4,2                  ## @rtc_start
	.comm	_rtc_stop,4,2                   ## @rtc_stop
	.no_dead_strip	_atrtc_attach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function atrtc_attach
lCPI0_0:
	.long	32768                           ; 0x8000
	.long	524288                          ; 0x80000
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_atrtc_attach:                          ; @atrtc_attach
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x0
	bl	_device_get_softc
	mov	x20, x0
Lloh0:
	adrp	x8, _SYS_RES_IOPORT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SYS_RES_IOPORT@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _IO_RTC@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IO_RTC@GOTPAGEOFF]
	add	x2, x0, #80
Lloh5:
	ldr	w3, [x8]
	add	w4, w3, #1
Lloh6:
	adrp	x22, _RF_ACTIVE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _RF_ACTIVE@GOTPAGEOFF]
	ldr	w6, [x22]
	mov	x0, x19
	mov	w5, #2
	bl	_bus_alloc_resource
	str	x0, [x20, #72]
	cbnz	x0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_device_printf
LBB0_2:
	bl	_atrtc_start
	mov	x0, x19
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_clock_register
	mov	x0, x20
	mov	w1, #4
	bl	_bzero
Lloh10:
	adrp	x8, _atrtcclock_disable@GOTPAGE
Lloh11:
	ldr	x8, [x8, _atrtcclock_disable@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
	cbnz	w8, LBB0_14
; %bb.3:
	mov	x0, x19
	bl	_device_get_name
	mov	x21, x0
	mov	x0, x19
	bl	_device_get_unit
	mov	x1, x0
Lloh13:
	adrp	x2, l_.str.1@PAGE
Lloh14:
	add	x2, x2, l_.str.1@PAGEOFF
	add	x3, sp, #8
	mov	x0, x21
	bl	_resource_int_value
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	w8, [sp, #8]
	cbz	w8, LBB0_14
LBB0_5:
	mov	x21, x20
	str	xzr, [x21, #64]!
Lloh15:
	adrp	x23, _SYS_RES_IRQ@GOTPAGE
Lloh16:
	ldr	x23, [x23, _SYS_RES_IRQ@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x3, sp, #12
	mov	x0, x19
	mov	x2, #0
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	mov	x4, #0
	bl	_bus_get_resource
	ldr	w8, [sp, #12]
	cmp	x0, #0
	ccmp	w8, #8, #4, eq
	b.eq	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x21]
	add	x2, x8, #1
	str	x2, [x21]
	ldr	w1, [x23]
	add	x3, sp, #12
	mov	x0, x19
	b	LBB0_6
LBB0_8:
	ldr	w1, [x23]
	ldr	w6, [x22]
	mov	x0, x19
	mov	x2, x21
	mov	w3, #8
	mov	w4, #8
	mov	w5, #1
	bl	_bus_alloc_resource
	str	x0, [x20, #48]
	cbz	x0, LBB0_11
; %bb.9:
	mov	x1, x0
Lloh17:
	adrp	x8, _INTR_TYPE_CLK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _INTR_TYPE_CLK@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x8, _rtc_intr@GOTPAGE
Lloh21:
	ldr	x8, [x8, _rtc_intr@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	add	x6, x20, #56
	mov	x0, x19
	mov	x4, #0
	mov	x5, x20
	bl	_bus_setup_intr
	cbz	x0, LBB0_13
; %bb.10:
Lloh23:
	adrp	x1, l_.str.3@PAGE
Lloh24:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_12
LBB0_11:
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_12:
	mov	x0, x19
	bl	_device_printf
	b	LBB0_14
LBB0_13:
	ldr	x1, [x20, #48]
	mov	x0, x19
	mov	w2, #0
	bl	_bus_bind_intr
Lloh27:
	adrp	x8, l_.str.4@PAGE
Lloh28:
	add	x8, x8, l_.str.4@PAGEOFF
	str	x8, [x20]
Lloh29:
	adrp	x8, _ET_FLAGS_PERIODIC@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ET_FLAGS_PERIODIC@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
Lloh32:
	adrp	x9, _ET_FLAGS_POW2DIV@GOTPAGE
Lloh33:
	ldr	x9, [x9, _ET_FLAGS_POW2DIV@GOTPAGEOFF]
Lloh34:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20, #8]
	str	xzr, [x20, #40]
Lloh35:
	adrp	x8, lCPI0_0@PAGE
Lloh36:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	stur	d0, [x20, #12]
	mov	w8, #-2147483648
Lloh37:
	adrp	x9, _rtc_start@GOTPAGE
Lloh38:
	ldr	x9, [x9, _rtc_start@GOTPAGEOFF]
Lloh39:
	adrp	x10, _rtc_stop@GOTPAGE
Lloh40:
	ldr	x10, [x10, _rtc_stop@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
Lloh42:
	ldr	w10, [x10]
	stp	w10, w9, [x20, #28]
	stp	w8, w19, [x20, #20]
	mov	x0, x20
	bl	_et_register
LBB0_14:
	mov	w0, #0
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh41
	.loh AdrpLdr	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_SYS_RES_IOPORT,4,2             ; @SYS_RES_IOPORT
	.comm	_IO_RTC,4,2                     ; @IO_RTC
	.comm	_RF_ACTIVE,4,2                  ; @RF_ACTIVE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Warning: Couldn't map I/O.\n"

	.comm	_atrtcclock_disable,4,2         ; @atrtcclock_disable
l_.str.1:                               ; @.str.1
	.asciz	"clock"

	.comm	_SYS_RES_IRQ,4,2                ; @SYS_RES_IRQ
l_.str.2:                               ; @.str.2
	.asciz	"Can't map interrupt.\n"

	.comm	_INTR_TYPE_CLK,4,2              ; @INTR_TYPE_CLK
	.comm	_rtc_intr,4,2                   ; @rtc_intr
l_.str.3:                               ; @.str.3
	.asciz	"Can't setup interrupt.\n"

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

	.comm	_ET_FLAGS_PERIODIC,4,2          ; @ET_FLAGS_PERIODIC
	.comm	_ET_FLAGS_POW2DIV,4,2           ; @ET_FLAGS_POW2DIV
	.comm	_rtc_start,4,2                  ; @rtc_start
	.comm	_rtc_stop,4,2                   ; @rtc_stop
	.no_dead_strip	_atrtc_attach
.subsections_via_symbols
