	.file	"562829.c"
	.intel_syntax noprefix
	.text
	.local	xv6env
	.comm	xv6env,800,32
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"/etc/env"
	.text
	.globl	loadxv6env
	.type	loadxv6env, @function
loadxv6env:
.LFB0:
	.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, 232
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -236[rbp], 0
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -232[rbp], rax
	cmp	QWORD PTR -232[rbp], 0
	je	.L11
	jmp	.L4
.L8:
	movzx	eax, BYTE PTR -224[rbp]
	cmp	al, 35
	jne	.L5
	jmp	.L4
.L5:
	cmp	DWORD PTR -236[rbp], 100
	je	.L12
	lea	rax, -224[rbp]
	mov	rdi, rax
	call	strlen@PLT
	sub	rax, 1
	mov	BYTE PTR -224[rbp+rax], 0
	mov	ebx, DWORD PTR -236[rbp]
	lea	eax, 1[rbx]
	mov	DWORD PTR -236[rbp], eax
	lea	rax, -224[rbp]
	mov	rdi, rax
	call	strdup@PLT
	mov	rcx, rax
	movsx	rax, ebx
	lea	rdx, 0[0+rax*8]
	lea	rax, xv6env[rip]
	mov	QWORD PTR [rdx+rax], rcx
.L4:
	mov	rdx, QWORD PTR -232[rbp]
	lea	rax, -224[rbp]
	mov	esi, 199
	mov	rdi, rax
	call	fgets@PLT
	test	rax, rax
	jne	.L8
	jmp	.L7
.L12:
	nop
.L7:
	mov	rax, QWORD PTR -232[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rax, xv6env[rip]
	mov	QWORD PTR environ[rip], rax
	jmp	.L1
.L11:
	nop
.L1:
	mov	rax, QWORD PTR -24[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	loadxv6env, .-loadxv6env
	.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	"562829.c"
	.text
	.local	xv6env
	.comm	xv6env,400,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"/etc/env\000"
	.align	2
.LC2:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	loadxv6env
	.syntax unified
	.arm
	.fpu softvfp
	.type	loadxv6env, %function
loadxv6env:
	@ args = 0, pretend = 0, frame = 216
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #220
	ldr	r3, .L13
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-224]
	ldr	r1, .L13+4
	ldr	r0, .L13+8
	bl	fopen
	str	r0, [fp, #-220]
	ldr	r3, [fp, #-220]
	cmp	r3, #0
	beq	.L11
	b	.L4
.L8:
	ldrb	r3, [fp, #-216]	@ zero_extendqisi2
	cmp	r3, #35
	bne	.L5
	b	.L4
.L5:
	ldr	r3, [fp, #-224]
	cmp	r3, #100
	beq	.L12
	sub	r3, fp, #216
	mov	r0, r3
	bl	strlen
	mov	r3, r0
	sub	r3, r3, #1
	sub	r2, fp, #12
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3, #-204]
	ldr	r4, [fp, #-224]
	add	r3, r4, #1
	str	r3, [fp, #-224]
	sub	r3, fp, #216
	mov	r0, r3
	bl	strdup
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L13+12
	str	r2, [r3, r4, lsl #2]
.L4:
	sub	r3, fp, #216
	ldr	r2, [fp, #-220]
	mov	r1, #199
	mov	r0, r3
	bl	fgets
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	b	.L7
.L12:
	nop
.L7:
	ldr	r0, [fp, #-220]
	bl	fclose
	ldr	r3, .L13+16
	ldr	r2, .L13+12
	str	r2, [r3]
	b	.L1
.L11:
	nop
.L1:
	ldr	r3, .L13
	ldr	r2, [r3]
	ldr	r3, [fp, #-16]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L10
	bl	__stack_chk_fail
.L10:
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC2
	.word	.LC0
	.word	.LC1
	.word	xv6env
	.word	environ
	.size	loadxv6env, .-loadxv6env
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
