	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_locale_charset                 ## -- Begin function locale_charset
	.p2align	4, 0x90
_locale_charset:                        ## @locale_charset
	.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
	leaq	L_.str(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	cmpb	$0, (%rax)
	jne	LBB0_5
LBB0_2:
	leaq	L_.str.1(%rip), %rdi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	cmpb	$0, (%rax)
	jne	LBB0_5
LBB0_4:
	leaq	L_.str.2(%rip), %rdi
	callq	_getenv
LBB0_5:
	testq	%rax, %rax
	leaq	L_.str.3(%rip), %r14
	cmovneq	%rax, %r14
	xorl	%eax, %eax
	callq	_get_charset_aliases
	cmpb	$0, (%rax)
	je	LBB0_12
## %bb.6:
	movq	%rax, %rbx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	leaq	(%rax,%rbx), %r15
	leaq	(%rax,%rbx), %rdi
	incq	%rdi
	callq	_strlen
	cltq
	leaq	(%rax,%r15), %rbx
	addq	$2, %rbx
	cmpb	$0, 2(%rax,%r15)
	je	LBB0_12
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpb	$42, (%rbx)
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpb	$0, 1(%rbx)
	jne	LBB0_11
LBB0_10:
	movq	%rbx, %rdi
	callq	_strlen
	cltq
	leaq	(%rbx,%rax), %r14
	incq	%r14
LBB0_12:
	cmpb	$0, (%r14)
	leaq	L_.str.4(%rip), %rax
	cmovneq	%r14, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LC_ALL"

L_.str.1:                               ## @.str.1
	.asciz	"LC_CTYPE"

L_.str.2:                               ## @.str.2
	.asciz	"LANG"

L_.str.3:                               ## @.str.3
	.space	1

L_.str.4:                               ## @.str.4
	.asciz	"ASCII"

	.comm	_CODESET,4,2                    ## @CODESET
	.comm	_LC_CTYPE,4,2                   ## @LC_CTYPE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_locale_charset                 ; -- Begin function locale_charset
	.p2align	2
_locale_charset:                        ; @locale_charset
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_2
; %bb.1:
	ldrb	w8, [x0]
	cbnz	w8, LBB0_5
LBB0_2:
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_getenv
	cbz	x0, LBB0_4
; %bb.3:
	ldrb	w8, [x0]
	cbnz	w8, LBB0_5
LBB0_4:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_getenv
LBB0_5:
Lloh6:
	adrp	x8, l_.str.3@PAGE
Lloh7:
	add	x8, x8, l_.str.3@PAGEOFF
	cmp	x0, #0
	csel	x19, x8, x0, eq
	bl	_get_charset_aliases
	ldrb	w8, [x0]
	cbz	w8, LBB0_12
; %bb.6:
	mov	x20, x0
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x20
	bl	_strlen
	add	x8, x20, w0, sxtw
	add	x20, x8, #1
	mov	x0, x20
	bl	_strlen
	add	x20, x20, w0, sxtw
	ldrb	w8, [x20, #1]!
	cbz	w8, LBB0_12
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x20
	bl	_strcmp
	cbz	x0, LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w8, [x20]
	cmp	w8, #42
	b.ne	LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w8, [x20, #1]
	cbnz	w8, LBB0_7
LBB0_11:
	mov	x0, x20
	bl	_strlen
	add	x8, x20, w0, sxtw
	add	x19, x8, #1
LBB0_12:
	ldrb	w8, [x19]
Lloh8:
	adrp	x9, l_.str.4@PAGE
Lloh9:
	add	x9, x9, l_.str.4@PAGEOFF
	cmp	w8, #0
	csel	x0, x9, x19, eq
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LC_ALL"

l_.str.1:                               ; @.str.1
	.asciz	"LC_CTYPE"

l_.str.2:                               ; @.str.2
	.asciz	"LANG"

l_.str.3:                               ; @.str.3
	.space	1

l_.str.4:                               ; @.str.4
	.asciz	"ASCII"

	.comm	_CODESET,4,2                    ; @CODESET
	.comm	_LC_CTYPE,4,2                   ; @LC_CTYPE
.subsections_via_symbols
