	.file	"extr_rtc-m48t59.c_m48t59_rtc_set_time.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"RTC set time %04d-%02d-%02d %02d/%02d/%02d\n"
	.text
	.p2align 4
	.type	m48t59_rtc_set_time, @function
m48t59_rtc_set_time:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	mov	r14, rdi
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rsi
	call	to_platform_device@PLT
	mov	rdi, rax
	mov	r12, QWORD PTR [rax]
	call	platform_get_drvdata@PLT
	mov	r13d, DWORD PTR [rbx]
	mov	ecx, DWORD PTR 24[rbx]
	mov	rdi, r14
	mov	rbp, rax
	mov	eax, DWORD PTR 16[rbx]
	mov	r9d, DWORD PTR 8[rbx]
	lea	rsi, .LC0[rip]
	mov	r8d, DWORD PTR 4[rbx]
	lea	edx, 1900[r13]
	push	rax
	.cfi_def_cfa_offset 56
	mov	eax, DWORD PTR 12[rbx]
	push	rax
	.cfi_def_cfa_offset 64
	call	dev_dbg@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	test	r13d, r13d
	js	.L9
	xor	esi, esi
	mov	rdi, rbp
	call	spin_lock_irqsave@PLT
	mov	esi, DWORD PTR M48T59_CNTL[rip]
	mov	edi, DWORD PTR M48T59_CNTL_WRITE[rip]
	call	M48T59_SET_BITS@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	r14d, DWORD PTR M48T59_SEC[rip]
	call	bin2bcd@PLT
	mov	esi, r14d
	and	eax, 127
	mov	edi, eax
	call	M48T59_WRITE@PLT
	mov	edi, DWORD PTR 12[rbx]
	mov	r14d, DWORD PTR M48T59_MIN[rip]
	call	bin2bcd@PLT
	mov	esi, r14d
	and	eax, 127
	mov	edi, eax
	call	M48T59_WRITE@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	r14d, DWORD PTR M48T59_HOUR[rip]
	call	bin2bcd@PLT
	mov	esi, r14d
	and	eax, 63
	mov	edi, eax
	call	M48T59_WRITE@PLT
	mov	edi, DWORD PTR 4[rbx]
	mov	r14d, DWORD PTR M48T59_MDAY[rip]
	call	bin2bcd@PLT
	mov	esi, r14d
	and	eax, 63
	mov	edi, eax
	call	M48T59_WRITE@PLT
	mov	eax, DWORD PTR 24[rbx]
	mov	r14d, DWORD PTR M48T59_MONTH[rip]
	lea	edi, 1[rax]
	call	bin2bcd@PLT
	mov	esi, r14d
	and	eax, 31
	mov	edi, eax
	call	M48T59_WRITE@PLT
	movsx	rax, r13d
	mov	edx, r13d
	mov	edi, r13d
	imul	rax, rax, 1374389535
	sar	edx, 31
	mov	r14d, DWORD PTR M48T59_YEAR[rip]
	sar	rax, 37
	sub	eax, edx
	imul	eax, eax, 100
	sub	edi, eax
	call	bin2bcd@PLT
	mov	esi, r14d
	xor	r14d, r14d
	mov	edi, eax
	call	M48T59_WRITE@PLT
	mov	rax, QWORD PTR M48T59RTC_TYPE_M48T59[rip]
	cmp	QWORD PTR [r12], rax
	je	.L10
