	.file	"800622.c"
	.intel_syntax noprefix
	.text
	.globl	putenv
	.type	putenv, @function
putenv:
.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, 352
	mov	QWORD PTR -344[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -344[rbp]
	mov	esi, 61
	mov	rdi, rax
	call	strchr@PLT
	mov	QWORD PTR -328[rbp], rax
	cmp	QWORD PTR -328[rbp], 0
	je	.L2
	mov	rax, QWORD PTR -328[rbp]
	sub	rax, QWORD PTR -344[rbp]
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -336[rbp], 0
	jle	.L3
	mov	eax, DWORD PTR -336[rbp]
	cmp	eax, 299
	jbe	.L4
.L3:
	mov	eax, -1
	jmp	.L8
.L4:
	mov	eax, DWORD PTR -336[rbp]
	movsx	rdx, eax
	mov	rcx, QWORD PTR -344[rbp]
	lea	rax, -320[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	strncpy@PLT
	mov	eax, DWORD PTR -336[rbp]
	cdqe
	mov	BYTE PTR -320[rbp+rax], 0
	lea	rax, -320[rbp]
	mov	esi, 438
	mov	rdi, rax
	call	creat@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L6
	mov	eax, 1
	jmp	.L8
.L6:
	add	QWORD PTR -328[rbp], 1
	mov	rax, QWORD PTR -328[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	DWORD PTR -336[rbp], eax
	mov	eax, DWORD PTR -336[rbp]
	movsx	rdx, eax
	lea	rcx, -320[rbp]
	mov	eax, DWORD PTR -332[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	edx, DWORD PTR -336[rbp]
	movsx	rdx, edx
	cmp	rax, rdx
	je	.L7
	mov	eax, -1
	jmp	.L8
.L7:
	mov	eax, DWORD PTR -332[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, 0
	jmp	.L8
.L2:
	mov	eax, -1
.L8:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	putenv, .-putenv
	.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	"800622.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	putenv
	.syntax unified
	.arm
	.fpu softvfp
	.type	putenv, %function
putenv:
	@ args = 0, pretend = 0, frame = 328
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #328
	str	r0, [fp, #-328]
	ldr	r3, .L10
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r1, #61
	ldr	r0, [fp, #-328]
	bl	strchr
	str	r0, [fp, #-320]
	ldr	r3, [fp, #-320]
	cmp	r3, #0
	beq	.L2
	ldr	r2, [fp, #-320]
	ldr	r3, [fp, #-328]
	sub	r3, r2, r3
	str	r3, [fp, #-316]
	ldr	r3, [fp, #-316]
	cmp	r3, #0
	ble	.L3
	ldr	r3, [fp, #-316]
	cmp	r3, #300
	bcc	.L4
.L3:
	mvn	r3, #0
	b	.L8
.L4:
	ldr	r2, [fp, #-316]
	sub	r3, fp, #308
	ldr	r1, [fp, #-328]
	mov	r0, r3
	bl	strncpy
	sub	r2, fp, #308
	ldr	r3, [fp, #-316]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	sub	r3, fp, #308
	ldr	r1, .L10+4
	mov	r0, r3
	bl	creat
	str	r0, [fp, #-312]
	ldr	r3, [fp, #-312]
	cmp	r3, #0
	bge	.L6
	mov	r3, #1
	b	.L8
.L6:
	ldr	r3, [fp, #-320]
	add	r3, r3, #1
	str	r3, [fp, #-320]
	ldr	r0, [fp, #-320]
	bl	strlen
	mov	r3, r0
	str	r3, [fp, #-316]
	ldr	r2, [fp, #-316]
	sub	r3, fp, #308
	mov	r1, r3
	ldr	r0, [fp, #-312]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-316]
	cmp	r3, r2
	beq	.L7
	mvn	r3, #0
	b	.L8
.L7:
	ldr	r0, [fp, #-312]
	bl	close
	mov	r3, #0
	b	.L8
.L2:
	mvn	r3, #0
.L8:
	ldr	r2, .L10
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L9
	bl	__stack_chk_fail
.L9:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	438
	.size	putenv, .-putenv
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
