	.file	"30651.c"
	.intel_syntax noprefix
	.text
	.globl	stdio_block_read
	.data
	.align 4
	.type	stdio_block_read, @object
	.size	stdio_block_read, 4
stdio_block_read:
	.long	1
	.globl	stdio_block_write
	.align 4
	.type	stdio_block_write, @object
	.size	stdio_block_write, 4
stdio_block_write:
	.long	1
	.section	.rodata
.LC0:
	.string	"rw"
.LC1:
	.string	"w+"
	.align 8
.LC2:
	.string	"Where does this text come from?"
.LC3:
	.string	"\nTest succeeded."
.LC4:
	.string	"\nTest 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, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movabs	rax, 7454972714070930479
	mov	QWORD PTR -63[rbp], rax
	mov	DWORD PTR -55[rbp], 1702112820
	mov	WORD PTR -51[rbp], 29811
	mov	BYTE PTR -49[rbp], 0
	jmp	.L2
.L5:
	cmp	DWORD PTR -76[rbp], 114
	je	.L3
	cmp	DWORD PTR -76[rbp], 119
	je	.L4
	jmp	.L2
.L3:
	mov	DWORD PTR stdio_block_read[rip], 0
	jmp	.L2
.L4:
	mov	DWORD PTR stdio_block_write[rip], 0
	nop
.L2:
	mov	rcx, QWORD PTR -96[rbp]
	mov	eax, DWORD PTR -84[rbp]
	lea	rdx, .LC0[rip]
	mov	rsi, rcx
	mov	edi, eax
	call	getopt@PLT
	mov	DWORD PTR -76[rbp], eax
	cmp	DWORD PTR -76[rbp], -1
	jne	.L5
	lea	rax, -63[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -72[rbp], rax
	mov	DWORD PTR -76[rbp], 0
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -72[rbp]
	mov	rsi, rax
	mov	edi, 120
	call	putc@PLT
	add	DWORD PTR -76[rbp], 1
.L6:
	cmp	DWORD PTR -76[rbp], 8999
	jle	.L7
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, 0
	mov	esi, 8180
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rcx, rax
	mov	edx, 31
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	edx, 0
	mov	esi, 8180
	mov	rdi, rax
	call	fseek@PLT
	mov	rdx, QWORD PTR -72[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 31
	mov	esi, 1
	mov	rdi, rax
	call	fread@PLT
	mov	rdx, QWORD PTR stdout[rip]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 31
	mov	esi, 1
	mov	rdi, rax
	call	fwrite@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rdi, rax
	call	fclose@PLT
	lea	rax, -63[rbp]
	mov	rdi, rax
	call	remove@PLT
	lea	rax, -48[rbp]
	mov	edx, 31
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	memcmp@PLT
	test	eax, eax
	jne	.L8
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	eax, 0
	jmp	.L10
.L8:
	lea	rdi, .LC4[rip]
	call	puts@PLT
	mov	eax, 1
.L10:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	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	"30651.c"
	.text
	.global	stdio_block_read
	.data
	.align	2
	.type	stdio_block_read, %object
	.size	stdio_block_read, 4
stdio_block_read:
	.word	1
	.global	stdio_block_write
	.align	2
	.type	stdio_block_write, %object
	.size	stdio_block_write, 4
stdio_block_write:
	.word	1
	.section	.rodata
	.align	2
.LC1:
	.ascii	"rw\000"
	.align	2
.LC2:
	.ascii	"w+\000"
	.align	2
.LC3:
	.ascii	"Where does this text come from?\000"
	.align	2
.LC4:
	.ascii	"\012Test succeeded.\000"
	.align	2
.LC5:
	.ascii	"\012Test FAILED!\000"
	.align	2
.LC0:
	.ascii	"/tmp/bug4.test\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	str	r0, [fp, #-72]
	str	r1, [fp, #-76]
	ldr	r3, .L12
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L12+4
	sub	ip, fp, #56
	ldm	r3, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2}
	strh	r3, [ip]	@ movhi
	add	ip, ip, #2
	lsr	r3, r3, #16
	strb	r3, [ip]
	b	.L2
.L5:
	ldr	r3, [fp, #-64]
	cmp	r3, #114
	beq	.L3
	ldr	r3, [fp, #-64]
	cmp	r3, #119
	beq	.L4
	b	.L2
.L3:
	ldr	r3, .L12+8
	mov	r2, #0
	str	r2, [r3]
	b	.L2
.L4:
	ldr	r3, .L12+12
	mov	r2, #0
	str	r2, [r3]
	nop
.L2:
	ldr	r2, .L12+16
	ldr	r1, [fp, #-76]
	ldr	r0, [fp, #-72]
	bl	getopt
	str	r0, [fp, #-64]
	ldr	r3, [fp, #-64]
	cmn	r3, #1
	bne	.L5
	sub	r3, fp, #56
	ldr	r1, .L12+20
	mov	r0, r3
	bl	fopen
	str	r0, [fp, #-60]
	mov	r3, #0
	str	r3, [fp, #-64]
	b	.L6
.L7:
	ldr	r1, [fp, #-60]
	mov	r0, #120
	bl	putc
	ldr	r3, [fp, #-64]
	add	r3, r3, #1
	str	r3, [fp, #-64]
.L6:
	ldr	r3, [fp, #-64]
	ldr	r2, .L12+24
	cmp	r3, r2
	ble	.L7
	mov	r2, #0
	ldr	r1, .L12+28
	ldr	r0, [fp, #-60]
	bl	fseek
	ldr	r3, [fp, #-60]
	mov	r2, #31
	mov	r1, #1
	ldr	r0, .L12+32
	bl	fwrite
	mov	r2, #0
	ldr	r1, .L12+28
	ldr	r0, [fp, #-60]
	bl	fseek
	sub	r0, fp, #40
	ldr	r3, [fp, #-60]
	mov	r2, #31
	mov	r1, #1
	bl	fread
	ldr	r3, .L12+36
	ldr	r3, [r3]
	sub	r0, fp, #40
	mov	r2, #31
	mov	r1, #1
	bl	fwrite
	ldr	r0, [fp, #-60]
	bl	fclose
	sub	r3, fp, #56
	mov	r0, r3
	bl	remove
	sub	r3, fp, #40
	mov	r2, #31
	ldr	r1, .L12+32
	mov	r0, r3
	bl	memcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r0, .L12+40
	bl	puts
	mov	r3, #0
	b	.L10
.L8:
	ldr	r0, .L12+44
	bl	puts
	mov	r3, #1
.L10:
	ldr	r2, .L12
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L11
	bl	__stack_chk_fail
.L11:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L13:
	.align	2
.L12:
	.word	.LC6
	.word	.LC0
	.word	stdio_block_read
	.word	stdio_block_write
	.word	.LC1
	.word	.LC2
	.word	8999
	.word	8180
	.word	.LC3
	.word	stdout
	.word	.LC4
	.word	.LC5
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
