	.file	"65742.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"tcsetattr()"
.LC1:
	.string	"tcsetattr ICANON"
.LC2:
	.string	"read()"
.LC3:
	.string	"tcsetattr ~ICANON"
	.text
	.globl	getch
	.type	getch, @function
getch:
.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, 96
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	BYTE PTR -81[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	QWORD PTR -32[rbp], 0
	mov	DWORD PTR -24[rbp], 0
	lea	rax, -80[rbp]
	mov	rsi, rax
	mov	edi, 0
	call	tcgetattr@PLT
	test	eax, eax
	jns	.L2
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L2:
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -3
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	and	eax, -9
	mov	DWORD PTR -68[rbp], eax
	mov	BYTE PTR -57[rbp], 1
	mov	BYTE PTR -58[rbp], 0
	lea	rax, -80[rbp]
	mov	rdx, rax
	mov	esi, 0
	mov	edi, 0
	call	tcsetattr@PLT
	test	eax, eax
	jns	.L3
	lea	rdi, .LC1[rip]
	call	perror@PLT
.L3:
	lea	rax, -81[rbp]
	mov	edx, 1
	mov	rsi, rax
	mov	edi, 0
	call	read@PLT
	test	rax, rax
	jns	.L4
	lea	rdi, .LC2[rip]
	call	perror@PLT
.L4:
	mov	eax, DWORD PTR -68[rbp]
	or	eax, 2
	mov	DWORD PTR -68[rbp], eax
	mov	eax, DWORD PTR -68[rbp]
	or	eax, 8
	mov	DWORD PTR -68[rbp], eax
	lea	rax, -80[rbp]
	mov	rdx, rax
	mov	esi, 1
	mov	edi, 0
	call	tcsetattr@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
.L5:
	movzx	eax, BYTE PTR -81[rbp]
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L7
	call	__stack_chk_fail@PLT
.L7:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getch, .-getch
	.section	.rodata
.LC4:
	.string	"Duplication fault !\n"
.LC5:
	.string	"draw.out"
	.text
	.globl	main
	.type	main, @function
main:
.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, 48
	mov	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, -16[rbp]
	mov	rdi, rax
	call	pipe@PLT
	call	fork@PLT
	mov	DWORD PTR -24[rbp], eax
	cmp	DWORD PTR -24[rbp], 0
	jne	.L9
	mov	eax, DWORD PTR -16[rbp]
	mov	esi, 0
	mov	edi, eax
	call	dup2@PLT
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -20[rbp], 0
	jns	.L10
	lea	rdi, .LC4[rip]
	call	perror@PLT
	mov	edi, 0
	call	exit@PLT
.L10:
	mov	eax, DWORD PTR -16[rbp]
	mov	edi, eax
	call	close@PLT
	mov	esi, 0
	lea	rdi, .LC5[rip]
	call	execv@PLT
	mov	eax, 0
	jmp	.L14
.L9:
	mov	eax, 0
	call	getch
	mov	BYTE PTR -25[rbp], al
	movzx	eax, BYTE PTR -25[rbp]
	movsx	eax, al
	cmp	eax, 113
	jne	.L12
	mov	eax, DWORD PTR -12[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 9
	mov	edi, eax
	call	kill@PLT
	mov	eax, 0
	jmp	.L14
.L12:
	mov	eax, DWORD PTR -12[rbp]
	lea	rcx, -25[rbp]
	mov	edx, 1
	mov	rsi, rcx
	mov	edi, eax
	call	write@PLT
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, 12
	mov	edi, eax
	call	kill@PLT
	nop
	jmp	.L9
.L14:
	mov	rdx, QWORD PTR -8[rbp]
	sub	rdx, QWORD PTR fs:40
	je	.L15
	call	__stack_chk_fail@PLT
.L15:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.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	"65742.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"tcsetattr()\000"
	.align	2
.LC1:
	.ascii	"tcsetattr ICANON\000"
	.align	2
.LC2:
	.ascii	"read()\000"
	.align	2
.LC3:
	.ascii	"tcsetattr ~ICANON\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	getch
	.syntax unified
	.arm
	.fpu softvfp
	.type	getch, %function
getch:
	@ args = 0, pretend = 0, frame = 72
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #72
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	strb	r3, [fp, #-69]
	sub	r3, fp, #68
	mov	r2, #60
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #68
	mov	r1, r3
	mov	r0, #0
	bl	tcgetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L2
	ldr	r0, .L8+4
	bl	perror
.L2:
	ldr	r3, [fp, #-56]
	bic	r3, r3, #2
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	bic	r3, r3, #8
	str	r3, [fp, #-56]
	mov	r3, #1
	strb	r3, [fp, #-45]
	mov	r3, #0
	strb	r3, [fp, #-46]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #0
	mov	r0, #0
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L3
	ldr	r0, .L8+8
	bl	perror
.L3:
	sub	r3, fp, #69
	mov	r2, #1
	mov	r1, r3
	mov	r0, #0
	bl	read
	mov	r3, r0
	cmp	r3, #0
	bge	.L4
	ldr	r0, .L8+12
	bl	perror
.L4:
	ldr	r3, [fp, #-56]
	orr	r3, r3, #2
	str	r3, [fp, #-56]
	ldr	r3, [fp, #-56]
	orr	r3, r3, #8
	str	r3, [fp, #-56]
	sub	r3, fp, #68
	mov	r2, r3
	mov	r1, #1
	mov	r0, #0
	bl	tcsetattr
	mov	r3, r0
	cmp	r3, #0
	bge	.L5
	ldr	r0, .L8+16
	bl	perror
.L5:
	ldrb	r3, [fp, #-69]	@ zero_extendqisi2
	ldr	r2, .L8
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L7
	bl	__stack_chk_fail
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L9:
	.align	2
.L8:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.size	getch, .-getch
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Duplication fault !\012\000"
	.align	2
.LC6:
	.ascii	"draw.out\000"
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L18
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #16
	mov	r0, r3
	bl	pipe
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	bne	.L11
	ldr	r3, [fp, #-16]
	mov	r1, #0
	mov	r0, r3
	bl	dup2
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bge	.L12
	ldr	r0, .L18+4
	bl	perror
	mov	r0, #0
	bl	exit
.L12:
	ldr	r3, [fp, #-16]
	mov	r0, r3
	bl	close
	mov	r1, #0
	ldr	r0, .L18+8
	bl	execv
	mov	r3, #0
	b	.L16
.L11:
	bl	getch
	mov	r3, r0
	strb	r3, [fp, #-25]
	ldrb	r3, [fp, #-25]	@ zero_extendqisi2
	cmp	r3, #113
	bne	.L14
	ldr	r3, [fp, #-12]
	mov	r0, r3
	bl	close
	mov	r1, #9
	ldr	r0, [fp, #-24]
	bl	kill
	mov	r3, #0
	b	.L16
.L14:
	ldr	r3, [fp, #-12]
	sub	r1, fp, #25
	mov	r2, #1
	mov	r0, r3
	bl	write
	mov	r1, #12
	ldr	r0, [fp, #-24]
	bl	kill
	nop
	b	.L11
.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	.LC7
	.word	.LC5
	.word	.LC6
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
