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

```c
/*
A0141
*/
#include <stdio.h>

int pattern[256];
char ban[100][100]={0};
int x,y;


int make_pattern(int n)
{
  int last,ret;

  if(n == 2)
  {  pattern[0]=1;
     pattern[1]=2;
     return(2);
  }
  last=(n & 1)?1:2;

  ret=0;
  n--;
  pattern[0]=n;
  pattern[1]=n;
  pattern[2]=n;
  ret = 3;
  
  while(n > last+2)
  { n -= 2;
    pattern[ret++]=n;
    pattern[ret++]=n;
  }
  pattern[ret++]=last;
  
  return(ret);
}

void show_pattern(int n,int turn)
{
  int i;
  
  for(i=0;i<turn;i++)
    printf("%d ",pattern[i]);
  printf("\n");
}

void show_ban(int n)
{
  int i,j;
  
  for(i=0;i<n;i++)
    {
      for(j=0;j<n;j++)
        printf("%c",ban[i][j]);
      printf("\n");

    }
}

void clear_ban(int n)
{
  
  int i,j;
  for(i=0;i<n;i++)
    for(j=0;j<n;j++)
       ban[i][j]=' ';
}

void up(){y--;}
void down(){y++;}
void left(){x++;}
void right(){x--;}
void (* move_table[4])()={up,left,down,right};

void draw_uzu(int turn)
{int i,j;

  for(i=0;i<turn;i++)
     for(j=0;j<pattern[i];j++)
       {
         /* printf("%d %d\n",y,x); */
         ban[y][x]='#';
         (*move_table[i % 4])();
       }

}

main()
{
  int cnt,N,turn;
  int flag = 0;
  
  scanf("%d",&cnt);
  while(cnt--)
  {
    if(flag)
      printf("\n");
    scanf("%d",&N);
    clear_ban(N);
    turn = make_pattern(N);
    x=0;y=N-1;
    draw_uzu(turn);
    show_ban(N);
    flag = 1;
  }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pattern
	.bss
	.align 32
	.type	pattern, @object
	.size	pattern, 1024
pattern:
	.zero	1024
	.globl	ban
	.align 32
	.type	ban, @object
	.size	ban, 10000
ban:
	.zero	10000
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.text
	.globl	make_pattern
	.type	make_pattern, @function
make_pattern:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	cmpl	$2, -20(%rbp)
	jne	.L2
	movl	$1, pattern(%rip)
	movl	$2, 4+pattern(%rip)
	movl	$2, %eax
	jmp	.L3
.L2:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	$2, %eax
.L5:
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	subl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 4+pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 8+pattern(%rip)
	movl	$3, -8(%rbp)
	jmp	.L6
.L7:
	subl	$2, -20(%rbp)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	make_pattern, .-make_pattern
	.section	.rodata
.LC0:
	.string	"%d "
	.text
	.globl	show_pattern
	.type	show_pattern, @function
show_pattern:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	show_pattern, .-show_pattern
	.globl	show_ban
	.type	show_ban, @function
show_ban:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	show_ban, .-show_ban
	.globl	clear_ban
	.type	clear_ban, @function
clear_ban:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L17
.L20:
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$32, (%rax)
	addl	$1, -4(%rbp)
.L18:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L19
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L20
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	clear_ban, .-clear_ban
	.globl	up
	.type	up, @function
up:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	up, .-up
	.globl	down
	.type	down, @function
down:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	down, .-down
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	subl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.globl	move_table
	.section	.data.rel.local,"aw"
	.align 32
	.type	move_table, @object
	.size	move_table, 32
move_table:
	.quad	up
	.quad	left
	.quad	down
	.quad	right
	.text
	.globl	draw_uzu
	.type	draw_uzu, @function
draw_uzu:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L26
.L29:
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movl	y(%rip), %eax
	movl	x(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	move_table(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	$0, %eax
	call	*%rdx
	addl	$1, -4(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
	addl	$1, -8(%rbp)
.L26:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L29
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	draw_uzu, .-draw_uzu
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L31
.L33:
	cmpl	$0, -16(%rbp)
	je	.L32
	movl	$10, %edi
	call	putchar@PLT
.L32:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	clear_ban
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	make_pattern
	movl	%eax, -12(%rbp)
	movl	$0, x(%rip)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	draw_uzu
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	show_ban
	movl	$1, -16(%rbp)
.L31:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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
	.p2align 4
	.globl	up
	.type	up, @function
up:
.LFB27:
	.cfi_startproc
	endbr64
	subl	$1, y(%rip)
	ret
	.cfi_endproc
.LFE27:
	.size	up, .-up
	.p2align 4
	.globl	down
	.type	down, @function
down:
.LFB28:
	.cfi_startproc
	endbr64
	addl	$1, y(%rip)
	ret
	.cfi_endproc
.LFE28:
	.size	down, .-down
	.p2align 4
	.globl	left
	.type	left, @function
left:
.LFB29:
	.cfi_startproc
	endbr64
	addl	$1, x(%rip)
	ret
	.cfi_endproc
.LFE29:
	.size	left, .-left
	.p2align 4
	.globl	right
	.type	right, @function
right:
.LFB30:
	.cfi_startproc
	endbr64
	subl	$1, x(%rip)
	ret
	.cfi_endproc
.LFE30:
	.size	right, .-right
	.p2align 4
	.globl	make_pattern
	.type	make_pattern, @function
make_pattern:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	je	.L17
	movl	%edi, %eax
	movl	$2, %r8d
	leal	-1(%rdi), %edx
	andl	$1, %eax
	movd	%edx, %xmm5
	movl	%edx, 8+pattern(%rip)
	subl	%eax, %r8d
	xorl	%eax, %eax
	pshufd	$0xe0, %xmm5, %xmm0
	movq	%xmm0, pattern(%rip)
	cmpl	$1, %r8d
	setne	%al
	addl	$3, %eax
	cmpl	%eax, %edx
	jle	.L13
	subl	$2, %edi
	subl	%eax, %edi
	movl	%edi, %eax
	shrl	%eax
	leal	1(%rax), %r9d
	cmpl	$1, %edi
	jbe	.L14
	movl	%r9d, %esi
	leaq	12+pattern(%rip), %rcx
	pshufd	$0, %xmm5, %xmm0
	movdqa	.LC2(%rip), %xmm3
	shrl	%esi
	leaq	16(%rcx), %rdi
	paddd	.LC1(%rip), %xmm0
	movdqa	.LC3(%rip), %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm0, %xmm1
	addq	$16, %rcx
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	movups	%xmm1, -16(%rcx)
	cmpq	%rcx, %rsi
	jne	.L11
	movl	%r9d, %edi
	movl	$3, %ecx
	andl	$-2, %edi
	movl	%edi, %esi
	negl	%esi
	addl	%esi, %esi
	addl	%esi, %edx
	subl	%esi, %ecx
	leaq	pattern(%rip), %rsi
	cmpl	%edi, %r9d
	je	.L12
.L10:
	subl	$2, %edx
	leaq	pattern(%rip), %rsi
	movd	%edx, %xmm4
	movslq	%ecx, %rdx
	pshufd	$0xe0, %xmm4, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
.L12:
	addl	%eax, %eax
	leal	5(%rax), %edx
	addl	$6, %eax
.L9:
	movslq	%edx, %rdx
	movl	%r8d, (%rsi,%rdx,4)
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	movq	.LC0(%rip), %rax
	movq	%rax, pattern(%rip)
	movl	$2, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$4, %eax
	movl	$3, %edx
	leaq	pattern(%rip), %rsi
	jmp	.L9
.L14:
	movl	$3, %ecx
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	make_pattern, .-make_pattern
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"%d "
	.text
	.p2align 4
	.globl	show_pattern
	.type	show_pattern, @function
show_pattern:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L23
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leal	-1(%rsi), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	pattern(%rip), %rbx
	leaq	4(%rbx), %rax
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L20
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE24:
	.size	show_pattern, .-show_pattern
	.p2align 4
	.globl	show_ban
	.type	show_ban, @function
show_ban:
.LFB25:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L32
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leal	-1(%rdi), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	(%r12,%r12,4), %rax
	leaq	1+ban(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rax,%rax,4), %rax
	addq	%r12, %rbp
	leaq	(%r12,%rax,4), %r13
	leaq	101+ban(%rip), %rax
	addq	%rax, %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rbp, %rbx
	subq	%r12, %rbx
	subq	$1, %rbx
	.p2align 4,,10
	.p2align 3
.L29:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	jne	.L29
	movl	$10, %edi
	addq	$100, %rbp
	call	putchar@PLT
	cmpq	%r13, %rbp
	jne	.L28
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
	.cfi_endproc
.LFE25:
	.size	show_ban, .-show_ban
	.p2align 4
	.globl	clear_ban
	.type	clear_ban, @function
clear_ban:
.LFB26:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L40
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leal	-1(%rdi), %eax
	leaq	ban(%rip), %rcx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rax,%rax,4), %rax
	movl	%edi, %ebx
	leaq	(%rax,%rax,4), %rdx
	leaq	100(%rcx), %rax
	leaq	(%rax,%rdx,4), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	movl	$32, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$100, %rcx
	cmpq	%rbp, %rcx
	jne	.L37
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE26:
	.size	clear_ban, .-clear_ban
	.p2align 4
	.globl	draw_uzu
	.type	draw_uzu, @function
draw_uzu:
.LFB31:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	testl	%edi, %edi
	jle	.L43
	leaq	pattern(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	ban(%rip), %r13
	leaq	move_table(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L45:
	movl	(%rbx), %eax
	movl	%r14d, %ebp
	xorl	%r15d, %r15d
	andl	$3, %ebp
	testl	%eax, %eax
	jle	.L48
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	y(%rip), %rax
	movslq	x(%rip), %rcx
	addl	$1, %r15d
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%r13,%rax,4), %rax
	movb	$35, (%rax,%rcx)
	xorl	%eax, %eax
	call	*(%r12,%rbp,8)
	cmpl	%r15d, (%rbx)
	jg	.L46
.L48:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r14d, 12(%rsp)
	jne	.L45
.L43:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE31:
	.size	draw_uzu, .-draw_uzu
	.section	.rodata.str1.1
.LC5:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB32:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC5(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L52
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	8(%rsp), %rsi
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L90
	movl	%eax, %ebx
	leaq	ban(%rip), %rcx
	leal	-1(%rbx), %eax
	movq	%rax, %r12
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	100(%rcx), %rax
	leaq	(%rax,%rdx,4), %rbp
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	movl	$32, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$100, %rcx
	cmpq	%rbp, %rcx
	jne	.L57
	movd	%r12d, %xmm2
	cmpl	$2, 4(%rsp)
	pshufd	$0xe0, %xmm2, %xmm0
	je	.L91
.L56:
	movl	4(%rsp), %esi
	movl	$2, %ecx
	movl	%r12d, 8+pattern(%rip)
	movl	%esi, %eax
	andl	$1, %eax
	subl	%eax, %ecx
	leaq	pattern(%rip), %rax
	movq	%xmm0, (%rax)
	xorl	%eax, %eax
	cmpl	$1, %ecx
	setne	%al
	addl	$3, %eax
	cmpl	%eax, %r12d
	jle	.L76
	subl	$2, %esi
	movl	%esi, %edx
	subl	%eax, %edx
	movl	%edx, %esi
	shrl	%esi
	leal	1(%rsi), %edi
	cmpl	$1, %edx
	jbe	.L77
	movl	%edi, %edx
	movd	%r12d, %xmm3
	leaq	12+pattern(%rip), %rax
	shrl	%edx
	pshufd	$0, %xmm3, %xmm0
	leaq	16(%rax), %rbx
	subl	$1, %edx
	paddd	.LC1(%rip), %xmm0
	salq	$4, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L62:
	movdqa	.LC2(%rip), %xmm1
	addq	$16, %rax
	paddd	%xmm0, %xmm1
	paddd	.LC3(%rip), %xmm0
	movups	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L62
	movl	%edi, %r9d
	movl	$3, %edx
	andl	$-2, %r9d
	movl	%r9d, %r8d
	negl	%r8d
	addl	%r8d, %r8d
	leal	(%r12,%r8), %eax
	subl	%r8d, %edx
	cmpl	%r9d, %edi
	je	.L63
.L61:
	subl	$2, %eax
	movd	%eax, %xmm0
	movslq	%edx, %rax
	leaq	pattern(%rip), %rdx
	pshufd	$0xe0, %xmm0, %xmm0
	movq	%xmm0, (%rdx,%rax,4)
.L63:
	addl	%esi, %esi
	leal	5(%rsi), %eax
	addl	$6, %esi
	movl	%esi, 4(%rsp)
.L60:
	cltq
	leaq	pattern(%rip), %rsi
	movl	%ecx, (%rsi,%rax,4)
.L59:
	movl	$0, x(%rip)
	leaq	pattern(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	ban(%rip), %r13
	movl	%r12d, y(%rip)
	leaq	move_table(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L64:
	movl	(%rbx), %eax
	movl	%r14d, %ebp
	xorl	%r15d, %r15d
	andl	$3, %ebp
	testl	%eax, %eax
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	y(%rip), %rax
	movslq	x(%rip), %rcx
	addl	$1, %r15d
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%r13,%rax,4), %rax
	movb	$35, (%rax,%rcx)
	xorl	%eax, %eax
	call	*(%r12,%rbp,8)
	cmpl	(%rbx), %r15d
	jl	.L65
.L68:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	4(%rsp), %r14d
	jne	.L64
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L73
	leal	-1(%rax), %ebp
	leaq	1+ban(%rip), %rbx
	leaq	0(%rbp,%rbp,4), %rax
	addq	%rbp, %rbx
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,4), %r12
	leaq	101+ban(%rip), %rax
	addq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rbx, %r13
	subq	%rbp, %r13
	subq	$1, %r13
	.p2align 4,,10
	.p2align 3
.L71:
	movsbl	0(%r13), %edi
	addq	$1, %r13
	call	putchar@PLT
	cmpq	%rbx, %r13
	jne	.L71
	movl	$10, %edi
	addq	$100, %rbx
	call	putchar@PLT
	cmpq	%r12, %rbx
	jne	.L72
.L73:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L52
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L74
.L91:
	movq	.LC0(%rip), %rax
	leaq	pattern(%rip), %rsi
	movq	%rax, (%rsi)
	jmp	.L59
.L52:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	addq	$40, %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
.L90:
	.cfi_restore_state
	leal	-1(%rax), %r12d
	movd	%r12d, %xmm4
	pshufd	$0xe0, %xmm4, %xmm0
	jmp	.L56
.L76:
	movl	$4, 4(%rsp)
	movl	$3, %eax
	jmp	.L60
.L77:
	movl	%r12d, %eax
	movl	$3, %edx
	jmp	.L61
.L92:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE32:
	.size	main, .-main
	.globl	move_table
	.section	.data.rel.local,"aw"
	.align 32
	.type	move_table, @object
	.size	move_table, 32
move_table:
	.quad	up
	.quad	left
	.quad	down
	.quad	right
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	ban
	.align 32
	.type	ban, @object
	.size	ban, 10000
ban:
	.zero	10000
	.globl	pattern
	.align 32
	.type	pattern, @object
	.size	pattern, 1024
pattern:
	.zero	1024
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	2
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	0
	.long	-2
	.long	-2
	.align 16
.LC2:
	.long	-2
	.long	-2
	.long	-2
	.long	-2
	.align 16
.LC3:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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
	.p2align 4
	.globl	up
	.type	up, @function
up:
.LFB27:
	.cfi_startproc
	endbr64
	subl	$1, y(%rip)
	ret
	.cfi_endproc
.LFE27:
	.size	up, .-up
	.p2align 4
	.globl	down
	.type	down, @function
down:
.LFB28:
	.cfi_startproc
	endbr64
	addl	$1, y(%rip)
	ret
	.cfi_endproc
.LFE28:
	.size	down, .-down
	.p2align 4
	.globl	left
	.type	left, @function
left:
.LFB29:
	.cfi_startproc
	endbr64
	addl	$1, x(%rip)
	ret
	.cfi_endproc
.LFE29:
	.size	left, .-left
	.p2align 4
	.globl	right
	.type	right, @function
right:
.LFB30:
	.cfi_startproc
	endbr64
	subl	$1, x(%rip)
	ret
	.cfi_endproc
.LFE30:
	.size	right, .-right
	.p2align 4
	.globl	make_pattern
	.type	make_pattern, @function
make_pattern:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	$2, %edi
	je	.L17
	movl	%edi, %eax
	movl	$2, %r8d
	leal	-1(%rdi), %edx
	andl	$1, %eax
	movd	%edx, %xmm5
	movl	%edx, 8+pattern(%rip)
	subl	%eax, %r8d
	xorl	%eax, %eax
	pshufd	$0xe0, %xmm5, %xmm0
	movq	%xmm0, pattern(%rip)
	cmpl	$1, %r8d
	setne	%al
	addl	$3, %eax
	cmpl	%eax, %edx
	jle	.L13
	subl	$2, %edi
	subl	%eax, %edi
	movl	%edi, %eax
	shrl	%eax
	leal	1(%rax), %r9d
	cmpl	$1, %edi
	jbe	.L14
	movl	%r9d, %esi
	leaq	12+pattern(%rip), %rcx
	pshufd	$0, %xmm5, %xmm0
	movdqa	.LC2(%rip), %xmm3
	shrl	%esi
	leaq	16(%rcx), %rdi
	paddd	.LC1(%rip), %xmm0
	movdqa	.LC3(%rip), %xmm2
	subl	$1, %esi
	salq	$4, %rsi
	addq	%rdi, %rsi
	.p2align 4,,10
	.p2align 3
.L11:
	movdqa	%xmm0, %xmm1
	addq	$16, %rcx
	paddd	%xmm2, %xmm0
	paddd	%xmm3, %xmm1
	movups	%xmm1, -16(%rcx)
	cmpq	%rcx, %rsi
	jne	.L11
	movl	%r9d, %edi
	movl	$3, %ecx
	andl	$-2, %edi
	movl	%edi, %esi
	negl	%esi
	addl	%esi, %esi
	addl	%esi, %edx
	subl	%esi, %ecx
	leaq	pattern(%rip), %rsi
	cmpl	%edi, %r9d
	je	.L12
.L10:
	subl	$2, %edx
	leaq	pattern(%rip), %rsi
	movd	%edx, %xmm4
	movslq	%ecx, %rdx
	pshufd	$0xe0, %xmm4, %xmm0
	movq	%xmm0, (%rsi,%rdx,4)
.L12:
	addl	%eax, %eax
	leal	5(%rax), %edx
	addl	$6, %eax
.L9:
	movslq	%edx, %rdx
	movl	%r8d, (%rsi,%rdx,4)
	ret
	.p2align 4,,10
	.p2align 3
.L17:
	movq	.LC0(%rip), %rax
	movq	%rax, pattern(%rip)
	movl	$2, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	movl	$4, %eax
	movl	$3, %edx
	leaq	pattern(%rip), %rsi
	jmp	.L9
.L14:
	movl	$3, %ecx
	jmp	.L10
	.cfi_endproc
.LFE23:
	.size	make_pattern, .-make_pattern
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC4:
	.string	"%d "
	.text
	.p2align 4
	.globl	show_pattern
	.type	show_pattern, @function
show_pattern:
.LFB24:
	.cfi_startproc
	endbr64
	testl	%esi, %esi
	jle	.L23
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leal	-1(%rsi), %edx
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	leaq	.LC4(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	leaq	pattern(%rip), %rbx
	leaq	4(%rbx), %rax
	leaq	(%rax,%rdx,4), %r12
	.p2align 4,,10
	.p2align 3
.L20:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%r12, %rbx
	jne	.L20
	popq	%rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 24
	movl	$10, %edi
	popq	%rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_restore 12
	.cfi_def_cfa_offset 8
	jmp	putchar@PLT
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$10, %edi
	jmp	putchar@PLT
	.cfi_endproc
.LFE24:
	.size	show_pattern, .-show_pattern
	.p2align 4
	.globl	show_ban
	.type	show_ban, @function
show_ban:
.LFB25:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L32
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leal	-1(%rdi), %r12d
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	(%r12,%r12,4), %rax
	leaq	1+ban(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	leaq	(%rax,%rax,4), %rax
	addq	%r12, %rbp
	leaq	(%r12,%rax,4), %r13
	leaq	101+ban(%rip), %rax
	addq	%rax, %r13
	subq	$8, %rsp
	.cfi_def_cfa_offset 48
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rbp, %rbx
	subq	%r12, %rbx
	subq	$1, %rbx
	.p2align 4,,10
	.p2align 3
.L29:
	movsbl	(%rbx), %edi
	addq	$1, %rbx
	call	putchar@PLT
	cmpq	%rbp, %rbx
	jne	.L29
	movl	$10, %edi
	addq	$100, %rbp
	call	putchar@PLT
	cmpq	%r13, %rbp
	jne	.L28
	addq	$8, %rsp
	.cfi_def_cfa_offset 40
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	ret
	.cfi_endproc
.LFE25:
	.size	show_ban, .-show_ban
	.p2align 4
	.globl	clear_ban
	.type	clear_ban, @function
clear_ban:
.LFB26:
	.cfi_startproc
	endbr64
	testl	%edi, %edi
	jle	.L40
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leal	-1(%rdi), %eax
	leaq	ban(%rip), %rcx
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	leaq	(%rax,%rax,4), %rax
	movl	%edi, %ebx
	leaq	(%rax,%rax,4), %rdx
	leaq	100(%rcx), %rax
	leaq	(%rax,%rdx,4), %rbp
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	.p2align 4,,10
	.p2align 3
.L37:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	movl	$32, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$100, %rcx
	cmpq	%rbp, %rcx
	jne	.L37
	addq	$8, %rsp
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore 3
	.cfi_restore 6
	ret
	.cfi_endproc
.LFE26:
	.size	clear_ban, .-clear_ban
	.p2align 4
	.globl	draw_uzu
	.type	draw_uzu, @function
draw_uzu:
.LFB31:
	.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	$24, %rsp
	.cfi_def_cfa_offset 80
	movl	%edi, 12(%rsp)
	testl	%edi, %edi
	jle	.L43
	leaq	pattern(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	ban(%rip), %r13
	leaq	move_table(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L45:
	movl	(%rbx), %eax
	movl	%r14d, %ebp
	xorl	%r15d, %r15d
	andl	$3, %ebp
	testl	%eax, %eax
	jle	.L48
	.p2align 4,,10
	.p2align 3
.L46:
	movslq	y(%rip), %rax
	movslq	x(%rip), %rcx
	addl	$1, %r15d
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%r13,%rax,4), %rax
	movb	$35, (%rax,%rcx)
	xorl	%eax, %eax
	call	*(%r12,%rbp,8)
	cmpl	%r15d, (%rbx)
	jg	.L46
.L48:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r14d, 12(%rsp)
	jne	.L45
.L43:
	addq	$24, %rsp
	.cfi_def_cfa_offset 56
	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
	.cfi_endproc
.LFE31:
	.size	draw_uzu, .-draw_uzu
	.section	.rodata.str1.1
.LC5:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB32:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC5(%rip), %rdi
	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	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L52
	leaq	20(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L74:
	movq	8(%rsp), %rsi
	leaq	.LC5(%rip), %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %eax
	movl	%eax, 4(%rsp)
	testl	%eax, %eax
	jle	.L90
	movl	%eax, %ebx
	leaq	ban(%rip), %rcx
	leal	-1(%rbx), %eax
	movq	%rax, %r12
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	100(%rcx), %rax
	leaq	(%rax,%rdx,4), %rbp
	.p2align 4,,10
	.p2align 3
.L57:
	movq	%rcx, %rdi
	movq	%rbx, %rdx
	movl	$32, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$100, %rcx
	cmpq	%rbp, %rcx
	jne	.L57
	movd	%r12d, %xmm2
	cmpl	$2, 4(%rsp)
	pshufd	$0xe0, %xmm2, %xmm0
	je	.L91
.L56:
	movl	4(%rsp), %esi
	movl	$2, %ecx
	movl	%r12d, 8+pattern(%rip)
	movl	%esi, %eax
	andl	$1, %eax
	subl	%eax, %ecx
	leaq	pattern(%rip), %rax
	movq	%xmm0, (%rax)
	xorl	%eax, %eax
	cmpl	$1, %ecx
	setne	%al
	addl	$3, %eax
	cmpl	%eax, %r12d
	jle	.L76
	subl	$2, %esi
	movl	%esi, %edx
	subl	%eax, %edx
	movl	%edx, %esi
	shrl	%esi
	leal	1(%rsi), %edi
	cmpl	$1, %edx
	jbe	.L77
	movl	%edi, %edx
	movd	%r12d, %xmm3
	leaq	12+pattern(%rip), %rax
	shrl	%edx
	pshufd	$0, %xmm3, %xmm0
	leaq	16(%rax), %rbx
	subl	$1, %edx
	paddd	.LC1(%rip), %xmm0
	salq	$4, %rdx
	addq	%rbx, %rdx
	.p2align 4,,10
	.p2align 3
.L62:
	movdqa	.LC2(%rip), %xmm1
	addq	$16, %rax
	paddd	%xmm0, %xmm1
	paddd	.LC3(%rip), %xmm0
	movups	%xmm1, -16(%rax)
	cmpq	%rdx, %rax
	jne	.L62
	movl	%edi, %r9d
	movl	$3, %edx
	andl	$-2, %r9d
	movl	%r9d, %r8d
	negl	%r8d
	addl	%r8d, %r8d
	leal	(%r12,%r8), %eax
	subl	%r8d, %edx
	cmpl	%r9d, %edi
	je	.L63
.L61:
	subl	$2, %eax
	movd	%eax, %xmm0
	movslq	%edx, %rax
	leaq	pattern(%rip), %rdx
	pshufd	$0xe0, %xmm0, %xmm0
	movq	%xmm0, (%rdx,%rax,4)
.L63:
	addl	%esi, %esi
	leal	5(%rsi), %eax
	addl	$6, %esi
	movl	%esi, 4(%rsp)
.L60:
	cltq
	leaq	pattern(%rip), %rsi
	movl	%ecx, (%rsi,%rax,4)
.L59:
	movl	$0, x(%rip)
	leaq	pattern(%rip), %rbx
	xorl	%r14d, %r14d
	leaq	ban(%rip), %r13
	movl	%r12d, y(%rip)
	leaq	move_table(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L64:
	movl	(%rbx), %eax
	movl	%r14d, %ebp
	xorl	%r15d, %r15d
	andl	$3, %ebp
	testl	%eax, %eax
	jle	.L68
	.p2align 4,,10
	.p2align 3
.L65:
	movslq	y(%rip), %rax
	movslq	x(%rip), %rcx
	addl	$1, %r15d
	leaq	(%rax,%rax,4), %rax
	leaq	(%rax,%rax,4), %rax
	leaq	0(%r13,%rax,4), %rax
	movb	$35, (%rax,%rcx)
	xorl	%eax, %eax
	call	*(%r12,%rbp,8)
	cmpl	(%rbx), %r15d
	jl	.L65
.L68:
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	4(%rsp), %r14d
	jne	.L64
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L73
	leal	-1(%rax), %ebp
	leaq	1+ban(%rip), %rbx
	leaq	0(%rbp,%rbp,4), %rax
	addq	%rbp, %rbx
	leaq	(%rax,%rax,4), %rax
	leaq	0(%rbp,%rax,4), %r12
	leaq	101+ban(%rip), %rax
	addq	%rax, %r12
	.p2align 4,,10
	.p2align 3
.L72:
	movq	%rbx, %r13
	subq	%rbp, %r13
	subq	$1, %r13
	.p2align 4,,10
	.p2align 3
.L71:
	movsbl	0(%r13), %edi
	addq	$1, %r13
	call	putchar@PLT
	cmpq	%rbx, %r13
	jne	.L71
	movl	$10, %edi
	addq	$100, %rbx
	call	putchar@PLT
	cmpq	%r12, %rbx
	jne	.L72
.L73:
	movl	16(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 16(%rsp)
	testl	%eax, %eax
	je	.L52
	movl	$10, %edi
	call	putchar@PLT
	jmp	.L74
.L91:
	movq	.LC0(%rip), %rax
	leaq	pattern(%rip), %rsi
	movq	%rax, (%rsi)
	jmp	.L59
.L52:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L92
	addq	$40, %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
.L90:
	.cfi_restore_state
	leal	-1(%rax), %r12d
	movd	%r12d, %xmm4
	pshufd	$0xe0, %xmm4, %xmm0
	jmp	.L56
.L76:
	movl	$4, 4(%rsp)
	movl	$3, %eax
	jmp	.L60
.L77:
	movl	%r12d, %eax
	movl	$3, %edx
	jmp	.L61
.L92:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE32:
	.size	main, .-main
	.globl	move_table
	.section	.data.rel.local,"aw"
	.align 32
	.type	move_table, @object
	.size	move_table, 32
move_table:
	.quad	up
	.quad	left
	.quad	down
	.quad	right
	.globl	y
	.bss
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	ban
	.align 32
	.type	ban, @object
	.size	ban, 10000
ban:
	.zero	10000
	.globl	pattern
	.align 32
	.type	pattern, @object
	.size	pattern, 1024
pattern:
	.zero	1024
	.section	.rodata.cst8,"aM",@progbits,8
	.align 8
.LC0:
	.long	1
	.long	2
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	0
	.long	-2
	.long	-2
	.align 16
.LC2:
	.long	-2
	.long	-2
	.long	-2
	.long	-2
	.align 16
.LC3:
	.long	-4
	.long	-4
	.long	-4
	.long	-4
	.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:

/*
A0141
*/
#include <stdio.h>

int pattern[256];
char ban[100][100]={0};
int x,y;


int make_pattern(int n)
{
  int last,ret;

  if(n == 2)
  {  pattern[0]=1;
     pattern[1]=2;
     return(2);
  }
  last=(n & 1)?1:2;

  ret=0;
  n--;
  pattern[0]=n;
  pattern[1]=n;
  pattern[2]=n;
  ret = 3;
  
  while(n > last+2)
  { n -= 2;
    pattern[ret++]=n;
    pattern[ret++]=n;
  }
  pattern[ret++]=last;
  
  return(ret);
}

void show_pattern(int n,int turn)
{
  int i;
  
  for(i=0;i<turn;i++)
    printf("%d ",pattern[i]);
  printf("\n");
}

void show_ban(int n)
{
  int i,j;
  
  for(i=0;i<n;i++)
    {
      for(j=0;j<n;j++)
        printf("%c",ban[i][j]);
      printf("\n");

    }
}

void clear_ban(int n)
{
  
  int i,j;
  for(i=0;i<n;i++)
    for(j=0;j<n;j++)
       ban[i][j]=' ';
}

void up(){y--;}
void down(){y++;}
void left(){x++;}
void right(){x--;}
void (* move_table[4])()={up,left,down,right};

void draw_uzu(int turn)
{int i,j;

  for(i=0;i<turn;i++)
     for(j=0;j<pattern[i];j++)
       {
         /* printf("%d %d\n",y,x); */
         ban[y][x]='#';
         (*move_table[i % 4])();
       }

}

main()
{
  int cnt,N,turn;
  int flag = 0;
  
  scanf("%d",&cnt);
  while(cnt--)
  {
    if(flag)
      printf("\n");
    scanf("%d",&N);
    clear_ban(N);
    turn = make_pattern(N);
    x=0;y=N-1;
    draw_uzu(turn);
    show_ban(N);
    flag = 1;
  }
  return(0);
}
2
5
5
 2
8
5
 2
12
5
 2
12
3
 2
5
9
 2
5
7
 2
8
9
 2
16
3
 2
9
9
 2
10
7

#####
#   #
# # #
# # #
# ###

#####
#   #
# # #
# # #
# ###
 ########
#      #
# #### #
# #  # #
# #  # #
# # ## #
# #    #
# ######

#####
#   #
# # #
# # #
# ###
 ############
#          #
# ######## #
# #      # #
# # #### # #
# # #  # # #
# # #  # # #
# # # ## # #
# # #    # #
# # ###### #
# #        #
# ##########

#####
#   #
# # #
# # #
# ###
 ############
#          #
# ######## #
# #      # #
# # #### # #
# # #  # # #
# # #  # # #
# # # ## # #
# # #    # #
# # ###### #
# #        #
# ##########

###
# #
# #
 #####
#   #
# # #
# # #
# ###

#########
#       #
# ##### #
# #   # #
# # # # #
# # # # #
# # ### #
# #     #
# #######
 #####
#   #
# # #
# # #
# ###

#######
#     #
# ### #
# # # #
# # # #
# #   #
# #####
 ########
#      #
# #### #
# #  # #
# #  # #
# # ## #
# #    #
# ######

#########
#       #
# ##### #
# #   # #
# # # # #
# # # # #
# # ### #
# #     #
# #######
 ################
#              #
# ############ #
# #          # #
# # ######## # #
# # #      # # #
# # # #### # # #
# # # #  # # # #
# # # #  # # # #
# # # # ## # # #
# # # #    # # #
# # # ###### # #
# # #        # #
# # ########## #
# #            #
# ##############

###
# #
# #
 #########
#       #
# ##### #
# #   # #
# # # # #
# # # # #
# # ### #
# #     #
# #######

#########
#       #
# ##### #
# #   # #
# # # # #
# # # # #
# # ### #
# #     #
# #######
 ##########
#        #
# ###### #
# #    # #
# # ## # #
# # #  # #
# # #  # #
# # #### #
# #      #
# ########

#######
#     #
# ### #
# # # #
# # # #
# #   #
# #####

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

```c
/*
A0141
*/
#include <stdio.h>

int pattern[256];
char ban[100][100]={0};
int x,y;


int make_pattern(int n)
{
  int last,ret;

  if(n == 2)
  {  pattern[0]=1;
     pattern[1]=2;
     return(2);
  }
  last=(n & 1)?1:2;

  ret=0;
  n--;
  pattern[0]=n;
  pattern[1]=n;
  pattern[2]=n;
  ret = 3;
  
  while(n > last+2)
  { n -= 2;
    pattern[ret++]=n;
    pattern[ret++]=n;
  }
  pattern[ret++]=last;
  
  return(ret);
}

void show_pattern(int n,int turn)
{
  int i;
  
  for(i=0;i<turn;i++)
    printf("%d ",pattern[i]);
  printf("\n");
}

void show_ban(int n)
{
  int i,j;
  
  for(i=0;i<n;i++)
    {
      for(j=0;j<n;j++)
        printf("%c",ban[i][j]);
      printf("\n");

    }
}

void clear_ban(int n)
{
  
  int i,j;
  for(i=0;i<n;i++)
    for(j=0;j<n;j++)
       ban[i][j]=' ';
}

void up(){y--;}
void down(){y++;}
void left(){x++;}
void right(){x--;}
void (* move_table[4])()={up,left,down,right};

void draw_uzu(int turn)
{int i,j;

  for(i=0;i<turn;i++)
     for(j=0;j<pattern[i];j++)
       {
         /* printf("%d %d\n",y,x); */
         ban[y][x]='#';
         (*move_table[i % 4])();
       }

}

