	.file	"904345.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"/root/test_filesystem_link.txt"
.LC1:
	.string	"/root/link.txt"
.LC2:
	.string	"Hello World\n"
	.align 8
.LC3:
	.string	"ERROR: failed to open a file for write"
	.align 8
.LC4:
	.string	"ERROR: failed to write to the file"
	.align 8
.LC5:
	.string	"ERROR: failed to link the file"
	.align 8
.LC6:
	.string	"ERROR: failed to open the file for read"
	.align 8
.LC7:
	.string	"ERROR: failed to read to the file"
	.align 8
.LC8:
	.string	"ERROR: the message read from the file is not as it was written"
	.align 8
.LC9:
	.string	"ERROR: stat on \"%s\" should return ENOENT"
	.align 8
.LC10:
	.string	"ERROR: failed to rename the file"
	.align 8
.LC11:
	.string	"ERROR: failed to stat the file"
	.align 8
.LC12:
	.string	"link, unlink, rename test successful"
	.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, 360
	.cfi_offset 3, -24
	mov	DWORD PTR -356[rbp], edi
	mov	QWORD PTR -368[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -328[rbp], rax
	lea	rax, .LC1[rip]
	mov	QWORD PTR -320[rbp], rax
	lea	rax, .LC2[rip]
	mov	QWORD PTR -312[rbp], rax
	mov	QWORD PTR -160[rbp], 0
	mov	QWORD PTR -152[rbp], 0
	mov	QWORD PTR -144[rbp], 0
	mov	QWORD PTR -136[rbp], 0
	mov	QWORD PTR -128[rbp], 0
	mov	QWORD PTR -120[rbp], 0
	mov	QWORD PTR -112[rbp], 0
	mov	QWORD PTR -104[rbp], 0
	mov	QWORD PTR -96[rbp], 0
	mov	QWORD PTR -88[rbp], 0
	mov	QWORD PTR -80[rbp], 0
	mov	QWORD PTR -72[rbp], 0
	mov	QWORD PTR -64[rbp], 0
	mov	QWORD PTR -56[rbp], 0
	mov	QWORD PTR -48[rbp], 0
	mov	QWORD PTR -40[rbp], 0
	mov	DWORD PTR -348[rbp], 577
	mov	DWORD PTR -344[rbp], 438
	mov	edx, DWORD PTR -344[rbp]
	mov	ecx, DWORD PTR -348[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	esi, ecx
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -340[rbp], eax
	cmp	DWORD PTR -340[rbp], 0
	jns	.L2
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L2:
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, rax
	mov	rcx, QWORD PTR -312[rbp]
	mov	eax, DWORD PTR -340[rbp]
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	DWORD PTR -336[rbp], eax
	cmp	DWORD PTR -336[rbp], 0
	jg	.L4
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L4:
	mov	eax, DWORD PTR -340[rbp]
	mov	edi, eax
	call	close@PLT
	mov	rdx, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	link@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L5
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L5:
	mov	rax, QWORD PTR -320[rbp]
	mov	edx, 438
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -340[rbp], eax
	cmp	DWORD PTR -340[rbp], 0
	jns	.L6
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L6:
	lea	rcx, -160[rbp]
	mov	eax, DWORD PTR -340[rbp]
	mov	edx, 128
	mov	rsi, rcx
	mov	edi, eax
	call	read@PLT
	mov	DWORD PTR -336[rbp], eax
	mov	eax, DWORD PTR -336[rbp]
	movsx	rbx, eax
	mov	rax, QWORD PTR -312[rbp]
	mov	rdi, rax
	call	strlen@PLT
	cmp	rbx, rax
	je	.L7
	lea	rdi, .LC7[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L7:
	lea	rdx, -160[rbp]
	mov	rax, QWORD PTR -312[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	strcmp@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	je	.L8
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L8:
	mov	rax, QWORD PTR -320[rbp]
	mov	rdi, rax
	call	unlink@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L9
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	eax, -1
	jmp	.L16
.L9:
	lea	rdx, -304[rbp]
	mov	rax, QWORD PTR -320[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L10
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 2
	je	.L11
.L10:
	mov	rax, QWORD PTR -320[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L16
.L11:
	mov	rdx, QWORD PTR -320[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	rename@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L12
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L16
.L12:
	lea	rdx, -304[rbp]
	mov	rax, QWORD PTR -328[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L13
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	cmp	eax, 2
	je	.L14
.L13:
	mov	rax, QWORD PTR -328[rbp]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L16
.L14:
	lea	rdx, -304[rbp]
	mov	rax, QWORD PTR -320[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	stat@PLT
	mov	DWORD PTR -332[rbp], eax
	cmp	DWORD PTR -332[rbp], 0
	jns	.L15
	lea	rdi, .LC11[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, -1
	jmp	.L16
.L15:
	lea	rdi, .LC12[rip]
	call	puts@PLT
	mov	eax, 0
.L16:
	mov	rbx, QWORD PTR -24[rbp]
	sub	rbx, QWORD PTR fs:40
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	"904345.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"/root/test_filesystem_link.txt\000"
	.align	2
.LC1:
	.ascii	"/root/link.txt\000"
	.align	2
.LC2:
	.ascii	"Hello World\012\000"
	.align	2
.LC3:
	.ascii	"ERROR: failed to open a file for write\000"
	.align	2
.LC4:
	.ascii	"ERROR: failed to write to the file\000"
	.align	2
.LC5:
	.ascii	"ERROR: failed to link the file\000"
	.align	2
.LC6:
	.ascii	"ERROR: failed to open the file for read\000"
	.align	2
.LC7:
	.ascii	"ERROR: failed to read to the file\000"
	.align	2
.LC8:
	.ascii	"ERROR: the message read from the file is not as it "
	.ascii	"was written\000"
	.align	2
.LC9:
	.ascii	"ERROR: stat on \"%s\" should return ENOENT\000"
	.align	2
.LC10:
	.ascii	"ERROR: failed to rename the file\000"
	.align	2
.LC11:
	.ascii	"ERROR: failed to stat the file\000"
	.align	2
.LC12:
	.ascii	"link, unlink, rename test successful\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 264
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #264
	str	r0, [fp, #-264]
	str	r1, [fp, #-268]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L18+4
	str	r3, [fp, #-260]
	ldr	r3, .L18+8
	str	r3, [fp, #-256]
	ldr	r3, .L18+12
	str	r3, [fp, #-252]
	mov	r3, #0
	str	r3, [fp, #-136]
	sub	r3, fp, #132
	mov	r2, #124
	mov	r1, #0
	mov	r0, r3
	bl	memset
	ldr	r3, .L18+16
	str	r3, [fp, #-248]
	ldr	r3, .L18+20
	str	r3, [fp, #-244]
	ldr	r2, [fp, #-244]
	ldr	r1, [fp, #-248]
	ldr	r0, [fp, #-260]
	bl	open
	str	r0, [fp, #-240]
	ldr	r3, [fp, #-240]
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L18+24
	bl	puts
	mvn	r3, #0
	b	.L16
.L2:
	ldr	r0, [fp, #-252]
	bl	strlen
	mov	r3, r0
	mov	r2, r3
	ldr	r1, [fp, #-252]
	ldr	r0, [fp, #-240]
	bl	write
	str	r0, [fp, #-236]
	ldr	r3, [fp, #-236]
	cmp	r3, #0
	bgt	.L4
	ldr	r0, .L18+28
	bl	puts
	mvn	r3, #0
	b	.L16
.L4:
	ldr	r0, [fp, #-240]
	bl	close
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-260]
	bl	link
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L18+32
	bl	puts
	mvn	r3, #0
	b	.L16
.L5:
	ldr	r2, .L18+20
	mov	r1, #0
	ldr	r0, [fp, #-256]
	bl	open
	str	r0, [fp, #-240]
	ldr	r3, [fp, #-240]
	cmp	r3, #0
	bge	.L6
	ldr	r0, .L18+36
	bl	puts
	mvn	r3, #0
	b	.L16
.L6:
	sub	r3, fp, #136
	mov	r2, #128
	mov	r1, r3
	ldr	r0, [fp, #-240]
	bl	read
	str	r0, [fp, #-236]
	ldr	r0, [fp, #-252]
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-236]
	cmp	r2, r3
	beq	.L7
	ldr	r0, .L18+40
	bl	puts
	mvn	r3, #0
	b	.L16
.L7:
	sub	r3, fp, #136
	mov	r1, r3
	ldr	r0, [fp, #-252]
	bl	strcmp
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	beq	.L8
	ldr	r0, .L18+44
	bl	puts
	mvn	r3, #0
	b	.L16
.L8:
	ldr	r0, [fp, #-256]
	bl	unlink
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L9
	ldr	r0, .L18+32
	bl	puts
	mvn	r3, #0
	b	.L16
.L9:
	sub	r3, fp, #228
	mov	r1, r3
	ldr	r0, [fp, #-256]
	bl	stat
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L10
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #2
	beq	.L11
.L10:
	ldr	r1, [fp, #-256]
	ldr	r0, .L18+48
	bl	printf
	mvn	r3, #0
	b	.L16
.L11:
	ldr	r1, [fp, #-256]
	ldr	r0, [fp, #-260]
	bl	rename
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L18+52
	bl	printf
	mvn	r3, #0
	b	.L16
.L12:
	sub	r3, fp, #228
	mov	r1, r3
	ldr	r0, [fp, #-260]
	bl	stat
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L13
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	cmp	r3, #2
	beq	.L14
.L13:
	ldr	r1, [fp, #-260]
	ldr	r0, .L18+48
	bl	printf
	mvn	r3, #0
	b	.L16
.L14:
	sub	r3, fp, #228
	mov	r1, r3
	ldr	r0, [fp, #-256]
	bl	stat
	str	r0, [fp, #-232]
	ldr	r3, [fp, #-232]
	cmp	r3, #0
	bge	.L15
	ldr	r0, .L18+56
	bl	printf
	mvn	r3, #0
	b	.L16
.L15:
	ldr	r0, .L18+60
	bl	puts
	mov	r3, #0
.L16:
	ldr	r2, .L18
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L17
	bl	__stack_chk_fail
.L17:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L19:
	.align	2
.L18:
	.word	.LC13
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	577
	.word	438
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
