	.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, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %r12
	callq	_strlen
	movslq	%eax, %r13
	movq	%r14, %rdi
	callq	_strlen
	incl	%eax
	movslq	%eax, %r15
	movq	___environ@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	testq	%rbx, %rbx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	je	LBB0_12
## %bb.1:
	movq	(%rbx), %r15
	xorl	%r14d, %r14d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%rbx,%r14,8), %r15
	incq	%r14
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r15, %r15
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r15, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_strncmp
	testl	%eax, %eax
	jne	LBB0_2
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpb	$61, (%r15,%r13)
	jne	LBB0_2
## %bb.6:
	xorl	%eax, %eax
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_23
## %bb.7:
	movq	%r15, %rdi
	callq	_strlen
	cltq
	incq	%rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r13), %rdi
	incq	%rdi
	cmpq	%rdi, %rax
	jae	LBB0_24
## %bb.8:
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_22
## %bb.9:
	movq	%rax, %rdi
	movq	%rax, (%rbx,%r14,8)
	jmp	LBB0_25
LBB0_10:
	movq	_last_environ@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_14
## %bb.11:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_13
LBB0_12:
	xorl	%r14d, %r14d
LBB0_13:
	leaq	16(,%r14,8), %rdi
	callq	_malloc
	movq	%rax, %rbx
	jmp	LBB0_15
LBB0_14:
	leaq	16(,%r14,8), %rsi
	movq	%rbx, %rdi
	callq	_realloc
	movq	%rax, %rbx
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_15:
	movl	$-1, %eax
	testq	%rbx, %rbx
	je	LBB0_23
## %bb.16:
	leaq	(%r15,%r13), %rdi
	incq	%rdi
	callq	_malloc
	movq	%rax, (%rbx,%r14,8)
	testq	%rax, %rax
	je	LBB0_21
## %bb.17:
	leaq	1(%r13), %r15
	movq	___environ@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	movq	_last_environ@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rsi
	je	LBB0_19
## %bb.18:
	leaq	(,%r14,8), %rdx
	movq	%rbx, %rdi
	callq	_memcpy
	movq	(%rbx,%r14,8), %rax
LBB0_19:
	movq	%rax, %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_memcpy
	movq	(%rbx,%r14,8), %rax
	movb	$61, (%rax,%r13)
	addq	(%rbx,%r14,8), %r15
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_memcpy
	movq	$0, 8(%rbx,%r14,8)
	movq	___environ@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
	movq	_last_environ@GOTPCREL(%rip), %rax
	movq	%rbx, (%rax)
LBB0_20:
	xorl	%eax, %eax
	jmp	LBB0_23
LBB0_21:
	movq	%rbx, %rdi
	callq	_free
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___set_errno
LBB0_22:
	movl	$-1, %eax
LBB0_23:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movq	(%rbx,%r14,8), %rdi
LBB0_25:
	leaq	1(%r13), %r15
	movq	%r12, %rsi
	movq	%r13, %rdx
	callq	_memcpy
	movq	(%rbx,%r14,8), %rax
	movb	$61, (%rax,%r13)
	addq	(%rbx,%r14,8), %r15
	movq	%r15, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_memcpy
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCK,4,2                       ## @LOCK
	.comm	___environ,8,3                  ## @__environ
	.comm	_last_environ,8,3               ## @last_environ
	.comm	_UNLOCK,4,2                     ## @UNLOCK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.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:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x24, x2
	mov	x19, x1
	mov	x22, x0
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x21, w0
	mov	x0, x19
	bl	_strlen
	add	w8, w0, #1
	sxtw	x20, w8
Lloh0:
	adrp	x26, ___environ@GOTPAGE
Lloh1:
	ldr	x26, [x26, ___environ@GOTPAGEOFF]
	ldr	x23, [x26]
	cbz	x23, LBB0_10
; %bb.1:
	ldr	x25, [x23]
	cbz	x25, LBB0_11
; %bb.2:
	mov	x28, #0
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x27, x28, #1
	add	x8, x23, x28, lsl #3
	ldr	x25, [x8, #8]
	mov	x28, x27
	cbz	x25, LBB0_12
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x25
	mov	x1, x22
	mov	x2, x21
	bl	_strncmp
	cbnz	w0, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldrb	w8, [x25, x21]
	cmp	w8, #61
	b.ne	LBB0_3
; %bb.6:
	cbz	w24, LBB0_23
; %bb.7:
	mov	x0, x25
	bl	_strlen
                                        ; kill: def $w0 killed $w0 def $x0
	sxtw	x8, w0
	add	x8, x8, #1
	add	x24, x21, #1
	add	x0, x24, x20
	cmp	x8, x0
	b.hs	LBB0_21
; %bb.8:
	bl	_malloc
	cbz	x0, LBB0_20
; %bb.9:
	str	x0, [x23, x28, lsl #3]
	b	LBB0_22
LBB0_10:
	mov	x27, #0
	b	LBB0_13
LBB0_11:
	mov	x27, #0
LBB0_12:
Lloh2:
	adrp	x8, _last_environ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _last_environ@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x23, x8
	b.eq	LBB0_19
LBB0_13:
	lsl	x8, x27, #3
	add	x0, x8, #16
	bl	_malloc
	mov	x23, x0
	cbz	x0, LBB0_20
LBB0_14:
	add	x25, x21, #1
	add	x0, x25, x20
	bl	_malloc
	str	x0, [x23, x27, lsl #3]
	cbz	x0, LBB0_18
; %bb.15:
	ldr	x1, [x26]
Lloh5:
	adrp	x28, _last_environ@GOTPAGE
Lloh6:
	ldr	x28, [x28, _last_environ@GOTPAGEOFF]
	ldr	x8, [x28]
	cmp	x1, x8
	b.eq	LBB0_17
; %bb.16:
	lsl	x24, x27, #3
	mov	x0, x23
	mov	x2, x24
	bl	_memcpy
	ldr	x0, [x23, x24]
LBB0_17:
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	add	x22, x23, x27, lsl #3
	ldr	x8, [x22]
	mov	w9, #61
	strb	w9, [x8, x21]
	ldr	x8, [x22]
	add	x0, x8, x25
	mov	x1, x19
	mov	x2, x20
	bl	_memcpy
	mov	w0, #0
	str	xzr, [x22, #8]
	str	x23, [x26]
	str	x23, [x28]
	b	LBB0_24
LBB0_18:
	mov	x0, x23
	bl	_free
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	bl	___set_errno
	mov	w0, #-1
	b	LBB0_24
LBB0_19:
	lsl	x8, x27, #3
	add	x1, x8, #16
	mov	x0, x23
	bl	_realloc
	mov	x23, x0
	cbnz	x0, LBB0_14
LBB0_20:
	mov	w0, #-1
	b	LBB0_24
LBB0_21:
	ldr	x0, [x23, x28, lsl #3]
LBB0_22:
	mov	x1, x22
	mov	x2, x21
	bl	_memcpy
	lsl	x8, x28, #3
	ldr	x9, [x23, x8]
	mov	w10, #61
	strb	w10, [x9, x21]
	ldr	x8, [x23, x8]
	add	x0, x8, x24
	mov	x1, x19
	mov	x2, x20
	bl	_memcpy
LBB0_23:
	mov	w0, #0
LBB0_24:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCK,4,2                       ; @LOCK
	.comm	___environ,8,3                  ; @__environ
	.comm	_last_environ,8,3               ; @last_environ
	.comm	_UNLOCK,4,2                     ; @UNLOCK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
