	.file	"extr_monthcal.c_MONTHCAL_GetMaxDate.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	MONTHCAL_GetMaxDate, @function
MONTHCAL_GetMaxDate:
.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	r12, rdi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rsi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rbx, QWORD PTR 8[rdi]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	lea	r14, 12[rsp]
	call	MONTHCAL_GetCalCount@PLT
	mov	esi, DWORD PTR FALSE[rip]
	mov	rdi, r14
	cdqe
	lea	rax, [rax+rax*2]
	lea	rbx, -12[rbx+rax*4]
	mov	rax, QWORD PTR [rbx]
	mov	QWORD PTR 0[rbp], rax
	mov	eax, DWORD PTR 8[rbx]
	mov	DWORD PTR 8[rbp], eax
	mov	rax, QWORD PTR [rbx]
	mov	QWORD PTR 12[rsp], rax
	mov	eax, DWORD PTR 8[rbx]
	mov	DWORD PTR 12[rsp], 1
	mov	DWORD PTR 20[rsp], eax
	call	MONTHCAL_CalculateDayOfWeek@PLT
	mov	rdi, rbp
	mov	r13d, eax
	call	MONTHCAL_GetNextMonth@PLT
	mov	rdi, r14
	call	MONTHCAL_GetPrevMonth@PLT
	mov	esi, DWORD PTR 16[rsp]
	mov	edi, DWORD PTR 20[rsp]
	call	MONTHCAL_MonthLength@PLT
	mov	edx, DWORD PTR [r12]
	mov	esi, DWORD PTR 16[rsp]
	mov	r8d, eax
	mov	edi, DWORD PTR 20[rsp]
	sub	edx, r13d
	movsx	rax, edx
	mov	ecx, edx
	imul	rax, rax, -1840700269
	sar	ecx, 31
	shr	rax, 32
	add	eax, edx
	sar	eax, 2
	sub	eax, ecx
	lea	ecx, 0[0+rax*8]
	sub	ecx, eax
	sub	edx, ecx
	lea	r12d, 1[rdx+r8]
	mov	DWORD PTR 12[rsp], r12d
	call	MONTHCAL_MonthLength@PLT
	cmp	r12d, eax
	jle	.L2
	sub	DWORD PTR 12[rsp], 7
.L2:
	mov	esi, DWORD PTR 16[rsp]
	mov	edi, DWORD PTR 20[rsp]
	mov	r12d, 41
	call	MONTHCAL_MonthLength@PLT
	mov	esi, DWORD PTR 4[rbx]
	mov	edi, DWORD PTR 8[rbx]
	sub	eax, DWORD PTR 12[rsp]
	sub	r12d, eax
	call	MONTHCAL_MonthLength@PLT
	mov	esi, DWORD PTR TRUE[rip]
	mov	rdi, rbp
	sub	r12d, eax
	mov	DWORD PTR 0[rbp], r12d
	call	MONTHCAL_CalculateDayOfWeek@PLT
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L6
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	pop	rbx
	.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
.L6:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	MONTHCAL_GetMaxDate, .-MONTHCAL_GetMaxDate
	.comm	TRUE,4,4
	.comm	FALSE,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_monthcal.c_MONTHCAL_GetMaxDate.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	MONTHCAL_GetMaxDate, %function
MONTHCAL_GetMaxDate:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L7
	sub	sp, sp, #16
	mov	r6, r1
	ldr	r5, [r0, #4]
	mov	r7, r0
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	MONTHCAL_GetCalCount
	mov	r3, #1
	mov	r4, sp
	add	r0, r0, r0, lsl r3
	add	r0, r5, r0, lsl #2
	sub	r5, r0, #12
	ldm	r5, {r0, r1, r2}
	stm	r6, {r0, r1, r2}
	ldr	ip, .L7+4
	ldm	r5, {r0, r1, r2}
	stm	r4, {r0, r1, r2}
	ldr	r1, [ip]
	mov	r0, r4
	str	r3, [sp]
	bl	MONTHCAL_CalculateDayOfWeek
	mov	r8, r0
	mov	r0, r6
	bl	MONTHCAL_GetNextMonth
	mov	r0, r4
	bl	MONTHCAL_GetPrevMonth
	ldr	r1, [sp, #4]
	ldr	r0, [sp, #8]
	bl	MONTHCAL_MonthLength
	ldr	r3, [r7]
	ldr	r1, .L7+8
	sub	r3, r3, r8
	smull	r2, r1, r3, r1
	asr	r2, r3, #31
	add	r1, r1, r3
	rsb	r2, r2, r1, asr #2
	rsb	r2, r2, r2, lsl #3
	sub	r3, r3, r2
	add	r3, r3, r0
	add	r4, r3, #1
	ldr	r1, [sp, #4]
	ldr	r0, [sp, #8]
	str	r4, [sp]
	bl	MONTHCAL_MonthLength
	cmp	r4, r0
	ldrgt	r3, [sp]
	ldr	r1, [sp, #4]
	subgt	r3, r3, #7
	ldr	r0, [sp, #8]
	strgt	r3, [sp]
	bl	MONTHCAL_MonthLength
	ldr	r4, [sp]
	ldr	r1, [r5, #4]
	sub	r4, r0, r4
	ldr	r0, [r5, #8]
	bl	MONTHCAL_MonthLength
	rsb	r4, r4, #41
	ldr	r3, .L7+12
	sub	r4, r4, r0
	ldr	r1, [r3]
	mov	r0, r6
	str	r4, [r6]
	bl	MONTHCAL_CalculateDayOfWeek
	ldr	r3, .L7
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L6
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L6:
	bl	__stack_chk_fail
.L8:
	.align	2
.L7:
	.word	.LC0
	.word	FALSE
	.word	-1840700269
	.word	TRUE
	.size	MONTHCAL_GetMaxDate, .-MONTHCAL_GetMaxDate
	.comm	TRUE,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