main()
{
  int cnt,N,turn;
  int flag = 0;
  
  scanf("%d",&cnt);
  while(cnt--)
  {
    if(flag)
      printf("\n");
    scanf("%d",&N);
    clear_ban(N);
    turn = make_pattern(N);
    x=0;y=N-1;
    draw_uzu(turn);
    show_ban(N);
    flag = 1;
  }
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	pattern
	.bss
	.align 32
	.type	pattern, @object
	.size	pattern, 1024
pattern:
	.zero	1024
	.globl	ban
	.align 32
	.type	ban, @object
	.size	ban, 10000
ban:
	.zero	10000
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.text
	.globl	make_pattern
	.type	make_pattern, @function
make_pattern:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	cmpl	$2, -20(%rbp)
	jne	.L2
	movl	$1, pattern(%rip)
	movl	$2, 4+pattern(%rip)
	movl	$2, %eax
	jmp	.L3
.L2:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	$2, %eax
.L5:
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	subl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 4+pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 8+pattern(%rip)
	movl	$3, -8(%rbp)
	jmp	.L6
.L7:
	subl	$2, -20(%rbp)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	make_pattern, .-make_pattern
	.section	.rodata
.LC0:
	.string	"%d "
	.text
	.globl	show_pattern
	.type	show_pattern, @function
show_pattern:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	show_pattern, .-show_pattern
	.globl	show_ban
	.type	show_ban, @function
show_ban:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	show_ban, .-show_ban
	.globl	clear_ban
	.type	clear_ban, @function
clear_ban:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L17
.L20:
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$32, (%rax)
	addl	$1, -4(%rbp)
.L18:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L19
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L20
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	clear_ban, .-clear_ban
	.globl	up
	.type	up, @function
up:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	up, .-up
	.globl	down
	.type	down, @function
down:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	down, .-down
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	subl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.globl	move_table
	.section	.data.rel.local,"aw"
	.align 32
	.type	move_table, @object
	.size	move_table, 32
move_table:
	.quad	up
	.quad	left
	.quad	down
	.quad	right
	.text
	.globl	draw_uzu
	.type	draw_uzu, @function
draw_uzu:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L26
.L29:
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movl	y(%rip), %eax
	movl	x(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	move_table(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	$0, %eax
	call	*%rdx
	addl	$1, -4(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
	addl	$1, -8(%rbp)
.L26:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L29
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	draw_uzu, .-draw_uzu
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L31
.L33:
	cmpl	$0, -16(%rbp)
	je	.L32
	movl	$10, %edi
	call	putchar@PLT
.L32:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	clear_ban
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	make_pattern
	movl	%eax, -12(%rbp)
	movl	$0, x(%rip)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	draw_uzu
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	show_ban
	movl	$1, -16(%rbp)
.L31:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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	pattern
	.bss
	.align 32
	.type	pattern, @object
	.size	pattern, 1024
pattern:
	.zero	1024
	.globl	ban
	.align 32
	.type	ban, @object
	.size	ban, 10000
ban:
	.zero	10000
	.globl	x
	.align 4
	.type	x, @object
	.size	x, 4
x:
	.zero	4
	.globl	y
	.align 4
	.type	y, @object
	.size	y, 4
y:
	.zero	4
	.text
	.globl	make_pattern
	.type	make_pattern, @function
make_pattern:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	cmpl	$2, -20(%rbp)
	jne	.L2
	movl	$1, pattern(%rip)
	movl	$2, 4+pattern(%rip)
	movl	$2, %eax
	jmp	.L3
.L2:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L4
	movl	$1, %eax
	jmp	.L5
.L4:
	movl	$2, %eax
.L5:
	movl	%eax, -4(%rbp)
	movl	$0, -8(%rbp)
	subl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 4+pattern(%rip)
	movl	-20(%rbp), %eax
	movl	%eax, 8+pattern(%rip)
	movl	$3, -8(%rbp)
	jmp	.L6
.L7:
	subl	$2, -20(%rbp)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-20(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
.L6:
	movl	-4(%rbp), %eax
	addl	$2, %eax
	cmpl	%eax, -20(%rbp)
	jg	.L7
	movl	-8(%rbp), %eax
	leal	1(%rax), %edx
	movl	%edx, -8(%rbp)
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	pattern(%rip), %rdx
	movl	-4(%rbp), %eax
	movl	%eax, (%rcx,%rdx)
	movl	-8(%rbp), %eax
.L3:
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	make_pattern, .-make_pattern
	.section	.rodata
.LC0:
	.string	"%d "
	.text
	.globl	show_pattern
	.type	show_pattern, @function
show_pattern:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L9
.L10:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -4(%rbp)
.L9:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jl	.L10
	movl	$10, %edi
	call	putchar@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	show_pattern, .-show_pattern
	.globl	show_ban
	.type	show_ban, @function
show_ban:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L12
.L15:
	movl	$0, -4(%rbp)
	jmp	.L13
.L14:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -4(%rbp)
.L13:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L14
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -8(%rbp)
.L12:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L15
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	show_ban, .-show_ban
	.globl	clear_ban
	.type	clear_ban, @function
clear_ban:
.LFB3:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L17
.L20:
	movl	$0, -4(%rbp)
	jmp	.L18
.L19:
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$32, (%rax)
	addl	$1, -4(%rbp)
.L18:
	movl	-4(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L19
	addl	$1, -8(%rbp)
.L17:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L20
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.size	clear_ban, .-clear_ban
	.globl	up
	.type	up, @function
up:
.LFB4:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE4:
	.size	up, .-up
	.globl	down
	.type	down, @function
down:
.LFB5:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	y(%rip), %eax
	addl	$1, %eax
	movl	%eax, y(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE5:
	.size	down, .-down
	.globl	left
	.type	left, @function
left:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	addl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	left, .-left
	.globl	right
	.type	right, @function
right:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	x(%rip), %eax
	subl	$1, %eax
	movl	%eax, x(%rip)
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	right, .-right
	.globl	move_table
	.section	.data.rel.local,"aw"
	.align 32
	.type	move_table, @object
	.size	move_table, 32
move_table:
	.quad	up
	.quad	left
	.quad	down
	.quad	right
	.text
	.globl	draw_uzu
	.type	draw_uzu, @function
draw_uzu:
.LFB8:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	$0, -8(%rbp)
	jmp	.L26
.L29:
	movl	$0, -4(%rbp)
	jmp	.L27
.L28:
	movl	y(%rip), %eax
	movl	x(%rip), %edx
	movslq	%edx, %rcx
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	addq	%rdx, %rax
	salq	$2, %rax
	leaq	(%rax,%rcx), %rdx
	leaq	ban(%rip), %rax
	addq	%rdx, %rax
	movb	$35, (%rax)
	movl	-8(%rbp), %eax
	cltd
	shrl	$30, %edx
	addl	%edx, %eax
	andl	$3, %eax
	subl	%edx, %eax
	cltq
	leaq	0(,%rax,8), %rdx
	leaq	move_table(%rip), %rax
	movq	(%rdx,%rax), %rdx
	movl	$0, %eax
	call	*%rdx
	addl	$1, -4(%rbp)
.L27:
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	pattern(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	%eax, -4(%rbp)
	jl	.L28
	addl	$1, -8(%rbp)
.L26:
	movl	-8(%rbp), %eax
	cmpl	-20(%rbp), %eax
	jl	.L29
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	draw_uzu, .-draw_uzu
	.section	.rodata
.LC1:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB9:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	jmp	.L31
.L33:
	cmpl	$0, -16(%rbp)
	je	.L32
	movl	$10, %edi
	call	putchar@PLT
.L32:
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	clear_ban
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	make_pattern
	movl	%eax, -12(%rbp)
	movl	$0, x(%rip)
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, y(%rip)
	movl	-12(%rbp), %eax
	movl	%eax, %edi
	call	draw_uzu
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	show_ban
	movl	$1, -16(%rbp)
.L31:
	movl	-24(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -24(%rbp)
	testl	%eax, %eax
	jne	.L33
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.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:
