	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setenv                         ## -- Begin function setenv
	.p2align	4, 0x90
_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	%edx, %r13d
	movq	%rsi, %r14
	movq	%rdi, %r15
	movl	$0, -48(%rbp)
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15,%r12), %eax
	testb	%al, %al
	je	LBB0_4
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpb	$61, %al
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	incq	%r12
	jmp	LBB0_1
LBB0_4:
	movq	%r14, %rdi
	callq	_strlen
	movl	%eax, %ebx
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	___findenv
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:
	movl	-48(%rbp), %eax
	incl	%eax
	movl	%eax, -44(%rbp)
	testl	%r13d, %r13d
	je	LBB0_25
## %bb.6:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	-44(%rbp), %rdx
	movq	%r15, %rdi
	movl	%r12d, %esi
	callq	___findenv
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:
	movq	_environ@GOTPCREL(%rip), %r13
	leaq	-44(%rbp), %rbx
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	(%r13), %rax
	movslq	-44(%rbp), %rcx
	leaq	(%rax,%rcx,8), %rax
	addq	$8, %rax
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rax), %rcx
	movq	%rcx, -8(%rax)
	addq	$8, %rax
	testq	%rcx, %rcx
	jne	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	%r15, %rdi
	movl	%r12d, %esi
	movq	%rbx, %rdx
	callq	___findenv
	testq	%rax, %rax
	jne	LBB0_8
LBB0_11:
	movl	-48(%rbp), %ebx
	jmp	LBB0_18
LBB0_12:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_environ@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	$-8, %rbx
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 8(%rax,%rbx)
	leaq	8(%rbx), %rbx
	jne	LBB0_13
## %bb.14:
	movq	_lastenv@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leal	16(%rbx), %esi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_27
## %bb.15:
	movq	%rax, %r13
	movq	%rbx, %rax
	sarq	$3, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movq	_environ@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_lastenv@GOTPCREL(%rip), %rcx
	cmpq	%rsi, (%rcx)
	je	LBB0_17
## %bb.16:
	movq	%r13, %rdi
	movq	%rbx, %rdx
	movq	%rcx, %rbx
	callq	_memcpy
	movq	%rbx, %rcx
LBB0_17:
	movq	_environ@GOTPCREL(%rip), %rax
	movq	%r13, (%rax)
	movq	%r13, (%rcx)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	$0, 8(%r13,%rbx,8)
LBB0_18:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addl	%r12d, %eax
	addl	$2, %eax
	movslq	%eax, %rdi
	callq	_malloc
	movq	_environ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movslq	%ebx, %rdx
	movq	%rax, (%rsi,%rdx,8)
	testq	%rax, %rax
	je	LBB0_27
## %bb.19:
	movq	(%rcx), %rax
	movq	(%rax,%rdx,8), %rax
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movzbl	(%r15), %ecx
	movb	%cl, (%rax)
	testb	%cl, %cl
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	cmpb	$61, %cl
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=1
	incq	%r15
	incq	%rax
	jmp	LBB0_20
LBB0_23:
	movb	$61, (%rax)
	movl	$1, %ecx
	.p2align	4, 0x90
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movzbl	-1(%r14,%rcx), %edx
	movb	%dl, (%rax,%rcx)
	incq	%rcx
	testb	%dl, %dl
	jne	LBB0_24
LBB0_25:
	xorl	%eax, %eax
	jmp	LBB0_28
LBB0_27:
	movl	$-1, %eax
LBB0_28:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_environ,8,3                    ## @environ
	.comm	_lastenv,8,3                    ## @lastenv
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setenv                         ; -- Begin function setenv
	.p2align	2
_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, x2
	mov	x19, x1
	mov	x20, x0
	mov	x21, #0
	str	wzr, [sp, #12]
	ldrb	w8, [x20, x21]
	cbz	w8, LBB0_3
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	cmp	w8, #61
	b.eq	LBB0_3
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	add	x21, x21, #1
	ldrb	w8, [x20, x21]
	cbnz	w8, LBB0_1
LBB0_3:
	mov	x0, x19
	bl	_strlen
	mov	x22, x0
	add	x2, sp, #12
	mov	x0, x20
	mov	x1, x21
	bl	___findenv
	cbz	x0, LBB0_11
; %bb.4:
	ldr	w8, [sp, #12]
	add	w8, w8, #1
	str	w8, [sp, #8]
	cbz	w23, LBB0_24
; %bb.5:
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	___findenv
	cbz	x0, LBB0_10
; %bb.6:
Lloh0:
	adrp	x23, _environ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _environ@GOTPAGEOFF]
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x8, [x23]
	ldrsw	x9, [sp, #8]
	add	x8, x8, x9, lsl #3
	add	x8, x8, #8
LBB0_8:                                 ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x9, [x8]
	stur	x9, [x8, #-8]
	add	x8, x8, #8
	cbnz	x9, LBB0_8
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x21
	bl	___findenv
	cbnz	x0, LBB0_7
LBB0_10:
	ldr	w24, [sp, #12]
	b	LBB0_17
LBB0_11:
	mov	x24, #0
Lloh2:
	adrp	x25, _environ@GOTPAGE
Lloh3:
	ldr	x25, [x25, _environ@GOTPAGEOFF]
	ldr	x8, [x25]
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8, x24]
	add	x24, x24, #8
	cbnz	x9, LBB0_12
; %bb.13:
Lloh4:
	adrp	x26, _lastenv@GOTPAGE
Lloh5:
	ldr	x26, [x26, _lastenv@GOTPAGEOFF]
	ldr	x0, [x26]
	add	w1, w24, #8
	bl	_realloc
	cbz	x0, LBB0_25
; %bb.14:
	mov	x23, x0
	sub	x24, x24, #8
	asr	x27, x24, #3
	ldr	x8, [x26]
	ldr	x1, [x25]
	cmp	x8, x1
	b.eq	LBB0_16
; %bb.15:
	mov	x0, x23
	mov	x2, x24
	bl	_memcpy
LBB0_16:
	lsr	x24, x24, #3
	str	x23, [x25]
	str	x23, [x26]
	add	x8, x23, x27, lsl #3
	str	xzr, [x8, #8]
LBB0_17:
	add	w8, w22, w21
	add	w8, w8, #2
	sxtw	x0, w8
	bl	_malloc
Lloh6:
	adrp	x8, _environ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _environ@GOTPAGEOFF]
	ldr	x9, [x8]
	str	x0, [x9, w24, sxtw #3]
	cbz	x0, LBB0_25
; %bb.18:
                                        ; kill: def $w24 killed $w24 killed $x24 def $x24
	sxtw	x9, w24
	ldr	x8, [x8]
	ldr	x8, [x8, x9, lsl #3]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	add	x8, x8, #1
	ldrb	w9, [x20]
	sturb	w9, [x8, #-1]
	cbz	w9, LBB0_22
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	cmp	w9, #61
	b.eq	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=1
	add	x20, x20, #1
	b	LBB0_19
LBB0_22:
	mov	x9, #0
	mov	w10, #61
	sturb	w10, [x8, #-1]
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldrb	w10, [x19, x9]
	strb	w10, [x8, x9]
	add	x9, x9, #1
	cbnz	w10, LBB0_23
LBB0_24:
	mov	w0, #0
	b	LBB0_26
LBB0_25:
	mov	w0, #-1
LBB0_26:
	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	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_environ,8,3                    ; @environ
	.comm	_lastenv,8,3                    ; @lastenv
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
.subsections_via_symbols
