	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function MONTHCAL_GetMonthRange
_MONTHCAL_GetMonthRange:                ## @MONTHCAL_GetMonthRange
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r12
	movl	%esi, %ebx
	movq	%rdi, %r14
	leaq	L_.str(%rip), %rdi
	callq	_TRACE
	cmpl	$129, %ebx
	je	LBB0_8
## %bb.1:
	cmpl	$128, %ebx
	jne	LBB0_11
## %bb.2:
	testq	%r12, %r12
	je	LBB0_7
## %bb.3:
	movq	(%r14), %rax
	movl	8(%rax), %ecx
	movl	%ecx, 8(%r12)
	movq	(%rax), %rax
	movq	%rax, (%r12)
	leaq	12(%r12), %r15
	movq	(%r14), %rbx
	movq	%r14, %rdi
	callq	_MONTHCAL_GetCalCount
	decl	%eax
	cltq
	leaq	(%rax,%rax,2), %rax
	movl	8(%rbx,%rax,4), %ecx
	movl	%ecx, 20(%r12)
	movq	(%rbx,%rax,4), %rax
	movq	%rax, 12(%r12)
	movl	8(%r12), %edx
	movq	_min_allowed_date@GOTPCREL(%rip), %rcx
	movl	$1, %eax
	cmpl	8(%rcx), %edx
	jne	LBB0_6
## %bb.4:
	movl	4(%r12), %edx
	movl	$1, %eax
	cmpl	4(%rcx), %edx
	jne	LBB0_6
## %bb.5:
	movl	(%rcx), %eax
LBB0_6:
	movl	%eax, (%r12)
	movq	_TRUE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_MONTHCAL_CalculateDayOfWeek
	movl	16(%r12), %esi
	movl	20(%r12), %edi
	callq	_MONTHCAL_MonthLength
	movl	%eax, 12(%r12)
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_MONTHCAL_CalculateDayOfWeek
LBB0_7:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_MONTHCAL_GetCalCount           ## TAILCALL
LBB0_8:
	testq	%r12, %r12
	je	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_MONTHCAL_GetMinDate
	addq	$12, %r12
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_MONTHCAL_GetMaxDate
LBB0_10:
	movq	%r14, %rdi
	callq	_MONTHCAL_GetCalCount
	addl	$2, %eax
	jmp	LBB0_12
LBB0_11:
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	callq	_WARN
	xorl	%eax, %eax
LBB0_12:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"flag=%d, st=%p\n"

	.comm	_min_allowed_date,12,2          ## @min_allowed_date
	.comm	_TRUE,4,2                       ## @TRUE
L_.str.1:                               ## @.str.1
	.asciz	"Unknown flag value, got %d\n"

	.no_dead_strip	_MONTHCAL_GetMonthRange
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function MONTHCAL_GetMonthRange
_MONTHCAL_GetMonthRange:                ; @MONTHCAL_GetMonthRange
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_TRACE
	cmp	w21, #129
	b.eq	LBB0_5
; %bb.1:
	cmp	w21, #128
	b.ne	LBB0_8
; %bb.2:
	cbz	x20, LBB0_12
; %bb.3:
	ldr	x8, [x19]
	ldr	x9, [x8]
	ldr	w8, [x8, #8]
	str	w8, [x20, #8]
	str	x9, [x20]
	ldr	x21, [x19]
	mov	x0, x19
	bl	_MONTHCAL_GetCalCount
	mov	w8, #12
	smaddl	x8, w0, w8, x21
	ldur	w9, [x8, #-4]
	ldur	x8, [x8, #-12]
	mov	x21, x20
	str	x8, [x21, #12]!
	str	w9, [x21, #8]
	ldr	w9, [x20, #8]
Lloh2:
	adrp	x8, _min_allowed_date@GOTPAGE
Lloh3:
	ldr	x8, [x8, _min_allowed_date@GOTPAGEOFF]
	ldr	w10, [x8, #8]
	cmp	w9, w10
	b.ne	LBB0_10
; %bb.4:
	ldr	w9, [x20, #4]
	ldp	w8, w10, [x8]
	cmp	w9, w10
	csinc	w8, w8, wzr, eq
	b	LBB0_11
LBB0_5:
	cbz	x20, LBB0_7
; %bb.6:
	mov	x0, x19
	mov	x1, x20
	bl	_MONTHCAL_GetMinDate
	add	x1, x20, #12
	mov	x0, x19
	bl	_MONTHCAL_GetMaxDate
LBB0_7:
	mov	x0, x19
	bl	_MONTHCAL_GetCalCount
	add	w0, w0, #2
	b	LBB0_9
LBB0_8:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_WARN
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w8, #1
LBB0_11:
	str	w8, [x20]
Lloh6:
	adrp	x22, _TRUE@GOTPAGE
Lloh7:
	ldr	x22, [x22, _TRUE@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_MONTHCAL_CalculateDayOfWeek
	ldp	w1, w0, [x20, #16]
	bl	_MONTHCAL_MonthLength
	str	w0, [x20, #12]
	ldr	w1, [x22]
	mov	x0, x21
	bl	_MONTHCAL_CalculateDayOfWeek
LBB0_12:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_MONTHCAL_GetCalCount
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"flag=%d, st=%p\n"

	.comm	_min_allowed_date,12,2          ; @min_allowed_date
	.comm	_TRUE,4,2                       ; @TRUE
l_.str.1:                               ; @.str.1
	.asciz	"Unknown flag value, got %d\n"

	.no_dead_strip	_MONTHCAL_GetMonthRange
.subsections_via_symbols
