	.file	"extr_rtc-ds1305.c_ds1305_get_alarm.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"alm0 read"
.LC1:
	.string	"%s: %02x %02x %02x %02x\n"
	.text
	.p2align 4
	.type	ds1305_get_alarm, @function
ds1305_get_alarm:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	mov	r14, rdi
	push	r13
	.cfi_offset 13, -40
	mov	r13, rsi
	push	r12
	push	rbx
	sub	rsp, 56
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	call	dev_get_drvdata@PLT
	mov	rcx, rsp
	mov	r10, QWORD PTR 8[rax]
	mov	rbx, rax
	movsx	rax, DWORD PTR DS1305_ALM_LEN[rip]
	mov	r9, rax
	lea	rax, 15[0+rax*4]
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L3
.L14:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L14
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L15
.L4:
	mov	eax, DWORD PTR DS1305_CONTROL[rip]
	mov	rcx, QWORD PTR [rbx]
	lea	rsi, -60[rbp]
	mov	rdi, r10
	mov	r8d, 8
	mov	edx, 4
	mov	DWORD PTR -84[rbp], r9d
	mov	r15, rsp
	mov	DWORD PTR -60[rbp], eax
	mov	QWORD PTR -80[rbp], rsi
	mov	QWORD PTR -72[rbp], r10
	call	spi_write_then_read@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR [rbx]
	mov	edx, DWORD PTR DS1305_AEI0[rip]
	xor	ecx, ecx
	mov	rdi, QWORD PTR DS1305_SEC[rip]
	test	DWORD PTR [rax], edx
	setne	cl
	mov	DWORD PTR 0[r13], ecx
	test	DWORD PTR 4[rax], edx
	setne	al
	movzx	eax, al
	mov	DWORD PTR 4[r13], eax
	call	DS1305_ALM0@PLT
	mov	r9d, DWORD PTR -84[rbp]
	mov	r10, QWORD PTR -72[rbp]
	mov	rcx, r15
	mov	rsi, QWORD PTR -80[rbp]
	mov	edx, 4
	mov	DWORD PTR -60[rbp], eax
	lea	r8d, 0[0+r9*4]
	mov	rdi, r10
	call	spi_write_then_read@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L1
	mov	rax, QWORD PTR DS1305_HOUR[rip]
	sub	rsp, 8
	mov	rdi, r14
	lea	rdx, .LC0[rip]
	lea	rsi, .LC1[rip]
	mov	r9d, DWORD PTR [r15+rax*4]
	mov	rax, QWORD PTR DS1305_MIN[rip]
	mov	r8d, DWORD PTR [r15+rax*4]
	mov	rax, QWORD PTR DS1305_SEC[rip]
	mov	ecx, DWORD PTR [r15+rax*4]
	mov	rax, QWORD PTR DS1305_WDAY[rip]
	mov	eax, DWORD PTR [r15+rax*4]
	push	rax
	call	dev_vdbg@PLT
	mov	rax, QWORD PTR DS1305_SEC[rip]
	mov	r12d, DWORD PTR DS1305_ALM_DISABLE[rip]
	mov	edi, DWORD PTR [r15+rax*4]
	pop	rax
	pop	rdx
	test	edi, r12d
	jne	.L6
	mov	rax, QWORD PTR DS1305_MIN[rip]
	test	DWORD PTR [r15+rax*4], r12d
	jne	.L6
	mov	rax, QWORD PTR DS1305_HOUR[rip]
	and	r12d, DWORD PTR [r15+rax*4]
	jne	.L6
	call	bcd2bin@PLT
	mov	QWORD PTR 24[r13], rax
	mov	rax, QWORD PTR DS1305_MIN[rip]
	mov	edi, DWORD PTR [r15+rax*4]
	call	bcd2bin@PLT
	mov	QWORD PTR 16[r13], rax
	mov	rax, QWORD PTR DS1305_HOUR[rip]
	mov	edi, DWORD PTR [r15+rax*4]
	call	bcd2hour@PLT
	mov	DWORD PTR 8[r13], eax
	.p2align 4,,10
	.p2align 3
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L16
	lea	rsp, -40[rbp]
	mov	eax, r12d
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L16:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	ds1305_get_alarm, .-ds1305_get_alarm
	.comm	EIO,4,4
	.comm	DS1305_WDAY,8,8
	.comm	DS1305_SEC,8,8
	.comm	DS1305_MIN,8,8
	.comm	DS1305_HOUR,8,8
	.comm	DS1305_CONTROL,4,4
	.comm	DS1305_ALM_LEN,4,4
	.comm	DS1305_ALM_DISABLE,4,4
	.comm	DS1305_AEI0,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-ds1305.c_ds1305_get_alarm.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"alm0 read\000"
	.align	2
.LC1:
	.ascii	"%s: %02x %02x %02x %02x\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ds1305_get_alarm, %function
ds1305_get_alarm:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r3, .L9
	mov	r6, r1
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	mov	r7, r0
	bl	dev_get_drvdata
	mov	r9, #4
	ldr	r3, .L9+4
	ldr	r2, .L9+8
	ldr	r5, [r3]
	ldr	r8, [r0, #4]
	lsl	r5, r5, #2
	add	r1, r5, #7
	bic	r1, r1, #7
	ldr	ip, [r2]
	sub	sp, sp, r1
	ldr	r3, [r0]
	mov	r4, r0
	mov	r2, r9
	mov	r0, r8
	str	r9, [sp]
	sub	r1, fp, #44
	str	ip, [fp, #-44]
	bl	spi_write_then_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r2, [r4]
	ldr	r3, .L9+12
	ldr	r1, [r2]
	ldr	r3, [r3]
	ldr	r4, .L9+16
	tst	r3, r1
	movne	r1, #1
	moveq	r1, #0
	str	r1, [r6]
	ldr	r2, [r2, #4]
	ldr	r0, [r4]
	tst	r3, r2
	movne	r3, #1
	moveq	r3, #0
	str	r3, [r6, #4]
	bl	DS1305_ALM0
	mov	ip, r0
	add	r10, sp, #16
	mov	r3, r10
	mov	r2, r9
	mov	r0, r8
	str	r5, [sp]
	sub	r1, fp, #44
	str	ip, [fp, #-44]
	bl	spi_write_then_read
	subs	r3, r0, #0
	blt	.L1
	ldr	r3, .L9+20
	ldr	r8, .L9+24
	ldr	r2, [r3]
	ldr	r3, [r4]
	ldr	r1, [r10, r2, lsl #2]
	ldr	r2, [r8]
	ldr	r3, [r10, r3, lsl #2]
	ldr	r5, .L9+28
	str	r1, [sp, #8]
	ldr	r1, [r10, r2, lsl #2]
	ldr	r2, [r5]
	str	r1, [sp, #4]
	ldr	r2, [r10, r2, lsl #2]
	mov	r0, r7
	str	r2, [sp]
	ldr	r1, .L9+32
	ldr	r2, .L9+36
	bl	dev_vdbg
	ldr	r2, [r4]
	ldr	r3, .L9+40
	ldr	r0, [r10, r2, lsl #2]
	ldr	r3, [r3]
	tst	r0, r3
	bne	.L3
	ldr	r2, [r5]
	ldr	r2, [r10, r2, lsl #2]
	tst	r3, r2
	bne	.L3
	ldr	r2, [r8]
	ldr	r2, [r10, r2, lsl #2]
	ands	r3, r3, r2
	bne	.L3
	str	r3, [fp, #-48]
	bl	bcd2bin
	ldr	r2, [r5]
	str	r0, [r6, #16]
	ldr	r0, [r10, r2, lsl #2]
	bl	bcd2bin
	ldr	r2, [r8]
	str	r0, [r6, #12]
	ldr	r0, [r10, r2, lsl #2]
	bl	bcd2hour
	ldr	r3, [fp, #-48]
	str	r0, [r6, #8]
.L1:
	ldr	r2, .L9
	ldr	r1, [r2]
	ldr	r2, [fp, #-40]
	eors	r1, r2, r1
	mov	r2, #0
	bne	.L8
	mov	r0, r3
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L3:
	ldr	r3, .L9+44
	ldr	r0, [r3]
	rsb	r3, r0, #0
	b	.L1
.L8:
	bl	__stack_chk_fail
.L10:
	.align	2
.L9:
	.word	.LC2
	.word	DS1305_ALM_LEN
	.word	DS1305_CONTROL
	.word	DS1305_AEI0
	.word	DS1305_SEC
	.word	DS1305_WDAY
	.word	DS1305_HOUR
	.word	DS1305_MIN
	.word	.LC1
	.word	.LC0
	.word	DS1305_ALM_DISABLE
	.word	EIO
	.size	ds1305_get_alarm, .-ds1305_get_alarm
	.comm	EIO,4,4
	.comm	DS1305_WDAY,4,4
	.comm	DS1305_SEC,4,4
	.comm	DS1305_MIN,4,4
	.comm	DS1305_HOUR,4,4
	.comm	DS1305_CONTROL,4,4
	.comm	DS1305_ALM_LEN,4,4
	.comm	DS1305_ALM_DISABLE,4,4
	.comm	DS1305_AEI0,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
