	.file	"907688.c"
	.intel_syntax noprefix
	.text
	.globl	stdbuf
	.bss
	.align 32
	.type	stdbuf, @object
	.size	stdbuf, 8192
stdbuf:
	.zero	8192
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"cat: can't open %s\n"
.LC2:
	.string	"-"
.LC3:
	.string	"cat: input %s is output\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
	push	r12
	push	rbx
	sub	rsp, 192
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	DWORD PTR -196[rbp], edi
	mov	QWORD PTR -208[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -188[rbp], 0
	mov	DWORD PTR -180[rbp], -1
	mov	rax, QWORD PTR stdout[rip]
	lea	rsi, stdbuf[rip]
	mov	rdi, rax
	call	setbuf@PLT
	jmp	.L2
.L7:
	mov	rax, QWORD PTR -208[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	test	eax, eax
	je	.L22
	cmp	eax, 117
	je	.L4
	jmp	.L6
.L4:
	mov	rax, QWORD PTR stdout[rip]
	mov	esi, 0
	mov	rdi, rax
	call	setbuf@PLT
	sub	DWORD PTR -196[rbp], 1
	add	QWORD PTR -208[rbp], 8
	jmp	.L2
.L22:
	nop
	jmp	.L6
.L2:
	cmp	DWORD PTR -196[rbp], 1
	jle	.L6
	mov	rax, QWORD PTR -208[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	je	.L7
.L6:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	edx, eax
	lea	rax, -176[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	fstat@PLT
	mov	eax, DWORD PTR -152[rbp]
	and	eax, 61440
	mov	DWORD PTR -152[rbp], eax
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, 8192
	je	.L8
	mov	eax, DWORD PTR -152[rbp]
	cmp	eax, 24576
	je	.L8
	mov	rax, QWORD PTR -176[rbp]
	mov	DWORD PTR -184[rbp], eax
	mov	rax, QWORD PTR -168[rbp]
	mov	DWORD PTR -180[rbp], eax
.L8:
	cmp	DWORD PTR -196[rbp], 1
	jg	.L10
	mov	DWORD PTR -196[rbp], 2
	add	DWORD PTR -188[rbp], 1
	jmp	.L10
.L19:
	cmp	DWORD PTR -188[rbp], 0
	jne	.L11
	add	QWORD PTR -208[rbp], 8
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	movzx	eax, BYTE PTR [rax]
	cmp	al, 45
	jne	.L12
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	add	rax, 1
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L12
.L11:
	mov	rbx, QWORD PTR stdin[rip]
	jmp	.L13
.L12:
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	rbx, rax
	test	rbx, rbx
	jne	.L13
	mov	rax, QWORD PTR -208[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	jmp	.L10
.L13:
	mov	rdi, rbx
	call	fileno@PLT
	mov	edx, eax
	lea	rax, -176[rbp]
	mov	rsi, rax
	mov	edi, edx
	call	fstat@PLT
	mov	rdx, QWORD PTR -176[rbp]
	mov	eax, DWORD PTR -184[rbp]
	cdqe
	cmp	rdx, rax
	jne	.L17
	mov	rdx, QWORD PTR -168[rbp]
	mov	eax, DWORD PTR -180[rbp]
	cdqe
	cmp	rdx, rax
	jne	.L17
	cmp	DWORD PTR -188[rbp], 0
	jne	.L15
	mov	rax, QWORD PTR -208[rbp]
	mov	rax, QWORD PTR [rax]
	jmp	.L16
.L15:
	lea	rax, .LC2[rip]
.L16:
	mov	rcx, QWORD PTR stderr[rip]
	mov	rdx, rax
	lea	rsi, .LC3[rip]
	mov	rdi, rcx
	mov	eax, 0
	call	fprintf@PLT
	mov	rdi, rbx
	call	fclose@PLT
	jmp	.L10
.L18:
	mov	edi, r12d
	call	putchar@PLT
.L17:
	mov	rdi, rbx
	call	getc@PLT
	mov	r12d, eax
	cmp	r12d, -1
	jne	.L18
	mov	rax, QWORD PTR stdin[rip]
	cmp	rbx, rax
	je	.L10
	mov	rdi, rbx
	call	fclose@PLT
.L10:
	sub	DWORD PTR -196[rbp], 1
	cmp	DWORD PTR -196[rbp], 0
	jg	.L19
	mov	eax, 0
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	add	rsp, 192
	pop	rbx
	pop	r12
	pop	rbp
	.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	"907688.c"
	.text
	.comm	stdbuf,8192,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"cat: can't open %s\012\000"
	.align	2
.LC2:
	.ascii	"-\000"
	.align	2
.LC3:
	.ascii	"cat: input %s is output\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	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #120
	str	r0, [fp, #-128]
	str	r1, [fp, #-132]
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-120]
	mvn	r3, #0
	str	r3, [fp, #-112]
	ldr	r3, .L23+4
	ldr	r3, [r3]
	ldr	r1, .L23+8
	mov	r0, r3
	bl	setbuf
	b	.L2
.L7:
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	beq	.L22
	cmp	r3, #117
	beq	.L4
	b	.L6
.L4:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	setbuf
	ldr	r3, [fp, #-128]
	sub	r3, r3, #1
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	str	r3, [fp, #-132]
	b	.L2
.L22:
	nop
	b	.L6
.L2:
	ldr	r3, [fp, #-128]
	cmp	r3, #1
	ble	.L6
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	beq	.L7
.L6:
	ldr	r3, .L23+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	mov	r2, r0
	sub	r3, fp, #108
	mov	r1, r3
	mov	r0, r2
	bl	fstat
	ldr	r3, [fp, #-92]
	and	r3, r3, #61440
	str	r3, [fp, #-92]
	ldr	r3, [fp, #-92]
	cmp	r3, #8192
	beq	.L8
	ldr	r3, [fp, #-92]
	cmp	r3, #24576
	beq	.L8
	sub	r3, fp, #108
	ldmia	r3, {r2-r3}
	mov	r3, r2
	str	r3, [fp, #-116]
	ldr	r3, [fp, #-96]
	str	r3, [fp, #-112]
.L8:
	ldr	r3, [fp, #-128]
	cmp	r3, #1
	bgt	.L10
	mov	r3, #2
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-120]
	add	r3, r3, #1
	str	r3, [fp, #-120]
	b	.L10
.L19:
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-132]
	add	r3, r3, #4
	str	r3, [fp, #-132]
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #45
	bne	.L12
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	add	r3, r3, #1
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L12
.L11:
	ldr	r3, .L23+12
	ldr	r4, [r3]
	b	.L13
.L12:
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	ldr	r1, .L23+16
	mov	r0, r3
	bl	fopen
	mov	r4, r0
	cmp	r4, #0
	bne	.L13
	ldr	r3, .L23+20
	ldr	r0, [r3]
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L23+24
	bl	fprintf
	b	.L10
.L13:
	mov	r0, r4
	bl	fileno
	mov	r2, r0
	sub	r3, fp, #108
	mov	r1, r3
	mov	r0, r2
	bl	fstat
	sub	r1, fp, #108
	ldmia	r1, {r0-r1}
	ldr	r3, [fp, #-116]
	mov	r2, r3
	asr	r3, r2, #31
	cmp	r1, r3
	cmpeq	r0, r2
	bne	.L17
	ldr	r2, [fp, #-96]
	ldr	r3, [fp, #-112]
	cmp	r2, r3
	bne	.L17
	ldr	r3, .L23+20
	ldr	r0, [r3]
	ldr	r3, [fp, #-120]
	cmp	r3, #0
	bne	.L15
	ldr	r3, [fp, #-132]
	ldr	r3, [r3]
	b	.L16
.L15:
	ldr	r3, .L23+28
.L16:
	mov	r2, r3
	ldr	r1, .L23+32
	bl	fprintf
	mov	r0, r4
	bl	fclose
	b	.L10
.L18:
	mov	r0, r5
	bl	putchar
.L17:
	mov	r0, r4
	bl	getc
	mov	r5, r0
	cmn	r5, #1
	bne	.L18
	ldr	r3, .L23+12
	ldr	r3, [r3]
	cmp	r4, r3
	beq	.L10
	mov	r0, r4
	bl	fclose
.L10:
	ldr	r3, [fp, #-128]
	sub	r3, r3, #1
	str	r3, [fp, #-128]
	ldr	r3, [fp, #-128]
	cmp	r3, #0
	bgt	.L19
	mov	r3, #0
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L21
	bl	__stack_chk_fail
.L21:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC4
	.word	stdout
	.word	stdbuf
	.word	stdin
	.word	.LC0
	.word	stderr
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
