	.file	"203460.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"Checking if './newfile' exists..."
.LC1:
	.string	"ls -l ./newfile"
	.align 8
.LC2:
	.string	"Trying to create './newfile' with O_RDONLY | O_CREAT..."
.LC3:
	.string	"./newfile"
	.align 8
.LC4:
	.string	"Unable to create './newfile': %s\n"
	.align 8
.LC5:
	.string	"'./newfile' created. File descriptor is: %d\n"
	.text
	.globl	createFile
	.type	createFile, @function
createFile:
.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, 16
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	system@PLT
	lea	rdi, .LC2[rip]
	call	puts@PLT
	mov	edx, 384
	mov	esi, 64
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L2:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	createFile, .-createFile
	.section	.rodata
	.align 8
.LC6:
	.string	"Trying to create './newfile' with O_RDONLY | O_CREAT | O_EXCL..."
.LC7:
	.string	"Closing failed: %s\n"
	.text
	.globl	failExclFileCreation
	.type	failExclFileCreation, @function
failExclFileCreation:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	lea	rdi, .LC0[rip]
	call	puts@PLT
	lea	rdi, .LC1[rip]
	call	system@PLT
	lea	rdi, .LC6[rip]
	call	puts@PLT
	mov	edx, 384
	mov	esi, 192
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L4
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L4:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	cmp	eax, -1
	jne	.L6
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC7[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L6:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	failExclFileCreation, .-failExclFileCreation
	.section	.rodata
	.align 8
.LC8:
	.string	"Trying to open (non-existant) './nosuchfile' with O_RDONLY..."
.LC9:
	.string	"./nosuchfile"
	.align 8
.LC10:
	.string	"Unable to open './nosuchfile': %s\n"
	.text
	.globl	failOpenNonexistingFile
	.type	failOpenNonexistingFile, @function
failOpenNonexistingFile:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	lea	rdi, .LC8[rip]
	call	puts@PLT
	mov	esi, 0
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L8
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC10[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
.L8:
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	failOpenNonexistingFile, .-failOpenNonexistingFile
	.section	.rodata
	.align 8
.LC11:
	.string	"Trying to open './openex.c' with O_RDONLY..."
.LC12:
	.string	"./openex.c"
	.align 8
.LC13:
	.string	"Unable to open './openex.c': %s\n"
	.align 8
.LC14:
	.string	"'./openex.c' opened. File descriptor is: %d\n"
.LC15:
	.string	"'./openex.c' closed again"
	.text
	.globl	openFile
	.type	openFile, @function
openFile:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	esi, 0
	lea	rdi, .LC12[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L10
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC14[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	test	eax, eax
	jne	.L12
	lea	rdi, .LC15[rip]
	call	puts@PLT
.L12:
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	openFile, .-openFile
	.section	.rodata
.LC16:
	.string	"cp openex.c newfile"
	.align 8
.LC17:
	.string	"Copied 'openex.c' to 'newfile'."
.LC18:
	.string	"ls -l newfile"
	.align 8
.LC19:
	.string	"Trying to open './newfile' with O_RDONLY | O_TRUNC..."
	.align 8
.LC20:
	.string	"Unable to open './newfile': %s\n"
	.align 8
.LC21:
	.string	"'./newfile' opened. File descriptor is: %d\n"
	.align 8
.LC22:
	.string	"'./newfile' truncated -- see 'ls -l newfile'"
	.text
	.globl	truncateFile
	.type	truncateFile, @function
truncateFile:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	lea	rdi, .LC16[rip]
	call	system@PLT
	lea	rdi, .LC17[rip]
	call	puts@PLT
	lea	rdi, .LC18[rip]
	call	system@PLT
	lea	rdi, .LC19[rip]
	call	puts@PLT
	mov	esi, 512
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -4[rbp], eax
	cmp	DWORD PTR -4[rbp], -1
	jne	.L14
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC20[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 1
	call	exit@PLT
.L14:
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, eax
	lea	rdi, .LC21[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdi, .LC22[rip]
	call	puts@PLT
	lea	rdi, .LC18[rip]
	call	system@PLT
	mov	eax, DWORD PTR -4[rbp]
	mov	edi, eax
	call	close@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	truncateFile, .-truncateFile
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, 0
	call	createFile
	lea	rdi, .LC18[rip]
	call	system@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 10
	call	sleep@PLT
	mov	eax, 0
	call	createFile
	lea	rdi, .LC18[rip]
	call	system@PLT
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 10
	call	sleep@PLT
	mov	eax, 0
	call	failExclFileCreation
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 10
	call	sleep@PLT
	mov	eax, 0
	call	openFile
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 10
	call	sleep@PLT
	mov	eax, 0
	call	failOpenNonexistingFile
	mov	edi, 10
	call	putchar@PLT
	mov	edi, 10
	call	sleep@PLT
	mov	eax, 0
	call	truncateFile
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"203460.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Checking if './newfile' exists...\000"
	.align	2
.LC1:
	.ascii	"ls -l ./newfile\000"
	.align	2
.LC2:
	.ascii	"Trying to create './newfile' with O_RDONLY | O_CREA"
	.ascii	"T...\000"
	.align	2
.LC3:
	.ascii	"./newfile\000"
	.align	2
.LC4:
	.ascii	"Unable to create './newfile': %s\012\000"
	.align	2
.LC5:
	.ascii	"'./newfile' created. File descriptor is: %d\012\000"
	.text
	.align	2
	.global	createFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	createFile, %function
createFile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r0, .L3
	bl	puts
	ldr	r0, .L3+4
	bl	system
	ldr	r0, .L3+8
	bl	puts
	mov	r2, #384
	mov	r1, #64
	ldr	r0, .L3+12
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L2
	ldr	r3, .L3+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L3+20
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L2:
	ldr	r1, [fp, #-16]
	ldr	r0, .L3+24
	bl	printf
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	stderr
	.word	.LC4
	.word	.LC5
	.size	createFile, .-createFile
	.section	.rodata
	.align	2
.LC6:
	.ascii	"Trying to create './newfile' with O_RDONLY | O_CREA"
	.ascii	"T | O_EXCL...\000"
	.align	2
.LC7:
	.ascii	"Closing failed: %s\012\000"
	.text
	.align	2
	.global	failExclFileCreation
	.syntax unified
	.arm
	.fpu softvfp
	.type	failExclFileCreation, %function
failExclFileCreation:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r0, .L9
	bl	puts
	ldr	r0, .L9+4
	bl	system
	ldr	r0, .L9+8
	bl	puts
	mov	r2, #384
	mov	r1, #192
	ldr	r0, .L9+12
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L6
	ldr	r3, .L9+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L9+20
	mov	r0, r4
	bl	fprintf
.L6:
	ldr	r0, [fp, #-16]
	bl	close
	mov	r3, r0
	cmn	r3, #1
	bne	.L8
	ldr	r3, .L9+16
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L9+24
	mov	r0, r4
	bl	fprintf
.L8:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC0
	.word	.LC1
	.word	.LC6
	.word	.LC3
	.word	stderr
	.word	.LC4
	.word	.LC7
	.size	failExclFileCreation, .-failExclFileCreation
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Trying to open (non-existant) './nosuchfile' with O"
	.ascii	"_RDONLY...\000"
	.align	2
.LC9:
	.ascii	"./nosuchfile\000"
	.align	2
.LC10:
	.ascii	"Unable to open './nosuchfile': %s\012\000"
	.text
	.align	2
	.global	failOpenNonexistingFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	failOpenNonexistingFile, %function
failOpenNonexistingFile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r0, .L13
	bl	puts
	mov	r1, #0
	ldr	r0, .L13+4
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L12
	ldr	r3, .L13+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L13+12
	mov	r0, r4
	bl	fprintf
.L12:
	ldr	r0, [fp, #-16]
	bl	close
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC8
	.word	.LC9
	.word	stderr
	.word	.LC10
	.size	failOpenNonexistingFile, .-failOpenNonexistingFile
	.section	.rodata
	.align	2
.LC11:
	.ascii	"Trying to open './openex.c' with O_RDONLY...\000"
	.align	2
.LC12:
	.ascii	"./openex.c\000"
	.align	2
.LC13:
	.ascii	"Unable to open './openex.c': %s\012\000"
	.align	2
.LC14:
	.ascii	"'./openex.c' opened. File descriptor is: %d\012\000"
	.align	2
.LC15:
	.ascii	"'./openex.c' closed again\000"
	.text
	.align	2
	.global	openFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	openFile, %function
openFile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r0, .L19
	bl	puts
	mov	r1, #0
	ldr	r0, .L19+4
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L16
	ldr	r3, .L19+8
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L19+12
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L16:
	ldr	r1, [fp, #-16]
	ldr	r0, .L19+16
	bl	printf
	ldr	r0, [fp, #-16]
	bl	close
	mov	r3, r0
	cmp	r3, #0
	bne	.L18
	ldr	r0, .L19+20
	bl	puts
.L18:
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L20:
	.align	2
.L19:
	.word	.LC11
	.word	.LC12
	.word	stderr
	.word	.LC13
	.word	.LC14
	.word	.LC15
	.size	openFile, .-openFile
	.section	.rodata
	.align	2
.LC16:
	.ascii	"cp openex.c newfile\000"
	.align	2
.LC17:
	.ascii	"Copied 'openex.c' to 'newfile'.\000"
	.align	2
.LC18:
	.ascii	"ls -l newfile\000"
	.align	2
.LC19:
	.ascii	"Trying to open './newfile' with O_RDONLY | O_TRUNC."
	.ascii	"..\000"
	.align	2
.LC20:
	.ascii	"Unable to open './newfile': %s\012\000"
	.align	2
.LC21:
	.ascii	"'./newfile' opened. File descriptor is: %d\012\000"
	.align	2
.LC22:
	.ascii	"'./newfile' truncated -- see 'ls -l newfile'\000"
	.text
	.align	2
	.global	truncateFile
	.syntax unified
	.arm
	.fpu softvfp
	.type	truncateFile, %function
truncateFile:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #12
	ldr	r0, .L23
	bl	system
	ldr	r0, .L23+4
	bl	puts
	ldr	r0, .L23+8
	bl	system
	ldr	r0, .L23+12
	bl	puts
	mov	r1, #512
	ldr	r0, .L23+16
	bl	open
	str	r0, [fp, #-16]
	ldr	r3, [fp, #-16]
	cmn	r3, #1
	bne	.L22
	ldr	r3, .L23+20
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L23+24
	mov	r0, r4
	bl	fprintf
	mov	r0, #1
	bl	exit
.L22:
	ldr	r1, [fp, #-16]
	ldr	r0, .L23+28
	bl	printf
	ldr	r0, .L23+32
	bl	puts
	ldr	r0, .L23+8
	bl	system
	ldr	r0, [fp, #-16]
	bl	close
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC16
	.word	.LC17
	.word	.LC18
	.word	.LC19
	.word	.LC3
	.word	stderr
	.word	.LC20
	.word	.LC21
	.word	.LC22
	.size	truncateFile, .-truncateFile
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	createFile
	ldr	r0, .L27
	bl	system
	mov	r0, #10
	bl	putchar
	mov	r0, #10
	bl	sleep
	bl	createFile
	ldr	r0, .L27
	bl	system
	mov	r0, #10
	bl	putchar
	mov	r0, #10
	bl	sleep
	bl	failExclFileCreation
	mov	r0, #10
	bl	putchar
	mov	r0, #10
	bl	sleep
	bl	openFile
	mov	r0, #10
	bl	putchar
	mov	r0, #10
	bl	sleep
	bl	failOpenNonexistingFile
	mov	r0, #10
	bl	putchar
	mov	r0, #10
	bl	sleep
	bl	truncateFile
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC18
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
