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 MAX 201

int main(void)
{
  int i,j,k,D,N,T[MAX],A[MAX],B[MAX],C[MAX],dp[MAX][MAX],z,S;
  scanf("%d%d",&D,&N);
  for(i=0;i<=D-1;i++)
    {
      scanf("%d",&T[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      scanf("%d%d%d",&A[i],&B[i],&C[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      for(j=0;j<=D-1;j++)
	{
          dp[j][i]=0;
	}
    }
  for(i=1;i<=D-1;i++)
    {
      for(j=0;j<=N-1;j++)
	{
	  if(A[j]<=T[i] && T[i]<=B[j])
	    {
	      for(k=0;k<=N-1;k++)
		{
		  if(A[k]<=T[i-1] && T[i-1]<=B[k])
		    {
		      if(C[j]>=C[k])
			{
		          z=C[j]-C[k]+dp[i-1][k];
			}
		      else
			{
			  z=C[k]-C[j]+dp[i-1][k];
			}
		      if(dp[i][j]<=z)
			{
			  dp[i][j]=z;
			}
		    }
		}
	    }
	}
    }
      S=0;
      for(i=0;i<=N-1;i++)
	{
	  if(S<=dp[D-1][i])
	    {
	      S=dp[D-1][i];
	    }
	}
      printf("%d\n",S);
      return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.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
	leaq	-163840(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-164904(%rbp), %rdx
	leaq	-164908(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164900(%rbp)
	jmp	.L2
.L3:
	leaq	-164880(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L2:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L3
	movl	$0, -164900(%rbp)
	jmp	.L4
.L5:
	leaq	-162432(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-163248(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-164064(%rbp), %rsi
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L4:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L5
	movl	$0, -164900(%rbp)
	jmp	.L6
.L9:
	movl	$0, -164896(%rbp)
	jmp	.L7
.L8:
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164896(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -161616(%rbp,%rax,4)
	addl	$1, -164896(%rbp)
.L7:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L8
	addl	$1, -164900(%rbp)
.L6:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L9
	movl	$1, -164900(%rbp)
	jmp	.L10
.L19:
	movl	$0, -164896(%rbp)
	jmp	.L11
.L18:
	movl	-164896(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	$0, -164892(%rbp)
	jmp	.L13
.L17:
	movl	-164892(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
	jmp	.L16
.L15:
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
.L16:
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164888(%rbp)
	jl	.L14
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-164888(%rbp), %eax
	movl	%eax, -161616(%rbp,%rdx,4)
.L14:
	addl	$1, -164892(%rbp)
.L13:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164892(%rbp)
	jl	.L17
.L12:
	addl	$1, -164896(%rbp)
.L11:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L18
	addl	$1, -164900(%rbp)
.L10:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L19
	movl	$0, -164884(%rbp)
	movl	$0, -164900(%rbp)
	jmp	.L20
.L22:
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164884(%rbp)
	jg	.L21
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	movl	%eax, -164884(%rbp)
.L21:
	addl	$1, -164900(%rbp)
.L20:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L22
	movl	-164884(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-163840(%rsp), %r11
	.cfi_def_cfa 11, 163896
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1096, %rsp
	.cfi_def_cfa_offset 164992
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 164920(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rdx
	leaq	40(%rsp), %rsi
	leaq	48(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 40(%rsp)
	jg	.L5
.L6:
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	leaq	2496(%rsp), %r12
	leaq	1680(%rsp), %rbp
	leaq	864(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%r13), %rcx
	leaq	0(%rbp,%r13), %rdx
	xorl	%eax, %eax
	addl	$1, %r15d
	leaq	(%rbx,%r13), %rsi
	leaq	.LC2(%rip), %rdi
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r14d
	cmpl	%r15d, %r14d
	jg	.L3
	movl	40(%rsp), %eax
	movl	%eax, 16(%rsp)
	testl	%r14d, %r14d
	jle	.L4
	testl	%eax, %eax
	leal	-1(%r14), %eax
	movl	%eax, 24(%rsp)
	jle	.L57
	cmpl	$2, %eax
	jbe	.L34
	movl	16(%rsp), %eax
	movl	%r14d, %esi
	pxor	%xmm0, %xmm0
	leaq	3312(%rsp), %rdi
	shrl	$2, %esi
	leaq	4116(%rsp), %r8
	movq	%rdi, %rcx
	leal	-1(%rax), %edx
	salq	$4, %rsi
	movl	%edx, 20(%rsp)
	imulq	$804, %rdx, %rdx
	addq	%rdi, %rsi
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movups	%xmm0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L10
	addq	$16, %rcx
	leaq	16(%rax), %rdx
	cmpq	%rsi, %rcx
	jne	.L9
	movl	%r14d, %ecx
	andl	$-4, %ecx
	testb	$3, %r14b
	je	.L13
.L8:
	movl	20(%rsp), %eax
	movslq	%ecx, %rdx
	leaq	(%rdi,%rdx,4), %rsi
	imulq	$201, %rax, %rax
	addq	%rdx, %rax
	leaq	(%r8,%rax,4), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L14
	addl	$1, %ecx
	addq	$4, %rsi
	addq	$4, %rdx
	cmpl	%ecx, %r14d
	jg	.L15
.L13:
	cmpl	$1, 16(%rsp)
	jle	.L26
	movl	16(%rsp), %eax
	movl	%r14d, 28(%rsp)
	movslq	%r14d, %rsi
	leaq	52(%rsp), %r13
	movq	%rdi, %r14
	subl	$2, %eax
	leaq	56(%rsp,%rax,4), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %r15
	addq	$804, %r14
	movl	0(%r13), %r8d
	xorl	%edx, %edx
	movq	%r14, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1, %rdx
	addq	$4, %rcx
	cmpq	%rsi, %rdx
	je	.L58
.L19:
	cmpl	%r8d, (%rbx,%rdx,4)
	jg	.L21
	cmpl	0(%rbp,%rdx,4), %r8d
	jg	.L21
	movl	-4(%r13), %edi
	xorl	%eax, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L59:
	subl	%r10d, %r11d
	addl	%r11d, %r9d
.L24:
	cmpl	%r9d, (%rcx)
	jg	.L22
	movl	%r9d, (%rcx)
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L21
.L25:
	cmpl	%edi, (%rbx,%rax,4)
	jg	.L22
	cmpl	0(%rbp,%rax,4), %edi
	jg	.L22
	movl	(%r12,%rdx,4), %r11d
	movl	(%r12,%rax,4), %r10d
	movl	(%r15,%rax,4), %r9d
	cmpl	%r10d, %r11d
	jge	.L59
	subl	%r11d, %r10d
	addl	%r10d, %r9d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L58:
	addq	$4, %r13
	cmpq	8(%rsp), %r13
	jne	.L17
	movl	28(%rsp), %r14d
.L26:
	cmpl	$2, 24(%rsp)
	jbe	.L35
	movslq	16(%rsp), %rax
	movl	%r14d, %edx
	pxor	%xmm2, %xmm2
	shrl	$2, %edx
	imulq	$804, %rax, %rax
	leal	-1(%rdx), %ecx
	salq	$4, %rcx
	leaq	2508(%rsp,%rax), %rax
	addq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rax), %xmm0
	movq	%rax, %rdx
	addq	$16, %rax
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L28
	movdqa	%xmm2, %xmm1
	movl	%r14d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r14b
	je	.L30
.L27:
	movslq	20(%rsp), %rcx
	movslq	%eax, %rsi
	leaq	(%rcx,%rcx,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rcx,%rdi,8), %rdi
	movq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	3312(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L30
	movslq	%ecx, %rcx
	addq	%rdi, %rcx
	movl	3312(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %eax
	cmpl	%eax, %r14d
	jle	.L30
	cltq
	addq	%rax, %rdi
	movl	3312(%rsp,%rdi,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L30:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	164920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	addq	$164936, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L30
.L57:
	movl	16(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	jmp	.L26
.L35:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L27
.L34:
	movl	16(%rsp), %eax
	xorl	%ecx, %ecx
	leaq	3312(%rsp), %rdi
	leaq	4116(%rsp), %r8
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	jmp	.L8
.L60:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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	-163840(%rsp), %r11
	.cfi_def_cfa 11, 163896
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1096, %rsp
	.cfi_def_cfa_offset 164992
	leaq	.LC0(%rip), %rdi
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r12
	movq	%fs:40, %rax
	movq	%rax, 164920(%rsp)
	xorl	%eax, %eax
	leaq	44(%rsp), %rdx
	leaq	40(%rsp), %rsi
	leaq	48(%rsp), %rbp
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %edx
	testl	%edx, %edx
	jle	.L6
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%rbp, %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	addq	$4, %rbp
	cmpl	%ebx, 40(%rsp)
	jg	.L5
.L6:
	movl	44(%rsp), %eax
	testl	%eax, %eax
	jle	.L4
	xorl	%r13d, %r13d
	xorl	%r15d, %r15d
	leaq	2496(%rsp), %r12
	leaq	1680(%rsp), %rbp
	leaq	864(%rsp), %rbx
	.p2align 4,,10
	.p2align 3
.L3:
	leaq	(%r12,%r13), %rcx
	leaq	0(%rbp,%r13), %rdx
	xorl	%eax, %eax
	addl	$1, %r15d
	leaq	(%rbx,%r13), %rsi
	leaq	.LC2(%rip), %rdi
	addq	$4, %r13
	call	__isoc99_scanf@PLT
	movl	44(%rsp), %r14d
	cmpl	%r15d, %r14d
	jg	.L3
	movl	40(%rsp), %eax
	movl	%eax, 16(%rsp)
	testl	%r14d, %r14d
	jle	.L4
	testl	%eax, %eax
	leal	-1(%r14), %eax
	movl	%eax, 24(%rsp)
	jle	.L57
	cmpl	$2, %eax
	jbe	.L34
	movl	16(%rsp), %eax
	movl	%r14d, %esi
	pxor	%xmm0, %xmm0
	leaq	3312(%rsp), %rdi
	shrl	$2, %esi
	leaq	4116(%rsp), %r8
	movq	%rdi, %rcx
	leal	-1(%rax), %edx
	salq	$4, %rsi
	movl	%edx, 20(%rsp)
	imulq	$804, %rdx, %rdx
	addq	%rdi, %rsi
	addq	%r8, %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movq	%rcx, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movups	%xmm0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L10
	addq	$16, %rcx
	leaq	16(%rax), %rdx
	cmpq	%rsi, %rcx
	jne	.L9
	movl	%r14d, %ecx
	andl	$-4, %ecx
	testb	$3, %r14b
	je	.L13
.L8:
	movl	20(%rsp), %eax
	movslq	%ecx, %rdx
	leaq	(%rdi,%rdx,4), %rsi
	imulq	$201, %rax, %rax
	addq	%rdx, %rax
	leaq	(%r8,%rax,4), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L14:
	movl	$0, (%rax)
	addq	$804, %rax
	cmpq	%rdx, %rax
	jne	.L14
	addl	$1, %ecx
	addq	$4, %rsi
	addq	$4, %rdx
	cmpl	%ecx, %r14d
	jg	.L15
.L13:
	cmpl	$1, 16(%rsp)
	jle	.L26
	movl	16(%rsp), %eax
	movl	%r14d, 28(%rsp)
	movslq	%r14d, %rsi
	leaq	52(%rsp), %r13
	movq	%rdi, %r14
	subl	$2, %eax
	leaq	56(%rsp,%rax,4), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L17:
	movq	%r14, %r15
	addq	$804, %r14
	movl	0(%r13), %r8d
	xorl	%edx, %edx
	movq	%r14, %rcx
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L21:
	addq	$1, %rdx
	addq	$4, %rcx
	cmpq	%rsi, %rdx
	je	.L58
.L19:
	cmpl	%r8d, (%rbx,%rdx,4)
	jg	.L21
	cmpl	0(%rbp,%rdx,4), %r8d
	jg	.L21
	movl	-4(%r13), %edi
	xorl	%eax, %eax
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L59:
	subl	%r10d, %r11d
	addl	%r11d, %r9d
.L24:
	cmpl	%r9d, (%rcx)
	jg	.L22
	movl	%r9d, (%rcx)
	.p2align 4,,10
	.p2align 3
.L22:
	addq	$1, %rax
	cmpq	%rsi, %rax
	je	.L21
.L25:
	cmpl	%edi, (%rbx,%rax,4)
	jg	.L22
	cmpl	0(%rbp,%rax,4), %edi
	jg	.L22
	movl	(%r12,%rdx,4), %r11d
	movl	(%r12,%rax,4), %r10d
	movl	(%r15,%rax,4), %r9d
	cmpl	%r10d, %r11d
	jge	.L59
	subl	%r11d, %r10d
	addl	%r10d, %r9d
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L58:
	addq	$4, %r13
	cmpq	8(%rsp), %r13
	jne	.L17
	movl	28(%rsp), %r14d
.L26:
	cmpl	$2, 24(%rsp)
	jbe	.L35
	movslq	16(%rsp), %rax
	movl	%r14d, %edx
	pxor	%xmm2, %xmm2
	shrl	$2, %edx
	imulq	$804, %rax, %rax
	leal	-1(%rdx), %ecx
	salq	$4, %rcx
	leaq	2508(%rsp,%rax), %rax
	addq	%rax, %rcx
	.p2align 4,,10
	.p2align 3
.L28:
	movdqu	(%rax), %xmm0
	movq	%rax, %rdx
	addq	$16, %rax
	movdqa	%xmm0, %xmm1
	pcmpgtd	%xmm2, %xmm1
	pand	%xmm1, %xmm0
	pandn	%xmm2, %xmm1
	movdqa	%xmm1, %xmm2
	por	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L28
	movdqa	%xmm2, %xmm1
	movl	%r14d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm2, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm2, %xmm0
	por	%xmm1, %xmm0
	movdqa	%xmm0, %xmm2
	psrldq	$4, %xmm2
	movdqa	%xmm2, %xmm1
	pcmpgtd	%xmm0, %xmm1
	pand	%xmm1, %xmm2
	pandn	%xmm0, %xmm1
	por	%xmm2, %xmm1
	movd	%xmm1, %edx
	testb	$3, %r14b
	je	.L30
.L27:
	movslq	20(%rsp), %rcx
	movslq	%eax, %rsi
	leaq	(%rcx,%rcx,4), %rdi
	leaq	(%rdi,%rdi,4), %rdi
	leaq	(%rcx,%rdi,8), %rdi
	movq	%rsi, %rcx
	addq	%rdi, %rcx
	movl	3312(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	leal	1(%rax), %ecx
	cmpl	%ecx, %r14d
	jle	.L30
	movslq	%ecx, %rcx
	addq	%rdi, %rcx
	movl	3312(%rsp,%rcx,4), %ecx
	cmpl	%ecx, %edx
	cmovl	%ecx, %edx
	addl	$2, %eax
	cmpl	%eax, %r14d
	jle	.L30
	cltq
	addq	%rax, %rdi
	movl	3312(%rsp,%rdi,4), %eax
	cmpl	%eax, %edx
	cmovl	%eax, %edx
.L30:
	xorl	%eax, %eax
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	164920(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L60
	addq	$164936, %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
.L4:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L30
.L57:
	movl	16(%rsp), %eax
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	jmp	.L26
.L35:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L27
.L34:
	movl	16(%rsp), %eax
	xorl	%ecx, %ecx
	leaq	3312(%rsp), %rdi
	leaq	4116(%rsp), %r8
	subl	$1, %eax
	movl	%eax, 20(%rsp)
	jmp	.L8
.L60:
	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>

#define MAX 201

int main(void)
{
  int i,j,k,D,N,T[MAX],A[MAX],B[MAX],C[MAX],dp[MAX][MAX],z,S;
  scanf("%d%d",&D,&N);
  for(i=0;i<=D-1;i++)
    {
      scanf("%d",&T[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      scanf("%d%d%d",&A[i],&B[i],&C[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      for(j=0;j<=D-1;j++)
	{
          dp[j][i]=0;
	}
    }
  for(i=1;i<=D-1;i++)
    {
      for(j=0;j<=N-1;j++)
	{
	  if(A[j]<=T[i] && T[i]<=B[j])
	    {
	      for(k=0;k<=N-1;k++)
		{
		  if(A[k]<=T[i-1] && T[i-1]<=B[k])
		    {
		      if(C[j]>=C[k])
			{
		          z=C[j]-C[k]+dp[i-1][k];
			}
		      else
			{
			  z=C[k]-C[j]+dp[i-1][k];
			}
		      if(dp[i][j]<=z)
			{
			  dp[i][j]=z;
			}
		    }
		}
	    }
	}
    }
      S=0;
      for(i=0;i<=N-1;i++)
	{
	  if(S<=dp[D-1][i])
	    {
	      S=dp[D-1][i];
	    }
	}
      printf("%d\n",S);
      return 0;
}
3 4
34
27
35
20 25 30
23 29 90
21 35 60
28 33 40
 3 4
31
27
35
20 25 30
35 29 90
21 35 60
28 33 40
 3 4
34
40
35
20 25 30
23 29 90
21 69 60
28 33 40
 3 4
31
27
35
20 25 30
23 29 90
21 35 60
28 48 40
 3 4
31
27
35
20 25 30
35 29 90
21 35 69
28 33 40
 3 4
31
27
35
20 25 30
23 29 90
21 35 60
28 48 25
 3 4
34
27
35
20 25 30
23 29 90
21 69 60
12 33 7
 3 4
31
27
35
20 25 30
43 29 90
21 35 60
28 48 25
 3 4
34
27
35
20 25 30
23 29 90
21 69 60
12 33 9
 3 4
34
40
44
38 25 30
24 29 11
21 69 60
28 43 40

60
 20
 0
 100
 29
 130
 106
 70
 102
 40

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 MAX 201

int main(void)
{
  int i,j,k,D,N,T[MAX],A[MAX],B[MAX],C[MAX],dp[MAX][MAX],z,S;
  scanf("%d%d",&D,&N);
  for(i=0;i<=D-1;i++)
    {
      scanf("%d",&T[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      scanf("%d%d%d",&A[i],&B[i],&C[i]);
    }
  for(i=0;i<=N-1;i++)
    {
      for(j=0;j<=D-1;j++)
	{
          dp[j][i]=0;
	}
    }
  for(i=1;i<=D-1;i++)
    {
      for(j=0;j<=N-1;j++)
	{
	  if(A[j]<=T[i] && T[i]<=B[j])
	    {
	      for(k=0;k<=N-1;k++)
		{
		  if(A[k]<=T[i-1] && T[i-1]<=B[k])
		    {
		      if(C[j]>=C[k])
			{
		          z=C[j]-C[k]+dp[i-1][k];
			}
		      else
			{
			  z=C[k]-C[j]+dp[i-1][k];
			}
		      if(dp[i][j]<=z)
			{
			  dp[i][j]=z;
			}
		    }
		}
	    }
	}
    }
      S=0;
      for(i=0;i<=N-1;i++)
	{
	  if(S<=dp[D-1][i])
	    {
	      S=dp[D-1][i];
	    }
	}
      printf("%d\n",S);
      return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.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
	leaq	-163840(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-164904(%rbp), %rdx
	leaq	-164908(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164900(%rbp)
	jmp	.L2
.L3:
	leaq	-164880(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L2:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L3
	movl	$0, -164900(%rbp)
	jmp	.L4
.L5:
	leaq	-162432(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-163248(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-164064(%rbp), %rsi
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L4:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L5
	movl	$0, -164900(%rbp)
	jmp	.L6
.L9:
	movl	$0, -164896(%rbp)
	jmp	.L7
.L8:
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164896(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -161616(%rbp,%rax,4)
	addl	$1, -164896(%rbp)
.L7:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L8
	addl	$1, -164900(%rbp)
.L6:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L9
	movl	$1, -164900(%rbp)
	jmp	.L10
.L19:
	movl	$0, -164896(%rbp)
	jmp	.L11
.L18:
	movl	-164896(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	$0, -164892(%rbp)
	jmp	.L13
.L17:
	movl	-164892(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
	jmp	.L16
.L15:
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
.L16:
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164888(%rbp)
	jl	.L14
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-164888(%rbp), %eax
	movl	%eax, -161616(%rbp,%rdx,4)
.L14:
	addl	$1, -164892(%rbp)
.L13:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164892(%rbp)
	jl	.L17
.L12:
	addl	$1, -164896(%rbp)
.L11:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L18
	addl	$1, -164900(%rbp)
.L10:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L19
	movl	$0, -164884(%rbp)
	movl	$0, -164900(%rbp)
	jmp	.L20
.L22:
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164884(%rbp)
	jg	.L21
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	movl	%eax, -164884(%rbp)
.L21:
	addl	$1, -164900(%rbp)
.L20:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L22
	movl	-164884(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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%d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d%d%d"
.LC3:
	.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
	leaq	-163840(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1072, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-164904(%rbp), %rdx
	leaq	-164908(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -164900(%rbp)
	jmp	.L2
.L3:
	leaq	-164880(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L2:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L3
	movl	$0, -164900(%rbp)
	jmp	.L4
.L5:
	leaq	-162432(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	leaq	(%rdx,%rax), %rcx
	leaq	-163248(%rbp), %rdx
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rax, %rdx
	leaq	-164064(%rbp), %rsi
	movl	-164900(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rsi, %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -164900(%rbp)
.L4:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L5
	movl	$0, -164900(%rbp)
	jmp	.L6
.L9:
	movl	$0, -164896(%rbp)
	jmp	.L7
.L8:
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164896(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	$0, -161616(%rbp,%rax,4)
	addl	$1, -164896(%rbp)
.L7:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L8
	addl	$1, -164900(%rbp)
.L6:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L9
	movl	$1, -164900(%rbp)
	jmp	.L10
.L19:
	movl	$0, -164896(%rbp)
	jmp	.L11
.L18:
	movl	-164896(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	-164900(%rbp), %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L12
	movl	$0, -164892(%rbp)
	jmp	.L13
.L17:
	movl	-164892(%rbp), %eax
	cltq
	movl	-164064(%rbp,%rax,4), %edx
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164900(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-164880(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-163248(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jg	.L14
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L15
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
	jmp	.L16
.L15:
	movl	-164892(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %edx
	movl	-164896(%rbp), %eax
	cltq
	movl	-162432(%rbp,%rax,4), %eax
	movl	%edx, %edi
	subl	%eax, %edi
	movl	-164900(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164892(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	addl	%edi, %eax
	movl	%eax, -164888(%rbp)
.L16:
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164888(%rbp)
	jl	.L14
	movl	-164896(%rbp), %eax
	movslq	%eax, %rcx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	leaq	(%rax,%rcx), %rdx
	movl	-164888(%rbp), %eax
	movl	%eax, -161616(%rbp,%rdx,4)
.L14:
	addl	$1, -164892(%rbp)
.L13:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164892(%rbp)
	jl	.L17
.L12:
	addl	$1, -164896(%rbp)
.L11:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164896(%rbp)
	jl	.L18
	addl	$1, -164900(%rbp)
.L10:
	movl	-164908(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L19
	movl	$0, -164884(%rbp)
	movl	$0, -164900(%rbp)
	jmp	.L20
.L22:
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	cmpl	%eax, -164884(%rbp)
	jg	.L21
	movl	-164908(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-164900(%rbp), %eax
	movslq	%eax, %rcx
	movslq	%edx, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rsi
	addq	%rsi, %rax
	salq	$3, %rax
	addq	%rdx, %rax
	addq	%rcx, %rax
	movl	-161616(%rbp,%rax,4), %eax
	movl	%eax, -164884(%rbp)
.L21:
	addl	$1, -164900(%rbp)
.L20:
	movl	-164904(%rbp), %eax
	cmpl	%eax, -164900(%rbp)
	jl	.L22
	movl	-164884(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	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:
