	.file	"508622.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"/etc/passwd"
.LC1:
	.string	"./passwd.txt"
	.align 8
.LC2:
	.string	"Error in determining passwd length.\n"
.LC3:
	.string	"Error while writing to file.\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
	sub	rsp, 208
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -184[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -176[rbp], rax
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -184[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	cmp	eax, -1
	jne	.L2
	lea	rsi, .LC2[rip]
	mov	edi, 1
	mov	eax, 0
	call	err@PLT
.L2:
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -168[rbp], rax
	mov	rax, QWORD PTR -184[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -192[rbp], eax
	mov	rax, QWORD PTR -176[rbp]
	mov	edx, 511
	mov	esi, 577
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -188[rbp], eax
	mov	DWORD PTR -196[rbp], 0
	jmp	.L3
.L5:
	mov	eax, DWORD PTR -196[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 58
	jne	.L4
	mov	eax, DWORD PTR -196[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -168[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 63
.L4:
	add	DWORD PTR -196[rbp], 1
.L3:
	mov	eax, DWORD PTR -196[rbp]
	movsx	rdx, eax
	mov	rax, QWORD PTR -168[rbp]
	lea	rcx, [rdx+rax]
	mov	eax, DWORD PTR -192[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	cmp	rax, 1
	je	.L5
	mov	rax, QWORD PTR -112[rbp]
	mov	rdx, rax
	mov	rcx, QWORD PTR -168[rbp]
	mov	eax, DWORD PTR -188[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	rdx, QWORD PTR -112[rbp]
	cmp	rax, rdx
	je	.L6
	lea	rsi, .LC3[rip]
	mov	edi, 3
	mov	eax, 0
	call	err@PLT
.L6:
	mov	eax, DWORD PTR -192[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -188[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rax, QWORD PTR -168[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	edi, 0
	call	exit@PLT
	.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	"508622.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/etc/passwd\000"
	.align	2
.LC1:
	.ascii	"./passwd.txt\000"
	.align	2
.LC2:
	.ascii	"Error in determining passwd length.\012\000"
	.align	2
.LC3:
	.ascii	"Error while writing to file.\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 120
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #120
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L8+4
	str	r3, [fp, #-120]
	ldr	r3, .L8+8
	str	r3, [fp, #-116]
	sub	r3, fp, #100
	mov	r1, r3
	ldr	r0, [fp, #-120]
	bl	stat
	mov	r3, r0
	cmn	r3, #1
	bne	.L2
	ldr	r1, .L8+12
	mov	r0, #1
	bl	err
.L2:
	ldr	r3, [fp, #-56]
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-112]
	mov	r1, #0
	ldr	r0, [fp, #-120]
	bl	open
	str	r0, [fp, #-108]
	ldr	r2, .L8+16
	ldr	r1, .L8+20
	ldr	r0, [fp, #-116]
	bl	open
	str	r0, [fp, #-104]
	mov	r3, #0
	str	r3, [fp, #-124]
	b	.L3
.L5:
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-112]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #58
	bne	.L4
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-112]
	add	r3, r2, r3
	mov	r2, #63
	strb	r2, [r3]
.L4:
	ldr	r3, [fp, #-124]
	add	r3, r3, #1
	str	r3, [fp, #-124]
.L3:
	ldr	r3, [fp, #-124]
	ldr	r2, [fp, #-112]
	add	r3, r2, r3
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-108]
	bl	read
	mov	r3, r0
	cmp	r3, #1
	beq	.L5
	ldr	r3, [fp, #-56]
	mov	r2, r3
	ldr	r1, [fp, #-112]
	ldr	r0, [fp, #-104]
	bl	write
	mov	r2, r0
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	beq	.L6
	ldr	r1, .L8+24
	mov	r0, #3
	bl	err
.L6:
	ldr	r0, [fp, #-108]
	bl	close
	ldr	r0, [fp, #-104]
	bl	close
	ldr	r0, [fp, #-112]
	bl	free
	mov	r0, #0
	bl	exit
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	511
	.word	577
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
