Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 2320: Infinity Maze
// 2017.10.4 bal4u@uu

#include <stdio.h>
#include <string.h>

char map[102][102];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int tr[128];
int mk[102][102][4];

int main()
{
	int h, w, r, c, d, r2, c2, sr, sc, step;
	long long l;
	char dir[5] = "NESW";

	tr['#'] = 10, tr['.'] = 11, tr['N'] = 0, tr['E'] = 1, tr['S'] = 2, tr['W'] = 3;
	while (scanf("%d%d%lld", &h, &w, &l) && l > 0) {
		memset(mk, 0, sizeof(mk));
		for (sr = -1, r = 0; r < h; r++) {
			scanf("%s", map[r]);
			if (sr >= 0) continue;
			for (c = 0; c < w; c++) {
				if (tr[map[r][c]] < 4) sr = r, sc = c, d = tr[map[r][c]], map[r][c] = '.';
			}
		}
		r = sr, c = sc, step = 0;
		while (l > 0) {
			if (mk[r][c][d]) {
				l = l % (step - mk[r][c][d]);
				if (!l) break;
			}
			mk[r][c][d] = step;
			while (1) {
				r2 = r + mv[d][0], c2 = c + mv[d][1];
				if (r2 >= 0 && r2 < h && c2 >= 0 && c2 < w && map[r2][c2] == '.') break;
				if (++d == 4) d = 0;
			}
			r = r2, c = c2;
			l--, step++;
		}
		printf("%d %d %c\n", r+1, c+1, dir[d]);
	}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	mv
	.data
	.align 32
	.type	mv, @object
	.size	mv, 32
mv:
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	0
	.long	0
	.long	-1
	.globl	tr
	.bss
	.align 32
	.type	tr, @object
	.size	tr, 512
tr:
	.zero	512
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 166464
mk:
	.zero	166464
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d %c\n"
.LC2:
	.string	"%d%d%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1465075022, -13(%rbp)
	movb	$0, -9(%rbp)
	movl	$10, 140+tr(%rip)
	movl	$11, 184+tr(%rip)
	movl	$0, 312+tr(%rip)
	movl	$1, 276+tr(%rip)
	movl	$2, 332+tr(%rip)
	movl	$3, 348+tr(%rip)
	jmp	.L2
.L19:
	movl	$166464, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$-1, -44(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L3
.L9:
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -44(%rbp)
	jns	.L23
	movl	$0, -52(%rbp)
	jmp	.L6
.L8:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$3, %eax
	jg	.L7
	movl	-56(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
.L7:
	addl	$1, -52(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L8
	jmp	.L5
.L23:
	nop
.L5:
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	movl	-44(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L10
.L17:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mk(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movq	-24(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rsi
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	movl	-52(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mk(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	je	.L24
.L11:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	mk(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-56(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L13
	movl	-64(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L13
	cmpl	$0, -28(%rbp)
	js	.L13
	movl	-60(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L13
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L25
.L13:
	addl	$1, -48(%rbp)
	cmpl	$4, -48(%rbp)
	jne	.L16
	movl	$0, -48(%rbp)
	jmp	.L16
.L25:
	nop
	movl	-32(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -52(%rbp)
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L10:
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L17
	jmp	.L12
.L24:
	nop
.L12:
	movl	-48(%rbp), %eax
	cltq
	movzbl	-13(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	-52(%rbp), %edx
	addl	$1, %edx
	movl	-56(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-24(%rbp), %rcx
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L19
.L18:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d %c\n"
.LC2:
	.string	"%d%d%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1465075022, 67(%rsp)
	movq	%rax, 32(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movb	$0, 71(%rsp)
	movl	$10, 140+tr(%rip)
	movl	$11, 184+tr(%rip)
	movl	$0, 312+tr(%rip)
	movl	$1, 276+tr(%rip)
	movl	$2, 332+tr(%rip)
	movl	$3, 348+tr(%rip)
	movq	%rax, 40(%rsp)
.L2:
	movq	32(%rsp), %rcx
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L20
	movq	56(%rsp), %r12
	testq	%r12, %r12
	jle	.L20
	movl	$166464, %edx
	xorl	%esi, %esi
	leaq	mk(%rip), %rdi
	call	memset@PLT
	movl	48(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L27
	leaq	map(%rip), %rax
	movl	%ebp, %r13d
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 8(%rsp)
	leaq	.LC0(%rip), %r12
	leaq	tr(%rip), %r15
	movq	%rax, %rbp
.L22:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %ebx
	je	.L66
	movl	48(%rsp), %r8d
	addl	$1, %r14d
	movl	%r13d, %ebp
	cmpl	%r14d, %r8d
	jle	.L24
	movslq	%r14d, %rax
	movq	8(%rsp), %r13
	imulq	$102, %rax, %rax
	addq	%rax, %r13
.L8:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %r8d
	addq	$102, %r13
	cmpl	%r14d, %r8d
	jg	.L8
.L24:
	movq	56(%rsp), %r12
	testq	%r12, %r12
	jle	.L67
.L3:
	movl	$0, 8(%rsp)
	movl	52(%rsp), %r11d
	movslq	%ebp, %rcx
	movl	20(%rsp), %esi
.L19:
	movslq	%ebx, %rdi
	movslq	%esi, %r9
	leaq	mk(%rip), %rdx
	imulq	$102, %rdi, %rax
	addq	%r9, %rax
	leaq	(%rcx,%rax,4), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L10
	movl	8(%rsp), %edx
	subl	%eax, %edx
	movq	%r12, %rax
	movslq	%edx, %r15
	cqto
	idivq	%r15
	movq	%rdx, %r12
	testq	%rdx, %rdx
	je	.L63
.L10:
	imulq	$102, %rdi, %rax
	movl	8(%rsp), %edi
	leaq	mk(%rip), %rdx
	leaq	map(%rip), %r15
	addq	%r9, %rax
	leaq	(%rcx,%rax,4), %rax
	movl	%edi, (%rdx,%rax,4)
	leaq	mv(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %edi
	addl	%ebx, %edx
	addl	%esi, %edi
	movl	%edx, %r14d
	orl	%edi, %r14d
	js	.L11
	cmpl	%edx, %r8d
	jg	.L68
.L11:
	leal	1(%rbp), %r9d
	cmpl	$3, %ebp
	je	.L30
	movslq	%r9d, %rcx
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %edi
	addl	%ebx, %edx
	addl	%esi, %edi
	movl	%edx, %r14d
	orl	%edi, %r14d
	js	.L14
	cmpl	%edx, %r8d
	jg	.L69
.L14:
	leal	2(%rbp), %r9d
	cmpl	$2, %ebp
	je	.L30
	movslq	%r9d, %rcx
	movl	4(%rax,%rcx,8), %edi
	movl	(%rax,%rcx,8), %edx
	addl	%esi, %edi
	addl	%ebx, %edx
	movl	%edi, %r14d
	orl	%edx, %r14d
	js	.L16
	cmpl	%edx, %r8d
	jg	.L70
.L16:
	leal	3(%rbp), %edi
	xorl	%ebp, %ebp
	cmpl	$4, %edi
	je	.L62
	movslq	%edi, %r9
	movl	(%rax,%r9,8), %r10d
	movl	4(%rax,%r9,8), %r13d
	addl	%ebx, %r10d
	addl	%esi, %r13d
	movl	%r10d, %ecx
	orl	%r13d, %ecx
	js	.L62
	xorl	%ecx, %ecx
	cmpl	%r10d, %r8d
	jle	.L13
	cmpl	%r13d, %r11d
	jle	.L13
	movslq	%r10d, %rdx
	movslq	%r13d, %r14
	imulq	$102, %rdx, %rdx
	addq	%r15, %rdx
	cmpb	$46, (%rdx,%r14)
	jne	.L13
	movl	%r13d, %esi
	movl	%r10d, %ebx
	movl	%edi, %ebp
	movq	%r9, %rcx
.L12:
	addl	$1, 8(%rsp)
	subq	$1, %r12
	jne	.L19
.L63:
	movq	$0, 56(%rsp)
.L9:
	addl	$1, %esi
	movsbl	67(%rsp,%rcx), %r8d
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movl	%esi, %ecx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	xorl	%ebp, %ebp
.L62:
	xorl	%ecx, %ecx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L68:
	cmpl	%edi, %r11d
	jle	.L11
	movslq	%edx, %r9
	movslq	%edi, %r10
	imulq	$102, %r9, %r9
	addq	%r15, %r9
	cmpb	$46, (%r9,%r10)
	jne	.L11
	movl	%edi, %esi
	movl	%edx, %ebx
	jmp	.L12
.L69:
	cmpl	%edi, %r11d
	jle	.L14
	movslq	%edx, %r10
	movslq	%edi, %r13
	imulq	$102, %r10, %r10
	addq	%r15, %r10
	cmpb	$46, (%r10,%r13)
	jne	.L14
	movl	%edi, %esi
	movl	%edx, %ebx
	movl	%r9d, %ebp
	jmp	.L12
.L70:
	cmpl	%edi, %r11d
	jle	.L16
	movslq	%edx, %r10
	movslq	%edi, %r13
	imulq	$102, %r10, %r10
	addq	%r15, %r10
	cmpb	$46, (%r10,%r13)
	jne	.L16
	movl	%edi, %esi
	movl	%edx, %ebx
	movl	%r9d, %ebp
	jmp	.L12
.L66:
	movl	52(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movl	20(%rsp), %edi
	movq	%rbp, %rdx
	xorl	%eax, %eax
.L7:
	movsbq	(%rdx), %rcx
	movl	(%r15,%rcx,4), %ecx
	cmpl	$3, %ecx
	jg	.L6
	movb	$46, (%rdx)
	movl	%eax, %edi
	movl	%r14d, %ebx
	movl	%ecx, %r13d
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%esi, %eax
	jne	.L7
	movl	%edi, 20(%rsp)
.L5:
	movl	48(%rsp), %r8d
	addl	$1, %r14d
	cmpl	%r14d, %r8d
	jle	.L71
	addq	$102, %rbp
	jmp	.L22
.L71:
	movq	56(%rsp), %r12
	movl	%r13d, %ebp
	testq	%r12, %r12
	jg	.L3
.L67:
	movl	20(%rsp), %esi
	movslq	%ebp, %rcx
	jmp	.L9
.L20:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	movl	$-1, %ebx
	jmp	.L3
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	mk
	.bss
	.align 32
	.type	mk, @object
	.size	mk, 166464
mk:
	.zero	166464
	.globl	tr
	.align 32
	.type	tr, @object
	.size	tr, 512
tr:
	.zero	512
	.globl	mv
	.data
	.align 32
	.type	mv, @object
	.size	mv, 32
mv:
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	0
	.long	0
	.long	-1
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d %c\n"
.LC2:
	.string	"%d%d%lld"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$88, %rsp
	.cfi_def_cfa_offset 144
	movq	%fs:40, %rax
	movq	%rax, 72(%rsp)
	xorl	%eax, %eax
	leaq	56(%rsp), %rax
	movl	$1465075022, 67(%rsp)
	movq	%rax, 32(%rsp)
	leaq	52(%rsp), %rax
	movq	%rax, 24(%rsp)
	leaq	48(%rsp), %rax
	movb	$0, 71(%rsp)
	movl	$10, 140+tr(%rip)
	movl	$11, 184+tr(%rip)
	movl	$0, 312+tr(%rip)
	movl	$1, 276+tr(%rip)
	movl	$2, 332+tr(%rip)
	movl	$3, 348+tr(%rip)
	movq	%rax, 40(%rsp)
.L2:
	movq	32(%rsp), %rcx
	movq	24(%rsp), %rdx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rdi
	movq	40(%rsp), %rsi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L20
	movq	56(%rsp), %r12
	testq	%r12, %r12
	jle	.L20
	movl	$166464, %edx
	xorl	%esi, %esi
	leaq	mk(%rip), %rdi
	call	memset@PLT
	movl	48(%rsp), %r8d
	testl	%r8d, %r8d
	jle	.L27
	leaq	map(%rip), %rax
	movl	%ebp, %r13d
	movl	$-1, %ebx
	xorl	%r14d, %r14d
	movq	%rax, 8(%rsp)
	leaq	.LC0(%rip), %r12
	leaq	tr(%rip), %r15
	movq	%rax, %rbp
.L22:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movq	%r12, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$-1, %ebx
	je	.L66
	movl	48(%rsp), %r8d
	addl	$1, %r14d
	movl	%r13d, %ebp
	cmpl	%r14d, %r8d
	jle	.L24
	movslq	%r14d, %rax
	movq	8(%rsp), %r13
	imulq	$102, %rax, %rax
	addq	%rax, %r13
.L8:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %r14d
	call	__isoc99_scanf@PLT
	movl	48(%rsp), %r8d
	addq	$102, %r13
	cmpl	%r14d, %r8d
	jg	.L8
.L24:
	movq	56(%rsp), %r12
	testq	%r12, %r12
	jle	.L67
.L3:
	movl	$0, 8(%rsp)
	movl	52(%rsp), %r11d
	movslq	%ebp, %rcx
	movl	20(%rsp), %esi
.L19:
	movslq	%ebx, %rdi
	movslq	%esi, %r9
	leaq	mk(%rip), %rdx
	imulq	$102, %rdi, %rax
	addq	%r9, %rax
	leaq	(%rcx,%rax,4), %rax
	movl	(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L10
	movl	8(%rsp), %edx
	subl	%eax, %edx
	movq	%r12, %rax
	movslq	%edx, %r15
	cqto
	idivq	%r15
	movq	%rdx, %r12
	testq	%rdx, %rdx
	je	.L63
.L10:
	imulq	$102, %rdi, %rax
	movl	8(%rsp), %edi
	leaq	mk(%rip), %rdx
	leaq	map(%rip), %r15
	addq	%r9, %rax
	leaq	(%rcx,%rax,4), %rax
	movl	%edi, (%rdx,%rax,4)
	leaq	mv(%rip), %rax
	.p2align 4,,10
	.p2align 3
.L13:
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %edi
	addl	%ebx, %edx
	addl	%esi, %edi
	movl	%edx, %r14d
	orl	%edi, %r14d
	js	.L11
	cmpl	%edx, %r8d
	jg	.L68
.L11:
	leal	1(%rbp), %r9d
	cmpl	$3, %ebp
	je	.L30
	movslq	%r9d, %rcx
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %edi
	addl	%ebx, %edx
	addl	%esi, %edi
	movl	%edx, %r14d
	orl	%edi, %r14d
	js	.L14
	cmpl	%edx, %r8d
	jg	.L69
.L14:
	leal	2(%rbp), %r9d
	cmpl	$2, %ebp
	je	.L30
	movslq	%r9d, %rcx
	movl	4(%rax,%rcx,8), %edi
	movl	(%rax,%rcx,8), %edx
	addl	%esi, %edi
	addl	%ebx, %edx
	movl	%edi, %r14d
	orl	%edx, %r14d
	js	.L16
	cmpl	%edx, %r8d
	jg	.L70
.L16:
	leal	3(%rbp), %edi
	xorl	%ebp, %ebp
	cmpl	$4, %edi
	je	.L62
	movslq	%edi, %r9
	movl	(%rax,%r9,8), %r10d
	movl	4(%rax,%r9,8), %r13d
	addl	%ebx, %r10d
	addl	%esi, %r13d
	movl	%r10d, %ecx
	orl	%r13d, %ecx
	js	.L62
	xorl	%ecx, %ecx
	cmpl	%r10d, %r8d
	jle	.L13
	cmpl	%r13d, %r11d
	jle	.L13
	movslq	%r10d, %rdx
	movslq	%r13d, %r14
	imulq	$102, %rdx, %rdx
	addq	%r15, %rdx
	cmpb	$46, (%rdx,%r14)
	jne	.L13
	movl	%r13d, %esi
	movl	%r10d, %ebx
	movl	%edi, %ebp
	movq	%r9, %rcx
.L12:
	addl	$1, 8(%rsp)
	subq	$1, %r12
	jne	.L19
.L63:
	movq	$0, 56(%rsp)
.L9:
	addl	$1, %esi
	movsbl	67(%rsp,%rcx), %r8d
	leal	1(%rbx), %edx
	xorl	%eax, %eax
	movl	%esi, %ecx
	movl	$1, %edi
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	jmp	.L2
.L30:
	xorl	%ebp, %ebp
.L62:
	xorl	%ecx, %ecx
	jmp	.L13
	.p2align 4,,10
	.p2align 3
.L68:
	cmpl	%edi, %r11d
	jle	.L11
	movslq	%edx, %r9
	movslq	%edi, %r10
	imulq	$102, %r9, %r9
	addq	%r15, %r9
	cmpb	$46, (%r9,%r10)
	jne	.L11
	movl	%edi, %esi
	movl	%edx, %ebx
	jmp	.L12
.L69:
	cmpl	%edi, %r11d
	jle	.L14
	movslq	%edx, %r10
	movslq	%edi, %r13
	imulq	$102, %r10, %r10
	addq	%r15, %r10
	cmpb	$46, (%r10,%r13)
	jne	.L14
	movl	%edi, %esi
	movl	%edx, %ebx
	movl	%r9d, %ebp
	jmp	.L12
.L70:
	cmpl	%edi, %r11d
	jle	.L16
	movslq	%edx, %r10
	movslq	%edi, %r13
	imulq	$102, %r10, %r10
	addq	%r15, %r10
	cmpb	$46, (%r10,%r13)
	jne	.L16
	movl	%edi, %esi
	movl	%edx, %ebx
	movl	%r9d, %ebp
	jmp	.L12
.L66:
	movl	52(%rsp), %esi
	testl	%esi, %esi
	jle	.L5
	movl	20(%rsp), %edi
	movq	%rbp, %rdx
	xorl	%eax, %eax
.L7:
	movsbq	(%rdx), %rcx
	movl	(%r15,%rcx,4), %ecx
	cmpl	$3, %ecx
	jg	.L6
	movb	$46, (%rdx)
	movl	%eax, %edi
	movl	%r14d, %ebx
	movl	%ecx, %r13d
.L6:
	addl	$1, %eax
	addq	$1, %rdx
	cmpl	%esi, %eax
	jne	.L7
	movl	%edi, 20(%rsp)
.L5:
	movl	48(%rsp), %r8d
	addl	$1, %r14d
	cmpl	%r14d, %r8d
	jle	.L71
	addq	$102, %rbp
	jmp	.L22
.L71:
	movq	56(%rsp), %r12
	movl	%r13d, %ebp
	testq	%r12, %r12
	jg	.L3
.L67:
	movl	20(%rsp), %esi
	movslq	%ebp, %rcx
	jmp	.L9
.L20:
	movq	72(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L72
	addq	$88, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L27:
	.cfi_restore_state
	movl	$-1, %ebx
	jmp	.L3
.L72:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	mk
	.bss
	.align 32
	.type	mk, @object
	.size	mk, 166464
mk:
	.zero	166464
	.globl	tr
	.align 32
	.type	tr, @object
	.size	tr, 512
tr:
	.zero	512
	.globl	mv
	.data
	.align 32
	.type	mv, @object
	.size	mv, 32
mv:
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	0
	.long	0
	.long	-1
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:

// AOJ 2320: Infinity Maze
// 2017.10.4 bal4u@uu

#include <stdio.h>
#include <string.h>

char map[102][102];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int tr[128];
int mk[102][102][4];

int main()
{
	int h, w, r, c, d, r2, c2, sr, sc, step;
	long long l;
	char dir[5] = "NESW";

	tr['#'] = 10, tr['.'] = 11, tr['N'] = 0, tr['E'] = 1, tr['S'] = 2, tr['W'] = 3;
	while (scanf("%d%d%lld", &h, &w, &l) && l > 0) {
		memset(mk, 0, sizeof(mk));
		for (sr = -1, r = 0; r < h; r++) {
			scanf("%s", map[r]);
			if (sr >= 0) continue;
			for (c = 0; c < w; c++) {
				if (tr[map[r][c]] < 4) sr = r, sc = c, d = tr[map[r][c]], map[r][c] = '.';
			}
		}
		r = sr, c = sc, step = 0;
		while (l > 0) {
			if (mk[r][c][d]) {
				l = l % (step - mk[r][c][d]);
				if (!l) break;
			}
			mk[r][c][d] = step;
			while (1) {
				r2 = r + mv[d][0], c2 = c + mv[d][1];
				if (r2 >= 0 && r2 < h && c2 >= 0 && c2 < w && map[r2][c2] == '.') break;
				if (++d == 4) d = 0;
			}
			r = r2, c = c2;
			l--, step++;
		}
		printf("%d %d %c\n", r+1, c+1, dir[d]);
	}
    return 0;
}
3 3 10
E..
.#.
...
5 5 19
####.
.....
.#S#.
...#.
#.##.
5 5 6
#.#..
#....
##.#.
#..S.
#....
5 4 35
.#.#
....
.##.
.#S.
...#
0 0 0
 3 3 19
E..
.#.
...
5 5 19
.
.....
.#S#.
...#.
.##.
5 5 6
.#..
....
.#.
..S.
....
5 4 35
..##
....
.##.
.#S.
...#
0 0 0
 3 3 10
E..
.#.
...
5 5 37
####.
.....
.#S#.
...#.
#.##.
5 5 6
#.#..
#....
##.#.
#..S.
#....
5 4 35
.#.#
....
.##.
.#S.
...#
0 0 0
 3 3 6
E..
.#.
...
5 5 19
.
.....
.#S#.
...#.
.##.
5 5 6
.#..
....
.#.
..S.
....
5 4 35
..##
....
.##.
.#S.
...#
0 0 0
 3 3 10
E..
.#.
...
5 5 37
####.
.....
.#S#.
...#.
#.##.
5 5 6
#.#..
#....
#..##
#..S.
#....
5 4 35
.#.#
....
.##.
.#S.
...#
0 0 0
 3 3 10
E..
.#.
...
5 5 19
####.
.....
.#S#.
...#.
#.##.
5 5 6
..#.#
#....
##.#.
#..S.
#....
5 4 35
..##
....
.##.
.#S.
...#
0 0 0
 3 3 10
E..
.#.
...
5 5 19
.
.....
.#S#.
...#.
.##.
5 5 6
.#..
....
.#.
..S.
....
5 4 5
..##
....
.##.
.#S.
...#
0 0 0
 3 3 10
E..
.#.
...
5 5 19
####.
.....
.#S#.
...#.
#.##.
5 5 6
#.#..
#....
##.#.
.S..#
#....
5 4 35
..##
....
.##.
.#S.
...#
0 0 0
 3 3 23
E..
.#.
...
5 5 19
.
.....
.#S#.
...#.
.##.
5 5 6
.#..
....
.#.
..S.
....
5 4 35
..##
....
.##.
.#S.
...#
0 0 0
 3 3 17
E..
.#.
...
5 5 19
.
.....
.#S#.
...#.
.##.
5 5 6
.#..
....
.#.
..S.
....
5 4 5
..##
....
.##.
.#S.
...#
0 0 0

1 3 E
4 5 S
4 4 E
5 1 S
 2 3 S
2 5 S
1 3 W
1 1 N
 1 3 E
4 5 N
4 4 E
5 1 S
 3 1 W
2 5 S
1 3 W
1 1 N
 1 3 E
4 5 N
2 2 N
5 1 S
 1 3 E
4 5 S
4 4 E
1 1 N
 1 3 E
2 5 S
1 3 W
3 1 N
 1 3 E
4 5 S
5 3 W
1 1 N
 2 1 N
2 5 S
1 3 W
1 1 N
 1 2 E
2 5 S
1 3 W
3 1 N

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
// AOJ 2320: Infinity Maze
// 2017.10.4 bal4u@uu

#include <stdio.h>
#include <string.h>

char map[102][102];
int mv[4][2] = {{-1,0},{0,1},{1,0},{0,-1}};
int tr[128];
int mk[102][102][4];

int main()
{
	int h, w, r, c, d, r2, c2, sr, sc, step;
	long long l;
	char dir[5] = "NESW";

	tr['#'] = 10, tr['.'] = 11, tr['N'] = 0, tr['E'] = 1, tr['S'] = 2, tr['W'] = 3;
	while (scanf("%d%d%lld", &h, &w, &l) && l > 0) {
		memset(mk, 0, sizeof(mk));
		for (sr = -1, r = 0; r < h; r++) {
			scanf("%s", map[r]);
			if (sr >= 0) continue;
			for (c = 0; c < w; c++) {
				if (tr[map[r][c]] < 4) sr = r, sc = c, d = tr[map[r][c]], map[r][c] = '.';
			}
		}
		r = sr, c = sc, step = 0;
		while (l > 0) {
			if (mk[r][c][d]) {
				l = l % (step - mk[r][c][d]);
				if (!l) break;
			}
			mk[r][c][d] = step;
			while (1) {
				r2 = r + mv[d][0], c2 = c + mv[d][1];
				if (r2 >= 0 && r2 < h && c2 >= 0 && c2 < w && map[r2][c2] == '.') break;
				if (++d == 4) d = 0;
			}
			r = r2, c = c2;
			l--, step++;
		}
		printf("%d %d %c\n", r+1, c+1, dir[d]);
	}
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	mv
	.data
	.align 32
	.type	mv, @object
	.size	mv, 32
mv:
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	0
	.long	0
	.long	-1
	.globl	tr
	.bss
	.align 32
	.type	tr, @object
	.size	tr, 512
tr:
	.zero	512
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 166464
mk:
	.zero	166464
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d %c\n"
.LC2:
	.string	"%d%d%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1465075022, -13(%rbp)
	movb	$0, -9(%rbp)
	movl	$10, 140+tr(%rip)
	movl	$11, 184+tr(%rip)
	movl	$0, 312+tr(%rip)
	movl	$1, 276+tr(%rip)
	movl	$2, 332+tr(%rip)
	movl	$3, 348+tr(%rip)
	jmp	.L2
.L19:
	movl	$166464, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$-1, -44(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L3
.L9:
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -44(%rbp)
	jns	.L23
	movl	$0, -52(%rbp)
	jmp	.L6
.L8:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$3, %eax
	jg	.L7
	movl	-56(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
.L7:
	addl	$1, -52(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L8
	jmp	.L5
.L23:
	nop
.L5:
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	movl	-44(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L10
.L17:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mk(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movq	-24(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rsi
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	movl	-52(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mk(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	je	.L24
.L11:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	mk(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-56(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L13
	movl	-64(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L13
	cmpl	$0, -28(%rbp)
	js	.L13
	movl	-60(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L13
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L25
.L13:
	addl	$1, -48(%rbp)
	cmpl	$4, -48(%rbp)
	jne	.L16
	movl	$0, -48(%rbp)
	jmp	.L16
.L25:
	nop
	movl	-32(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -52(%rbp)
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L10:
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L17
	jmp	.L12
.L24:
	nop
.L12:
	movl	-48(%rbp), %eax
	cltq
	movzbl	-13(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	-52(%rbp), %edx
	addl	$1, %edx
	movl	-56(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-24(%rbp), %rcx
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L19
.L18:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	map
	.bss
	.align 32
	.type	map, @object
	.size	map, 10404
map:
	.zero	10404
	.globl	mv
	.data
	.align 32
	.type	mv, @object
	.size	mv, 32
mv:
	.long	-1
	.long	0
	.long	0
	.long	1
	.long	1
	.long	0
	.long	0
	.long	-1
	.globl	tr
	.bss
	.align 32
	.type	tr, @object
	.size	tr, 512
tr:
	.zero	512
	.globl	mk
	.align 32
	.type	mk, @object
	.size	mk, 166464
mk:
	.zero	166464
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d %d %c\n"
.LC2:
	.string	"%d%d%lld"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$64, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$1465075022, -13(%rbp)
	movb	$0, -9(%rbp)
	movl	$10, 140+tr(%rip)
	movl	$11, 184+tr(%rip)
	movl	$0, 312+tr(%rip)
	movl	$1, 276+tr(%rip)
	movl	$2, 332+tr(%rip)
	movl	$3, 348+tr(%rip)
	jmp	.L2
.L19:
	movl	$166464, %edx
	movl	$0, %esi
	leaq	mk(%rip), %rax
	movq	%rax, %rdi
	call	memset@PLT
	movl	$-1, -44(%rbp)
	movl	$0, -56(%rbp)
	jmp	.L3
.L9:
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	leaq	map(%rip), %rdx
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$0, -44(%rbp)
	jns	.L23
	movl	$0, -52(%rbp)
	jmp	.L6
.L8:
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$3, %eax
	jg	.L7
	movl	-56(%rbp), %eax
	movl	%eax, -44(%rbp)
	movl	-52(%rbp), %eax
	movl	%eax, -40(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	tr(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, -48(%rbp)
	movl	-52(%rbp), %eax
	movslq	%eax, %rdx
	movl	-56(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movb	$46, (%rax)
.L7:
	addl	$1, -52(%rbp)
.L6:
	movl	-60(%rbp), %eax
	cmpl	%eax, -52(%rbp)
	jl	.L8
	jmp	.L5
.L23:
	nop
.L5:
	addl	$1, -56(%rbp)
.L3:
	movl	-64(%rbp), %eax
	cmpl	%eax, -56(%rbp)
	jl	.L9
	movl	-44(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-40(%rbp), %eax
	movl	%eax, -52(%rbp)
	movl	$0, -36(%rbp)
	jmp	.L10
.L17:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	mk(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	je	.L11
	movq	-24(%rbp), %rax
	movl	-48(%rbp), %edx
	movslq	%edx, %rsi
	movl	-56(%rbp), %edx
	movslq	%edx, %rdx
	movl	-52(%rbp), %ecx
	movslq	%ecx, %rcx
	imulq	$102, %rdx, %rdx
	addq	%rcx, %rdx
	salq	$2, %rdx
	addq	%rsi, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	mk(%rip), %rdx
	movl	(%rcx,%rdx), %ecx
	movl	-36(%rbp), %edx
	subl	%ecx, %edx
	movslq	%edx, %rcx
	cqto
	idivq	%rcx
	movq	%rdx, %rax
	movq	%rax, -24(%rbp)
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	je	.L24
.L11:
	movl	-48(%rbp), %eax
	movslq	%eax, %rcx
	movl	-56(%rbp), %eax
	cltq
	movl	-52(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$102, %rax, %rax
	addq	%rdx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	leaq	0(,%rax,4), %rcx
	leaq	mk(%rip), %rdx
	movl	-36(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L16:
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-56(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -32(%rbp)
	movl	-48(%rbp), %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	4+mv(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-52(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -28(%rbp)
	cmpl	$0, -32(%rbp)
	js	.L13
	movl	-64(%rbp), %eax
	cmpl	%eax, -32(%rbp)
	jge	.L13
	cmpl	$0, -28(%rbp)
	js	.L13
	movl	-60(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jge	.L13
	movl	-28(%rbp), %eax
	movslq	%eax, %rdx
	movl	-32(%rbp), %eax
	cltq
	imulq	$102, %rax, %rax
	addq	%rax, %rdx
	leaq	map(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	cmpb	$46, %al
	je	.L25
.L13:
	addl	$1, -48(%rbp)
	cmpl	$4, -48(%rbp)
	jne	.L16
	movl	$0, -48(%rbp)
	jmp	.L16
.L25:
	nop
	movl	-32(%rbp), %eax
	movl	%eax, -56(%rbp)
	movl	-28(%rbp), %eax
	movl	%eax, -52(%rbp)
	movq	-24(%rbp), %rax
	subq	$1, %rax
	movq	%rax, -24(%rbp)
	addl	$1, -36(%rbp)
.L10:
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L17
	jmp	.L12
.L24:
	nop
.L12:
	movl	-48(%rbp), %eax
	cltq
	movzbl	-13(%rbp,%rax), %eax
	movsbl	%al, %eax
	movl	-52(%rbp), %edx
	addl	$1, %edx
	movl	-56(%rbp), %ecx
	leal	1(%rcx), %esi
	movl	%eax, %ecx
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L2:
	leaq	-24(%rbp), %rcx
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L18
	movq	-24(%rbp), %rax
	testq	%rax, %rax
	jg	.L19
.L18:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L21
	call	__stack_chk_fail@PLT
.L21:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.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:
