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

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

char map[10][8] = { "0111111", "0000110", "1011011", "1001111", "1100110",
		    "1101101", "1111101", "0100111", "1111111", "1101111" };

int main(){
  int n, m, f = 0,i;
  char res[8];

  while(scanf("%d", &n) && n != -1){
    f = 0;
    while(n--){
      scanf("%d", &m);
      if(f){
	for(i = 0; i < 7; i++){
	  if(res[i] == map[m][i]) res[i] = '0';
	  else res[i] = '1';
	}
      }
      else strcpy(res, map[m]);
      f = 1;
      puts(res);
      strcpy(res, map[m]);
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	map(%rip), %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L13
	movl	8(%rsp), %eax
	cmpl	$-1, %eax
	je	.L13
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	12(%rsp), %r12
	movq	%r13, %rdi
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
.L3:
	movq	%rbp, %rdi
	call	puts@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movzbl	(%rbx,%rax,8), %ecx
	cmpb	%cl, 16(%rsp)
	setne	%dl
	movzbl	1(%rbx,%rax,8), %ecx
	movzbl	3(%rbx,%rax,8), %edi
	addl	$48, %edx
	cmpb	%cl, 17(%rsp)
	movzbl	2(%rbx,%rax,8), %ecx
	movb	%dl, 16(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%cl, 18(%rsp)
	movzbl	4(%rbx,%rax,8), %ecx
	movb	%dl, 17(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 19(%rsp)
	movzbl	5(%rbx,%rax,8), %edi
	movb	%dl, 18(%rsp)
	setne	%dl
	movzbl	6(%rbx,%rax,8), %eax
	addl	$48, %edx
	cmpb	%cl, 20(%rsp)
	movb	%dl, 19(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 21(%rsp)
	movb	%dl, 20(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%al, 22(%rsp)
	setne	%al
	movb	%dl, 21(%rsp)
	addl	$48, %eax
	movb	%al, 22(%rsp)
	jmp	.L3
.L13:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 80
map:
	.string	"0111111"
	.string	"0000110"
	.string	"1011011"
	.string	"1001111"
	.string	"1100110"
	.string	"1101101"
	.string	"1111101"
	.string	"0100111"
	.string	"1111111"
	.string	"1101111"
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	map(%rip), %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L13
	movl	8(%rsp), %eax
	cmpl	$-1, %eax
	je	.L13
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	12(%rsp), %r12
	movq	%r13, %rdi
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
.L3:
	movq	%rbp, %rdi
	call	puts@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movzbl	(%rbx,%rax,8), %ecx
	cmpb	%cl, 16(%rsp)
	setne	%dl
	movzbl	1(%rbx,%rax,8), %ecx
	movzbl	3(%rbx,%rax,8), %edi
	addl	$48, %edx
	cmpb	%cl, 17(%rsp)
	movzbl	2(%rbx,%rax,8), %ecx
	movb	%dl, 16(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%cl, 18(%rsp)
	movzbl	4(%rbx,%rax,8), %ecx
	movb	%dl, 17(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 19(%rsp)
	movzbl	5(%rbx,%rax,8), %edi
	movb	%dl, 18(%rsp)
	setne	%dl
	movzbl	6(%rbx,%rax,8), %eax
	addl	$48, %edx
	cmpb	%cl, 20(%rsp)
	movb	%dl, 19(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 21(%rsp)
	movb	%dl, 20(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%al, 22(%rsp)
	setne	%al
	movb	%dl, 21(%rsp)
	addl	$48, %eax
	movb	%al, 22(%rsp)
	jmp	.L3
.L13:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 80
map:
	.string	"0111111"
	.string	"0000110"
	.string	"1011011"
	.string	"1001111"
	.string	"1100110"
	.string	"1101101"
	.string	"1111101"
	.string	"0100111"
	.string	"1111111"
	.string	"1101111"
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	map(%rip), %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L13
	movl	8(%rsp), %eax
	cmpl	$-1, %eax
	je	.L13
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	12(%rsp), %r12
	movq	%r13, %rdi
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
.L3:
	movq	%rbp, %rdi
	call	puts@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movzbl	(%rbx,%rax,8), %ecx
	cmpb	%cl, 16(%rsp)
	setne	%dl
	movzbl	1(%rbx,%rax,8), %ecx
	movzbl	3(%rbx,%rax,8), %edi
	addl	$48, %edx
	cmpb	%cl, 17(%rsp)
	movzbl	2(%rbx,%rax,8), %ecx
	movb	%dl, 16(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%cl, 18(%rsp)
	movzbl	4(%rbx,%rax,8), %ecx
	movb	%dl, 17(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 19(%rsp)
	movzbl	5(%rbx,%rax,8), %edi
	movb	%dl, 18(%rsp)
	setne	%dl
	movzbl	6(%rbx,%rax,8), %eax
	addl	$48, %edx
	cmpb	%cl, 20(%rsp)
	movb	%dl, 19(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 21(%rsp)
	movb	%dl, 20(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%al, 22(%rsp)
	setne	%al
	movb	%dl, 21(%rsp)
	addl	$48, %eax
	movb	%al, 22(%rsp)
	jmp	.L3
.L13:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 80
map:
	.string	"0111111"
	.string	"0000110"
	.string	"1011011"
	.string	"1001111"
	.string	"1100110"
	.string	"1101101"
	.string	"1111101"
	.string	"0100111"
	.string	"1111111"
	.string	"1101111"
	.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:
```
```c
#include <string.h>
#include <stdio.h>

char map[10][8] = { "0111111", "0000110", "1011011", "1001111", "1100110",
		    "1101101", "1111101", "0100111", "1111111", "1101111" };

int main(){
  int n, m, f = 0,i;
  char res[8];

  while(scanf("%d", &n) && n != -1){
    f = 0;
    while(n--){
      scanf("%d", &m);
      if(f){
	for(i = 0; i < 7; i++){
	  if(res[i] == map[m][i]) res[i] = '0';
	  else res[i] = '1';
	}
      }
      else strcpy(res, map[m]);
      f = 1;
      puts(res);
      strcpy(res, map[m]);
    }
  }
  return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

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

char map[10][8] = { "0111111", "0000110", "1011011", "1001111", "1100110",
		    "1101101", "1111101", "0100111", "1111111", "1101111" };

int main(){
  int n, m, f = 0,i;
  char res[8];

  while(scanf("%d", &n) && n != -1){
    f = 0;
    while(n--){
      scanf("%d", &m);
      if(f){
	for(i = 0; i < 7; i++){
	  if(res[i] == map[m][i]) res[i] = '0';
	  else res[i] = '1';
	}
      }
      else strcpy(res, map[m]);
      f = 1;
      puts(res);
      strcpy(res, map[m]);
    }
  }
  return 0;
}```

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.
Optimized Assembly Code:

3
0
5
1
1
1
-1
 3
0
9
1
1
0
-1
 3
0
5
1
1
2
-1
 3
1
9
1
1
0
-1
 3
0
6
1
1
2
-1
 3
1
9
0
1
0
-1
 3
0
5
0
1
0
-1
 3
1
5
1
1
0
-1
 3
0
6
1
1
1
-1
 3
0
7
1
1
0
-1

0111111
1010010
1101011
0000110
 0111111
1010000
1101001
0111111
 0111111
1010010
1101011
1011011
 0000110
1101001
1101001
0111111
 0111111
1000010
1111011
1011011
 0000110
1101001
1010000
0111111
 0111111
1010010
1010010
0111111
 0000110
1101011
1101011
0111111
 0111111
1000010
1111011
0000110
 0111111
0011000
0100001
0111111

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

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

char map[10][8] = { "0111111", "0000110", "1011011", "1001111", "1100110",
		    "1101101", "1111101", "0100111", "1111111", "1101111" };

int main(){
  int n, m, f = 0,i;
  char res[8];

  while(scanf("%d", &n) && n != -1){
    f = 0;
    while(n--){
      scanf("%d", &m);
      if(f){
	for(i = 0; i < 7; i++){
	  if(res[i] == map[m][i]) res[i] = '0';
	  else res[i] = '1';
	}
      }
      else strcpy(res, map[m]);
      f = 1;
      puts(res);
      strcpy(res, map[m]);
    }
  }
  return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	map(%rip), %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L13
	movl	8(%rsp), %eax
	cmpl	$-1, %eax
	je	.L13
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	12(%rsp), %r12
	movq	%r13, %rdi
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
.L3:
	movq	%rbp, %rdi
	call	puts@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movzbl	(%rbx,%rax,8), %ecx
	cmpb	%cl, 16(%rsp)
	setne	%dl
	movzbl	1(%rbx,%rax,8), %ecx
	movzbl	3(%rbx,%rax,8), %edi
	addl	$48, %edx
	cmpb	%cl, 17(%rsp)
	movzbl	2(%rbx,%rax,8), %ecx
	movb	%dl, 16(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%cl, 18(%rsp)
	movzbl	4(%rbx,%rax,8), %ecx
	movb	%dl, 17(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 19(%rsp)
	movzbl	5(%rbx,%rax,8), %edi
	movb	%dl, 18(%rsp)
	setne	%dl
	movzbl	6(%rbx,%rax,8), %eax
	addl	$48, %edx
	cmpb	%cl, 20(%rsp)
	movb	%dl, 19(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 21(%rsp)
	movb	%dl, 20(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%al, 22(%rsp)
	setne	%al
	movb	%dl, 21(%rsp)
	addl	$48, %eax
	movb	%al, 22(%rsp)
	jmp	.L3
.L13:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 80
map:
	.string	"0111111"
	.string	"0000110"
	.string	"1011011"
	.string	"1001111"
	.string	"1100110"
	.string	"1101101"
	.string	"1111101"
	.string	"0100111"
	.string	"1111111"
	.string	"1101111"
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	map(%rip), %rbx
	subq	$32, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %r14
	.p2align 4,,10
	.p2align 3
.L2:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%r13, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L13
	movl	8(%rsp), %eax
	cmpl	$-1, %eax
	je	.L13
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	leaq	12(%rsp), %r12
	movq	%r13, %rdi
	leaq	16(%rsp), %rbp
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
.L3:
	movq	%rbp, %rdi
	call	puts@PLT
	movslq	12(%rsp), %rax
	movl	$8, %edx
	movq	%rbp, %rdi
	leaq	(%rbx,%rax,8), %rsi
	call	__strcpy_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L2
	movq	%r13, %rdi
	xorl	%eax, %eax
	movq	%r12, %rsi
	call	__isoc99_scanf@PLT
	movslq	12(%rsp), %rax
	movzbl	(%rbx,%rax,8), %ecx
	cmpb	%cl, 16(%rsp)
	setne	%dl
	movzbl	1(%rbx,%rax,8), %ecx
	movzbl	3(%rbx,%rax,8), %edi
	addl	$48, %edx
	cmpb	%cl, 17(%rsp)
	movzbl	2(%rbx,%rax,8), %ecx
	movb	%dl, 16(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%cl, 18(%rsp)
	movzbl	4(%rbx,%rax,8), %ecx
	movb	%dl, 17(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 19(%rsp)
	movzbl	5(%rbx,%rax,8), %edi
	movb	%dl, 18(%rsp)
	setne	%dl
	movzbl	6(%rbx,%rax,8), %eax
	addl	$48, %edx
	cmpb	%cl, 20(%rsp)
	movb	%dl, 19(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%dil, 21(%rsp)
	movb	%dl, 20(%rsp)
	setne	%dl
	addl	$48, %edx
	cmpb	%al, 22(%rsp)
	setne	%al
	movb	%dl, 21(%rsp)
	addl	$48, %eax
	movb	%al, 22(%rsp)
	jmp	.L3
.L13:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L33
	addq	$32, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L33:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.globl	map
	.data
	.align 32
	.type	map, @object
	.size	map, 80
map:
	.string	"0111111"
	.string	"0000110"
	.string	"1011011"
	.string	"1001111"
	.string	"1100110"
	.string	"1101101"
	.string	"1111101"
	.string	"0100111"
	.string	"1111111"
	.string	"1101111"
	.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:
```