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 array[50];

int fib(int a){
  int ans;


  if(a  ==0 || a  ==1){
    return array[a]=1;
  }
  if(array[a]!=-1)return array[a];


  else {return array[a]=fib(a-1)+fib(a-2);}
  

}



int main(){

  int number;
  int ans;
  int i;

  
  for(i=0;i<50;i++){array[i]=-1;}
  
  scanf("%d",&number);

  ans=fib(number);


  

  printf("%d\n",ans);

  


  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 200
array:
	.zero	200
	.text
	.globl	fib
	.type	fib, @function
fib:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L2
	cmpl	$1, -20(%rbp)
	jne	.L3
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, %ebx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	fib
	leal	(%rbx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fib, .-fib
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	cmpl	$49, -16(%rbp)
	jle	.L8
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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
	.type	fib.part.0, @function
fib.part.0:
.LFB25:
	.cfi_startproc
	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
	leaq	array(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rbx
	leal	-1(%rbx), %eax
	leal	-2(%rbx), %r14d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$1, %eax
	jbe	.L13
	movslq	%eax, %rbp
	movslq	%r14d, %r15
	movl	(%r12,%rbp,4), %r13d
	cmpl	$-1, %r13d
	je	.L14
.L3:
	cmpl	$1, %r14d
	jbe	.L15
.L8:
	movl	(%r12,%r15,4), %eax
	cmpl	$-1, %eax
	je	.L16
.L9:
	addl	%r13d, %eax
	movl	%eax, (%r12,%rbx,4)
	addq	$24, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cltq
	movl	$1, %r13d
	movslq	%r14d, %r15
	movl	$1, (%r12,%rax,4)
	cmpl	$1, %r14d
	ja	.L8
.L15:
	movl	$1, (%r12,%r15,4)
	movl	$1, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r14d, %edi
	call	fib.part.0
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$1, %r14d
	jbe	.L17
	movl	(%r12,%r15,4), %edx
	cmpl	$-1, %edx
	je	.L18
.L5:
	leal	-3(%rbx), %edi
	cmpl	$1, %edi
	jbe	.L19
	movslq	%edi, %rax
	movl	(%r12,%rax,4), %r13d
	cmpl	$-1, %r13d
	je	.L20
.L7:
	addl	%edx, %r13d
	movl	%r13d, (%r12,%rbp,4)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$1, (%r12,%r15,4)
	movl	$1, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	%edi, %rdi
	movl	$1, %r13d
	movl	$1, (%r12,%rdi,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, 12(%rsp)
	call	fib.part.0
	movl	12(%rsp), %edx
	movl	%eax, %r13d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r14d, %edi
	call	fib.part.0
	movl	%eax, %edx
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	fib.part.0, .-fib.part.0
	.p2align 4
	.globl	fib
	.type	fib, @function
fib:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rcx
	cmpl	$1, %ecx
	jbe	.L37
	leaq	array(%rip), %rsi
	movslq	%ecx, %r8
	movl	(%rsi,%r8,4), %eax
	cmpl	$-1, %eax
	je	.L38
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	array(%rip), %rax
	movl	$1, (%rax,%rcx,4)
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leal	-1(%rcx), %eax
	leal	-2(%rcx), %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$1, %eax
	jbe	.L39
	movslq	%eax, %r9
	movslq	%r11d, %rbx
	movl	(%rsi,%r9,4), %r10d
	cmpl	$-1, %r10d
	je	.L40
.L25:
	cmpl	$1, %r11d
	jbe	.L41
	movl	(%rsi,%rbx,4), %eax
	cmpl	$-1, %eax
	je	.L42
.L31:
	addl	%r10d, %eax
	movl	%eax, (%rsi,%r8,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	cltq
	movl	$1, %r10d
	movslq	%r11d, %rbx
	movl	$1, (%rsi,%rax,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, (%rsi,%rbx,4)
	movl	$1, %eax
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L42:
	movl	%r11d, %edi
	call	fib.part.0
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L40:
	cmpl	$1, %r11d
	jbe	.L43
	movl	(%rsi,%rbx,4), %ebp
	cmpl	$-1, %ebp
	je	.L44
.L27:
	leal	-3(%rcx), %edi
	cmpl	$1, %edi
	jbe	.L45
	movslq	%edi, %rax
	movl	(%rsi,%rax,4), %r10d
	cmpl	$-1, %r10d
	je	.L46
.L29:
	addl	%ebp, %r10d
	movl	%r10d, (%rsi,%r9,4)
	jmp	.L25
.L43:
	movl	$1, (%rsi,%rbx,4)
	movl	$1, %ebp
	jmp	.L27
.L45:
	movslq	%edi, %rcx
	movl	$1, %r10d
	movl	$1, (%rsi,%rcx,4)
	jmp	.L29
.L46:
	call	fib.part.0
	movl	%eax, %r10d
	jmp	.L29
.L44:
	movl	%r11d, %edi
	call	fib.part.0
	movl	%eax, %ebp
	jmp	.L27
	.cfi_endproc
.LFE23:
	.size	fib, .-fib
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	pcmpeqd	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movaps	%xmm0, array(%rip)
	movq	$-1, 192+array(%rip)
	movaps	%xmm0, 16+array(%rip)
	movaps	%xmm0, 32+array(%rip)
	movaps	%xmm0, 48+array(%rip)
	movaps	%xmm0, 64+array(%rip)
	movaps	%xmm0, 80+array(%rip)
	movaps	%xmm0, 96+array(%rip)
	movaps	%xmm0, 112+array(%rip)
	movaps	%xmm0, 128+array(%rip)
	movaps	%xmm0, 144+array(%rip)
	movaps	%xmm0, 160+array(%rip)
	movaps	%xmm0, 176+array(%rip)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	call	fib
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L50:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 200
array:
	.zero	200
	.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
	.type	fib.part.0, @function
fib.part.0:
.LFB25:
	.cfi_startproc
	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
	leaq	array(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	movslq	%edi, %rbx
	leal	-1(%rbx), %eax
	leal	-2(%rbx), %r14d
	subq	$24, %rsp
	.cfi_def_cfa_offset 80
	cmpl	$1, %eax
	jbe	.L13
	movslq	%eax, %rbp
	movslq	%r14d, %r15
	movl	(%r12,%rbp,4), %r13d
	cmpl	$-1, %r13d
	je	.L14
.L3:
	cmpl	$1, %r14d
	jbe	.L15
.L8:
	movl	(%r12,%r15,4), %eax
	cmpl	$-1, %eax
	je	.L16
.L9:
	addl	%r13d, %eax
	movl	%eax, (%r12,%rbx,4)
	addq	$24, %rsp
	.cfi_remember_state
	.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
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	cltq
	movl	$1, %r13d
	movslq	%r14d, %r15
	movl	$1, (%r12,%rax,4)
	cmpl	$1, %r14d
	ja	.L8
.L15:
	movl	$1, (%r12,%r15,4)
	movl	$1, %eax
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%r14d, %edi
	call	fib.part.0
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L14:
	cmpl	$1, %r14d
	jbe	.L17
	movl	(%r12,%r15,4), %edx
	cmpl	$-1, %edx
	je	.L18
.L5:
	leal	-3(%rbx), %edi
	cmpl	$1, %edi
	jbe	.L19
	movslq	%edi, %rax
	movl	(%r12,%rax,4), %r13d
	cmpl	$-1, %r13d
	je	.L20
.L7:
	addl	%edx, %r13d
	movl	%r13d, (%r12,%rbp,4)
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L17:
	movl	$1, (%r12,%r15,4)
	movl	$1, %edx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L19:
	movslq	%edi, %rdi
	movl	$1, %r13d
	movl	$1, (%r12,%rdi,4)
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, 12(%rsp)
	call	fib.part.0
	movl	12(%rsp), %edx
	movl	%eax, %r13d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%r14d, %edi
	call	fib.part.0
	movl	%eax, %edx
	jmp	.L5
	.cfi_endproc
.LFE25:
	.size	fib.part.0, .-fib.part.0
	.p2align 4
	.globl	fib
	.type	fib, @function
fib:
.LFB23:
	.cfi_startproc
	endbr64
	movslq	%edi, %rcx
	cmpl	$1, %ecx
	jbe	.L37
	leaq	array(%rip), %rsi
	movslq	%ecx, %r8
	movl	(%rsi,%r8,4), %eax
	cmpl	$-1, %eax
	je	.L38
	ret
	.p2align 4,,10
	.p2align 3
.L37:
	leaq	array(%rip), %rax
	movl	$1, (%rax,%rcx,4)
	movl	$1, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L38:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leal	-1(%rcx), %eax
	leal	-2(%rcx), %r11d
	pushq	%rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	subq	$8, %rsp
	.cfi_def_cfa_offset 32
	cmpl	$1, %eax
	jbe	.L39
	movslq	%eax, %r9
	movslq	%r11d, %rbx
	movl	(%rsi,%r9,4), %r10d
	cmpl	$-1, %r10d
	je	.L40
.L25:
	cmpl	$1, %r11d
	jbe	.L41
	movl	(%rsi,%rbx,4), %eax
	cmpl	$-1, %eax
	je	.L42
.L31:
	addl	%r10d, %eax
	movl	%eax, (%rsi,%r8,4)
	addq	$8, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	popq	%rbx
	.cfi_def_cfa_offset 16
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L39:
	.cfi_restore_state
	cltq
	movl	$1, %r10d
	movslq	%r11d, %rbx
	movl	$1, (%rsi,%rax,4)
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L41:
	movl	$1, (%rsi,%rbx,4)
	movl	$1, %eax
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L42:
	movl	%r11d, %edi
	call	fib.part.0
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L40:
	cmpl	$1, %r11d
	jbe	.L43
	movl	(%rsi,%rbx,4), %ebp
	cmpl	$-1, %ebp
	je	.L44
.L27:
	leal	-3(%rcx), %edi
	cmpl	$1, %edi
	jbe	.L45
	movslq	%edi, %rax
	movl	(%rsi,%rax,4), %r10d
	cmpl	$-1, %r10d
	je	.L46
.L29:
	addl	%ebp, %r10d
	movl	%r10d, (%rsi,%r9,4)
	jmp	.L25
.L43:
	movl	$1, (%rsi,%rbx,4)
	movl	$1, %ebp
	jmp	.L27
.L45:
	movslq	%edi, %rcx
	movl	$1, %r10d
	movl	$1, (%rsi,%rcx,4)
	jmp	.L29
.L46:
	call	fib.part.0
	movl	%eax, %r10d
	jmp	.L29
.L44:
	movl	%r11d, %edi
	call	fib.part.0
	movl	%eax, %ebp
	jmp	.L27
	.cfi_endproc
.LFE23:
	.size	fib, .-fib
	.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:
.LFB24:
	.cfi_startproc
	endbr64
	subq	$24, %rsp
	.cfi_def_cfa_offset 32
	pcmpeqd	%xmm0, %xmm0
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	movaps	%xmm0, array(%rip)
	movq	$-1, 192+array(%rip)
	movaps	%xmm0, 16+array(%rip)
	movaps	%xmm0, 32+array(%rip)
	movaps	%xmm0, 48+array(%rip)
	movaps	%xmm0, 64+array(%rip)
	movaps	%xmm0, 80+array(%rip)
	movaps	%xmm0, 96+array(%rip)
	movaps	%xmm0, 112+array(%rip)
	movaps	%xmm0, 128+array(%rip)
	movaps	%xmm0, 144+array(%rip)
	movaps	%xmm0, 160+array(%rip)
	movaps	%xmm0, 176+array(%rip)
	call	__isoc99_scanf@PLT
	movl	4(%rsp), %edi
	call	fib
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L50
	xorl	%eax, %eax
	addq	$24, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L50:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 200
array:
	.zero	200
	.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 array[50];

int fib(int a){
  int ans;


  if(a  ==0 || a  ==1){
    return array[a]=1;
  }
  if(array[a]!=-1)return array[a];


  else {return array[a]=fib(a-1)+fib(a-2);}
  

}



int main(){

  int number;
  int ans;
  int i;

  
  for(i=0;i<50;i++){array[i]=-1;}
  
  scanf("%d",&number);

  ans=fib(number);


  

  printf("%d\n",ans);

  


  return 0;
}


1
 2
 4
 8
 6
 15
 7
 24
 14
 5

1
 2
 5
 34
 13
 987
 21
 75025
 610
 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 array[50];

int fib(int a){
  int ans;


  if(a  ==0 || a  ==1){
    return array[a]=1;
  }
  if(array[a]!=-1)return array[a];


  else {return array[a]=fib(a-1)+fib(a-2);}
  

}



int main(){

  int number;
  int ans;
  int i;

  
  for(i=0;i<50;i++){array[i]=-1;}
  
  scanf("%d",&number);

  ans=fib(number);


  

  printf("%d\n",ans);

  


  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 200
array:
	.zero	200
	.text
	.globl	fib
	.type	fib, @function
fib:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L2
	cmpl	$1, -20(%rbp)
	jne	.L3
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, %ebx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	fib
	leal	(%rbx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fib, .-fib
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	cmpl	$49, -16(%rbp)
	jle	.L8
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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	array
	.bss
	.align 32
	.type	array, @object
	.size	array, 200
array:
	.zero	200
	.text
	.globl	fib
	.type	fib, @function
fib:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 3, -24
	movl	%edi, -20(%rbp)
	cmpl	$0, -20(%rbp)
	je	.L2
	cmpl	$1, -20(%rbp)
	jne	.L3
.L2:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$1, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L3:
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	cmpl	$-1, %eax
	je	.L5
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
	jmp	.L4
.L5:
	movl	-20(%rbp), %eax
	subl	$1, %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, %ebx
	movl	-20(%rbp), %eax
	subl	$2, %eax
	movl	%eax, %edi
	call	fib
	leal	(%rbx,%rax), %ecx
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	(%rdx,%rax), %eax
.L4:
	movq	-8(%rbp), %rbx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	fib, .-fib
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.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
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -16(%rbp)
	jmp	.L7
.L8:
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	array(%rip), %rax
	movl	$-1, (%rdx,%rax)
	addl	$1, -16(%rbp)
.L7:
	cmpl	$49, -16(%rbp)
	jle	.L8
	leaq	-20(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-20(%rbp), %eax
	movl	%eax, %edi
	call	fib
	movl	%eax, -12(%rbp)
	movl	-12(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L10
	call	__stack_chk_fail@PLT
.L10:
	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:
