	.file	"890808.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"\nFile seek test"
.LC1:
	.string	"w"
.LC2:
	.string	"/tmp/test.dat"
.LC3:
	.string	"r"
.LC4:
	.string	"Cannot open file for reading"
.LC5:
	.string	"%3d\n"
.LC6:
	.string	"SEEK_END failed %d\n"
.LC7:
	.string	"Cannot SEEK_SET"
.LC8:
	.string	"SEEK_SET failed %d\n"
.LC9:
	.string	"Cannot SEEK_CUR"
.LC10:
	.string	"SEEK_CUR failed %d\n"
.LC11:
	.string	"Test succeeded."
.LC12:
	.string	"Test FAILED!"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	rsi, .LC1[rip]
	lea	rdi, .LC2[rip]
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L2
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	DWORD PTR -16[rbp], 0
	jmp	.L4
.L5:
	mov	rdx, QWORD PTR -8[rbp]
	mov	eax, DWORD PTR -16[rbp]
	mov	rsi, rdx
	mov	edi, eax
	call	putc@PLT
	add	DWORD PTR -16[rbp], 1
.L4:
	cmp	DWORD PTR -16[rbp], 255
	jle	.L5
	mov	rax, QWORD PTR -8[rbp]
	mov	rdx, rax
	lea	rsi, .LC3[rip]
	lea	rdi, .LC2[rip]
	call	freopen@PLT
	cmp	QWORD PTR -8[rbp], rax
	je	.L6
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L3
.L6:
	mov	DWORD PTR -16[rbp], 1
	jmp	.L7
.L19:
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -16[rbp]
	neg	eax
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 2
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, 256
	sub	eax, DWORD PTR -16[rbp]
	cmp	DWORD PTR -12[rbp], eax
	je	.L8
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L8:
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L10
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L9
.L10:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -12[rbp], eax
	mov	eax, DWORD PTR -12[rbp]
	cmp	eax, DWORD PTR -16[rbp]
	je	.L11
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -16[rbp]
	movsx	rcx, eax
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 0
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L12
	lea	rdi, .LC7[rip]
	call	puts@PLT
	jmp	.L9
.L12:
	cmp	DWORD PTR -16[rbp], 127
	jle	.L13
	mov	rcx, -128
	jmp	.L14
.L13:
	mov	ecx, 128
.L14:
	mov	rax, QWORD PTR -8[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	rdi, rax
	call	fseek@PLT
	test	eax, eax
	je	.L15
	lea	rdi, .LC9[rip]
	call	puts@PLT
	jmp	.L9
.L15:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	getc@PLT
	mov	DWORD PTR -12[rbp], eax
	cmp	DWORD PTR -16[rbp], 127
	jle	.L16
	mov	eax, DWORD PTR -16[rbp]
	add	eax, -128
	jmp	.L17
.L16:
	mov	eax, DWORD PTR -16[rbp]
	sub	eax, -128
.L17:
	cmp	DWORD PTR -12[rbp], eax
	je	.L18
	mov	eax, DWORD PTR -12[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L9
.L18:
	add	DWORD PTR -16[rbp], 1
.L7:
	cmp	DWORD PTR -16[rbp], 255
	jle	.L19
.L9:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rdi, .LC2[rip]
	call	remove@PLT
	cmp	DWORD PTR -16[rbp], 255
	jle	.L20
	lea	rax, .LC11[rip]
	jmp	.L21
.L20:
	lea	rax, .LC12[rip]
.L21:
	mov	rdi, rax
	call	puts@PLT
	cmp	DWORD PTR -16[rbp], 255
	setle	al
	movzx	eax, al
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"890808.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"\012File seek test\000"
	.align	2
.LC1:
	.ascii	"w\000"
	.align	2
.LC2:
	.ascii	"/tmp/test.dat\000"
	.align	2
.LC3:
	.ascii	"r\000"
	.align	2
.LC4:
	.ascii	"Cannot open file for reading\000"
	.align	2
.LC5:
	.ascii	"%3d\012\000"
	.align	2
.LC6:
	.ascii	"SEEK_END failed %d\012\000"
	.align	2
.LC7:
	.ascii	"Cannot SEEK_SET\000"
	.align	2
.LC8:
	.ascii	"SEEK_SET failed %d\012\000"
	.align	2
.LC9:
	.ascii	"Cannot SEEK_CUR\000"
	.align	2
.LC10:
	.ascii	"SEEK_CUR failed %d\012\000"
	.align	2
.LC11:
	.ascii	"Test succeeded.\000"
	.align	2
.LC12:
	.ascii	"Test FAILED!\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r0, .L22
	bl	puts
	ldr	r1, .L22+4
	ldr	r0, .L22+8
	bl	fopen
	str	r0, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L2
	ldr	r0, .L22+8
	bl	perror
	mov	r3, #1
	b	.L3
.L2:
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L4
.L5:
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	putc
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L4:
	ldr	r3, [fp, #-16]
	cmp	r3, #255
	ble	.L5
	ldr	r2, [fp, #-12]
	ldr	r1, .L22+12
	ldr	r0, .L22+8
	bl	freopen
	mov	r2, r0
	ldr	r3, [fp, #-12]
	cmp	r3, r2
	beq	.L6
	ldr	r0, .L22+16
	bl	perror
	mov	r3, #1
	b	.L3
.L6:
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L7
.L19:
	ldr	r1, [fp, #-16]
	ldr	r0, .L22+20
	bl	printf
	ldr	r3, [fp, #-16]
	rsb	r3, r3, #0
	mov	r2, #2
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	fseek
	ldr	r0, [fp, #-12]
	bl	getc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-16]
	rsb	r3, r3, #256
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L8
	ldr	r1, [fp, #-8]
	ldr	r0, .L22+24
	bl	printf
	b	.L9
.L8:
	mov	r2, #0
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L22+28
	bl	puts
	b	.L9
.L10:
	ldr	r0, [fp, #-12]
	bl	getc
	str	r0, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r2, r3
	beq	.L11
	ldr	r1, [fp, #-8]
	ldr	r0, .L22+32
	bl	printf
	b	.L9
.L11:
	mov	r2, #0
	ldr	r1, [fp, #-16]
	ldr	r0, [fp, #-12]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L12
	ldr	r0, .L22+28
	bl	puts
	b	.L9
.L12:
	ldr	r3, [fp, #-16]
	cmp	r3, #127
	ble	.L13
	mvn	r3, #127
	b	.L14
.L13:
	mov	r3, #128
.L14:
	mov	r2, #1
	mov	r1, r3
	ldr	r0, [fp, #-12]
	bl	fseek
	mov	r3, r0
	cmp	r3, #0
	beq	.L15
	ldr	r0, .L22+36
	bl	puts
	b	.L9
.L15:
	ldr	r0, [fp, #-12]
	bl	getc
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-16]
	cmp	r3, #127
	ble	.L16
	ldr	r3, [fp, #-16]
	sub	r3, r3, #128
	b	.L17
.L16:
	ldr	r3, [fp, #-16]
	add	r3, r3, #128
.L17:
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	beq	.L18
	ldr	r1, [fp, #-8]
	ldr	r0, .L22+40
	bl	printf
	b	.L9
.L18:
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L7:
	ldr	r3, [fp, #-16]
	cmp	r3, #255
	ble	.L19
.L9:
	ldr	r0, [fp, #-12]
	bl	fclose
	ldr	r0, .L22+8
	bl	remove
	ldr	r3, [fp, #-16]
	cmp	r3, #255
	ble	.L20
	ldr	r3, .L22+44
	b	.L21
.L20:
	ldr	r3, .L22+48
.L21:
	mov	r0, r3
	bl	puts
	ldr	r3, [fp, #-16]
	cmp	r3, #255
	movle	r3, #1
	movgt	r3, #0
	and	r3, r3, #255
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L23:
	.align	2
.L22:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.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
