	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function MONTHCAL_SetFirstDayOfWeek
_MONTHCAL_SetFirstDayOfWeek:            ## @MONTHCAL_SetFirstDayOfWeek
	.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	$328, %rsp                      ## imm = 0x148
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	callq	_MONTHCAL_GetFirstDayOfWeek
	movl	%eax, %r14d
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	xorl	%eax, %eax
	callq	_TRACE
	cmpl	$-1, %ebx
	je	LBB0_1
## %bb.2:
	cmpl	$7, %ebx
	jl	LBB0_4
## %bb.3:
	movq	_TRUE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	movl	$6, %ebx
	jmp	LBB0_8
LBB0_1:
	movq	_LOCALE_USER_DEFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	_LOCALE_IFIRSTDAYOFWEEK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	leaq	-368(%rbp), %r12
	movq	%r12, %rdi
	callq	_ARRAY_SIZE
	movl	%r13d, %edi
	movl	%ebx, %esi
	movq	%r12, %rdx
	movl	%eax, %ecx
	callq	_GetLocaleInfoW
	movq	%r12, %rdi
	callq	_debugstr_w
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_strlenW
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_TRACE
	movq	%r12, %rdi
	callq	_atoiW
	movl	%eax, %ebx
	movq	_FALSE@GOTPCREL(%rip), %rax
	jmp	LBB0_7
LBB0_4:
	cmpl	$-2, %ebx
	jg	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rdi
	movl	%ebx, %esi
	callq	_FIXME
LBB0_6:
	movq	_TRUE@GOTPCREL(%rip), %rax
LBB0_7:
	movq	(%rax), %rax
	movq	%rax, 8(%r15)
	testl	%ebx, %ebx
	js	LBB0_9
LBB0_8:
	leal	1(%rbx), %eax
	imulq	$613566757, %rax, %rcx          ## imm = 0x24924925
	shrq	$32, %rcx
	subl	%ecx, %eax
	shrl	%eax
	addl	%ecx, %eax
	shrl	$2, %eax
	leal	(,%rax,8), %ecx
	subl	%ecx, %eax
	addl	%eax, %ebx
	incl	%ebx
LBB0_9:
	movl	%ebx, (%r15)
	movl	4(%r15), %edi
	movq	_FALSE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	xorl	%esi, %esi
	callq	_InvalidateRect
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%r14d, %eax
	addq	$328, %rsp                      ## imm = 0x148
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d\n"

	.comm	_LOCALE_USER_DEFAULT,4,2        ## @LOCALE_USER_DEFAULT
	.comm	_LOCALE_IFIRSTDAYOFWEEK,4,2     ## @LOCALE_IFIRSTDAYOFWEEK
L_.str.1:                               ## @.str.1
	.asciz	"%s %d\n"

	.comm	_FALSE,8,3                      ## @FALSE
	.comm	_TRUE,8,3                       ## @TRUE
L_.str.2:                               ## @.str.2
	.asciz	"No bug compatibility for day=%d\n"

	.no_dead_strip	_MONTHCAL_SetFirstDayOfWeek
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function MONTHCAL_SetFirstDayOfWeek
_MONTHCAL_SetFirstDayOfWeek:            ; @MONTHCAL_SetFirstDayOfWeek
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #400
	.cfi_def_cfa_offset 400
	stp	x24, x23, [sp, #336]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #352]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #368]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #384]            ; 16-byte Folded Spill
	add	x29, sp, #384
	.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	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	bl	_MONTHCAL_GetFirstDayOfWeek
	mov	x19, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	_TRACE
Lloh5:
	adrp	x23, _FALSE@GOTPAGE
Lloh6:
	ldr	x23, [x23, _FALSE@GOTPAGEOFF]
	cmn	w21, #1
	b.eq	LBB0_3
; %bb.1:
	cmp	w21, #7
	b.lt	LBB0_7
; %bb.2:
Lloh7:
	adrp	x8, _TRUE@GOTPAGE
Lloh8:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh9:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	mov	w21, #6
	b	LBB0_4
LBB0_3:
Lloh10:
	adrp	x8, _LOCALE_USER_DEFAULT@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LOCALE_USER_DEFAULT@GOTPAGEOFF]
Lloh12:
	ldr	w21, [x8]
Lloh13:
	adrp	x8, _LOCALE_IFIRSTDAYOFWEEK@GOTPAGE
Lloh14:
	ldr	x8, [x8, _LOCALE_IFIRSTDAYOFWEEK@GOTPAGEOFF]
Lloh15:
	ldr	w22, [x8]
	add	x0, sp, #8
	bl	_ARRAY_SIZE
	mov	x3, x0
	add	x2, sp, #8
	mov	x0, x21
	mov	x1, x22
	bl	_GetLocaleInfoW
	add	x0, sp, #8
	bl	_debugstr_w
	mov	x21, x0
	add	x0, sp, #8
	bl	_strlenW
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_TRACE
	add	x0, sp, #8
	bl	_atoiW
	mov	x21, x0
	ldr	x8, [x23]
	str	x8, [x20, #8]
	tbnz	w21, #31, LBB0_5
LBB0_4:
	add	w8, w21, #1
	mov	w9, #18725
	movk	w9, #9362, lsl #16
	umull	x9, w8, w9
	lsr	x9, x9, #32
	sub	w10, w8, w9
	add	w9, w9, w10, lsr #1
	lsr	w9, w9, #2
	sub	w9, w9, w9, lsl #3
	add	w21, w8, w9
LBB0_5:
	str	w21, [x20]
	ldr	w0, [x20, #4]
	ldr	x2, [x23]
	mov	x1, #0
	bl	_InvalidateRect
	ldur	x8, [x29, #-56]
Lloh18:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh19:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh20:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_10
; %bb.6:
	mov	x0, x19
	ldp	x29, x30, [sp, #384]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #368]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #352]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #336]            ; 16-byte Folded Reload
	add	sp, sp, #400
	ret
LBB0_7:
	cmn	w21, #2
	b.gt	LBB0_9
; %bb.8:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_FIXME
LBB0_9:
Lloh23:
	adrp	x8, _TRUE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	str	x8, [x20, #8]
	tbz	w21, #31, LBB0_4
	b	LBB0_5
LBB0_10:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d\n"

	.comm	_LOCALE_USER_DEFAULT,4,2        ; @LOCALE_USER_DEFAULT
	.comm	_LOCALE_IFIRSTDAYOFWEEK,4,2     ; @LOCALE_IFIRSTDAYOFWEEK
l_.str.1:                               ; @.str.1
	.asciz	"%s %d\n"

	.comm	_FALSE,8,3                      ; @FALSE
	.comm	_TRUE,8,3                       ; @TRUE
l_.str.2:                               ; @.str.2
	.asciz	"No bug compatibility for day=%d\n"

	.no_dead_strip	_MONTHCAL_SetFirstDayOfWeek
.subsections_via_symbols
