	.file	"extr_rtc-m41t80.c_m41t80_rtc_set_time.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"Unable to write to date registers\n"
	.align 8
.LC1:
	.string	"Unable to write flags register\n"
	.text
	.p2align 4
	.type	m41t80_rtc_set_time, @function
m41t80_rtc_set_time:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	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	to_i2c_client@PLT
	mov	rdi, rax
	mov	rbp, rax
	call	i2c_get_clientdata@PLT
	mov	rbx, rax
	mov	eax, DWORD PTR [r12]
	sub	eax, 100
	cmp	eax, 99
	jbe	.L2
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.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, r12d
	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
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR M41T80_REG_SSEC[rip]
	mov	edi, DWORD PTR 4[r12]
	mov	r13, QWORD PTR M41T80_REG_SEC[rip]
	mov	BYTE PTR [rsp+rax], 0
	call	bin2bcd@PLT
	mov	edi, DWORD PTR 8[r12]
	mov	BYTE PTR [rsp+r13], al
	mov	r13, QWORD PTR M41T80_REG_MIN[rip]
	call	bin2bcd@PLT
	mov	edi, DWORD PTR 12[r12]
	mov	BYTE PTR [rsp+r13], al
	mov	r13, QWORD PTR M41T80_REG_HOUR[rip]
	call	bin2bcd@PLT
	mov	edi, DWORD PTR 16[r12]
	mov	BYTE PTR [rsp+r13], al
	mov	r13, QWORD PTR M41T80_REG_DAY[rip]
	call	bin2bcd@PLT
	mov	BYTE PTR [rsp+r13], al
	mov	eax, DWORD PTR 20[r12]
	mov	r13, QWORD PTR M41T80_REG_MON[rip]
	lea	edi, 1[rax]
	call	bin2bcd@PLT
	mov	BYTE PTR [rsp+r13], al
	mov	eax, DWORD PTR [r12]
	mov	r13, QWORD PTR M41T80_REG_YEAR[rip]
	lea	edi, -100[rax]
	call	bin2bcd@PLT
	mov	rsi, QWORD PTR M41T80_REG_WDAY[rip]
	mov	BYTE PTR [rsp+r13], al
	movzx	eax, BYTE PTR 24[r12]
	mov	BYTE PTR [rsp+rsi], al
	mov	eax, DWORD PTR [rbx]
	test	DWORD PTR M41T80_FEATURE_SQ_ALT[rip], eax
	je	.L4
	mov	rdi, rbp
	call	i2c_smbus_read_byte_data@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rdx, QWORD PTR M41T80_REG_WDAY[rip]
	and	eax, -16
	or	BYTE PTR [rsp+rdx], al
.L4:
	mov	rsi, QWORD PTR M41T80_REG_SSEC[rip]
	mov	rcx, rsp
	mov	edx, 8
	mov	rdi, rbp
	call	i2c_smbus_write_i2c_block_data@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L13
	mov	rsi, QWORD PTR M41T80_REG_FLAGS[rip]
	mov	rdi, rbp
	call	i2c_smbus_read_byte_data@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	edx, DWORD PTR M41T80_FLAGS_OF[rip]
	mov	rsi, QWORD PTR M41T80_REG_FLAGS[rip]
	mov	rdi, rbp
	not	edx
	and	edx, eax
	call	i2c_smbus_write_byte_data@PLT
	mov	r12d, eax
	test	eax, eax
	jns	.L1
	lea	rsi, .LC1[rip]
	mov	rdi, rbp
	call	dev_err@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rsi, .LC0[rip]
	mov	rdi, rbp
	call	dev_err@PLT
	jmp	.L1
.L12:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	m41t80_rtc_set_time, .-m41t80_rtc_set_time
	.comm	M41T80_REG_YEAR,8,8
	.comm	M41T80_REG_WDAY,8,8
	.comm	M41T80_REG_SSEC,8,8
	.comm	M41T80_REG_SEC,8,8
	.comm	M41T80_REG_MON,8,8
	.comm	M41T80_REG_MIN,8,8
	.comm	M41T80_REG_HOUR,8,8
	.comm	M41T80_REG_FLAGS,8,8
	.comm	M41T80_REG_DAY,8,8
	.comm	M41T80_FLAGS_OF,4,4
	.comm	M41T80_FEATURE_SQ_ALT,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-m41t80.c_m41t80_rtc_set_time.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Unable to write to date registers\012\000"
	.align	2
.LC1:
	.ascii	"Unable to write flags register\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	m41t80_rtc_set_time, %function
m41t80_rtc_set_time:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	ldr	r3, .L14
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	mov	r4, r1
	bl	to_i2c_client
	mov	r5, r0
	bl	i2c_get_clientdata
	ldr	r3, [r4]
	sub	r3, r3, #100
	cmp	r3, #99
	bls	.L2
	ldr	r3, .L14+4
	ldr	r0, [r3]
	rsb	r4, r0, #0
