	.file	"987320.c"
	.intel_syntax noprefix
	.text
	.globl	unsetenv
	.type	unsetenv, @function
unsetenv:
.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, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	movzx	eax, BYTE PTR [rax]
	test	al, al
	je	.L2
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 61
	mov	rdi, rax
	call	strchr@PLT
	test	rax, rax
	je	.L17
.L2:
	call	__errno_location@PLT
	mov	DWORD PTR [rax], 22
	mov	eax, -1
	jmp	.L4
.L17:
	nop
.L3:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L5
.L7:
	add	DWORD PTR -16[rbp], 1
.L5:
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L6
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR [rax]
	mov	rdx, QWORD PTR -8[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L7
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -8[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 61
	jne	.L7
.L6:
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L8
	mov	rax, QWORD PTR __env_map[rip]
	test	rax, rax
	je	.L15
	mov	DWORD PTR -12[rbp], 0
	jmp	.L10
.L12:
	add	DWORD PTR -12[rbp], 1
.L10:
	mov	rdx, QWORD PTR __env_map[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L11
	mov	rdx, QWORD PTR __env_map[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rcx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	cmp	rdx, rax
	jne	.L12
.L11:
	mov	rdx, QWORD PTR __env_map[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	free@PLT
	jmp	.L13
.L14:
	mov	rdx, QWORD PTR __env_map[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	add	rax, 1
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR __env_map[rip]
	mov	edx, DWORD PTR -12[rbp]
	movsx	rdx, edx
	sal	rdx, 3
	add	rdx, rcx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -12[rbp], 1
.L13:
	mov	rdx, QWORD PTR __env_map[rip]
	mov	eax, DWORD PTR -12[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L14
	jmp	.L15
.L16:
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	add	rax, 1
	sal	rax, 3
	add	rax, rdx
	mov	rcx, QWORD PTR __environ[rip]
	mov	edx, DWORD PTR -16[rbp]
	movsx	rdx, edx
	sal	rdx, 3
	add	rdx, rcx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -16[rbp], 1
.L15:
	mov	rdx, QWORD PTR __environ[rip]
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	sal	rax, 3
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L16
	jmp	.L3
.L8:
	mov	eax, 0
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	unsetenv, .-unsetenv
	.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	"987320.c"
	.text
	.align	2
	.global	unsetenv
	.syntax unified
	.arm
	.fpu softvfp
	.type	unsetenv, %function
unsetenv:
	@ 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]
	ldr	r0, [fp, #-24]
	bl	strlen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L2
	mov	r1, #61
	ldr	r0, [fp, #-24]
	bl	strchr
	mov	r3, r0
	cmp	r3, #0
	beq	.L17
.L2:
	bl	__errno_location
	mov	r3, r0
	mov	r2, #22
	str	r2, [r3]
	mvn	r3, #0
	b	.L4
.L17:
	nop
.L3:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L5
.L7:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L5:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L6
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	ldr	r2, [fp, #-8]
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #61
	bne	.L7
.L6:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L8
	ldr	r3, .L18+4
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L15
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L10
.L12:
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L10:
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r2, [r3]
	ldr	r3, .L18
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r3, [r3]
	cmp	r2, r3
	bne	.L12
.L11:
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	b	.L13
.L14:
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	lsl	r3, r3, #2
	add	r2, r2, r3
	ldr	r3, .L18+4
	ldr	r1, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L13:
	ldr	r3, .L18+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-12]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L14
	b	.L15
.L16:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	lsl	r3, r3, #2
	add	r2, r2, r3
	ldr	r3, .L18
	ldr	r1, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r1, r3
	ldr	r2, [r2]
	str	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L15:
	ldr	r3, .L18
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #2
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L16
	b	.L3
.L8:
	mov	r3, #0
.L4:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	__environ
	.word	__env_map
	.size	unsetenv, .-unsetenv
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
