	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __setenv
___setenv:                              ## @__setenv
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rdx, %rbx
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	_envVarsTotal@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	decl	%eax
	movl	%eax, -44(%rbp)
	movq	_envActive@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movq	%rdx, %rdi
	callq	_strlen
	movq	%rax, %r13
	leaq	-44(%rbp), %rdx
	movq	%r12, %rdi
	movq	%r15, %rsi
	xorl	%ecx, %ecx
	callq	___findenv
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	_envVars@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	-44(%rbp), %edi
	movslq	%edi, %rcx
	leaq	(%rcx,%rcx,2), %rdx
	shlq	$4, %rdx
	cmpl	$0, (%rax,%rdx)
	je	LBB0_6
## %bb.3:
	testl	%r14d, %r14d
	je	LBB0_4
## %bb.5:
	addq	%rax, %rdx
	movl	$0, (%rdx)
	decl	-48(%rbp)                       ## 4-byte Folded Spill
	movl	-44(%rbp), %edi
	movslq	%edi, %rcx
LBB0_6:
	leaq	(%rcx,%rcx,2), %rcx
	shlq	$4, %rcx
	cmpq	$0, 40(%rax,%rcx)
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_8
## %bb.7:
	callq	___remove_putenv
	jmp	LBB0_9
LBB0_1:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
LBB0_9:
	movq	_envVarsTotal@GOTPCREL(%rip), %rbx
	movl	(%rbx), %eax
	movl	%eax, -44(%rbp)
	xorl	%eax, %eax
	callq	___enlarge_env
	movl	$-1, %r14d
	testl	%eax, %eax
	je	LBB0_17
## %bb.10:
	leal	(%r15,%r13), %edi
	addl	$2, %edi
	callq	_malloc
	movq	_envVars@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rsi
	movslq	-44(%rbp), %rcx
	movq	%rcx, %rdi
	shlq	$4, %rdi
	leaq	(%rdi,%rdi,2), %rdi
	movq	%rax, 32(%rsi,%rdi)
	movq	(%rdx), %rax
	movq	32(%rax,%rdi), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.12:
	leaq	(%rcx,%rcx,2), %rcx
	shlq	$4, %rcx
	movq	%r15, 16(%rax,%rcx)
	movq	%r13, 8(%rax,%rcx)
	movq	%r12, %rsi
	movq	%r15, %rdx
	callq	_stpncpy
	movq	%rax, %rbx
	movb	$61, (%rax)
	incq	%rbx
	xorl	%r14d, %r14d
	jmp	LBB0_14
LBB0_8:
	cmpq	%r13, 8(%rax,%rcx)
	jb	LBB0_9
## %bb.13:
	movq	24(%rax,%rcx), %rbx
	movb	$1, %r14b
LBB0_14:
	movq	%rbx, %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_strcpy
	movq	_envVars@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	-44(%rbp), %rdx
	shlq	$4, %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movq	%rbx, 24(%rcx,%rdx)
	movq	(%rax), %rax
	movl	$1, (%rax,%rdx)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	incl	%edi
	testb	%r14b, %r14b
	je	LBB0_16
## %bb.15:
	xorl	%r14d, %r14d
	movq	_envActive@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	je	LBB0_17
LBB0_16:
	callq	___rebuild_environ
	movl	%eax, %r14d
	jmp	LBB0_17
LBB0_11:
	decl	(%rbx)
	jmp	LBB0_17
LBB0_4:
	xorl	%r14d, %r14d
LBB0_17:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_envVarsTotal,4,2               ## @envVarsTotal
	.comm	_envActive,4,2                  ## @envActive
	.comm	_envVars,8,3                    ## @envVars
	.no_dead_strip	___setenv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __setenv
___setenv:                              ; @__setenv
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x3
	mov	x19, x2
	mov	x20, x1
	mov	x21, x0
Lloh0:
	adrp	x27, _envVarsTotal@GOTPAGE
