	.file	"153267486.c"
	.intel_syntax noprefix
	.text
	.globl	u
	.bss
	.align 32
	.type	u, @object
	.size	u, 3992004
u:
	.zero	3992004
	.globl	dx
	.data
	.align 16
	.type	dx, @object
	.size	dx, 16
dx:
	.long	1
	.long	0
	.long	-1
	.long	0
	.globl	dy
	.align 16
	.type	dy, @object
	.size	dy, 16
dy:
	.long	0
	.long	1
	.long	0
	.long	-1
	.text
	.globl	valid
	.type	valid, @function
valid:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -4[rbp]
	cdqe
	imul	rax, rax, 999
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, u[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	sete	al
	movzx	eax, al
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	valid, .-valid
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d %d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, -24[rbp]
	lea	rdx, -28[rbp]
	lea	rax, -32[rbp]
	mov	rsi, rax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	scanf@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR -28[rbp]
	add	eax, 1
	movsx	rcx, eax
	mov	edx, DWORD PTR -20[rbp]
	movsx	rdx, edx
	imul	rdx, rdx, 999
	add	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, u[rip]
	mov	DWORD PTR [rcx+rdx], 1
	movsx	rdx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	imul	rax, rax, 999
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, u[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	imul	rax, rax, 3996
	lea	rcx, u[rip]
	mov	DWORD PTR [rax+rcx], edx
	add	DWORD PTR -20[rbp], 1
.L4:
	mov	eax, DWORD PTR -32[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L5
	mov	DWORD PTR -20[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR -32[rbp]
	add	eax, 1
	mov	edx, DWORD PTR -20[rbp]
	movsx	rcx, edx
	movsx	rdx, eax
	imul	rdx, rdx, 999
	add	rdx, rcx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, u[rip]
	mov	DWORD PTR [rcx+rdx], 1
	mov	edx, DWORD PTR -20[rbp]
	movsx	rdx, edx
	cdqe
	imul	rax, rax, 999
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, u[rip]
	mov	eax, DWORD PTR [rdx+rax]
	mov	edx, DWORD PTR -20[rbp]
	movsx	rdx, edx
	lea	rcx, 0[0+rdx*4]
	lea	rdx, u[rip]
	mov	DWORD PTR [rcx+rdx], eax
	add	DWORD PTR -20[rbp], 1
.L6:
	mov	eax, DWORD PTR -28[rbp]
	cmp	DWORD PTR -20[rbp], eax
	jle	.L7
	mov	DWORD PTR -12[rbp], 1
	mov	eax, DWORD PTR -12[rbp]
	mov	DWORD PTR -16[rbp], eax
	mov	DWORD PTR -20[rbp], 0
	jmp	.L8
.L19:
	mov	eax, DWORD PTR -12[rbp]
	movsx	rdx, eax
	mov	eax, DWORD PTR -16[rbp]
	cdqe
	imul	rax, rax, 999
	add	rax, rdx
	lea	rdx, 0[0+rax*4]
	lea	rax, u[rip]
	mov	DWORD PTR [rdx+rax], 1
	jmp	.L9
.L11:
	add	DWORD PTR -20[rbp], 1
.L9:
	cmp	DWORD PTR -20[rbp], 3
	jg	.L10
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, dy[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	add	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, dx[rip]
	mov	ecx, DWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -16[rbp]
	add	eax, ecx
	mov	esi, edx
	mov	edi, eax
	mov	eax, 0
	call	valid
	test	eax, eax
	je	.L11
.L10:
	cmp	DWORD PTR -20[rbp], 3
	jle	.L12
	mov	DWORD PTR -20[rbp], 0
	jmp	.L13
.L15:
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, dy[rip]
	mov	edx, DWORD PTR [rdx+rax]
	mov	eax, DWORD PTR -12[rbp]
	add	edx, eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rcx, 0[0+rax*4]
	lea	rax, dx[rip]
	mov	ecx, DWORD PTR [rcx+rax]
	mov	eax, DWORD PTR -16[rbp]
	add	eax, ecx
	mov	esi, edx
	mov	edi, eax
	mov	eax, 0
	call	valid
	test	eax, eax
	jne	.L22
	add	DWORD PTR -20[rbp], 1
.L13:
	cmp	DWORD PTR -20[rbp], 3
	jle	.L15
	jmp	.L12
.L22:
	nop
.L12:
	cmp	DWORD PTR -20[rbp], 3
	jg	.L23
	cmp	DWORD PTR -20[rbp], 3
	jg	.L24
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, dx[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	DWORD PTR -16[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	lea	rdx, 0[0+rax*4]
	lea	rax, dy[rip]
	mov	eax, DWORD PTR [rdx+rax]
	add	DWORD PTR -12[rbp], eax
.L8:
	mov	eax, DWORD PTR -24[rbp]
	lea	edx, -1[rax]
	mov	DWORD PTR -24[rbp], edx
	test	eax, eax
	jne	.L19
	jmp	.L17
.L23:
	nop
	jmp	.L17
.L24:
	nop
.L17:
	mov	eax, DWORD PTR -16[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -12[rbp]
	sub	eax, 1
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	mov	rsi, QWORD PTR -8[rbp]
	sub	rsi, QWORD PTR fs:40
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	"153267486.c"
	.text
	.comm	u,3992004,4
	.global	dx
	.data
	.align	2
	.type	dx, %object
	.size	dx, 16
dx:
	.word	1
	.word	0
	.word	-1
	.word	0
	.global	dy
	.align	2
	.type	dy, %object
	.size	dy, 16
dy:
	.word	0
	.word	1
	.word	0
	.word	-1
	.text
	.align	2
	.global	valid
	.syntax unified
	.arm
	.fpu softvfp
	.type	valid, %function
valid:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r1, .L3
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	cmp	r3, #0
	moveq	r3, #1
	movne	r3, #0
	and	r3, r3, #255
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L4:
	.align	2
.L3:
	.word	u
	.size	valid, .-valid
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d %d %d\000"
	.align	2
.LC1:
	.ascii	"%d %d\012\000"
	.align	2
.LC2:
	.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
	ldr	r3, .L27
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	sub	r3, fp, #24
	sub	r2, fp, #28
	sub	r1, fp, #32
	ldr	r0, .L27+4
	bl	scanf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L6
.L7:
	ldr	r3, [fp, #-28]
	add	r1, r3, #1
	ldr	r0, .L27+8
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	add	r3, r3, r1
	mov	r2, #1
	str	r2, [r0, r3, lsl #2]
	ldr	r0, .L27+8
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	add	r3, r3, r1
	ldr	r1, [r0, r3, lsl #2]
	ldr	r0, .L27+8
	ldr	r2, [fp, #-20]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	lsl	r3, r3, #2
	add	r3, r0, r3
	str	r1, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L6:
	ldr	r3, [fp, #-32]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	ble	.L7
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L8
.L9:
	ldr	r3, [fp, #-32]
	add	r2, r3, #1
	ldr	r0, .L27+8
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r1, r3, #3
	add	r3, r3, r1
	ldr	r1, [fp, #-20]
	add	r3, r3, r1
	mov	r1, #1
	str	r1, [r0, r3, lsl #2]
	ldr	r1, .L27+8
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	ldr	r2, [fp, #-20]
	add	r3, r3, r2
	ldr	r2, [r1, r3, lsl #2]
	ldr	r1, .L27+8
	ldr	r3, [fp, #-20]
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L8:
	ldr	r3, [fp, #-28]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	ble	.L9
	mov	r3, #1
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	str	r3, [fp, #-16]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L10
.L21:
	ldr	r1, .L27+8
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #3
	sub	r3, r3, r2
	lsl	r3, r3, #4
	sub	r3, r3, r2
	lsl	r2, r3, #3
	add	r3, r3, r2
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	mov	r2, #1
	str	r2, [r1, r3, lsl #2]
	b	.L11
.L13:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L11:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	bgt	.L12
	ldr	r2, .L27+12
	ldr	r3, [fp, #-20]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, .L27+16
	ldr	r3, [fp, #-20]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r1, r3
	bl	valid
	mov	r3, r0
	cmp	r3, #0
	beq	.L13
.L12:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	ble	.L14
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L15
.L17:
	ldr	r2, .L27+12
	ldr	r3, [fp, #-20]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-16]
	add	r0, r2, r3
	ldr	r2, .L27+16
	ldr	r3, [fp, #-20]
	ldr	r2, [r2, r3, lsl #2]
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r1, r3
	bl	valid
	mov	r3, r0
	cmp	r3, #0
	bne	.L24
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L15:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	ble	.L17
	b	.L14
.L24:
	nop
.L14:
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	bgt	.L25
	ldr	r3, [fp, #-20]
	cmp	r3, #3
	bgt	.L26
	ldr	r2, .L27+12
	ldr	r3, [fp, #-20]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-16]
	add	r3, r2, r3
	str	r3, [fp, #-16]
	ldr	r2, .L27+16
	ldr	r3, [fp, #-20]
	ldr	r3, [r2, r3, lsl #2]
	ldr	r2, [fp, #-12]
	add	r3, r2, r3
	str	r3, [fp, #-12]
.L10:
	ldr	r3, [fp, #-24]
	sub	r2, r3, #1
	str	r2, [fp, #-24]
	cmp	r3, #0
	bne	.L21
	b	.L19
.L25:
	nop
	b	.L19
.L26:
	nop
.L19:
	ldr	r3, [fp, #-12]
	sub	r1, r3, #1
	ldr	r3, [fp, #-16]
	sub	r3, r3, #1
	mov	r2, r3
	ldr	r0, .L27+20
	bl	printf
	mov	r3, #0
	ldr	r2, .L27
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L28:
	.align	2
.L27:
	.word	.LC2
	.word	.LC0
	.word	u
	.word	dx
	.word	dy
	.word	.LC1
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
