	.file	"extr_rtc-at91sam9.c_at91_rtc_settime.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"settime"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"%s: %4d-%02d-%02d %02d:%02d:%02d\n"
	.text
	.p2align 4
	.type	at91_rtc_settime, @function
at91_rtc_settime:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	sub	rsp, 24
	.cfi_def_cfa_offset 64
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	call	dev_get_drvdata@PLT
	sub	rsp, 8
	.cfi_def_cfa_offset 72
	mov	rdi, r13
	lea	rdx, .LC0[rip]
	mov	r12, rax
	mov	rax, QWORD PTR 24[rbp]
	lea	rsi, .LC1[rip]
	lea	rcx, 1900[rax]
	mov	eax, DWORD PTR 0[rbp]
	push	rax
	.cfi_def_cfa_offset 80
	mov	eax, DWORD PTR 4[rbp]
	push	rax
	.cfi_def_cfa_offset 88
	mov	eax, DWORD PTR 8[rbp]
	push	rax
	.cfi_def_cfa_offset 96
	mov	r9d, DWORD PTR 12[rbp]
	mov	r8d, DWORD PTR 16[rbp]
	call	dev_dbg@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 64
	mov	rdi, rbp
	mov	rsi, rsp
	call	rtc_tm_to_time@PLT
	mov	r13d, eax
	test	eax, eax
	je	.L11
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L12
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbx
	.cfi_def_cfa_offset 32
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	esi, DWORD PTR MR[rip]
	mov	rdi, r12
	call	rtt_readl@PLT
	mov	rdx, QWORD PTR AT91_RTT_ALMIEN[rip]
	or	rdx, QWORD PTR AT91_RTT_RTTINCIEN[rip]
	mov	rdi, r12
	mov	esi, DWORD PTR MR[rip]
	not	rdx
	mov	rbp, rax
	and	rdx, rax
	call	rtt_writel@PLT
	mov	rdi, r12
	call	gpbr_readl@PLT
	mov	rdi, r12
	mov	rbx, rax
	mov	rax, QWORD PTR [rsp]
	lea	rsi, 1[rax]
	mov	QWORD PTR [rsp], rsi
	call	gpbr_writel@PLT
	mov	esi, DWORD PTR AR[rip]
	mov	rdi, r12
	call	rtt_readl@PLT
	mov	rdx, QWORD PTR ALARM_DISABLED[rip]
	cmp	rdx, rax
	je	.L3
	mov	rcx, QWORD PTR [rsp]
	add	rax, rbx
	cmp	rcx, rbx
	jnb	.L4
.L9:
	sub	rax, rcx
	mov	rdx, rax
.L5:
	mov	esi, DWORD PTR AR[rip]
	mov	rdi, r12
	call	rtt_writel@PLT
.L3:
	mov	rdx, QWORD PTR AT91_RTT_RTTRST[rip]
	mov	esi, DWORD PTR MR[rip]
	mov	rdi, r12
	or	rdx, rbp
	call	rtt_writel@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L4:
	cmp	rcx, rax
	jb	.L9
	mov	rax, QWORD PTR AT91_RTT_ALMIEN[rip]
	not	rax
	and	rbp, rax
	jmp	.L5
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	at91_rtc_settime, .-at91_rtc_settime
	.comm	MR,4,4
	.comm	AT91_RTT_RTTRST,8,8
	.comm	AT91_RTT_RTTINCIEN,8,8
	.comm	AT91_RTT_ALMIEN,8,8
	.comm	AR,4,4
	.comm	ALARM_DISABLED,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_rtc-at91sam9.c_at91_rtc_settime.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"settime\000"
	.align	2
.LC1:
	.ascii	"%s: %4d-%02d-%02d %02d:%02d:%02d\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	at91_rtc_settime, %function
at91_rtc_settime:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r1
	ldr	r3, .L13
	sub	sp, sp, #32
	mov	r6, r0
	ldr	r3, [r3]
	str	r3, [sp, #28]
	mov	r3,#0
	bl	dev_get_drvdata
	ldm	r4, {r1, r2, ip}
	ldr	r3, [r4, #20]
	str	r1, [sp, #16]
	ldr	r1, [r4, #12]
	str	r2, [sp, #12]
	ldr	r2, [r4, #16]
	add	r3, r3, #1888
	stmib	sp, {r1, ip}
	add	r3, r3, #12
	ldr	r1, .L13+4
	str	r2, [sp]
	mov	r5, r0
	ldr	r2, .L13+8
	mov	r0, r6
	bl	dev_dbg
	mov	r0, r4
	add	r1, sp, #24
	bl	rtc_tm_to_time
	subs	r4, r0, #0
	beq	.L11
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [sp, #28]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L11:
	ldr	r7, .L13+12
	mov	r0, r5
	ldr	r1, [r7]
	bl	rtt_readl
	ldr	r9, .L13+16
	ldr	r3, .L13+20
	ldr	r2, [r9]
	ldr	r3, [r3]
	ldr	r1, [r7]
	orr	r2, r2, r3
	bic	r2, r0, r2
	mov	r6, r0
	mov	r0, r5
	bl	rtt_writel
	mov	r0, r5
	bl	gpbr_readl
	ldr	r1, [sp, #24]
	ldr	r8, .L13+24
	add	r1, r1, #1
	mov	r10, r0
	mov	r0, r5
	str	r1, [sp, #24]
	bl	gpbr_writel
	mov	r0, r5
	ldr	r1, [r8]
	bl	rtt_readl
	ldr	r2, .L13+28
	ldr	r2, [r2]
	cmp	r2, r0
	beq	.L3
	ldr	r1, [sp, #24]
	add	r3, r10, r0
	cmp	r1, r10
	bcs	.L4
.L9:
	sub	r2, r3, r1
.L5:
	mov	r0, r5
	ldr	r1, [r8]
	bl	rtt_writel
.L3:
	ldr	r3, .L13+32
	mov	r0, r5
	ldr	r2, [r3]
	ldr	r1, [r7]
	orr	r2, r6, r2
	bl	rtt_writel
	b	.L1
.L4:
	cmp	r1, r3
	bcc	.L9
	ldr	r3, [r9]
	bic	r6, r6, r3
	b	.L5
.L12:
	bl	__stack_chk_fail
.L14:
	.align	2
.L13:
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.word	MR
	.word	AT91_RTT_ALMIEN
	.word	AT91_RTT_RTTINCIEN
	.word	AR
	.word	ALARM_DISABLED
	.word	AT91_RTT_RTTRST
	.size	at91_rtc_settime, .-at91_rtc_settime
	.comm	MR,4,4
	.comm	AT91_RTT_RTTRST,4,4
	.comm	AT91_RTT_RTTINCIEN,4,4
	.comm	AT91_RTT_ALMIEN,4,4
	.comm	AR,4,4
	.comm	ALARM_DISABLED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
