	.file	"extr_fm_rtc.c_FM_RTC_Init.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Init Parameters are not Valid"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"Invalid relation between source and destination clocks. Should be larger than 1.0001"
	.text
	.p2align 4
	.globl	FM_RTC_Init
	.type	FM_RTC_Init, @function
FM_RTC_Init:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12d, DWORD PTR FALSE[rip]
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	rbx, rdi
	mov	rbp, QWORD PTR 8[rdi]
	mov	r13, QWORD PTR 24[rdi]
	call	CheckInitParameters@PLT
	cmp	rax, QWORD PTR E_OK[rip]
	je	.L2
	mov	esi, DWORD PTR E_CONFLICT[rip]
	mov	edi, DWORD PTR MAJOR[rip]
	lea	rdx, .LC0[rip]
	call	RETURN_ERROR@PLT
.L2:
	mov	rax, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR E_FMAN_RTC_SOURCE_CLOCK_SYSTEM[rip]
	cmp	QWORD PTR [rax], rcx
	je	.L3
	mov	esi, DWORD PTR 8[rax]
	mov	DWORD PTR [rbx], esi
.L4:
	mov	r14d, DWORD PTR 24[rbp]
	test	r14d, r14d
	jne	.L5
	mov	rax, QWORD PTR 8[rbx]
	cmp	QWORD PTR 16[rax], 0
	jne	.L10
.L5:
	imul	esi, DWORD PTR 4[rbx]
	mov	r12d, DWORD PTR TRUE[rip]
	imul	edi, DWORD PTR ACCUMULATOR_OVERFLOW[rip], 1000
	call	DIV_CEIL@PLT
	mov	esi, DWORD PTR [rbx]
	mov	r14d, eax
	mov	eax, DWORD PTR 4[rbx]
	imul	eax, esi
	imul	eax, eax, 10000
	cmp	eax, 10001
	jle	.L11
.L7:
	mov	eax, DWORD PTR 20[rbx]
	mov	r8d, DWORD PTR FM_RTC_NUM_OF_EXT_TRIGGERS[rip]
	mov	r9d, r12d
	mov	rsi, r13
	mov	ecx, DWORD PTR FM_RTC_NUM_OF_PERIODIC_PULSES[rip]
	mov	edx, DWORD PTR FM_RTC_NUM_OF_ALARMS[rip]
	mov	rdi, rbp
	push	rax
	.cfi_def_cfa_offset 56
	push	r14
	.cfi_def_cfa_offset 64
	call	fman_rtc_init@PLT
	mov	edi, DWORD PTR 16[rbx]
	mov	ecx, DWORD PTR e_FM_INTR_TYPE_NORMAL[rip]
	xor	edx, edx
	mov	r8d, DWORD PTR RtcExceptions[rip]
	mov	esi, DWORD PTR e_FM_MOD_TMR[rip]
	mov	r9, rbx
	call	FmRegisterIntr@PLT
	mov	rdi, QWORD PTR 8[rbx]
	call	XX_Free@PLT
	pop	rax
	.cfi_def_cfa_offset 56
	pop	rdx
	.cfi_def_cfa_offset 48
	mov	QWORD PTR 8[rbx], 0
	mov	rax, QWORD PTR E_OK[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
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	eax, 1000
	cdq
	idiv	esi
	mov	DWORD PTR 4[rbx], eax
	imul	eax, esi
	imul	eax, eax, 10000
	cmp	eax, 10001
	jg	.L7
.L11:
	mov	esi, DWORD PTR E_CONFLICT[rip]
	mov	edi, DWORD PTR MAJOR[rip]
	lea	rdx, .LC1[rip]
	call	RETURN_ERROR@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	mov	edi, DWORD PTR 16[rbx]
	call	FmGetMacClockFreq@PLT
	mov	DWORD PTR [rbx], eax
	mov	esi, eax
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	FM_RTC_Init, .-FM_RTC_Init
	.comm	e_FM_MOD_TMR,4,4
	.comm	e_FM_INTR_TYPE_NORMAL,4,4
	.comm	TRUE,4,4
	.comm	RtcExceptions,4,4
	.comm	MAJOR,4,4
	.comm	FM_RTC_NUM_OF_PERIODIC_PULSES,4,4
	.comm	FM_RTC_NUM_OF_EXT_TRIGGERS,4,4
	.comm	FM_RTC_NUM_OF_ALARMS,4,4
	.comm	FALSE,4,4
	.comm	E_OK,8,8
	.comm	E_FMAN_RTC_SOURCE_CLOCK_SYSTEM,8,8
	.comm	E_CONFLICT,4,4
	.comm	ACCUMULATOR_OVERFLOW,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_fm_rtc.c_FM_RTC_Init.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Init Parameters are not Valid\000"
	.global	__aeabi_idiv
	.align	2
.LC1:
	.ascii	"Invalid relation between source and destination clo"
	.ascii	"cks. Should be larger than 1.0001\000"
	.text
	.align	2
	.global	FM_RTC_Init
	.syntax unified
	.arm
	.fpu softvfp
	.type	FM_RTC_Init, %function
FM_RTC_Init:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L15
	sub	sp, sp, #16
	ldr	r7, [r3]
	mov	r4, r0
	ldr	r6, [r0, #8]
	ldr	r8, [r0, #20]
	bl	CheckInitParameters
	ldr	r5, .L15+4
	ldr	r3, [r5]
	cmp	r0, r3
	beq	.L2
	ldr	r2, .L15+8
	ldr	r3, .L15+12
	ldr	r1, [r2]
	ldr	r0, [r3]
	ldr	r2, .L15+16
	bl	RETURN_ERROR
.L2:
	ldr	r3, [r4, #8]
	ldr	r2, .L15+20
	ldr	r1, [r3]
	ldr	r2, [r2]
	cmp	r1, r2
	beq	.L3
	ldr	r10, [r3, #4]
	str	r10, [r4]
.L4:
	ldr	r9, [r6, #12]
	cmp	r9, #0
	bne	.L5
	ldr	r3, [r4, #8]
	ldr	r3, [r3, #8]
	cmp	r3, #0
	bne	.L13
.L5:
	ldr	r3, .L15+24
	ldr	r1, [r4, #4]
	ldr	r0, [r3]
	mul	r1, r10, r1
	rsb	r3, r0, r0, lsl #5
	add	r0, r0, r3, lsl #2
	ldr	r3, .L15+28
	lsl	r0, r0, #3
	ldr	r7, [r3]
	bl	DIV_CEIL
	mov	r9, r0
	ldr	r3, [r4, #4]
	ldr	r10, [r4]
.L6:
	mul	r1, r10, r3
	rsb	r0, r1, r1, lsl #5
	ldr	r3, .L15+32
	add	r1, r1, r0, lsl #2
	add	r1, r1, r1, lsl #2
	cmp	r3, r1, lsl #4
	bge	.L14
.L7:
	ldr	r2, .L15+36
	ldr	r3, .L15+40
	ldr	lr, [r2]
	str	r9, [sp, #8]
	str	r7, [sp, #4]
	ldr	ip, [r4, #16]
	ldr	r2, .L15+44
	str	lr, [sp]
	mov	r1, r8
	ldr	r3, [r3]
	ldr	r2, [r2]
	mov	r0, r6
	str	ip, [sp, #12]
	bl	fman_rtc_init
	ldr	r2, .L15+48
	ldr	r3, .L15+52
	ldr	r1, [r2]
	ldr	r2, .L15+56
	stm	sp, {r1, r4}
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r2, #0
	ldr	r0, [r4, #12]
	bl	FmRegisterIntr
	ldr	r0, [r4, #8]
	bl	XX_Free
	mov	r3, #0
	ldr	r0, [r5]
	str	r3, [r4, #8]
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	mov	r1, r10
	mov	r0, #1000
	bl	__aeabi_idiv
	mov	r3, r0
	str	r0, [r4, #4]
	b	.L6
.L14:
	ldr	r2, .L15+8
	ldr	r3, .L15+12
	ldr	r1, [r2]
	ldr	r0, [r3]
	ldr	r2, .L15+60
	bl	RETURN_ERROR
	b	.L7
.L3:
	ldr	r0, [r4, #12]
	bl	FmGetMacClockFreq
	mov	r10, r0
	str	r0, [r4]
	b	.L4
.L16:
	.align	2
.L15:
	.word	FALSE
	.word	E_OK
	.word	E_CONFLICT
	.word	MAJOR
	.word	.LC0
	.word	E_FMAN_RTC_SOURCE_CLOCK_SYSTEM
	.word	ACCUMULATOR_OVERFLOW
	.word	TRUE
	.word	10001
	.word	FM_RTC_NUM_OF_EXT_TRIGGERS
	.word	FM_RTC_NUM_OF_PERIODIC_PULSES
	.word	FM_RTC_NUM_OF_ALARMS
	.word	RtcExceptions
	.word	e_FM_INTR_TYPE_NORMAL
	.word	e_FM_MOD_TMR
	.word	.LC1
	.size	FM_RTC_Init, .-FM_RTC_Init
	.comm	e_FM_MOD_TMR,4,4
	.comm	e_FM_INTR_TYPE_NORMAL,4,4
	.comm	TRUE,4,4
	.comm	RtcExceptions,4,4
	.comm	MAJOR,4,4
	.comm	FM_RTC_NUM_OF_PERIODIC_PULSES,4,4
	.comm	FM_RTC_NUM_OF_EXT_TRIGGERS,4,4
	.comm	FM_RTC_NUM_OF_ALARMS,4,4
	.comm	FALSE,4,4
	.comm	E_OK,4,4
	.comm	E_FMAN_RTC_SOURCE_CLOCK_SYSTEM,4,4
	.comm	E_CONFLICT,4,4
	.comm	ACCUMULATOR_OVERFLOW,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
