	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_thread_locale
_set_thread_locale:                     ## @set_thread_locale
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_LC_GLOBAL_LOCALE@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	cmpq	%rdi, (%rax)
	cmovneq	%rdi, %rbx
	movq	_init_key@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_once_control@GOTPCREL(%rip), %rdi
	callq	__once
	testq	%rbx, %rbx
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_xlocale_retain
LBB0_2:
	movq	_locale_info_key@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	callq	_pthread_getspecific
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	cmpq	%rax, %rbx
	je	LBB0_5
## %bb.4:
	movq	%rax, %rdi
	callq	_xlocale_release
LBB0_5:
	movq	_fake_tls@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_7
## %bb.6:
	movq	_thread_local_locale@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	jmp	LBB0_8
LBB0_7:
	movl	(%r15), %edi
	movq	%rbx, %rsi
	callq	_pthread_setspecific
LBB0_8:
	movq	___thread_locale@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	___set_thread_rune_locale       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_LC_GLOBAL_LOCALE,8,3           ## @LC_GLOBAL_LOCALE
	.comm	_once_control,4,2               ## @once_control
	.comm	_init_key,4,2                   ## @init_key
	.comm	_locale_info_key,4,2            ## @locale_info_key
	.comm	_fake_tls,8,3                   ## @fake_tls
	.comm	_thread_local_locale,8,3        ## @thread_local_locale
	.comm	___thread_locale,8,3            ## @__thread_locale
	.no_dead_strip	_set_thread_locale
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_thread_locale
_set_thread_locale:                     ; @set_thread_locale
	.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	x19, x0
Lloh0:
	adrp	x8, _LC_GLOBAL_LOCALE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LC_GLOBAL_LOCALE@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x0
	csel	x20, xzr, x0, eq
Lloh3:
	adrp	x8, _init_key@GOTPAGE
Lloh4:
	ldr	x8, [x8, _init_key@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x0, _once_control@GOTPAGE
Lloh7:
	ldr	x0, [x0, _once_control@GOTPAGEOFF]
	bl	__once
	cbz	x20, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_xlocale_retain
LBB0_2:
Lloh8:
	adrp	x21, _locale_info_key@GOTPAGE
Lloh9:
	ldr	x21, [x21, _locale_info_key@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_pthread_getspecific
	cmp	x0, #0
	ccmp	x20, x0, #4, ne
	b.eq	LBB0_4
; %bb.3:
	bl	_xlocale_release
LBB0_4:
Lloh10:
	adrp	x8, _fake_tls@GOTPAGE
Lloh11:
	ldr	x8, [x8, _fake_tls@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh13:
	adrp	x8, _thread_local_locale@GOTPAGE
Lloh14:
	ldr	x8, [x8, _thread_local_locale@GOTPAGEOFF]
Lloh15:
	str	x20, [x8]
	b	LBB0_7
LBB0_6:
	ldr	w0, [x21]
	mov	x1, x20
	bl	_pthread_setspecific
LBB0_7:
Lloh16:
	adrp	x8, ___thread_locale@GOTPAGE
Lloh17:
	ldr	x8, [x8, ___thread_locale@GOTPAGEOFF]
Lloh18:
	str	x20, [x8]
	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	___set_thread_rune_locale
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotStr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_LC_GLOBAL_LOCALE,8,3           ; @LC_GLOBAL_LOCALE
	.comm	_once_control,4,2               ; @once_control
	.comm	_init_key,4,2                   ; @init_key
	.comm	_locale_info_key,4,2            ; @locale_info_key
	.comm	_fake_tls,8,3                   ; @fake_tls
	.comm	_thread_local_locale,8,3        ; @thread_local_locale
	.comm	___thread_locale,8,3            ; @__thread_locale
	.no_dead_strip	_set_thread_locale
.subsections_via_symbols
