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>
int main(){
  int a[30],i,j,k,l,num1,num2[2],num3=0;
  for(i=0;i<30;i++){
    a[i]=0;
  }
  for(j=0;j<28;j++){
    scanf("%d",&num1);
    a[num1-1]=1;
  }
  for(k=0;k<30;k++){
    if(a[k]==0){
      num2[num3]=k+1;
      num3++;
    }
  }
  for(l=0;l<2;l++){
  printf("%d\n",num2[l]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -140(%rbp)
	movl	$0, -156(%rbp)
	jmp	.L2
.L3:
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -128(%rbp,%rax,4)
	addl	$1, -156(%rbp)
.L2:
	cmpl	$29, -156(%rbp)
	jle	.L3
	movl	$0, -152(%rbp)
	jmp	.L4
.L5:
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$1, -128(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L4:
	cmpl	$27, -152(%rbp)
	jle	.L5
	movl	$0, -148(%rbp)
	jmp	.L6
.L8:
	movl	-148(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-148(%rbp), %eax
	leal	1(%rax), %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -136(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L7:
	addl	$1, -148(%rbp)
.L6:
	cmpl	$29, -148(%rbp)
	jle	.L8
	movl	$0, -144(%rbp)
	jmp	.L9
.L10:
	movl	-144(%rbp), %eax
	cltq
	movl	-136(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -144(%rbp)
.L9:
	cmpl	$1, -144(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$15, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$28, %ebx
	subq	$152, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	4(%rsp), %r13
	movq	%rbp, %rdi
	rep stosq
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	subl	$1, %eax
	cltq
	movl	$1, 16(%rsp,%rax,4)
	subl	$1, %ebx
	jne	.L2
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	-4(%rbp,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L3
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, 8(%rsp,%rcx,4)
.L3:
	addq	$1, %rax
	cmpq	$31, %rax
	jne	.L4
	movl	8(%rsp), %edx
	leaq	.LC1(%rip), %rbp
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L10:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	movl	$15, %ecx
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	$28, %ebx
	subq	$152, %rsp
	.cfi_def_cfa_offset 192
	movq	%fs:40, %rax
	movq	%rax, 136(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rbp
	leaq	4(%rsp), %r13
	movq	%rbp, %rdi
	rep stosq
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r13, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %eax
	subl	$1, %eax
	cltq
	movl	$1, 16(%rsp,%rax,4)
	subl	$1, %ebx
	jne	.L2
	movl	$1, %eax
	xorl	%edx, %edx
	.p2align 4,,10
	.p2align 3
.L4:
	movl	-4(%rbp,%rax,4), %ecx
	testl	%ecx, %ecx
	jne	.L3
	movslq	%edx, %rcx
	addl	$1, %edx
	movl	%eax, 8(%rsp,%rcx,4)
.L3:
	addq	$1, %rax
	cmpq	$31, %rax
	jne	.L4
	movl	8(%rsp), %edx
	leaq	.LC1(%rip), %rbp
	movl	$1, %edi
	xorl	%eax, %eax
	movq	%rbp, %rsi
	call	__printf_chk@PLT
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	136(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$152, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	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
.L10:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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>
int main(){
  int a[30],i,j,k,l,num1,num2[2],num3=0;
  for(i=0;i<30;i++){
    a[i]=0;
  }
  for(j=0;j<28;j++){
    scanf("%d",&num1);
    a[num1-1]=1;
  }
  for(k=0;k<30;k++){
    if(a[k]==0){
      num2[num3]=k+1;
      num3++;
    }
  }
  for(l=0;l<2;l++){
  printf("%d\n",num2[l]);
  }
  return 0;
}
3
1
4
5
7
9
6
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

2
8

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>
int main(){
  int a[30],i,j,k,l,num1,num2[2],num3=0;
  for(i=0;i<30;i++){
    a[i]=0;
  }
  for(j=0;j<28;j++){
    scanf("%d",&num1);
    a[num1-1]=1;
  }
  for(k=0;k<30;k++){
    if(a[k]==0){
      num2[num3]=k+1;
      num3++;
    }
  }
  for(l=0;l<2;l++){
  printf("%d\n",num2[l]);
  }
  return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -140(%rbp)
	movl	$0, -156(%rbp)
	jmp	.L2
.L3:
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -128(%rbp,%rax,4)
	addl	$1, -156(%rbp)
.L2:
	cmpl	$29, -156(%rbp)
	jle	.L3
	movl	$0, -152(%rbp)
	jmp	.L4
.L5:
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$1, -128(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L4:
	cmpl	$27, -152(%rbp)
	jle	.L5
	movl	$0, -148(%rbp)
	jmp	.L6
.L8:
	movl	-148(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-148(%rbp), %eax
	leal	1(%rax), %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -136(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L7:
	addl	$1, -148(%rbp)
.L6:
	cmpl	$29, -148(%rbp)
	jle	.L8
	movl	$0, -144(%rbp)
	jmp	.L9
.L10:
	movl	-144(%rbp), %eax
	cltq
	movl	-136(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -144(%rbp)
.L9:
	cmpl	$1, -144(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$160, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -140(%rbp)
	movl	$0, -156(%rbp)
	jmp	.L2
.L3:
	movl	-156(%rbp), %eax
	cltq
	movl	$0, -128(%rbp,%rax,4)
	addl	$1, -156(%rbp)
.L2:
	cmpl	$29, -156(%rbp)
	jle	.L3
	movl	$0, -152(%rbp)
	jmp	.L4
.L5:
	leaq	-160(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-160(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	$1, -128(%rbp,%rax,4)
	addl	$1, -152(%rbp)
.L4:
	cmpl	$27, -152(%rbp)
	jle	.L5
	movl	$0, -148(%rbp)
	jmp	.L6
.L8:
	movl	-148(%rbp), %eax
	cltq
	movl	-128(%rbp,%rax,4), %eax
	testl	%eax, %eax
	jne	.L7
	movl	-148(%rbp), %eax
	leal	1(%rax), %edx
	movl	-140(%rbp), %eax
	cltq
	movl	%edx, -136(%rbp,%rax,4)
	addl	$1, -140(%rbp)
.L7:
	addl	$1, -148(%rbp)
.L6:
	cmpl	$29, -148(%rbp)
	jle	.L8
	movl	$0, -144(%rbp)
	jmp	.L9
.L10:
	movl	-144(%rbp), %eax
	cltq
	movl	-136(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -144(%rbp)
.L9:
	cmpl	$1, -144(%rbp)
	jle	.L10
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
