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>
#include <math.h>
#define INF 2000000

int n,p[301],m[301][301];

void matrixChainOrder(){
  int i,j,k,l,q;
  for(i=1;i<=n;i++)m[i][i]=0;
  for(l=2;l<=n;l++)
    for(i=1;i<=n;i++){
      j=i+l-1;
      m[i][j]=INF;
      for(k=i;k<=j;k++){
	q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
	m[i][j]=fmin(m[i][j],q);
      }
    }
}

int main(){
  int i;
  scanf("%d",&n);
  for(i=1;i<=n;i++)scanf("%d %d",&p[i-1],&p[i]);
  matrixChainOrder();
  printf("%d\n",m[1][n]);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 1204
p:
	.zero	1204
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 362404
m:
	.zero	362404
	.text
	.globl	matrixChainOrder
	.type	matrixChainOrder, @function
matrixChainOrder:
.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
	movl	$1, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	$1208, %rax, %rax
	leaq	m(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$2, -12(%rbp)
	jmp	.L4
.L9:
	movl	$1, -20(%rbp)
	jmp	.L5
.L8:
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	$2000000, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$301, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %esi
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%eax, %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$301, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	m(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	addl	$1, -20(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L8
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	matrixChainOrder, .-matrixChainOrder
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$0, %eax
	call	matrixChainOrder
	movl	n(%rip), %eax
	cltq
	addq	$301, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	matrixChainOrder
	.type	matrixChainOrder, @function
matrixChainOrder:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L23
	leal	-1(%rcx), %edx
	leaq	1208+m(%rip), %rax
	imulq	$1208, %rdx, %rdx
	leaq	1208(%rax), %rsi
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$0, (%rax)
	addq	$1208, %rax
	cmpq	%rdx, %rax
	jne	.L5
	cmpl	$1, %ecx
	jle	.L24
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	8+p(%rip), %rax
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rax, 24(%rsp)
	leaq	1212+m(%rip), %rax
	movq	%rax, 40(%rsp)
	leal	1(%rcx), %eax
	movq	%rax, 16(%rsp)
	movq	$2, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movl	32(%rsp), %ebp
	movq	40(%rsp), %rbx
	movq	$1, 8(%rsp)
	leaq	1204+m(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$2000000, (%rbx)
	cmpl	8(%rsp), %ebp
	jl	.L11
	movq	8(%rsp), %r15
	leaq	-4+p(%rip), %rax
	movq	%rbx, %r13
	movl	$2000000, %esi
	movl	(%rax,%r15,4), %r14d
	movq	24(%rsp), %rax
	movl	-4(%rax,%r15,4), %eax
	movl	%eax, 4(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	p(%rip), %rdi
	movl	1204(%r13), %eax
	addl	(%r12,%r15,4), %eax
	pxor	%xmm0, %xmm0
	movl	(%rdi,%r15,4), %edx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%esi, %xmm0
	addq	$1, %r15
	addq	$1204, %r13
	imull	%r14d, %edx
	imull	4(%rsp), %edx
	addl	%edx, %eax
	cvtsi2sdl	%eax, %xmm1
	call	fmin@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%rbx)
	cmpl	%r15d, %ebp
	jge	.L10
.L11:
	addq	$1, 8(%rsp)
	addl	$1, %ebp
	movq	8(%rsp), %rax
	addq	$1208, %rbx
	addq	$1204, %r12
	cmpq	16(%rsp), %rax
	jne	.L8
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	addq	$4, 24(%rsp)
	addq	$4, 40(%rsp)
	cmpq	16(%rsp), %rax
	jne	.L12
	addq	$56, %rsp
	.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
.L23:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
.L24:
	ret
	.cfi_endproc
.LFE23:
	.size	matrixChainOrder, .-matrixChainOrder
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L26
	leaq	p(%rip), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%rbx, %rsi
	addq	$4, %rbx
	xorl	%eax, %eax
	movq	%r12, %rdi
	movq	%rbx, %rdx
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	cmpl	%ebp, n(%rip)
	jge	.L27
.L26:
	xorl	%eax, %eax
	call	matrixChainOrder
	movslq	n(%rip), %rdx
	movl	$1, %edi
	leaq	m(%rip), %rax
	leaq	.LC2(%rip), %rsi
	movl	1204(%rax,%rdx,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 362404
m:
	.zero	362404
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 1204
p:
	.zero	1204
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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	matrixChainOrder
	.type	matrixChainOrder, @function
matrixChainOrder:
.LFB23:
	.cfi_startproc
	endbr64
	movl	n(%rip), %ecx
	testl	%ecx, %ecx
	jle	.L23
	leal	-1(%rcx), %edx
	leaq	1208+m(%rip), %rax
	imulq	$1208, %rdx, %rdx
	leaq	1208(%rax), %rsi
	addq	%rsi, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movl	$0, (%rax)
	addq	$1208, %rax
	cmpq	%rdx, %rax
	jne	.L5
	cmpl	$1, %ecx
	jle	.L24
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	8+p(%rip), %rax
	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
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%rax, 24(%rsp)
	leaq	1212+m(%rip), %rax
	movq	%rax, 40(%rsp)
	leal	1(%rcx), %eax
	movq	%rax, 16(%rsp)
	movq	$2, 32(%rsp)
	.p2align 4,,10
	.p2align 3
.L12:
	movl	32(%rsp), %ebp
	movq	40(%rsp), %rbx
	movq	$1, 8(%rsp)
	leaq	1204+m(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L8:
	movl	$2000000, (%rbx)
	cmpl	8(%rsp), %ebp
	jl	.L11
	movq	8(%rsp), %r15
	leaq	-4+p(%rip), %rax
	movq	%rbx, %r13
	movl	$2000000, %esi
	movl	(%rax,%r15,4), %r14d
	movq	24(%rsp), %rax
	movl	-4(%rax,%r15,4), %eax
	movl	%eax, 4(%rsp)
	.p2align 4,,10
	.p2align 3
.L10:
	leaq	p(%rip), %rdi
	movl	1204(%r13), %eax
	addl	(%r12,%r15,4), %eax
	pxor	%xmm0, %xmm0
	movl	(%rdi,%r15,4), %edx
	pxor	%xmm1, %xmm1
	cvtsi2sdl	%esi, %xmm0
	addq	$1, %r15
	addq	$1204, %r13
	imull	%r14d, %edx
	imull	4(%rsp), %edx
	addl	%edx, %eax
	cvtsi2sdl	%eax, %xmm1
	call	fmin@PLT
	cvttsd2sil	%xmm0, %esi
	movl	%esi, (%rbx)
	cmpl	%r15d, %ebp
	jge	.L10
.L11:
	addq	$1, 8(%rsp)
	addl	$1, %ebp
	movq	8(%rsp), %rax
	addq	$1208, %rbx
	addq	$1204, %r12
	cmpq	16(%rsp), %rax
	jne	.L8
	addq	$1, 32(%rsp)
	movq	32(%rsp), %rax
	addq	$4, 24(%rsp)
	addq	$4, 40(%rsp)
	cmpq	16(%rsp), %rax
	jne	.L12
	addq	$56, %rsp
	.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
.L23:
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
.L24:
	ret
	.cfi_endproc
.LFE23:
	.size	matrixChainOrder, .-matrixChainOrder
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	leaq	n(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	pushq	%rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	pushq	%rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	__isoc99_scanf@PLT
	movl	n(%rip), %eax
	testl	%eax, %eax
	jle	.L26
	leaq	p(%rip), %rbx
	movl	$1, %ebp
	leaq	.LC1(%rip), %r12
	.p2align 4,,10
	.p2align 3
.L27:
	movq	%rbx, %rsi
	addq	$4, %rbx
	xorl	%eax, %eax
	movq	%r12, %rdi
	movq	%rbx, %rdx
	addl	$1, %ebp
	call	__isoc99_scanf@PLT
	cmpl	%ebp, n(%rip)
	jge	.L27
.L26:
	xorl	%eax, %eax
	call	matrixChainOrder
	movslq	n(%rip), %rdx
	movl	$1, %edi
	leaq	m(%rip), %rax
	leaq	.LC2(%rip), %rsi
	movl	1204(%rax,%rdx,4), %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	popq	%rbx
	.cfi_def_cfa_offset 24
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 16
	popq	%r12
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE24:
	.size	main, .-main
	.globl	m
	.bss
	.align 32
	.type	m, @object
	.size	m, 362404
m:
	.zero	362404
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 1204
p:
	.zero	1204
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.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>
#include <math.h>
#define INF 2000000

int n,p[301],m[301][301];

void matrixChainOrder(){
  int i,j,k,l,q;
  for(i=1;i<=n;i++)m[i][i]=0;
  for(l=2;l<=n;l++)
    for(i=1;i<=n;i++){
      j=i+l-1;
      m[i][j]=INF;
      for(k=i;k<=j;k++){
	q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
	m[i][j]=fmin(m[i][j],q);
      }
    }
}

int main(){
  int i;
  scanf("%d",&n);
  for(i=1;i<=n;i++)scanf("%d %d",&p[i-1],&p[i]);
  matrixChainOrder();
  printf("%d\n",m[1][n]);
  return 0;
}


6
10 35
35 15
15 5
5 10
10 20
20 25
 6
1 35
35 15
15 5
5 10
10 20
20 25
 6
30 35
35 15
15 5
5 10
10 20
20 29
 6
2 35
35 15
15 5
5 10
10 20
20 25
 6
2 35
35 15
15 5
5 10
10 20
20 24
 6
30 35
35 15
15 5
5 10
10 20
20 27
 6
30 35
35 15
15 5
5 10
10 20
20 8
 6
30 35
35 15
15 5
5 10
10 20
20 7
 6
2 35
35 15
15 5
5 10
10 20
20 34
 6
29 35
35 15
15 5
5 10
10 20
20 7

9125
 1350
 16125
 2700
 2660
 15625
 10875
 10625
 3060
 10415

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>
#include <math.h>
#define INF 2000000

int n,p[301],m[301][301];

void matrixChainOrder(){
  int i,j,k,l,q;
  for(i=1;i<=n;i++)m[i][i]=0;
  for(l=2;l<=n;l++)
    for(i=1;i<=n;i++){
      j=i+l-1;
      m[i][j]=INF;
      for(k=i;k<=j;k++){
	q=m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
	m[i][j]=fmin(m[i][j],q);
      }
    }
}

int main(){
  int i;
  scanf("%d",&n);
  for(i=1;i<=n;i++)scanf("%d %d",&p[i-1],&p[i]);
  matrixChainOrder();
  printf("%d\n",m[1][n]);
  return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 1204
p:
	.zero	1204
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 362404
m:
	.zero	362404
	.text
	.globl	matrixChainOrder
	.type	matrixChainOrder, @function
matrixChainOrder:
.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
	movl	$1, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	$1208, %rax, %rax
	leaq	m(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$2, -12(%rbp)
	jmp	.L4
.L9:
	movl	$1, -20(%rbp)
	jmp	.L5
.L8:
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	$2000000, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$301, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %esi
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%eax, %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$301, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	m(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	addl	$1, -20(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L8
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	matrixChainOrder, .-matrixChainOrder
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$0, %eax
	call	matrixChainOrder
	movl	n(%rip), %eax
	cltq
	addq	$301, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 1204
p:
	.zero	1204
	.globl	m
	.align 32
	.type	m, @object
	.size	m, 362404
m:
	.zero	362404
	.text
	.globl	matrixChainOrder
	.type	matrixChainOrder, @function
matrixChainOrder:
.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
	movl	$1, -20(%rbp)
	jmp	.L2
.L3:
	movl	-20(%rbp), %eax
	cltq
	imulq	$1208, %rax, %rax
	leaq	m(%rip), %rdx
	movl	$0, (%rax,%rdx)
	addl	$1, -20(%rbp)
.L2:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L3
	movl	$2, -12(%rbp)
	jmp	.L4
.L9:
	movl	$1, -20(%rbp)
	jmp	.L5
.L8:
	movl	-20(%rbp), %edx
	movl	-12(%rbp), %eax
	addl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	$2000000, (%rdx,%rax)
	movl	-20(%rbp), %eax
	movl	%eax, -16(%rbp)
	jmp	.L6
.L7:
	movl	-16(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %eax
	leal	1(%rax), %edx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movslq	%edx, %rax
	imulq	$301, %rax, %rax
	addq	%rsi, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	leal	(%rcx,%rax), %esi
	movl	-20(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	movl	(%rdx,%rax), %edx
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%eax, %edx
	movl	-8(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	movl	(%rcx,%rax), %eax
	imull	%edx, %eax
	addl	%esi, %eax
	movl	%eax, -4(%rbp)
	pxor	%xmm0, %xmm0
	cvtsi2sdl	-4(%rbp), %xmm0
	movl	-8(%rbp), %eax
	movslq	%eax, %rdx
	movl	-20(%rbp), %eax
	cltq
	imulq	$301, %rax, %rax
	addq	%rdx, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	pxor	%xmm2, %xmm2
	cvtsi2sdl	%eax, %xmm2
	movq	%xmm2, %rax
	movapd	%xmm0, %xmm1
	movq	%rax, %xmm0
	call	fmin@PLT
	cvttsd2sil	%xmm0, %eax
	movl	-8(%rbp), %edx
	movslq	%edx, %rcx
	movl	-20(%rbp), %edx
	movslq	%edx, %rdx
	imulq	$301, %rdx, %rdx
	addq	%rcx, %rdx
	leaq	0(,%rdx,4), %rcx
	leaq	m(%rip), %rdx
	movl	%eax, (%rcx,%rdx)
	addl	$1, -16(%rbp)
.L6:
	movl	-16(%rbp), %eax
	cmpl	-8(%rbp), %eax
	jle	.L7
	addl	$1, -20(%rbp)
.L5:
	movl	n(%rip), %eax
	cmpl	%eax, -20(%rbp)
	jle	.L8
	addl	$1, -12(%rbp)
.L4:
	movl	n(%rip), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L9
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	matrixChainOrder, .-matrixChainOrder
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %d"
.LC2:
	.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	$16, %rsp
	leaq	n(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -4(%rbp)
	jmp	.L11
.L12:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	p(%rip), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	subl	$1, %eax
	cltq
	leaq	0(,%rax,4), %rcx
	leaq	p(%rip), %rax
	addq	%rcx, %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -4(%rbp)
.L11:
	movl	n(%rip), %eax
	cmpl	%eax, -4(%rbp)
	jle	.L12
	movl	$0, %eax
	call	matrixChainOrder
	movl	n(%rip), %eax
	cltq
	addq	$301, %rax
	leaq	0(,%rax,4), %rdx
	leaq	m(%rip), %rax
	movl	(%rdx,%rax), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	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:
