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

```c
#include<stdio.h>
#define N 10000
#define M 101

void guruguru(
    char map[101][101],int n,
    int x,int y,
    int vector,int length,int count){

  if(count>=length-1)
    return;
  else if(vector==8){
    y--;
    if(y<0 || map[y-1][x]=='#'){
      vector=6;
      y++;
      x++;
    }
    map[y][x]='#';
    map[y][x+1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==6){
    x++;
    if(x>=n || map[y][x+1]=='#'){
      vector=2;
      y++;
      x--;
    }
    map[y][x]='#';
    map[y+1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==2){
    y++;
    if(y>=n || map[y+1][x]=='#'){
      vector=4;
      y--;
      x--;
    }
    map[y][x]='#';
    map[y][x-1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==4){
    x--;
    if(x<0 || map[y][x-1]=='#'){
      vector=8;
      x++;
      y--;
    }
    map[y][x]='#';
    map[y-1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
}

int main(void){
  int i,j,k;
  int d,n[N];
  char map[M][M];
  int sx,sy,vector,length,count;

  scanf("%d",&d);
  for(i=0;i<d;i++){
    scanf("%d",&n[i]);
  }
  for(i=0;i<d;i++){
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        map[j][k]=0;
      }
    }
    sx=0;
    sy=n[i]-1;
    vector=8;
    map[sy][sx]='#';
    map[sy][sx+1]=' ';
    length=1;
    for(j=2;j<=n[i];j++){
      length+=j;
      if(j%2!=0)
        length++;
    }
    count=0;
    guruguru(map,n[i],sx,sy,vector,length,count);
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        printf("%c",map[j][k]);
      }
      printf("\n");
    }
    if(i<d-1)
      printf("\n");
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	guruguru
	.type	guruguru, @function
guruguru:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	%ecx, -20(%rbp)
	movl	%r8d, -24(%rbp)
	movl	%r9d, -28(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, 16(%rbp)
	jge	.L15
	cmpl	$8, -24(%rbp)
	jne	.L4
	subl	$1, -20(%rbp)
	cmpl	$0, -20(%rbp)
	js	.L5
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L6
.L5:
	movl	$6, -24(%rbp)
	addl	$1, -20(%rbp)
	addl	$1, -16(%rbp)
.L6:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L4:
	cmpl	$6, -24(%rbp)
	jne	.L7
	addl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L8
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L9
.L8:
	movl	$2, -24(%rbp)
	addl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L7:
	cmpl	$2, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L12
.L11:
	movl	$4, -24(%rbp)
	subl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L12:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L10:
	cmpl	$4, -24(%rbp)
	jne	.L1
	subl	$1, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L14
.L13:
	movl	$8, -24(%rbp)
	addl	$1, -16(%rbp)
	subl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L15:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	guruguru, .-guruguru
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-49152(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1120, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-50260(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -50256(%rbp)
	jmp	.L17
.L18:
	leaq	-40016(%rbp), %rdx
	movl	-50256(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -50256(%rbp)
.L17:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L18
	movl	$0, -50256(%rbp)
	jmp	.L19
.L32:
	movl	$0, -50252(%rbp)
	jmp	.L20
.L23:
	movl	$0, -50248(%rbp)
	jmp	.L21
.L22:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$0, (%rax)
	addl	$1, -50248(%rbp)
.L21:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L22
	addl	$1, -50252(%rbp)
.L20:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L23
	movl	$0, -50240(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, -50236(%rbp)
	movl	$8, -50232(%rbp)
	movl	-50240(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$35, (%rax)
	movl	-50240(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$32, (%rax)
	movl	$1, -50244(%rbp)
	movl	$2, -50252(%rbp)
	jmp	.L24
.L26:
	movl	-50252(%rbp), %eax
	addl	%eax, -50244(%rbp)
	movl	-50252(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L25
	addl	$1, -50244(%rbp)
.L25:
	addl	$1, -50252(%rbp)
.L24:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jle	.L26
	movl	$0, -50228(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %esi
	movl	-50244(%rbp), %r9d
	movl	-50232(%rbp), %r8d
	movl	-50236(%rbp), %ecx
	movl	-50240(%rbp), %edx
	leaq	-50224(%rbp), %rax
	subq	$8, %rsp
	movl	-50228(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	movl	$0, -50252(%rbp)
	jmp	.L27
.L30:
	movl	$0, -50248(%rbp)
	jmp	.L28
.L29:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -50248(%rbp)
.L28:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L29
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -50252(%rbp)
.L27:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L30
	movl	-50260(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -50256(%rbp)
	jge	.L31
	movl	$10, %edi
	call	putchar@PLT
.L31:
	addl	$1, -50256(%rbp)
.L19:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	guruguru
	.type	guruguru, @function
guruguru:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edx, %eax
	subl	$1, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	24(%rsp), %edx
	cmpl	%r9d, %edx
	jge	.L1
	movl	%esi, %r10d
	addl	$1, %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	cmpl	$6, %r8d
	je	.L22
	cmpl	$2, %r8d
	je	.L23
	cmpl	$4, %r8d
	jne	.L1
	movl	%eax, %ebp
	subl	$1, %ebp
	js	.L14
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	leal	-2(%rax), %r11d
	leaq	(%rdi,%rsi), %rbx
	movslq	%r11d, %r11
	cmpb	$35, (%rbx,%r11)
	je	.L14
	movl	%ebp, %eax
.L15:
	movslq	%eax, %r11
	addq	%rdi, %rsi
	movb	$35, (%rbx,%r11)
	movb	$32, -101(%r11,%rsi)
	movl	%edx, %esi
.L7:
	addl	$1, %edx
	cmpl	%r9d, %esi
	jge	.L1
.L3:
	cmpl	$8, %r8d
	jne	.L4
	movl	%ecx, %ebx
	subl	$1, %ebx
	js	.L5
	movslq	%ebx, %rsi
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	movslq	%eax, %r11
	leaq	(%rdi,%rsi), %rbp
	cmpb	$35, -101(%rbp,%r11)
	je	.L5
	movl	%ebx, %ecx
.L6:
	addq	%rdi, %rsi
	movb	$35, (%rsi,%r11)
	leal	1(%rax), %r11d
	movslq	%r11d, %r11
	movb	$32, (%rsi,%r11)
	movl	%edx, %esi
	addl	$1, %edx
	cmpl	%r9d, %esi
	jl	.L3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	leal	1(%rax), %ebx
	cmpl	%ebx, %r10d
	jle	.L9
	movslq	%ecx, %rsi
	leal	2(%rax), %ebp
	leaq	(%rsi,%rsi,4), %r11
	movslq	%ebp, %rbp
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %r11
	addq	%rdi, %r11
	cmpb	$35, (%r11,%rbp)
	je	.L9
	movl	%ebx, %eax
.L10:
	movslq	%eax, %rbx
	addq	$1, %rsi
	movb	$35, (%r11,%rbx)
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	addq	%rdi, %rsi
	movb	$32, (%rsi,%rbx)
	movl	%edx, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%ecx, %rsi
	addl	$1, %eax
	leaq	(%rsi,%rsi,4), %r8
	movslq	%eax, %r11
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %rsi
	movl	$6, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	subl	$1, %ecx
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %rsi
	movl	$8, %r8d
	leaq	(%rdi,%rsi), %rbx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %r11
	movl	$2, %r8d
	addq	%rdi, %r11
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rcx), %ebx
	cmpl	%ebx, %r10d
	jle	.L12
	movslq	%ebx, %rsi
	leaq	1(%rsi), %r11
	leaq	(%r11,%r11,4), %rbp
	leaq	0(%rbp,%rbp,4), %rbp
	leaq	(%r11,%rbp,4), %rbp
	movslq	%eax, %r11
	addq	%rdi, %rbp
	cmpb	$35, 0(%rbp,%r11)
	je	.L12
	movl	%ebx, %ecx
.L13:
	leaq	(%rsi,%rsi,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rsi,%rbx,4), %rsi
	addq	%rdi, %rsi
	movb	$35, (%rsi,%r11)
	leal	-1(%rax), %r11d
	movslq	%r11d, %r11
	movb	$32, (%rsi,%r11)
	movl	%edx, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %eax
	movslq	%ecx, %rsi
	movl	$4, %r8d
	movslq	%eax, %r11
	jmp	.L13
	.cfi_endproc
.LFE23:
	.size	guruguru, .-guruguru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	-49152(%rsp), %r11
	.cfi_def_cfa 11, 49208
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1112, %rsp
	.cfi_def_cfa_offset 50320
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 50248(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L25
	leaq	10240(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L26
	testl	%eax, %eax
	jle	.L25
	leaq	133(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
.L27:
	movl	(%rbx), %r13d
	testl	%r13d, %r13d
	jle	.L55
.L39:
	leal	-1(%r13), %eax
	movq	%r15, %rcx
	movl	%r13d, %r12d
	leaq	(%rax,%rax,4), %rdx
	movl	%eax, 4(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rbp
	addq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rcx, %rdi
	movq	%r12, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$101, %rcx
	cmpq	%rbp, %rcx
	jne	.L28
	movslq	4(%rsp), %rax
	movl	$8227, %r8d
	leaq	(%rax,%rax,4), %rdx
	movq	%rax, %r10
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movw	%r8w, 32(%rsp,%rax)
	cmpl	$1, %r13d
	jle	.L41
	cmpl	$2, %r13d
	je	.L44
	leal	1(%r13), %ecx
	movl	$3, %eax
	movl	$3, %r9d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%eax, %edx
	addl	%eax, %r9d
	andl	$1, %edx
	cmpl	$1, %edx
	sbbl	$-1, %r9d
	addl	$1, %eax
	cmpl	%eax, %ecx
	jne	.L33
.L30:
	subq	$8, %rsp
	.cfi_def_cfa_offset 50328
	movl	%r10d, %ecx
	movl	%r13d, %esi
	movq	%r15, %rdi
	pushq	$0
	.cfi_def_cfa_offset 50336
	movl	$8, %r8d
	xorl	%edx, %edx
	call	guruguru
	movl	(%rbx), %edi
	popq	%rcx
	.cfi_def_cfa_offset 50328
	popq	%rsi
	.cfi_def_cfa_offset 50320
	testl	%edi, %edi
	jle	.L34
	movq	%r15, %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L36:
	movsbl	0(%rbp,%r13), %edi
	addq	$1, %r13
	call	putchar@PLT
	cmpl	%r13d, (%rbx)
	jg	.L36
	movl	$10, %edi
	addl	$1, %r12d
	addq	$101, %rbp
	call	putchar@PLT
	cmpl	%r12d, (%rbx)
	jg	.L35
.L34:
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L56
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r14d, %eax
	jg	.L27
.L25:
	movq	50248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$50264, %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
.L56:
	.cfi_restore_state
	movl	$10, %edi
	addl	$1, %r14d
	addq	$4, %rbx
	call	putchar@PLT
	cmpl	%r14d, 28(%rsp)
	jle	.L25
	movl	(%rbx), %r13d
	testl	%r13d, %r13d
	jg	.L39
.L55:
	leal	-1(%r13), %r10d
	movslq	%r10d, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movl	$8227, %edx
	movw	%dx, 32(%rsp,%rax)
.L41:
	movl	$1, %r9d
	jmp	.L30
.L44:
	movl	$3, %r9d
	jmp	.L30
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

rule
	.file	"temp.c"
	.text
	.p2align 4
	.globl	guruguru
	.type	guruguru, @function
guruguru:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movl	%edx, %eax
	subl	$1, %r9d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	movl	24(%rsp), %edx
	cmpl	%r9d, %edx
	jge	.L1
	movl	%esi, %r10d
	addl	$1, %edx
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L4:
	cmpl	$6, %r8d
	je	.L22
	cmpl	$2, %r8d
	je	.L23
	cmpl	$4, %r8d
	jne	.L1
	movl	%eax, %ebp
	subl	$1, %ebp
	js	.L14
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	leal	-2(%rax), %r11d
	leaq	(%rdi,%rsi), %rbx
	movslq	%r11d, %r11
	cmpb	$35, (%rbx,%r11)
	je	.L14
	movl	%ebp, %eax
.L15:
	movslq	%eax, %r11
	addq	%rdi, %rsi
	movb	$35, (%rbx,%r11)
	movb	$32, -101(%r11,%rsi)
	movl	%edx, %esi
.L7:
	addl	$1, %edx
	cmpl	%r9d, %esi
	jge	.L1
.L3:
	cmpl	$8, %r8d
	jne	.L4
	movl	%ecx, %ebx
	subl	$1, %ebx
	js	.L5
	movslq	%ebx, %rsi
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	movslq	%eax, %r11
	leaq	(%rdi,%rsi), %rbp
	cmpb	$35, -101(%rbp,%r11)
	je	.L5
	movl	%ebx, %ecx
.L6:
	addq	%rdi, %rsi
	movb	$35, (%rsi,%r11)
	leal	1(%rax), %r11d
	movslq	%r11d, %r11
	movb	$32, (%rsi,%r11)
	movl	%edx, %esi
	addl	$1, %edx
	cmpl	%r9d, %esi
	jl	.L3
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L22:
	.cfi_restore_state
	leal	1(%rax), %ebx
	cmpl	%ebx, %r10d
	jle	.L9
	movslq	%ecx, %rsi
	leal	2(%rax), %ebp
	leaq	(%rsi,%rsi,4), %r11
	movslq	%ebp, %rbp
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %r11
	addq	%rdi, %r11
	cmpb	$35, (%r11,%rbp)
	je	.L9
	movl	%ebx, %eax
.L10:
	movslq	%eax, %rbx
	addq	$1, %rsi
	movb	$35, (%r11,%rbx)
	leaq	(%rsi,%rsi,4), %r11
	leaq	(%r11,%r11,4), %r11
	leaq	(%rsi,%r11,4), %rsi
	addq	%rdi, %rsi
	movb	$32, (%rsi,%rbx)
	movl	%edx, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movslq	%ecx, %rsi
	addl	$1, %eax
	leaq	(%rsi,%rsi,4), %r8
	movslq	%eax, %r11
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %rsi
	movl	$6, %r8d
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L14:
	subl	$1, %ecx
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %rsi
	movl	$8, %r8d
	leaq	(%rdi,%rsi), %rbx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L9:
	addl	$1, %ecx
	movslq	%ecx, %rsi
	leaq	(%rsi,%rsi,4), %r8
	leaq	(%r8,%r8,4), %r8
	leaq	(%rsi,%r8,4), %r11
	movl	$2, %r8d
	addq	%rdi, %r11
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L23:
	leal	1(%rcx), %ebx
	cmpl	%ebx, %r10d
	jle	.L12
	movslq	%ebx, %rsi
	leaq	1(%rsi), %r11
	leaq	(%r11,%r11,4), %rbp
	leaq	0(%rbp,%rbp,4), %rbp
	leaq	(%r11,%rbp,4), %rbp
	movslq	%eax, %r11
	addq	%rdi, %rbp
	cmpb	$35, 0(%rbp,%r11)
	je	.L12
	movl	%ebx, %ecx
.L13:
	leaq	(%rsi,%rsi,4), %rbx
	leaq	(%rbx,%rbx,4), %rbx
	leaq	(%rsi,%rbx,4), %rsi
	addq	%rdi, %rsi
	movb	$35, (%rsi,%r11)
	leal	-1(%rax), %r11d
	movslq	%r11d, %r11
	movb	$32, (%rsi,%r11)
	movl	%edx, %esi
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$1, %eax
	movslq	%ecx, %rsi
	movl	$4, %r8d
	movslq	%eax, %r11
	jmp	.L13
	.cfi_endproc
.LFE23:
	.size	guruguru, .-guruguru
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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
	leaq	-49152(%rsp), %r11
	.cfi_def_cfa 11, 49208
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1112, %rsp
	.cfi_def_cfa_offset 50320
	leaq	.LC0(%rip), %r13
	movq	%r13, %rdi
	movq	%fs:40, %rax
	movq	%rax, 50248(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %r9d
	testl	%r9d, %r9d
	jle	.L25
	leaq	10240(%rsp), %rbx
	xorl	%ebp, %ebp
	movq	%rbx, %r12
	.p2align 4,,10
	.p2align 3
.L26:
	movq	%r12, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	addq	$4, %r12
	cmpl	%ebp, %eax
	jg	.L26
	testl	%eax, %eax
	jle	.L25
	leaq	133(%rsp), %rax
	xorl	%r14d, %r14d
	leaq	32(%rsp), %r15
	movq	%rax, 8(%rsp)
.L27:
	movl	(%rbx), %r13d
	testl	%r13d, %r13d
	jle	.L55
.L39:
	leal	-1(%r13), %eax
	movq	%r15, %rcx
	movl	%r13d, %r12d
	leaq	(%rax,%rax,4), %rdx
	movl	%eax, 4(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rbp
	addq	8(%rsp), %rbp
	.p2align 4,,10
	.p2align 3
.L28:
	movq	%rcx, %rdi
	movq	%r12, %rdx
	xorl	%esi, %esi
	call	memset@PLT
	movq	%rax, %rcx
	addq	$101, %rcx
	cmpq	%rbp, %rcx
	jne	.L28
	movslq	4(%rsp), %rax
	movl	$8227, %r8d
	leaq	(%rax,%rax,4), %rdx
	movq	%rax, %r10
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movw	%r8w, 32(%rsp,%rax)
	cmpl	$1, %r13d
	jle	.L41
	cmpl	$2, %r13d
	je	.L44
	leal	1(%r13), %ecx
	movl	$3, %eax
	movl	$3, %r9d
	.p2align 4,,10
	.p2align 3
.L33:
	movl	%eax, %edx
	addl	%eax, %r9d
	andl	$1, %edx
	cmpl	$1, %edx
	sbbl	$-1, %r9d
	addl	$1, %eax
	cmpl	%eax, %ecx
	jne	.L33
.L30:
	subq	$8, %rsp
	.cfi_def_cfa_offset 50328
	movl	%r10d, %ecx
	movl	%r13d, %esi
	movq	%r15, %rdi
	pushq	$0
	.cfi_def_cfa_offset 50336
	movl	$8, %r8d
	xorl	%edx, %edx
	call	guruguru
	movl	(%rbx), %edi
	popq	%rcx
	.cfi_def_cfa_offset 50328
	popq	%rsi
	.cfi_def_cfa_offset 50320
	testl	%edi, %edi
	jle	.L34
	movq	%r15, %rbp
	xorl	%r12d, %r12d
	.p2align 4,,10
	.p2align 3
.L35:
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L36:
	movsbl	0(%rbp,%r13), %edi
	addq	$1, %r13
	call	putchar@PLT
	cmpl	%r13d, (%rbx)
	jg	.L36
	movl	$10, %edi
	addl	$1, %r12d
	addq	$101, %rbp
	call	putchar@PLT
	cmpl	%r12d, (%rbx)
	jg	.L35
.L34:
	movl	28(%rsp), %eax
	leal	-1(%rax), %edx
	cmpl	%r14d, %edx
	jg	.L56
	addl	$1, %r14d
	addq	$4, %rbx
	cmpl	%r14d, %eax
	jg	.L27
.L25:
	movq	50248(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L57
	addq	$50264, %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
.L56:
	.cfi_restore_state
	movl	$10, %edi
	addl	$1, %r14d
	addq	$4, %rbx
	call	putchar@PLT
	cmpl	%r14d, 28(%rsp)
	jle	.L25
	movl	(%rbx), %r13d
	testl	%r13d, %r13d
	jg	.L39
.L55:
	leal	-1(%r13), %r10d
	movslq	%r10d, %rax
	leaq	(%rax,%rax,4), %rdx
	leaq	(%rdx,%rdx,4), %rdx
	leaq	(%rax,%rdx,4), %rax
	movl	$8227, %edx
	movw	%dx, 32(%rsp,%rax)
.L41:
	movl	$1, %r9d
	jmp	.L30
.L44:
	movl	$3, %r9d
	jmp	.L30
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:

#include<stdio.h>
#define N 10000
#define M 101

void guruguru(
    char map[101][101],int n,
    int x,int y,
    int vector,int length,int count){

  if(count>=length-1)
    return;
  else if(vector==8){
    y--;
    if(y<0 || map[y-1][x]=='#'){
      vector=6;
      y++;
      x++;
    }
    map[y][x]='#';
    map[y][x+1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==6){
    x++;
    if(x>=n || map[y][x+1]=='#'){
      vector=2;
      y++;
      x--;
    }
    map[y][x]='#';
    map[y+1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==2){
    y++;
    if(y>=n || map[y+1][x]=='#'){
      vector=4;
      y--;
      x--;
    }
    map[y][x]='#';
    map[y][x-1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==4){
    x--;
    if(x<0 || map[y][x-1]=='#'){
      vector=8;
      x++;
      y--;
    }
    map[y][x]='#';
    map[y-1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
}

int main(void){
  int i,j,k;
  int d,n[N];
  char map[M][M];
  int sx,sy,vector,length,count;

  scanf("%d",&d);
  for(i=0;i<d;i++){
    scanf("%d",&n[i]);
  }
  for(i=0;i<d;i++){
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        map[j][k]=0;
      }
    }
    sx=0;
    sy=n[i]-1;
    vector=8;
    map[sy][sx]='#';
    map[sy][sx+1]=' ';
    length=1;
    for(j=2;j<=n[i];j++){
      length+=j;
      if(j%2!=0)
        length++;
    }
    count=0;
    guruguru(map,n[i],sx,sy,vector,length,count);
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        printf("%c",map[j][k]);
      }
      printf("\n");
    }
    if(i<d-1)
      printf("\n");
  }

  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
#include<stdio.h>
#define N 10000
#define M 101

void guruguru(
    char map[101][101],int n,
    int x,int y,
    int vector,int length,int count){

  if(count>=length-1)
    return;
  else if(vector==8){
    y--;
    if(y<0 || map[y-1][x]=='#'){
      vector=6;
      y++;
      x++;
    }
    map[y][x]='#';
    map[y][x+1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==6){
    x++;
    if(x>=n || map[y][x+1]=='#'){
      vector=2;
      y++;
      x--;
    }
    map[y][x]='#';
    map[y+1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==2){
    y++;
    if(y>=n || map[y+1][x]=='#'){
      vector=4;
      y--;
      x--;
    }
    map[y][x]='#';
    map[y][x-1]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
  else if(vector==4){
    x--;
    if(x<0 || map[y][x-1]=='#'){
      vector=8;
      x++;
      y--;
    }
    map[y][x]='#';
    map[y-1][x]=' ';
    count++;
    guruguru(map,n,x,y,vector,length,count);
    return;
  }
}

int main(void){
  int i,j,k;
  int d,n[N];
  char map[M][M];
  int sx,sy,vector,length,count;

  scanf("%d",&d);
  for(i=0;i<d;i++){
    scanf("%d",&n[i]);
  }
  for(i=0;i<d;i++){
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        map[j][k]=0;
      }
    }
    sx=0;
    sy=n[i]-1;
    vector=8;
    map[sy][sx]='#';
    map[sy][sx+1]=' ';
    length=1;
    for(j=2;j<=n[i];j++){
      length+=j;
      if(j%2!=0)
        length++;
    }
    count=0;
    guruguru(map,n[i],sx,sy,vector,length,count);
    for(j=0;j<n[i];j++){
      for(k=0;k<n[i];k++){
        printf("%c",map[j][k]);
      }
      printf("\n");
    }
    if(i<d-1)
      printf("\n");
  }

  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	guruguru
	.type	guruguru, @function
guruguru:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	%ecx, -20(%rbp)
	movl	%r8d, -24(%rbp)
	movl	%r9d, -28(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, 16(%rbp)
	jge	.L15
	cmpl	$8, -24(%rbp)
	jne	.L4
	subl	$1, -20(%rbp)
	cmpl	$0, -20(%rbp)
	js	.L5
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L6
.L5:
	movl	$6, -24(%rbp)
	addl	$1, -20(%rbp)
	addl	$1, -16(%rbp)
.L6:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L4:
	cmpl	$6, -24(%rbp)
	jne	.L7
	addl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L8
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L9
.L8:
	movl	$2, -24(%rbp)
	addl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L7:
	cmpl	$2, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L12
.L11:
	movl	$4, -24(%rbp)
	subl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L12:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L10:
	cmpl	$4, -24(%rbp)
	jne	.L1
	subl	$1, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L14
.L13:
	movl	$8, -24(%rbp)
	addl	$1, -16(%rbp)
	subl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L15:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	guruguru, .-guruguru
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-49152(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1120, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-50260(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -50256(%rbp)
	jmp	.L17
.L18:
	leaq	-40016(%rbp), %rdx
	movl	-50256(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -50256(%rbp)
.L17:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L18
	movl	$0, -50256(%rbp)
	jmp	.L19
.L32:
	movl	$0, -50252(%rbp)
	jmp	.L20
.L23:
	movl	$0, -50248(%rbp)
	jmp	.L21
.L22:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$0, (%rax)
	addl	$1, -50248(%rbp)
.L21:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L22
	addl	$1, -50252(%rbp)
.L20:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L23
	movl	$0, -50240(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, -50236(%rbp)
	movl	$8, -50232(%rbp)
	movl	-50240(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$35, (%rax)
	movl	-50240(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$32, (%rax)
	movl	$1, -50244(%rbp)
	movl	$2, -50252(%rbp)
	jmp	.L24
.L26:
	movl	-50252(%rbp), %eax
	addl	%eax, -50244(%rbp)
	movl	-50252(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L25
	addl	$1, -50244(%rbp)
.L25:
	addl	$1, -50252(%rbp)
.L24:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jle	.L26
	movl	$0, -50228(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %esi
	movl	-50244(%rbp), %r9d
	movl	-50232(%rbp), %r8d
	movl	-50236(%rbp), %ecx
	movl	-50240(%rbp), %edx
	leaq	-50224(%rbp), %rax
	subq	$8, %rsp
	movl	-50228(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	movl	$0, -50252(%rbp)
	jmp	.L27
.L30:
	movl	$0, -50248(%rbp)
	jmp	.L28
.L29:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -50248(%rbp)
.L28:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L29
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -50252(%rbp)
.L27:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L30
	movl	-50260(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -50256(%rbp)
	jge	.L31
	movl	$10, %edi
	call	putchar@PLT
.L31:
	addl	$1, -50256(%rbp)
.L19:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	guruguru
	.type	guruguru, @function
guruguru:
.LFB0:
	.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	%rdi, -8(%rbp)
	movl	%esi, -12(%rbp)
	movl	%edx, -16(%rbp)
	movl	%ecx, -20(%rbp)
	movl	%r8d, -24(%rbp)
	movl	%r9d, -28(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, 16(%rbp)
	jge	.L15
	cmpl	$8, -24(%rbp)
	jne	.L4
	subl	$1, -20(%rbp)
	cmpl	$0, -20(%rbp)
	js	.L5
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L6
.L5:
	movl	$6, -24(%rbp)
	addl	$1, -20(%rbp)
	addl	$1, -16(%rbp)
.L6:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L4:
	cmpl	$6, -24(%rbp)
	jne	.L7
	addl	$1, -16(%rbp)
	movl	-16(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L8
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	addl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L9
.L8:
	movl	$2, -24(%rbp)
	addl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L9:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L7:
	cmpl	$2, -24(%rbp)
	jne	.L10
	addl	$1, -20(%rbp)
	movl	-20(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jge	.L11
	movl	-20(%rbp), %eax
	cltq
	leaq	1(%rax), %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L12
.L11:
	movl	$4, -24(%rbp)
	subl	$1, -20(%rbp)
	subl	$1, -16(%rbp)
.L12:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L10:
	cmpl	$4, -24(%rbp)
	jne	.L1
	subl	$1, -16(%rbp)
	cmpl	$0, -16(%rbp)
	js	.L13
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	subl	$1, %eax
	cltq
	movzbl	(%rdx,%rax), %eax
	cmpb	$35, %al
	jne	.L14
.L13:
	movl	$8, -24(%rbp)
	addl	$1, -16(%rbp)
	subl	$1, -20(%rbp)
.L14:
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rax, %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$35, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rcx
	addq	%rcx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	-101(%rax), %rdx
	movq	-8(%rbp), %rax
	addq	%rax, %rdx
	movl	-16(%rbp), %eax
	cltq
	movb	$32, (%rdx,%rax)
	addl	$1, 16(%rbp)
	movl	-28(%rbp), %r9d
	movl	-24(%rbp), %r8d
	movl	-20(%rbp), %ecx
	movl	-16(%rbp), %edx
	movl	-12(%rbp), %esi
	movq	-8(%rbp), %rax
	subq	$8, %rsp
	movl	16(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	jmp	.L1
.L15:
	nop
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	guruguru, .-guruguru
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	leaq	-49152(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1120, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-50260(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -50256(%rbp)
	jmp	.L17
.L18:
	leaq	-40016(%rbp), %rdx
	movl	-50256(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -50256(%rbp)
.L17:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L18
	movl	$0, -50256(%rbp)
	jmp	.L19
.L32:
	movl	$0, -50252(%rbp)
	jmp	.L20
.L23:
	movl	$0, -50248(%rbp)
	jmp	.L21
.L22:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$0, (%rax)
	addl	$1, -50248(%rbp)
.L21:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L22
	addl	$1, -50252(%rbp)
.L20:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L23
	movl	$0, -50240(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	subl	$1, %eax
	movl	%eax, -50236(%rbp)
	movl	$8, -50232(%rbp)
	movl	-50240(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$35, (%rax)
	movl	-50240(%rbp), %eax
	addl	$1, %eax
	movslq	%eax, %rcx
	movl	-50236(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movb	$32, (%rax)
	movl	$1, -50244(%rbp)
	movl	$2, -50252(%rbp)
	jmp	.L24
.L26:
	movl	-50252(%rbp), %eax
	addl	%eax, -50244(%rbp)
	movl	-50252(%rbp), %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L25
	addl	$1, -50244(%rbp)
.L25:
	addl	$1, -50252(%rbp)
.L24:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jle	.L26
	movl	$0, -50228(%rbp)
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %esi
	movl	-50244(%rbp), %r9d
	movl	-50232(%rbp), %r8d
	movl	-50236(%rbp), %ecx
	movl	-50240(%rbp), %edx
	leaq	-50224(%rbp), %rax
	subq	$8, %rsp
	movl	-50228(%rbp), %edi
	pushq	%rdi
	movq	%rax, %rdi
	call	guruguru
	addq	$16, %rsp
	movl	$0, -50252(%rbp)
	jmp	.L27
.L30:
	movl	$0, -50248(%rbp)
	jmp	.L28
.L29:
	movl	-50248(%rbp), %eax
	movslq	%eax, %rcx
	movl	-50252(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rbp, %rax
	addq	%rcx, %rax
	subq	$50224, %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	putchar@PLT
	addl	$1, -50248(%rbp)
.L28:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50248(%rbp)
	jl	.L29
	movl	$10, %edi
	call	putchar@PLT
	addl	$1, -50252(%rbp)
.L27:
	movl	-50256(%rbp), %eax
	cltq
	movl	-40016(%rbp,%rax,4), %eax
	cmpl	%eax, -50252(%rbp)
	jl	.L30
	movl	-50260(%rbp), %eax
	subl	$1, %eax
	cmpl	%eax, -50256(%rbp)
	jge	.L31
	movl	$10, %edi
	call	putchar@PLT
.L31:
	addl	$1, -50256(%rbp)
.L19:
	movl	-50260(%rbp), %eax
	cmpl	%eax, -50256(%rbp)
	jl	.L32
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L34
	call	__stack_chk_fail@PLT
.L34:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
