	.file	"503331.c"
	.intel_syntax noprefix
	.text
	.type	count_instances, @function
count_instances:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -20[rbp], 0
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR environ[rip]
	mov	QWORD PTR -16[rbp], rax
	jmp	.L2
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, QWORD PTR [rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncmp@PLT
	test	eax, eax
	jne	.L3
	mov	rax, QWORD PTR -16[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 61
	jne	.L3
	add	DWORD PTR -20[rbp], 1
.L3:
	add	QWORD PTR -16[rbp], 8
.L2:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L4
	mov	eax, DWORD PTR -20[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	count_instances, .-count_instances
	.section	.rodata
.LC0:
	.string	"HOME=/root"
.LC1:
	.string	"USER=root"
.LC2:
	.string	"LOGNAME=root"
.LC3:
	.string	"SHELL=/bin/sh"
	.text
	.type	fake_env, @function
fake_env:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	lea	rax, .LC0[rip]
	mov	QWORD PTR fakenv.0[rip], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR fakenv.0[rip+8], rax
	lea	rax, .LC2[rip]
	mov	QWORD PTR fakenv.0[rip+16], rax
	lea	rax, .LC3[rip]
	mov	QWORD PTR fakenv.0[rip+24], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR fakenv.0[rip+32], rax
	mov	QWORD PTR fakenv.0[rip+40], 0
	lea	rax, fakenv.0[rip]
	mov	QWORD PTR environ[rip], rax
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	fake_env, .-fake_env
	.section	.rodata
.LC4:
	.string	"S"
.LC5:
	.string	"MALLOC_OPTIONS"
.LC6:
	.string	"USER"
	.align 8
.LC7:
	.string	"initial: %d instances of USER, expected %d\n"
	.align 8
.LC8:
	.string	"unsetenv: failed to remove USER\n"
	.align 8
.LC9:
	.string	"unsetenv: %d instances of USER, expected %d\n"
.LC10:
	.string	"nobody"
.LC11:
	.string	"setenv: failed to set USER\n"
	.align 8
.LC12:
	.string	"setenv: %d instances of USER, expected %d\n"
.LC13:
	.string	"USER=nobody"
.LC14:
	.string	"putenv: failed to set USER\n"
	.align 8
.LC15:
	.string	"putenv: %d instances of USER, expected %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	DWORD PTR -20[rbp], edi
	mov	QWORD PTR -32[rbp], rsi
	mov	DWORD PTR -8[rbp], 0
	mov	edx, 0
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	setenv@PLT
	call	fake_env
	lea	rdi, .LC6[rip]
	call	count_instances
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 2
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, 2
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -8[rbp], 1
.L8:
	lea	rdi, .LC6[rip]
	call	unsetenv@PLT
	test	eax, eax
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 32
	mov	esi, 1
	lea	rdi, .LC8[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L9:
	lea	rdi, .LC6[rip]
	call	count_instances
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 0
	je	.L10
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, 0
	lea	rsi, .LC9[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -8[rbp], 1
.L10:
	call	fake_env
	mov	edx, 0
	lea	rsi, .LC10[rip]
	lea	rdi, .LC6[rip]
	call	setenv@PLT
	test	eax, eax
	je	.L11
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L11:
	lea	rdi, .LC6[rip]
	call	count_instances
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 2
	je	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, 2
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -8[rbp], 1
.L12:
	call	fake_env
	mov	edx, 1
	lea	rsi, .LC10[rip]
	lea	rdi, .LC6[rip]
	call	setenv@PLT
	test	eax, eax
	je	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L13:
	lea	rdi, .LC6[rip]
	call	count_instances
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 1
	je	.L14
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, 1
	lea	rsi, .LC12[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -8[rbp], 1
.L14:
	call	fake_env
	lea	rdi, .LC13[rip]
	call	putenv@PLT
	test	eax, eax
	je	.L15
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 27
	mov	esi, 1
	lea	rdi, .LC14[rip]
	call	fwrite@PLT
	add	DWORD PTR -8[rbp], 1
.L15:
	lea	rdi, .LC6[rip]
	call	count_instances
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], 1
	je	.L16
	mov	rax, QWORD PTR stderr[rip]
	mov	edx, DWORD PTR -4[rbp]
	mov	ecx, 1
	lea	rsi, .LC15[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -8[rbp], 1
.L16:
	mov	eax, DWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	main, .-main
	.local	fakenv.0
	.comm	fakenv.0,56,32
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"503331.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	count_instances, %function
count_instances:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-16]
	ldr	r0, [fp, #-24]
	bl	strlen
	str	r0, [fp, #-8]
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	b	.L2
.L4:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	strncmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L3
	ldr	r3, [fp, #-12]
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #61
	bne	.L3
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L3:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	str	r3, [fp, #-12]
.L2:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L4
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	environ
	.size	count_instances, .-count_instances
	.section	.rodata
	.align	2
.LC0:
	.ascii	"HOME=/root\000"
	.align	2
.LC1:
	.ascii	"USER=root\000"
	.align	2
.LC2:
	.ascii	"LOGNAME=root\000"
	.align	2
.LC3:
	.ascii	"SHELL=/bin/sh\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	fake_env, %function
fake_env:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	ldr	r3, .L9
	ldr	r2, .L9+4
	str	r2, [r3]
	ldr	r3, .L9
	ldr	r2, .L9+8
	str	r2, [r3, #4]
	ldr	r3, .L9
	ldr	r2, .L9+12
	str	r2, [r3, #8]
	ldr	r3, .L9
	ldr	r2, .L9+16
	str	r2, [r3, #12]
	ldr	r3, .L9
	ldr	r2, .L9+8
	str	r2, [r3, #16]
	ldr	r3, .L9
	mov	r2, #0
	str	r2, [r3, #20]
	ldr	r3, .L9+20
	ldr	r2, .L9
	str	r2, [r3]
	nop
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L10:
	.align	2
.L9:
	.word	fakenv.5914
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	environ
	.size	fake_env, .-fake_env
	.section	.rodata
	.align	2
.LC4:
	.ascii	"S\000"
	.align	2
.LC5:
	.ascii	"MALLOC_OPTIONS\000"
	.align	2
.LC6:
	.ascii	"USER\000"
	.align	2
.LC7:
	.ascii	"initial: %d instances of USER, expected %d\012\000"
	.align	2
.LC8:
	.ascii	"unsetenv: failed to remove USER\012\000"
	.align	2
.LC9:
	.ascii	"unsetenv: %d instances of USER, expected %d\012\000"
	.align	2
.LC10:
	.ascii	"nobody\000"
	.align	2
.LC11:
	.ascii	"setenv: failed to set USER\012\000"
	.align	2
.LC12:
	.ascii	"setenv: %d instances of USER, expected %d\012\000"
	.align	2
.LC13:
	.ascii	"USER=nobody\000"
	.align	2
.LC14:
	.ascii	"putenv: failed to set USER\012\000"
	.align	2
.LC15:
	.ascii	"putenv: %d instances of USER, expected %d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-12]
	mov	r2, #0
	ldr	r1, .L22
	ldr	r0, .L22+4
	bl	setenv
	bl	fake_env
	ldr	r0, .L22+8
	bl	count_instances
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #2
	beq	.L12
	ldr	r3, .L22+12
	ldr	r0, [r3]
	mov	r3, #2
	ldr	r2, [fp, #-8]
	ldr	r1, .L22+16
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L12:
	ldr	r0, .L22+8
	bl	unsetenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
	ldr	r3, .L22+12
	ldr	r3, [r3]
	mov	r2, #32
	mov	r1, #1
	ldr	r0, .L22+20
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L13:
	ldr	r0, .L22+8
	bl	count_instances
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L14
	ldr	r3, .L22+12
	ldr	r0, [r3]
	mov	r3, #0
	ldr	r2, [fp, #-8]
	ldr	r1, .L22+24
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L14:
	bl	fake_env
	mov	r2, #0
	ldr	r1, .L22+28
	ldr	r0, .L22+8
	bl	setenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r3, .L22+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L22+32
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L15:
	ldr	r0, .L22+8
	bl	count_instances
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #2
	beq	.L16
	ldr	r3, .L22+12
	ldr	r0, [r3]
	mov	r3, #2
	ldr	r2, [fp, #-8]
	ldr	r1, .L22+36
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L16:
	bl	fake_env
	mov	r2, #1
	ldr	r1, .L22+28
	ldr	r0, .L22+8
	bl	setenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
	ldr	r3, .L22+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L22+32
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L17:
	ldr	r0, .L22+8
	bl	count_instances
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	beq	.L18
	ldr	r3, .L22+12
	ldr	r0, [r3]
	mov	r3, #1
	ldr	r2, [fp, #-8]
	ldr	r1, .L22+36
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L18:
	bl	fake_env
	ldr	r0, .L22+40
	bl	putenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L19
	ldr	r3, .L22+12
	ldr	r3, [r3]
	mov	r2, #27
	mov	r1, #1
	ldr	r0, .L22+44
	bl	fwrite
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L19:
	ldr	r0, .L22+8
	bl	count_instances
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #1
	beq	.L20
	ldr	r3, .L22+12
	ldr	r0, [r3]
	mov	r3, #1
	ldr	r2, [fp, #-8]
	ldr	r1, .L22+48
	bl	fprintf
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L20:
	ldr	r3, [fp, #-12]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	stderr
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	main, .-main
	.local	fakenv.5914
	.comm	fakenv.5914,28,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
