	.file	"457098.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"day"
.LC1:
	.string	"alarm rollover: %s\n"
.LC2:
	.string	"month"
.LC3:
	.string	"year"
.LC4:
	.string	"alarm rollover not handled\n"
.LC5:
	.string	"invalid alarm value: %ptR\n"
	.text
	.globl	__rtc_read_alarm
	.type	__rtc_read_alarm, @function
__rtc_read_alarm:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 144
	mov	QWORD PTR -136[rbp], rdi
	mov	QWORD PTR -144[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -124[rbp], 1
	mov	DWORD PTR -120[rbp], 0
	lea	rdx, -96[rbp]
	mov	rax, QWORD PTR -136[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rtc_read_time@PLT
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	jns	.L2
	mov	eax, DWORD PTR -128[rbp]
	jmp	.L29
.L2:
	cmp	DWORD PTR -124[rbp], 0
	jne	.L4
	lea	rcx, -48[rbp]
	lea	rax, -96[rbp]
	mov	edx, 40
	mov	rsi, rcx
	mov	rdi, rax
	call	memcpy@PLT
.L4:
	mov	DWORD PTR -124[rbp], 0
	mov	rdx, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR -136[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rtc_read_alarm_internal@PLT
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	je	.L5
	mov	eax, DWORD PTR -128[rbp]
	jmp	.L29
.L5:
	mov	rax, QWORD PTR -144[rbp]
	mov	rdi, rax
	call	rtc_valid_tm@PLT
	test	eax, eax
	jne	.L6
	mov	rdx, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR -136[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rtc_add_offset@PLT
	mov	eax, 0
	jmp	.L29
.L6:
	lea	rdx, -48[rbp]
	mov	rax, QWORD PTR -136[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rtc_read_time@PLT
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	jns	.L7
	mov	eax, DWORD PTR -128[rbp]
	jmp	.L29
.L7:
	mov	rdx, QWORD PTR -96[rbp]
	mov	rax, QWORD PTR -48[rbp]
	cmp	rdx, rax
	jne	.L2
	mov	rdx, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR -40[rbp]
	cmp	rdx, rax
	jne	.L2
	mov	rdx, QWORD PTR -80[rbp]
	mov	rax, QWORD PTR -32[rbp]
	cmp	rdx, rax
	jne	.L2
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -24[rbp]
	cmp	rdx, rax
	jne	.L2
	mov	rax, QWORD PTR -144[rbp]
	mov	eax, DWORD PTR 32[rax]
	cmp	eax, -1
	jne	.L8
	mov	edx, DWORD PTR -16[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	DWORD PTR 32[rax], edx
.L8:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR [rax]
	cmp	rax, -1
	jne	.L9
	mov	rdx, QWORD PTR -48[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR [rax], rdx
.L9:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 8[rax]
	cmp	rax, -1
	jne	.L10
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 8[rax], rdx
.L10:
	mov	rax, QWORD PTR -144[rbp]
	mov	eax, DWORD PTR 36[rax]
	test	eax, eax
	jle	.L11
	mov	rax, QWORD PTR -144[rbp]
	mov	eax, DWORD PTR 36[rax]
	cmp	eax, 31
	jle	.L12
.L11:
	mov	edx, DWORD PTR -12[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	DWORD PTR 36[rax], edx
	mov	DWORD PTR -120[rbp], 1
.L12:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	eax, 11
	jbe	.L13
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 16[rax], rdx
	cmp	DWORD PTR -120[rbp], 0
	jne	.L13
	mov	DWORD PTR -120[rbp], 2
.L13:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 24[rax]
	cmp	rax, -1
	jne	.L14
	mov	rdx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 24[rax], rdx
	cmp	DWORD PTR -120[rbp], 0
	jne	.L14
	mov	DWORD PTR -120[rbp], 3
.L14:
	mov	rax, QWORD PTR -144[rbp]
	mov	rdi, rax
	call	rtc_valid_tm@PLT
	mov	DWORD PTR -128[rbp], eax
	cmp	DWORD PTR -128[rbp], 0
	jne	.L31
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	rtc_tm_to_time64@PLT
	mov	QWORD PTR -112[rbp], rax
	mov	rax, QWORD PTR -144[rbp]
	mov	rdi, rax
	call	rtc_tm_to_time64@PLT
	mov	QWORD PTR -104[rbp], rax
	mov	rax, QWORD PTR -112[rbp]
	cmp	rax, QWORD PTR -104[rbp]
	jl	.L32
	cmp	DWORD PTR -120[rbp], 3
	je	.L18
	cmp	DWORD PTR -120[rbp], 3
	ja	.L19
	cmp	DWORD PTR -120[rbp], 1
	je	.L20
	cmp	DWORD PTR -120[rbp], 2
	je	.L21
	jmp	.L19
.L20:
	mov	rax, QWORD PTR -136[rbp]
	lea	rdx, .LC0[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	dev_dbg@PLT
	add	QWORD PTR -104[rbp], 86400
	mov	rdx, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR -104[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rtc_time64_to_tm@PLT
	jmp	.L22
.L21:
	mov	rax, QWORD PTR -136[rbp]
	lea	rdx, .LC2[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	dev_dbg@PLT
.L25:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 16[rax]
	cmp	rax, 10
	jg	.L23
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 16[rax]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 16[rax], rdx
	jmp	.L24
.L23:
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 16[rax], 0
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 24[rax]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 24[rax], rdx
.L24:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 24[rax]
	mov	rdx, QWORD PTR -144[rbp]
	mov	rdx, QWORD PTR 16[rdx]
	mov	rsi, rax
	mov	edi, edx
	call	rtc_month_days@PLT
	mov	DWORD PTR -116[rbp], eax
	mov	rax, QWORD PTR -144[rbp]
	mov	eax, DWORD PTR 36[rax]
	cmp	DWORD PTR -116[rbp], eax
	jb	.L25
	jmp	.L22
.L18:
	mov	rax, QWORD PTR -136[rbp]
	lea	rdx, .LC3[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	dev_dbg@PLT
.L27:
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 24[rax]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -144[rbp]
	mov	QWORD PTR 24[rax], rdx
	mov	rax, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR 24[rax]
	add	rax, 1900
	mov	rdi, rax
	call	is_leap_year@PLT
	test	eax, eax
	jne	.L33
	mov	rax, QWORD PTR -144[rbp]
	mov	rdi, rax
	call	rtc_valid_tm@PLT
	test	eax, eax
	jne	.L27
	jmp	.L33
.L19:
	mov	rax, QWORD PTR -136[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	dev_warn@PLT
	jmp	.L22
.L33:
	nop
.L22:
	mov	rax, QWORD PTR -144[rbp]
	mov	rdi, rax
	call	rtc_valid_tm@PLT
	mov	DWORD PTR -128[rbp], eax
	jmp	.L16
.L31:
	nop
	jmp	.L16
.L32:
	nop
.L16:
	cmp	DWORD PTR -128[rbp], 0
	je	.L28
	mov	rdx, QWORD PTR -144[rbp]
	mov	rax, QWORD PTR -136[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	dev_warn@PLT
.L28:
	mov	eax, DWORD PTR -128[rbp]
.L29:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L30
	call	__stack_chk_fail@PLT
.L30:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	__rtc_read_alarm, .-__rtc_read_alarm
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"457098.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"day\000"
	.align	2
.LC1:
	.ascii	"alarm rollover: %s\012\000"
	.align	2
.LC2:
	.ascii	"month\000"
	.align	2
.LC3:
	.ascii	"year\000"
	.align	2
.LC4:
	.ascii	"alarm rollover not handled\012\000"
	.align	2
.LC5:
	.ascii	"invalid alarm value: %ptR\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	__rtc_read_alarm
	.syntax unified
	.arm
	.fpu softvfp
	.type	__rtc_read_alarm, %function
__rtc_read_alarm:
	@ args = 0, pretend = 0, frame = 88
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #88
	str	r0, [fp, #-88]
	str	r1, [fp, #-92]
	ldr	r3, .L34
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #1
	str	r3, [fp, #-76]
	mov	r3, #0
	str	r3, [fp, #-72]
	sub	r3, fp, #56
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	rtc_read_time
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bge	.L2
	ldr	r3, [fp, #-80]
	b	.L29
.L2:
	ldr	r3, [fp, #-76]
	cmp	r3, #0
	bne	.L4
	sub	ip, fp, #56
	sub	lr, fp, #32
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
.L4:
	mov	r3, #0
	str	r3, [fp, #-76]
	ldr	r1, [fp, #-92]
	ldr	r0, [fp, #-88]
	bl	rtc_read_alarm_internal
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	beq	.L5
	ldr	r3, [fp, #-80]
	b	.L29
.L5:
	ldr	r3, [fp, #-92]
	mov	r0, r3
	bl	rtc_valid_tm
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, [fp, #-92]
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	rtc_add_offset
	mov	r3, #0
	b	.L29
.L6:
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, [fp, #-88]
	bl	rtc_read_time
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bge	.L7
	ldr	r3, [fp, #-80]
	b	.L29
.L7:
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bne	.L2
	ldr	r2, [fp, #-52]
	ldr	r3, [fp, #-28]
	cmp	r2, r3
	bne	.L2
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bne	.L2
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-20]
	cmp	r2, r3
	bne	.L2
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #16]
	cmn	r3, #1
	bne	.L8
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-92]
	str	r2, [r3, #16]
.L8:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L9
	ldr	r2, [fp, #-32]
	ldr	r3, [fp, #-92]
	str	r2, [r3]
.L9:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #4]
	cmn	r3, #1
	bne	.L10
	ldr	r2, [fp, #-28]
	ldr	r3, [fp, #-92]
	str	r2, [r3, #4]
.L10:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #20]
	cmp	r3, #0
	ble	.L11
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #20]
	cmp	r3, #31
	ble	.L12
.L11:
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-92]
	str	r2, [r3, #20]
	mov	r3, #1
	str	r3, [fp, #-72]
.L12:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #8]
	cmp	r3, #11
	bls	.L13
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-92]
	str	r2, [r3, #8]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bne	.L13
	mov	r3, #2
	str	r3, [fp, #-72]
.L13:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	cmn	r3, #1
	bne	.L14
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-92]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bne	.L14
	mov	r3, #3
	str	r3, [fp, #-72]
.L14:
	ldr	r3, [fp, #-92]
	mov	r0, r3
	bl	rtc_valid_tm
	str	r0, [fp, #-80]
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	bne	.L31
	sub	r3, fp, #32
	mov	r0, r3
	bl	rtc_tm_to_time64
	str	r0, [fp, #-68]
	ldr	r3, [fp, #-92]
	mov	r0, r3
	bl	rtc_tm_to_time64
	str	r0, [fp, #-64]
	ldr	r2, [fp, #-68]
	ldr	r3, [fp, #-64]
	cmp	r2, r3
	blt	.L32
	ldr	r3, [fp, #-72]
	cmp	r3, #3
	beq	.L18
	ldr	r3, [fp, #-72]
	cmp	r3, #3
	bhi	.L19
	ldr	r3, [fp, #-72]
	cmp	r3, #1
	beq	.L20
	ldr	r3, [fp, #-72]
	cmp	r3, #2
	beq	.L21
	b	.L19
.L20:
	ldr	r3, [fp, #-88]
	ldr	r2, .L34+4
	ldr	r1, .L34+8
	mov	r0, r3
	bl	dev_dbg
	ldr	r3, [fp, #-64]
	add	r3, r3, #86016
	add	r3, r3, #384
	str	r3, [fp, #-64]
	ldr	r3, [fp, #-92]
	mov	r1, r3
	ldr	r0, [fp, #-64]
	bl	rtc_time64_to_tm
	b	.L22
.L21:
	ldr	r3, [fp, #-88]
	ldr	r2, .L34+12
	ldr	r1, .L34+8
	mov	r0, r3
	bl	dev_dbg
.L25:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #8]
	cmp	r3, #10
	bgt	.L23
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #8]
	add	r2, r3, #1
	ldr	r3, [fp, #-92]
	str	r2, [r3, #8]
	b	.L24
.L23:
	ldr	r3, [fp, #-92]
	mov	r2, #0
	str	r2, [r3, #8]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	add	r2, r3, #1
	ldr	r3, [fp, #-92]
	str	r2, [r3, #12]
.L24:
	ldr	r3, [fp, #-92]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	mov	r1, r3
	mov	r0, r2
	bl	rtc_month_days
	str	r0, [fp, #-60]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #20]
	mov	r2, r3
	ldr	r3, [fp, #-60]
	cmp	r3, r2
	bcc	.L25
	b	.L22
.L18:
	ldr	r3, [fp, #-88]
	ldr	r2, .L34+16
	ldr	r1, .L34+8
	mov	r0, r3
	bl	dev_dbg
.L27:
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	add	r2, r3, #1
	ldr	r3, [fp, #-92]
	str	r2, [r3, #12]
	ldr	r3, [fp, #-92]
	ldr	r3, [r3, #12]
	add	r3, r3, #1888
	add	r3, r3, #12
	mov	r0, r3
	bl	is_leap_year
	mov	r3, r0
	cmp	r3, #0
	bne	.L33
	ldr	r3, [fp, #-92]
	mov	r0, r3
	bl	rtc_valid_tm
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	b	.L33
.L19:
	ldr	r3, [fp, #-88]
	ldr	r1, .L34+20
	mov	r0, r3
	bl	dev_warn
	b	.L22
.L33:
	nop
.L22:
	ldr	r3, [fp, #-92]
	mov	r0, r3
	bl	rtc_valid_tm
	str	r0, [fp, #-80]
	b	.L16
.L31:
	nop
	b	.L16
.L32:
	nop
.L16:
	ldr	r3, [fp, #-80]
	cmp	r3, #0
	beq	.L28
	ldr	r3, [fp, #-88]
	ldr	r2, [fp, #-92]
	ldr	r1, .L34+24
	mov	r0, r3
	bl	dev_warn
.L28:
	ldr	r3, [fp, #-80]
.L29:
	ldr	r2, .L34
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L30
	bl	__stack_chk_fail
.L30:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L35:
	.align	2
.L34:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.size	__rtc_read_alarm, .-__rtc_read_alarm
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
