	.file	"extr_rtc-m48t59.c_m48t59_rtc_setalarm.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"RTC set alarm time %04d-%02d-%02d %02d/%02d/%02d\n"
	.text
	.p2align 4
	.type	m48t59_rtc_setalarm, @function
m48t59_rtc_setalarm:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rsi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	call	to_platform_device@PLT
	mov	rdi, rax
	call	platform_get_drvdata@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR NO_IRQ[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L19
	mov	eax, DWORD PTR EINVAL[rip]
	mov	r13d, DWORD PTR [rbx]
	neg	eax
	test	r13d, r13d
	js	.L1
	mov	edi, DWORD PTR 4[rbx]
	lea	eax, -1[rdi]
	cmp	eax, 30
	jbe	.L5
.L7:
	mov	edi, DWORD PTR M48T59_MDAY[rip]
	xor	r15d, r15d
	call	M48T59_READ@PLT
	mov	edi, DWORD PTR 8[rbx]
	mov	r14d, eax
	cmp	edi, 23
	jle	.L20
.L8:
	mov	edi, DWORD PTR 12[rbx]
	xor	r10d, r10d
	cmp	edi, 59
	jle	.L21
.L9:
	mov	edi, DWORD PTR 16[rbx]
	xor	r9d, r9d
	cmp	edi, 59
	jle	.L22
.L10:
	xor	r8d, r8d
	add	rbp, 8
	mov	DWORD PTR 12[rsp], r9d
	mov	rsi, r8
	mov	rdi, rbp
	mov	DWORD PTR 8[rsp], r10d
	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	esi, DWORD PTR M48T59_ALARM_DATE[rip]
	mov	edi, r14d
	call	M48T59_WRITE@PLT
	mov	esi, DWORD PTR M48T59_ALARM_HOUR[rip]
	mov	edi, r15d
	call	M48T59_WRITE@PLT
	mov	r10d, DWORD PTR 8[rsp]
	mov	esi, DWORD PTR M48T59_ALARM_MIN[rip]
	mov	edi, r10d
	call	M48T59_WRITE@PLT
	mov	r9d, DWORD PTR 12[rsp]
	mov	esi, DWORD PTR M48T59_ALARM_SEC[rip]
	mov	edi, r9d
	call	M48T59_WRITE@PLT
	mov	esi, DWORD PTR M48T59_CNTL[rip]
	mov	edi, DWORD PTR M48T59_CNTL_WRITE[rip]
	call	M48T59_CLEAR_BITS@PLT
	xor	r8d, r8d
	mov	rdi, rbp
	mov	rsi, r8
	call	spin_unlock_irqrestore@PLT
	mov	eax, DWORD PTR 16[rbx]
	mov	ecx, DWORD PTR 20[rbx]
	mov	rdi, r12
	mov	r9d, DWORD PTR 8[rbx]
	mov	r8d, DWORD PTR 4[rbx]
	lea	edx, 1900[r13]
	lea	rsi, .LC0[rip]
	push	rax
	.cfi_def_cfa_offset 88
	mov	eax, DWORD PTR 12[rbx]
	push	rax
	.cfi_def_cfa_offset 96
	call	dev_dbg@PLT
	pop	rax
	.cfi_def_cfa_offset 88
	xor	eax, eax
	pop	rdx
	.cfi_def_cfa_offset 80
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	call	bin2bcd@PLT
	mov	r14d, eax
	cmp	eax, 255
	je	.L7
	mov	edi, DWORD PTR 8[rbx]
	xor	r15d, r15d
	cmp	edi, 23
	jg	.L8
.L20:
	call	bin2bcd@PLT
	mov	edi, DWORD PTR 12[rbx]
	xor	r10d, r10d
	mov	r15d, eax
	cmp	edi, 59
	jg	.L9
.L21:
	call	bin2bcd@PLT
	mov	edi, DWORD PTR 16[rbx]
	xor	r9d, r9d
	mov	r10d, eax
	cmp	edi, 59
	jg	.L10
.L22:
	mov	DWORD PTR 8[rsp], r10d
	call	bin2bcd@PLT
	mov	r10d, DWORD PTR 8[rsp]
	mov	r9d, eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L19:
	mov	eax, DWORD PTR EIO[rip]
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	neg	eax
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	m48t59_rtc_setalarm, .-m48t59_rtc_setalarm
	.comm	NO_IRQ,8,8
	.comm	M48T59_MDAY,4,4
	.comm	M48T59_CNTL_WRITE,4,4
	.comm	M48T59_CNTL,4,4
	.comm	M48T59_ALARM_SEC,4,4
	.comm	M48T59_ALARM_MIN,4,4
	.comm	M48T59_ALARM_HOUR,4,4
	.comm	M48T59_ALARM_DATE,4,4
	.comm	EIO,4,4
	.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_setalarm.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"RTC set alarm time %04d-%02d-%02d %02d/%02d/%02d\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	m48t59_rtc_setalarm, %function
m48t59_rtc_setalarm:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #36
	mov	r4, r1
	mov	r6, r0
	bl	to_platform_device
	bl	platform_get_drvdata
	ldr	r3, .L24
	ldr	r2, [r0]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L19
	ldr	r8, [r4]
	cmp	r8, #0
	blt	.L20
	mov	r5, r0
	ldr	r0, [r4, #4]
	sub	r3, r0, #1
	cmp	r3, #30
	bls	.L5
.L7:
	ldr	r3, .L24+4
	ldr	r0, [r3]
	bl	M48T59_READ
	mov	r7, r0
.L6:
	ldr	r0, [r4, #8]
	cmp	r0, #23
	movgt	r3, #0
	strgt	r3, [sp, #28]
	ble	.L21
	ldr	r0, [r4, #12]
	cmp	r0, #59
	movgt	r2, #0
	ble	.L22
.L9:
	ldr	r0, [r4, #16]
	cmp	r0, #59
	movgt	r3, #0
	ble	.L23
.L10:
	mov	r9, #0
	ldr	r10, .L24+8
	ldr	fp, .L24+12
	add	r5, r5, #4
	mov	r1, r9
	mov	r0, r5
	str	r3, [sp, #24]
	str	r2, [sp, #20]
	bl	spin_lock_irqsave
	ldr	r1, [r10]
	ldr	r0, [fp]
	bl	M48T59_SET_BITS
	ldr	r1, .L24+16
	mov	r0, r7
	ldr	r1, [r1]
	bl	M48T59_WRITE
	ldr	r1, .L24+20
	ldr	r0, [sp, #28]
	ldr	r1, [r1]
	bl	M48T59_WRITE
	ldr	r2, [sp, #20]
	ldr	r1, .L24+24
	mov	r0, r2
	ldr	r1, [r1]
	bl	M48T59_WRITE
	ldr	r3, [sp, #24]
	ldr	r2, .L24+28
	mov	r0, r3
	ldr	r1, [r2]
	bl	M48T59_WRITE
	ldr	r1, [r10]
	ldr	r0, [fp]
	bl	M48T59_CLEAR_BITS
	mov	r1, r9
	mov	r0, r5
	bl	spin_unlock_irqrestore
	add	r1, r4, #8
	ldr	r3, [r4, #4]
	ldm	r1, {r1, ip, lr}
	stmib	sp, {r1, ip, lr}
	str	r3, [sp]
	add	r2, r8, #1888
	mov	r0, r6
	ldr	r3, [r4, #20]
	ldr	r1, .L24+32
	add	r2, r2, #12
	bl	dev_dbg
	mov	r0, r9
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L5:
	bl	bin2bcd
	cmp	r0, #255
	mov	r7, r0
	bne	.L6
	b	.L7
.L19:
	ldr	r3, .L24+36
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	ldr	r3, .L24+40
	ldr	r0, [r3]
	rsb	r0, r0, #0
	add	sp, sp, #36
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L21:
	bl	bin2bcd
	str	r0, [sp, #28]
	ldr	r0, [r4, #12]
	cmp	r0, #59
	movgt	r2, #0
	bgt	.L9
.L22:
	bl	bin2bcd
	mov	r2, r0
	ldr	r0, [r4, #16]
	cmp	r0, #59
	movgt	r3, #0
	bgt	.L10
.L23:
	str	r2, [sp, #20]
	bl	bin2bcd
	ldr	r2, [sp, #20]
	mov	r3, r0
	b	.L10
.L25:
	.align	2
.L24:
	.word	NO_IRQ
	.word	M48T59_MDAY
	.word	M48T59_CNTL
	.word	M48T59_CNTL_WRITE
	.word	M48T59_ALARM_DATE
	.word	M48T59_ALARM_HOUR
	.word	M48T59_ALARM_MIN
	.word	M48T59_ALARM_SEC
	.word	.LC0
	.word	EIO
	.word	EINVAL
	.size	m48t59_rtc_setalarm, .-m48t59_rtc_setalarm
	.comm	NO_IRQ,4,4
	.comm	M48T59_MDAY,4,4
	.comm	M48T59_CNTL_WRITE,4,4
	.comm	M48T59_CNTL,4,4
	.comm	M48T59_ALARM_SEC,4,4
	.comm	M48T59_ALARM_MIN,4,4
	.comm	M48T59_ALARM_HOUR,4,4
	.comm	M48T59_ALARM_DATE,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