Lloh1:
	ldr	x27, [x27, _envVarsTotal@GOTPAGEOFF]
	ldr	w8, [x27]
	sub	w8, w8, #1
	str	w8, [sp, #12]
Lloh2:
	adrp	x24, _envActive@GOTPAGE
Lloh3:
	ldr	x24, [x24, _envActive@GOTPAGEOFF]
	ldr	w25, [x24]
	mov	x0, x2
	bl	_strlen
	mov	x22, x0
	add	x2, sp, #12
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	bl	___findenv
Lloh4:
	adrp	x26, _envVars@GOTPAGE
Lloh5:
	ldr	x26, [x26, _envVars@GOTPAGEOFF]
	cbz	x0, LBB0_8
; %bb.1:
	ldr	x8, [x26]
	ldr	w0, [sp, #12]
	mov	w9, #48
	smaddl	x9, w0, w9, x8
	ldr	w10, [x9]
	cbz	w10, LBB0_4
; %bb.2:
	cbz	w23, LBB0_16
; %bb.3:
	str	wzr, [x9]
	sub	w25, w25, #1
	ldr	w0, [sp, #12]
	sxtw	x9, w0
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	b	LBB0_5
LBB0_4:
	sxtw	x9, w0
LBB0_5:
	mov	w10, #48
	madd	x10, x9, x10, x8
	ldr	x10, [x10, #40]
	cbz	x10, LBB0_7
; %bb.6:
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	___remove_putenv
	b	LBB0_8
LBB0_7:
	mov	w10, #48
	madd	x10, x9, x10, x8
	ldr	x10, [x10, #8]
	cmp	x10, x22
	b.hs	LBB0_13
LBB0_8:
	ldr	w8, [x27]
	str	w8, [sp, #12]
	bl	___enlarge_env
	cbz	w0, LBB0_11
; %bb.9:
	add	w8, w20, w22
	add	w0, w8, #2
	bl	_malloc
	ldr	x9, [x26]
	ldrsw	x8, [sp, #12]
	add	x10, x8, x8, lsl #1
	lsl	x10, x10, #4
	add	x9, x9, x10
	str	x0, [x9, #32]
	ldr	x9, [x26]
	add	x10, x9, x10
	ldr	x0, [x10, #32]
	cbz	x0, LBB0_12
; %bb.10:
	mov	w10, #48
	madd	x8, x8, x10, x9
	stp	x22, x20, [x8, #8]
	mov	x1, x21
	mov	x2, x20
	bl	_stpncpy
	mov	x20, x0
	mov	w21, #0
	mov	w8, #61
	strb	w8, [x20], #1
	b	LBB0_14
LBB0_11:
	mov	w0, #-1
	b	LBB0_18
LBB0_12:
	ldr	w8, [x27]
	sub	w8, w8, #1
	str	w8, [x27]
	mov	w0, #-1
	b	LBB0_18
LBB0_13:
	mov	w10, #48
	madd	x8, x9, x10, x8
	ldr	x20, [x8, #24]
	mov	w21, #1
LBB0_14:
	mov	x0, x20
	mov	x1, x19
	bl	_strcpy
	ldr	x8, [x26]
	ldrsw	x9, [sp, #12]
	add	x9, x9, x9, lsl #1
	lsl	x9, x9, #4
	add	x8, x8, x9
	str	x20, [x8, #24]
	ldr	x8, [x26]
	mov	w10, #1
	str	w10, [x8, x9]
	add	w0, w25, #1
	cbz	w21, LBB0_17
; %bb.15:
	ldr	w8, [x24]
	cmp	w0, w8
	b.ne	LBB0_17
LBB0_16:
	mov	w0, #0
	b	LBB0_18
LBB0_17:
	bl	___rebuild_environ
LBB0_18:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_envVarsTotal,4,2               ; @envVarsTotal
	.comm	_envActive,4,2                  ; @envActive
	.comm	_envVars,8,3                    ; @envVars
	.no_dead_strip	___setenv
.subsections_via_symbols
