	.file	"997810.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"failed to allocate %ld bytes\n"
.LC1:
	.string	"--"
	.align 8
.LC2:
	.string	"found environment variable without =?: %s\n"
.LC3:
	.string	"PATH"
	.align 8
.LC4:
	.string	"error setting PATH: errno %d: %s\n"
.LC5:
	.string	"shouldn't reach here\n"
	.align 8
.LC6:
	.string	"no command specified for env-set to run\n"
	.align 8
.LC7:
	.string	"failed to execvpe %s: errno %d: %s\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 120
	.cfi_offset 3, -24
	mov	DWORD PTR -116[rbp], edi
	mov	QWORD PTR -128[rbp], rsi
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -88[rbp], rax
	mov	eax, DWORD PTR -116[rbp]
	cdqe
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -80[rbp], rax
	mov	DWORD PTR -104[rbp], 0
	mov	DWORD PTR -100[rbp], 0
	mov	DWORD PTR -96[rbp], 1
	mov	DWORD PTR -92[rbp], 1
	jmp	.L2
.L12:
	mov	eax, DWORD PTR -92[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -92[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	QWORD PTR -64[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L3
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -64[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L3:
	mov	rdx, QWORD PTR -72[rbp]
	mov	rax, QWORD PTR -56[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	cmp	DWORD PTR -96[rbp], 1
	je	.L4
	cmp	DWORD PTR -96[rbp], 2
	je	.L5
	jmp	.L14
.L4:
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L7
	mov	DWORD PTR -96[rbp], 2
	mov	rax, QWORD PTR -56[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L7:
	mov	eax, DWORD PTR -100[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -100[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rax, QWORD PTR -56[rbp]
	mov	esi, 61
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -48[rbp], rax
	cmp	QWORD PTR -48[rbp], 0
	jne	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rdx, QWORD PTR -56[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L9
.L8:
	mov	rax, QWORD PTR -48[rbp]
	sub	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR -40[rbp], rax
	mov	rax, QWORD PTR -40[rbp]
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -32[rbp], rax
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	mov	rdi, rax
	call	strlen@PLT
	add	rax, 1
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	cmp	QWORD PTR -24[rbp], 0
	jne	.L10
	mov	rax, QWORD PTR -48[rbp]
	add	rax, 1
	mov	rdi, rax
	call	strlen@PLT
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L10:
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcpy@PLT
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L11
	mov	rcx, QWORD PTR -24[rbp]
	mov	rax, QWORD PTR -32[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	rdi, rax
	call	setenv@PLT
	test	eax, eax
	je	.L11
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rbx
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	call	abort@PLT
.L11:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	jmp	.L2
.L5:
	mov	eax, DWORD PTR -104[rbp]
	lea	edx, 1[rax]
	mov	DWORD PTR -104[rbp], edx
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -88[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -56[rbp]
	mov	QWORD PTR [rdx], rax
	jmp	.L2
.L14:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC5[rip]
	call	fwrite@PLT
	call	abort@PLT
.L2:
	mov	eax, DWORD PTR -92[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -128[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	jne	.L12
	cmp	DWORD PTR -104[rbp], 0
	jg	.L13
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 40
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	eax, 1
	jmp	.L9
.L13:
	mov	eax, DWORD PTR -104[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -88[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	eax, DWORD PTR -100[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	QWORD PTR [rax], 0
	mov	rax, QWORD PTR -88[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR -80[rbp]
	mov	rcx, QWORD PTR -88[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	execvpe@PLT
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	ecx, DWORD PTR [rax]
	mov	rax, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	mov	r8, rbx
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
.L9:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.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	"997810.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"failed to allocate %ld bytes\012\000"
	.align	2
.LC1:
	.ascii	"--\000"
	.align	2
.LC2:
	.ascii	"found environment variable without =?: %s\012\000"
	.align	2
.LC3:
	.ascii	"PATH\000"
	.align	2
.LC4:
	.ascii	"error setting PATH: errno %d: %s\012\000"
	.align	2
.LC5:
	.ascii	"shouldn't reach here\012\000"
	.align	2
.LC6:
	.ascii	"no command specified for env-set to run\012\000"
	.align	2
.LC7:
	.ascii	"failed to execvpe %s: errno %d: %s\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 64
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, fp, lr}
	add	fp, sp, #16
	sub	sp, sp, #76
	str	r0, [fp, #-80]
	str	r1, [fp, #-84]
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-80]
	lsl	r3, r3, #2
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-52]
	mov	r3, #0
	str	r3, [fp, #-72]
	mov	r3, #0
	str	r3, [fp, #-68]
	mov	r3, #1
	str	r3, [fp, #-64]
	mov	r3, #1
	str	r3, [fp, #-60]
	b	.L2
.L12:
	ldr	r3, [fp, #-60]
	add	r2, r3, #1
	str	r2, [fp, #-60]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	ldr	r3, [r3]
	str	r3, [fp, #-48]
	ldr	r0, [fp, #-48]
	bl	strlen
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L3
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-44]
	ldr	r1, .L15+4
	mov	r0, r3
	bl	fprintf
	bl	abort
.L3:
	ldr	r1, [fp, #-48]
	ldr	r0, [fp, #-40]
	bl	strcpy
	ldr	r3, [fp, #-64]
	cmp	r3, #1
	beq	.L4
	ldr	r3, [fp, #-64]
	cmp	r3, #2
	beq	.L5
	b	.L14
.L4:
	ldr	r1, .L15+8
	ldr	r0, [fp, #-48]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L7
	mov	r3, #2
	str	r3, [fp, #-64]
	ldr	r0, [fp, #-40]
	bl	free
	b	.L2
.L7:
	ldr	r3, [fp, #-68]
	add	r2, r3, #1
	str	r2, [fp, #-68]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	ldr	r2, [fp, #-40]
	str	r2, [r3]
	mov	r1, #61
	ldr	r0, [fp, #-40]
	bl	strchr
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bne	.L8
	ldr	r3, .L15
	ldr	r3, [r3]
	ldr	r2, [fp, #-40]
	ldr	r1, .L15+12
	mov	r0, r3
	bl	fprintf
	mov	r3, #1
	b	.L9
.L8:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-40]
	sub	r3, r2, r3
	str	r3, [fp, #-32]
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r2, [fp, #-32]
	ldr	r1, [fp, #-40]
	ldr	r0, [fp, #-28]
	bl	strncpy
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L10
	ldr	r3, .L15
	ldr	r4, [r3]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	add	r3, r3, #1
	mov	r2, r3
	ldr	r1, .L15+4
	mov	r0, r4
	bl	fprintf
	bl	abort
.L10:
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-24]
	bl	strcpy
	ldr	r1, .L15+16
	ldr	r0, [fp, #-28]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L11
	mov	r2, #1
	ldr	r1, [fp, #-24]
	ldr	r0, [fp, #-28]
	bl	setenv
	mov	r3, r0
	cmp	r3, #0
	beq	.L11
	ldr	r3, .L15
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r5
	ldr	r1, .L15+20
	mov	r0, r4
	bl	fprintf
	bl	abort
.L11:
	ldr	r0, [fp, #-28]
	bl	free
	ldr	r0, [fp, #-24]
	bl	free
	b	.L2
.L5:
	ldr	r3, [fp, #-72]
	add	r2, r3, #1
	str	r2, [fp, #-72]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	ldr	r2, [fp, #-40]
	str	r2, [r3]
	b	.L2
.L14:
	ldr	r3, .L15
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L15+24
	bl	fwrite
	bl	abort
.L2:
	ldr	r3, [fp, #-60]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-84]
	add	r3, r2, r3
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L12
	ldr	r3, [fp, #-72]
	cmp	r3, #0
	bgt	.L13
	ldr	r3, .L15
	ldr	r3, [r3]
	mov	r2, #40
	mov	r1, #1
	ldr	r0, .L15+28
	bl	fwrite
	mov	r3, #1
	b	.L9
.L13:
	ldr	r3, [fp, #-72]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-56]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-68]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-52]
	add	r3, r2, r3
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, [fp, #-56]
	ldr	r3, [r3]
	ldr	r2, [fp, #-52]
	ldr	r1, [fp, #-56]
	mov	r0, r3
	bl	execvpe
	ldr	r3, .L15
	ldr	r4, [r3]
	ldr	r3, [fp, #-56]
	ldr	r5, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r6, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	str	r3, [sp]
	mov	r3, r6
	mov	r2, r5
	ldr	r1, .L15+32
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
.L9:
	mov	r0, r3
	sub	sp, fp, #16
	@ sp needed
	pop	{r4, r5, r6, fp, pc}
.L16:
	.align	2
.L15:
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