.L4:
	mov	edi, DWORD PTR 20[rbx]
	call	bin2bcd@PLT
	mov	esi, DWORD PTR M48T59_WDAY[rip]
	and	eax, 7
	mov	edi, eax
	or	edi, r14d
	call	M48T59_WRITE@PLT
	mov	esi, DWORD PTR M48T59_CNTL[rip]
	mov	edi, DWORD PTR M48T59_CNTL_WRITE[rip]
	call	M48T59_CLEAR_BITS@PLT
	mov	rdi, rbp
	xor	esi, esi
	call	spin_unlock_irqrestore@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	mov	eax, DWORD PTR EINVAL[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	neg	eax
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	add	r13d, 99
	cmp	r13d, 198
	jbe	.L4
	mov	edi, DWORD PTR M48T59_WDAY_CEB[rip]
	or	edi, DWORD PTR M48T59_WDAY_CB[rip]
	mov	r14d, edi
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	m48t59_rtc_set_time, .-m48t59_rtc_set_time
	.comm	M48T59_YEAR,4,4
	.comm	M48T59_WDAY_CEB,4,4
	.comm	M48T59_WDAY_CB,4,4
	.comm	M48T59_WDAY,4,4
	.comm	M48T59_SEC,4,4
	.comm	M48T59_MONTH,4,4
	.comm	M48T59_MIN,4,4
	.comm	M48T59_MDAY,4,4
	.comm	M48T59_HOUR,4,4
	.comm	M48T59_CNTL_WRITE,4,4
	.comm	M48T59_CNTL,4,4
	.comm	M48T59RTC_TYPE_M48T59,8,8
	.comm	EINVAL,4,4
	.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-m48t59.c_m48t59_rtc_set_time.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"RTC set time %04d-%02d-%02d %02d/%02d/%02d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	m48t59_rtc_set_time, %function
m48t59_rtc_set_time:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	sub	sp, sp, #20
	mov	r4, r1
	mov	r7, r0
	bl	to_platform_device
	ldr	r9, [r0]
	bl	platform_get_drvdata
	ldr	r3, [r4, #16]
	ldr	r1, [r4, #8]
	ldr	ip, [r4, #12]
	ldr	r5, [r4]
	str	r3, [sp, #12]
	ldr	r3, [r4, #4]
	stmib	sp, {r1, ip}
	str	r3, [sp]
	add	r2, r5, #1888
	mov	r6, r0
	ldr	r3, [r4, #24]
	mov	r0, r7
	ldr	r1, .L11
	add	r2, r2, #12
	bl	dev_dbg
	cmp	r5, #0
	blt	.L9
	ldr	r8, .L11+4
	ldr	r7, .L11+8
	mov	r1, #0
	mov	r0, r6
	bl	spin_lock_irqsave
	ldr	r1, [r8]
	ldr	r0, [r7]
	bl	M48T59_SET_BITS
	ldr	r0, [r4, #16]
	bl	bin2bcd
	ldr	r3, .L11+12
	and	r0, r0, #127
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r0, [r4, #12]
	bl	bin2bcd
	ldr	r3, .L11+16
	and	r0, r0, #127
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r0, [r4, #8]
	bl	bin2bcd
	ldr	r3, .L11+20
	and	r0, r0, #63
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r0, [r4, #4]
	bl	bin2bcd
	ldr	r3, .L11+24
	and	r0, r0, #63
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r0, [r4, #24]
	add	r0, r0, #1
	bl	bin2bcd
	ldr	r3, .L11+28
	and	r0, r0, #31
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r0, .L11+32
	asr	r3, r5, #31
	smull	r2, r0, r5, r0
	rsb	r3, r3, r0, asr #5
	add	r3, r3, r3, lsl #2
	add	r3, r3, r3, lsl #2
	sub	r0, r5, r3, lsl #2
	bl	bin2bcd
	ldr	r3, .L11+36
	ldr	r1, [r3]
	bl	M48T59_WRITE
	ldr	r3, .L11+40
	ldr	r2, [r9]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L10
.L6:
	mov	r5, #0
.L4:
	ldr	r0, [r4, #20]
	bl	bin2bcd
	ldr	r3, .L11+44
	and	r0, r0, #7
	ldr	r1, [r3]
	orr	r0, r0, r5
	bl	M48T59_WRITE
	ldr	r1, [r8]
	ldr	r0, [r7]
	bl	M48T59_CLEAR_BITS
	mov	r0, r6
	mov	r1, #0
	bl	spin_unlock_irqrestore
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L9:
	ldr	r3, .L11+48
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L10:
	add	r5, r5, #99
	cmp	r5, #198
	bls	.L6
	ldr	r2, .L11+52
	ldr	r3, .L11+56
	ldr	r5, [r2]
	ldr	r3, [r3]
	orr	r5, r5, r3
	b	.L4
.L12:
	.align	2
.L11:
	.word	.LC0
	.word	M48T59_CNTL
	.word	M48T59_CNTL_WRITE
	.word	M48T59_SEC
	.word	M48T59_MIN
	.word	M48T59_HOUR
	.word	M48T59_MDAY
	.word	M48T59_MONTH
	.word	1374389535
	.word	M48T59_YEAR
	.word	M48T59RTC_TYPE_M48T59
	.word	M48T59_WDAY
	.word	EINVAL
	.word	M48T59_WDAY_CEB
	.word	M48T59_WDAY_CB
	.size	m48t59_rtc_set_time, .-m48t59_rtc_set_time
	.comm	M48T59_YEAR,4,4
	.comm	M48T59_WDAY_CEB,4,4
	.comm	M48T59_WDAY_CB,4,4
	.comm	M48T59_WDAY,4,4
	.comm	M48T59_SEC,4,4
	.comm	M48T59_MONTH,4,4
	.comm	M48T59_MIN,4,4
	.comm	M48T59_MDAY,4,4
	.comm	M48T59_HOUR,4,4
	.comm	M48T59_CNTL_WRITE,4,4
	.comm	M48T59_CNTL,4,4
	.comm	M48T59RTC_TYPE_M48T59,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