.L1:
	ldr	r3, .L14
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L12
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L2:
	mov	r1, #0
	ldr	r8, .L14+8
	add	ip, sp, #16
	ldr	r3, [r8]
	ldr	r2, .L14+12
	add	r3, ip, r3
	mov	r6, r0
	ldr	r0, [r4, #4]
	ldr	r7, [r2]
	strb	r1, [r3, #-12]
	bl	bin2bcd
	mov	r2, r0
	ldr	r3, .L14+16
	add	r1, sp, #16
	add	r7, r1, r7
	ldr	r0, [r4, #8]
	strb	r2, [r7, #-12]
	ldr	r7, [r3]
	bl	bin2bcd
	mov	r2, r0
	ldr	r3, .L14+20
	add	r1, sp, #16
	add	r7, r1, r7
	ldr	r0, [r4, #12]
	strb	r2, [r7, #-12]
	ldr	r7, [r3]
	bl	bin2bcd
	mov	r2, r0
	ldr	r3, .L14+24
	add	r1, sp, #16
	add	r7, r1, r7
	ldr	r0, [r4, #16]
	strb	r2, [r7, #-12]
	ldr	r7, [r3]
	bl	bin2bcd
	mov	r2, r0
	ldr	r0, [r4, #20]
	ldr	r3, .L14+28
	add	r1, sp, #16
	add	r7, r1, r7
	add	r0, r0, #1
	strb	r2, [r7, #-12]
	ldr	r7, [r3]
	bl	bin2bcd
	mov	r2, r0
	ldr	r0, [r4]
	ldr	r3, .L14+32
	add	r1, sp, #16
	add	r7, r1, r7
	sub	r0, r0, #100
	strb	r2, [r7, #-12]
	ldr	r7, [r3]
	bl	bin2bcd
	ldr	r9, .L14+36
	add	r3, sp, #16
	ldr	r1, [r9]
	ldrb	ip, [r4, #24]	@ zero_extendqisi2
	add	r2, r3, r1
	add	r7, r3, r7
	ldr	r3, .L14+40
	strb	r0, [r7, #-12]
	strb	ip, [r2, #-12]
	ldr	r2, [r6]
	ldr	r3, [r3]
	tst	r2, r3
	beq	.L4
	mov	r0, r5
	bl	i2c_smbus_read_byte_data
	subs	r4, r0, #0
	blt	.L1
	ldr	r3, [r9]
	add	r2, sp, #16
	add	r3, r2, r3
	ldrb	r2, [r3, #-12]	@ zero_extendqisi2
	bic	r4, r4, #15
	orr	r4, r2, r4
	strb	r4, [r3, #-12]
.L4:
	mov	r2, #8
	mov	r0, r5
	ldr	r1, [r8]
	add	r3, sp, #4
	bl	i2c_smbus_write_i2c_block_data
	subs	r4, r0, #0
	blt	.L13
	ldr	r6, .L14+44
	mov	r0, r5
	ldr	r1, [r6]
	bl	i2c_smbus_read_byte_data
	subs	r4, r0, #0
	blt	.L1
	ldr	r3, .L14+48
	mov	r0, r5
	ldr	r2, [r3]
	ldr	r1, [r6]
	bic	r2, r4, r2
	bl	i2c_smbus_write_byte_data
	subs	r4, r0, #0
	bge	.L1
	mov	r0, r5
	ldr	r1, .L14+52
	bl	dev_err
	b	.L1
.L13:
	mov	r0, r5
	ldr	r1, .L14+56
	bl	dev_err
	b	.L1
.L12:
	bl	__stack_chk_fail
.L15:
	.align	2
.L14:
	.word	.LC2
	.word	EINVAL
	.word	M41T80_REG_SSEC
	.word	M41T80_REG_SEC
	.word	M41T80_REG_MIN
	.word	M41T80_REG_HOUR
	.word	M41T80_REG_DAY
	.word	M41T80_REG_MON
	.word	M41T80_REG_YEAR
	.word	M41T80_REG_WDAY
	.word	M41T80_FEATURE_SQ_ALT
	.word	M41T80_REG_FLAGS
	.word	M41T80_FLAGS_OF
	.word	.LC1
	.word	.LC0
	.size	m41t80_rtc_set_time, .-m41t80_rtc_set_time
	.comm	M41T80_REG_YEAR,4,4
	.comm	M41T80_REG_WDAY,4,4
	.comm	M41T80_REG_SSEC,4,4
	.comm	M41T80_REG_SEC,4,4
	.comm	M41T80_REG_MON,4,4
	.comm	M41T80_REG_MIN,4,4
	.comm	M41T80_REG_HOUR,4,4
	.comm	M41T80_REG_FLAGS,4,4
	.comm	M41T80_REG_DAY,4,4
	.comm	M41T80_FLAGS_OF,4,4
	.comm	M41T80_FEATURE_SQ_ALT,4,4
	.comm	EINVAL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
