	.file	"7951448.c"
	.intel_syntax noprefix
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 100
a:
	.zero	100
	.globl	N
	.align 4
	.type	N, @object
	.size	N, 4
N:
	.zero	4
	.globl	M
	.align 4
	.type	M, @object
	.size	M, 4
M:
	.zero	4
	.globl	T
	.align 4
	.type	T, @object
	.size	T, 4
T:
	.zero	4
	.globl	sx
	.align 4
	.type	sx, @object
	.size	sx, 4
sx:
	.zero	4
	.globl	sy
	.align 4
	.type	sy, @object
	.size	sy, 4
sy:
	.zero	4
	.globl	fx
	.align 4
	.type	fx, @object
	.size	fx, 4
fx:
	.zero	4
	.globl	fy
	.align 4
	.type	fy, @object
	.size	fy, 4
fy:
	.zero	4
	.globl	ans
	.align 4
	.type	ans, @object
	.size	ans, 4
ans:
	.zero	4
	.globl	visited
	.align 32
	.type	visited, @object
	.size	visited, 400
visited:
	.zero	400
	.section	.rodata
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d%d%d%d"
.LC2:
	.string	"%d%d"
	.text
	.globl	read
	.type	read, @function
read:
.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, 32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rcx, T[rip]
	lea	rdx, M[rip]
	lea	rsi, N[rip]
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	r8, fy[rip]
	lea	rcx, fx[rip]
	lea	rdx, sy[rip]
	lea	rsi, sx[rip]
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L2
.L3:
	lea	rdx, -24[rbp]
	lea	rax, -28[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	mov	eax, DWORD PTR -24[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -28[rbp]
	sub	eax, 1
	movsx	rcx, eax
	movsx	rdx, edx
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, [rax+rcx]
	lea	rax, a[rip]
	add	rax, rdx
	mov	BYTE PTR [rax], 1
	add	DWORD PTR -20[rbp], 1
.L2:
	mov	eax, DWORD PTR T[rip]
	cmp	DWORD PTR -20[rbp], eax
	jl	.L3
	mov	DWORD PTR -16[rbp], 0
	jmp	.L4
.L5:
	mov	eax, DWORD PTR M[rip]
	movsx	rcx, eax
	mov	eax, DWORD PTR -16[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, [rax+rcx]
	lea	rax, a[rip]
	add	rax, rdx
	mov	BYTE PTR [rax], 1
	add	DWORD PTR -16[rbp], 1
.L4:
	mov	eax, DWORD PTR N[rip]
	cmp	DWORD PTR -16[rbp], eax
	jle	.L5
	mov	DWORD PTR -12[rbp], 0
	jmp	.L6
.L7:
	mov	eax, DWORD PTR N[rip]
	mov	edx, DWORD PTR -12[rbp]
	movsx	rcx, edx
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, [rax+rcx]
	lea	rax, a[rip]
	add	rax, rdx
	mov	BYTE PTR [rax], 1
	add	DWORD PTR -12[rbp], 1
.L6:
	mov	eax, DWORD PTR M[rip]
	cmp	DWORD PTR -12[rbp], eax
	jl	.L7
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L8
	call	__stack_chk_fail@PLT
.L8:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	read, .-read
	.globl	dfs
	.type	dfs, @function
dfs:
.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, 16
	mov	DWORD PTR -4[rbp], edi
	mov	DWORD PTR -8[rbp], esi
	mov	eax, DWORD PTR -4[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -8[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	lea	rdx, [rax+rcx]
	lea	rax, a[rip]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 1
	je	.L15
	cmp	DWORD PTR -4[rbp], 0
	js	.L15
	cmp	DWORD PTR -8[rbp], 0
	js	.L15
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, visited[rip]
	mov	eax, DWORD PTR [rdx+rax]
	test	eax, eax
	jne	.L16
	mov	eax, DWORD PTR fx[rip]
	sub	eax, 1
	cmp	DWORD PTR -4[rbp], eax
	jne	.L14
	mov	eax, DWORD PTR fy[rip]
	sub	eax, 1
	cmp	DWORD PTR -8[rbp], eax
	jne	.L14
	mov	eax, DWORD PTR ans[rip]
	add	eax, 1
	mov	DWORD PTR ans[rip], eax
	jmp	.L9
.L14:
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, visited[rip]
	mov	DWORD PTR [rdx+rax], 1
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	mov	edi, edx
	call	dfs
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, 1[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	dfs
	mov	eax, DWORD PTR -8[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -4[rbp]
	mov	esi, edx
	mov	edi, eax
	call	dfs
	mov	eax, DWORD PTR -4[rbp]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR -8[rbp]
	mov	esi, eax
	mov	edi, edx
	call	dfs
	mov	eax, DWORD PTR -8[rbp]
	movsx	rcx, eax
	mov	eax, DWORD PTR -4[rbp]
	movsx	rdx, eax
	mov	rax, rdx
	sal	rax, 2
	add	rax, rdx
	add	rax, rax
	add	rax, rcx
	lea	rdx, 0[0+rax*4]
	lea	rax, visited[rip]
	mov	DWORD PTR [rdx+rax], 0
	jmp	.L9
.L15:
	nop
	jmp	.L9
.L16:
	nop
.L9:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	dfs, .-dfs
	.section	.rodata
.LC3:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, 0
	call	read
	mov	eax, DWORD PTR sy[rip]
	lea	edx, -1[rax]
	mov	eax, DWORD PTR sx[rip]
	sub	eax, 1
	mov	esi, edx
	mov	edi, eax
	call	dfs
	mov	eax, DWORD PTR ans[rip]
	mov	esi, eax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	"7951448.c"
	.text
	.comm	a,100,4
	.comm	N,4,4
	.comm	M,4,4
	.comm	T,4,4
	.comm	sx,4,4
	.comm	sy,4,4
	.comm	fx,4,4
	.comm	fy,4,4
	.global	ans
	.bss
	.align	2
	.type	ans, %object
	.size	ans, 4
ans:
	.space	4
	.comm	visited,400,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"%d%d%d\000"
	.align	2
.LC1:
	.ascii	"%d%d%d%d\000"
	.align	2
.LC2:
	.ascii	"%d%d\000"
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	read
	.syntax unified
	.arm
	.fpu softvfp
	.type	read, %function
read:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L9+4
	ldr	r2, .L9+8
	ldr	r1, .L9+12
	ldr	r0, .L9+16
	bl	__isoc99_scanf
	ldr	r3, .L9+20
	str	r3, [sp]
	ldr	r3, .L9+24
	ldr	r2, .L9+28
	ldr	r1, .L9+32
	ldr	r0, .L9+36
	bl	__isoc99_scanf
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L2
.L3:
	sub	r2, fp, #24
	sub	r3, fp, #28
	mov	r1, r3
	ldr	r0, .L9+40
	bl	__isoc99_scanf
	ldr	r3, [fp, #-24]
	sub	r2, r3, #1
	ldr	r3, [fp, #-28]
	sub	r1, r3, #1
	ldr	r0, .L9+44
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r0, r3
	add	r3, r3, r1
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, .L9+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L3
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L4
.L5:
	ldr	r3, .L9+8
	ldr	r1, [r3]
	ldr	r0, .L9+44
	ldr	r2, [fp, #-16]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r3, r0, r3
	add	r3, r3, r1
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L4:
	ldr	r3, .L9+12
	ldr	r3, [r3]
	ldr	r2, [fp, #-16]
	cmp	r2, r3
	ble	.L5
	mov	r3, #0
	str	r3, [fp, #-12]
	b	.L6
.L7:
	ldr	r3, .L9+12
	ldr	r2, [r3]
	ldr	r1, .L9+44
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r2, r1, r3
	ldr	r3, [fp, #-12]
	add	r3, r2, r3
	mov	r2, #1
	strb	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	str	r3, [fp, #-12]
.L6:
	ldr	r3, .L9+8
	ldr	r3, [r3]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	blt	.L7
	nop
	ldr	r3, .L9
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC3
	.word	T
	.word	M
	.word	N
	.word	.LC0
	.word	fy
	.word	fx
	.word	sy
	.word	sx
	.word	.LC1
	.word	.LC2
	.word	a
	.size	read, .-read
	.align	2
	.global	dfs
	.syntax unified
	.arm
	.fpu softvfp
	.type	dfs, %function
dfs:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r1, .L19
	ldr	r2, [fp, #-12]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	add	r2, r1, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #1
	beq	.L17
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	blt	.L17
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	blt	.L17
	ldr	r1, .L19+4
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	ldr	r3, [r1, r3, lsl #2]
	cmp	r3, #0
	bne	.L18
	ldr	r3, .L19+8
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bne	.L16
	ldr	r3, .L19+12
	ldr	r3, [r3]
	sub	r3, r3, #1
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	bne	.L16
	ldr	r3, .L19+16
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L19+16
	str	r3, [r2]
	b	.L11
.L16:
	ldr	r1, .L19+4
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	mov	r2, #1
	str	r2, [r1, r3, lsl #2]
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	dfs
	ldr	r3, [fp, #-12]
	add	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	dfs
	ldr	r3, [fp, #-12]
	sub	r3, r3, #1
	mov	r1, r3
	ldr	r0, [fp, #-8]
	bl	dfs
	ldr	r3, [fp, #-8]
	sub	r3, r3, #1
	ldr	r1, [fp, #-12]
	mov	r0, r3
	bl	dfs
	ldr	r1, .L19+4
	ldr	r2, [fp, #-8]
	mov	r3, r2
	lsl	r3, r3, #2
	add	r3, r3, r2
	lsl	r3, r3, #1
	ldr	r2, [fp, #-12]
	add	r3, r3, r2
	mov	r2, #0
	str	r2, [r1, r3, lsl #2]
	b	.L11
.L17:
	nop
	b	.L11
.L18:
	nop
.L11:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	a
	.word	visited
	.word	fx
	.word	fy
	.word	ans
	.size	dfs, .-dfs
	.section	.rodata
	.align	2
.LC4:
	.ascii	"%d\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	read
	ldr	r3, .L23
	ldr	r3, [r3]
	sub	r2, r3, #1
	ldr	r3, .L23+4
	ldr	r3, [r3]
	sub	r3, r3, #1
	mov	r1, r3
	mov	r0, r2
	bl	dfs
	ldr	r3, .L23+8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L23+12
	bl	printf
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	sx
	.word	sy
	.word	ans
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
