	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function MONTHCAL_GetDayPos
_MONTHCAL_GetDayPos:                    ## @MONTHCAL_GetDayPos
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r13
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	leaq	(%r8,%r8,2), %r14
	movq	(%rax,%r14,4), %rcx
	movq	%rcx, -72(%rbp)
	movl	8(%rax,%r14,4), %eax
	movl	%eax, -64(%rbp)
	movl	$1, -72(%rbp)
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-72(%rbp), %rdi
	callq	_MONTHCAL_CalculateDayOfWeek
                                        ## kill: def $eax killed $eax def $rax
	movl	(%rbx), %ecx
	movl	%eax, %edx
	subl	%ecx, %edx
	negl	%ecx
	addl	%ecx, %eax
	addl	$6, %eax
	cltq
	imulq	$-1840700269, %rax, %rax        ## imm = 0x92492493
	shrq	$32, %rax
	addl	%edx, %eax
	addl	$6, %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	sarl	$2, %eax
	addl	%ecx, %eax
	leal	(,%rax,8), %ecx
	subl	%ecx, %eax
	addl	%edx, %eax
	addl	$6, %eax
	movslq	%eax, %r15
	testq	%r13, %r13
	je	LBB0_3
## %bb.1:
	movq	%rbx, %rdi
	callq	_MONTHCAL_GetCalCount
	decl	%eax
	cltq
	cmpq	%r13, %rax
	jne	LBB0_2
LBB0_3:
	movq	8(%rbx), %rbx
	leaq	-72(%rbp), %rsi
	movq	%r12, %rdi
	callq	_MONTHCAL_CompareMonths
	cmpl	$-1, %eax
	je	LBB0_6
## %bb.4:
	cmpl	$1, %eax
	jne	LBB0_2
## %bb.5:
	movl	4(%rbx,%r14,4), %esi
	movl	8(%rbx,%r14,4), %edi
	callq	_MONTHCAL_MonthLength
	addq	%rax, %r15
LBB0_2:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movslq	(%r12), %rcx
	addq	%r15, %rcx
	movabsq	$2635249153387078803, %rdx      ## imm = 0x2492492492492493
	movq	%rcx, %rax
	mulq	%rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$2, %rax
	leaq	(,%rax,8), %rdx
	movq	%rax, %rsi
	subq	%rdx, %rsi
	addq	%rcx, %rsi
	movq	%rsi, (%rbx)
	jmp	LBB0_7
LBB0_6:
	movl	8(%r12), %edi
	movl	4(%rbx,%r14,4), %esi
	callq	_MONTHCAL_MonthLength
	subq	%rax, %r15
	movslq	(%r12), %rcx
	addq	%r15, %rcx
	movabsq	$2635249153387078803, %rdx      ## imm = 0x2492492492492493
	movq	%rcx, %rax
	mulq	%rdx
	movq	%rcx, %rax
	subq	%rdx, %rax
	shrq	%rax
	addq	%rdx, %rax
	shrq	$2, %rax
	leaq	(,%rax,8), %rdx
	subq	%rdx, %rax
	addq	%rcx, %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_7:
	movq	%rax, (%rdi)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FALSE,4,2                      ## @FALSE
	.no_dead_strip	_MONTHCAL_GetDayPos
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function MONTHCAL_GetDayPos
_MONTHCAL_GetDayPos:                    ; @MONTHCAL_GetDayPos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x22, x4
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x23, x0
	ldr	x8, [x0, #8]
	mov	w9, #12
	madd	x8, x4, x9, x8
	ldr	w9, [x8, #8]
	ldr	x8, [x8]
	str	x8, [sp]
	mov	w8, #1
	str	w9, [sp, #8]
	str	w8, [sp]
Lloh0:
	adrp	x8, _FALSE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, sp
	bl	_MONTHCAL_CalculateDayOfWeek
	ldr	w8, [x23]
	sub	w8, w0, w8
	add	w8, w8, #6
	mov	w9, #9363
	movk	w9, #37449, lsl #16
	smull	x9, w8, w9
	lsr	x9, x9, #32
	add	w9, w9, w8
	asr	w10, w9, #2
	add	w9, w10, w9, lsr #31
	sub	w9, w9, w9, lsl #3
	add	w8, w8, w9
	sxtw	x24, w8
	cbz	x22, LBB0_2
; %bb.1:
	mov	x0, x23
	bl	_MONTHCAL_GetCalCount
	sub	w8, w0, #1
	sxtw	x8, w8
	cmp	x8, x22
	b.ne	LBB0_5
LBB0_2:
	ldr	x23, [x23, #8]
	mov	x1, sp
	mov	x0, x21
	bl	_MONTHCAL_CompareMonths
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.3:
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.4:
	mov	w8, #12
	madd	x8, x22, x8, x23
	ldp	w1, w0, [x8, #4]
	bl	_MONTHCAL_MonthLength
	add	x24, x0, x24
LBB0_5:
	ldrsw	x8, [x21]
	mov	x9, #9363
	movk	x9, #37449, lsl #16
	movk	x9, #18724, lsl #32
	movk	x9, #9362, lsl #48
	add	x10, x24, x8
	umulh	x8, x10, x9
	sub	x9, x10, x8
	add	x8, x8, x9, lsr #1
	lsr	x8, x8, #2
	sub	x9, x8, x8, lsl #3
	add	x9, x10, x9
	b	LBB0_7
LBB0_6:
	ldr	w0, [x21, #8]
	mov	w8, #12
	madd	x8, x22, x8, x23
	ldr	w1, [x8, #4]
	bl	_MONTHCAL_MonthLength
	mov	x8, #0
	ldrsw	x9, [x21]
	sub	x10, x24, x0
	add	x9, x10, x9
	mov	x10, #9363
	movk	x10, #37449, lsl #16
	movk	x10, #18724, lsl #32
	movk	x10, #9362, lsl #48
	umulh	x10, x9, x10
	sub	x11, x9, x10
	add	x10, x10, x11, lsr #1
	lsr	x10, x10, #2
	sub	x10, x10, x10, lsl #3
	add	x9, x9, x10
LBB0_7:
	str	x9, [x20]
	str	x8, [x19]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_FALSE,4,2                      ; @FALSE
	.no_dead_strip	_MONTHCAL_GetDayPos
.subsections_via_symbols
