	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_rtc_attach              ## -- Begin function as3722_rtc_attach
	.p2align	4, 0x90
_as3722_rtc_attach:                     ## @as3722_rtc_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_AS3722_RTC_CONTROL@GOTPCREL(%rip), %rax
	movq	_AS3722_RTC_ON@GOTPCREL(%rip), %rdx
	movq	_AS3722_RTC_ALARM_WAKEUP_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movl	(%rax), %esi
	movq	_AS3722_RTC_AM_PM_MODE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	orl	%ecx, %edx
	callq	_RM1
	movl	(%rbx), %edi
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_clock_register
	xorl	%eax, %eax
	jmp	LBB0_3
LBB0_1:
	leaq	L_.str(%rip), %rsi
	callq	_device_printf
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AS3722_RTC_CONTROL,4,2         ## @AS3722_RTC_CONTROL
	.comm	_AS3722_RTC_ON,4,2              ## @AS3722_RTC_ON
	.comm	_AS3722_RTC_ALARM_WAKEUP_EN,4,2 ## @AS3722_RTC_ALARM_WAKEUP_EN
	.comm	_AS3722_RTC_AM_PM_MODE,4,2      ## @AS3722_RTC_AM_PM_MODE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to initialize RTC controller\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_as3722_rtc_attach              ; -- Begin function as3722_rtc_attach
	.p2align	2
_as3722_rtc_attach:                     ; @as3722_rtc_attach
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _AS3722_RTC_CONTROL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AS3722_RTC_CONTROL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _AS3722_RTC_ON@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AS3722_RTC_ON@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _AS3722_RTC_ALARM_WAKEUP_EN@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AS3722_RTC_ALARM_WAKEUP_EN@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w3, w9, w8
Lloh9:
	adrp	x8, _AS3722_RTC_AM_PM_MODE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AS3722_RTC_AM_PM_MODE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	orr	w2, w3, w8
	bl	_RM1
	mov	x8, x0
	ldr	w0, [x19]
	tbnz	w8, #31, LBB0_2
; %bb.1:
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_clock_register
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_device_printf
Lloh14:
	adrp	x8, _ENXIO@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
LBB0_3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_AS3722_RTC_CONTROL,4,2         ; @AS3722_RTC_CONTROL
	.comm	_AS3722_RTC_ON,4,2              ; @AS3722_RTC_ON
	.comm	_AS3722_RTC_ALARM_WAKEUP_EN,4,2 ; @AS3722_RTC_ALARM_WAKEUP_EN
	.comm	_AS3722_RTC_AM_PM_MODE,4,2      ; @AS3722_RTC_AM_PM_MODE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to initialize RTC controller\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
.subsections_via_symbols
