	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tr2_sysenv_get                 ## -- Begin function tr2_sysenv_get
	.p2align	4, 0x90
_tr2_sysenv_get:                        ## @tr2_sysenv_get
	.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
	movl	%edi, %ebx
	movq	_TR2_SYSENV_MUST_BE_LAST@GOTPCREL(%rip), %rax
	cmpl	%edi, (%rax)
	ja	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_BUG
LBB0_2:
	movq	_tr2_sysenv_settings@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movl	%ebx, %r12d
	leaq	(%r12,%r12,2), %rbx
	cmpl	$0, (%rax,%rbx,8)
	jne	LBB0_7
## %bb.3:
	movl	16(%rax,%rbx,8), %edi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_6
## %bb.4:
	movq	%rax, %r14
	cmpb	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	(%r15), %rax
	shlq	$3, %r12
	leaq	(%r12,%r12,2), %r12
	movq	8(%rax,%r12), %rdi
	callq	_free
	movq	%r14, %rdi
	callq	_xstrdup
	movq	(%r15), %rcx
	movq	%rax, 8(%rcx,%r12)
LBB0_6:
	movq	(%r15), %rax
	movl	$1, (%rax,%rbx,8)
LBB0_7:
	movq	8(%rax,%rbx,8), %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TR2_SYSENV_MUST_BE_LAST,4,2    ## @TR2_SYSENV_MUST_BE_LAST
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tr2_sysenv_get invalid var '%d'"

	.comm	_tr2_sysenv_settings,8,3        ## @tr2_sysenv_settings
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tr2_sysenv_get                 ; -- Begin function tr2_sysenv_get
	.p2align	2
_tr2_sysenv_get:                        ; @tr2_sysenv_get
	.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, _TR2_SYSENV_MUST_BE_LAST@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TR2_SYSENV_MUST_BE_LAST@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w0
	b.hi	LBB0_2
; %bb.1:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_BUG
LBB0_2:
Lloh5:
	adrp	x21, _tr2_sysenv_settings@GOTPAGE
Lloh6:
	ldr	x21, [x21, _tr2_sysenv_settings@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w20, w19
	mov	w9, #24
	umull	x9, w19, w9
	ldr	w9, [x8, x9]
	cbnz	w9, LBB0_7
; %bb.3:
	mov	w9, #24
	madd	x8, x20, x9, x8
	ldr	w0, [x8, #16]
	bl	_getenv
	cbz	x0, LBB0_6
; %bb.4:
	mov	x19, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_6
; %bb.5:
	ldr	x8, [x21]
	add	x9, x20, x20, lsl #1
	lsl	x22, x9, #3
	add	x8, x8, x22
	ldr	x0, [x8, #8]
	bl	_free
	mov	x0, x19
	bl	_xstrdup
	ldr	x8, [x21]
	add	x8, x8, x22
	str	x0, [x8, #8]
LBB0_6:
	ldr	x8, [x21]
	mov	w9, #24
	mul	x9, x20, x9
	mov	w10, #1
	str	w10, [x8, x9]
LBB0_7:
	mov	w9, #24
	madd	x8, x20, x9, x8
	ldr	x0, [x8, #8]
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_TR2_SYSENV_MUST_BE_LAST,4,2    ; @TR2_SYSENV_MUST_BE_LAST
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tr2_sysenv_get invalid var '%d'"

	.comm	_tr2_sysenv_settings,8,3        ; @tr2_sysenv_settings
.subsections_via_symbols
