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 n;
  long tt,t,pt,cnt=0;
  scanf("%d %ld",&n,&tt);
  scanf("%ld",&pt);
  cnt+=tt;
  for(int i=1;i<n;i++){
    scanf("%ld",&t);
    cnt+=tt;
    if(t-pt<tt)
      cnt-=tt-(t-pt);
    pt=t;
  }
  printf("%ld\n",cnt);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movl	$1, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	-24(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L3
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rcx
	subq	%rcx, %rdx
	subq	%rdx, %rax
	subq	%rax, -16(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L4
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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 %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 12(%rsp)
	movq	16(%rsp), %r12
	jle	.L2
	movl	$1, %ebx
	leaq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movq	16(%rsp), %rcx
	movq	%rax, %rdx
	subq	32(%rsp), %rdx
	leaq	(%r12,%rcx), %rsi
	movq	%rax, 32(%rsp)
	addq	%rdx, %r12
	cmpq	%rdx, %rcx
	cmovle	%rsi, %r12
	addl	$1, %ebx
	cmpl	%ebx, 12(%rsp)
	jg	.L5
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$56, %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 %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$56, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rdx
	leaq	12(%rsp), %rsi
	call	__isoc99_scanf@PLT
	xorl	%eax, %eax
	leaq	32(%rsp), %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, 12(%rsp)
	movq	16(%rsp), %r12
	jle	.L2
	movl	$1, %ebx
	leaq	24(%rsp), %r13
	.p2align 4,,10
	.p2align 3
.L5:
	movq	%r13, %rsi
	xorl	%eax, %eax
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movq	24(%rsp), %rax
	movq	16(%rsp), %rcx
	movq	%rax, %rdx
	subq	32(%rsp), %rdx
	leaq	(%r12,%rcx), %rsi
	movq	%rax, 32(%rsp)
	addq	%rdx, %r12
	cmpq	%rdx, %rcx
	cmovle	%rsi, %r12
	addl	$1, %ebx
	cmpl	%ebx, 12(%rsp)
	jg	.L5
.L2:
	xorl	%eax, %eax
	movq	%r12, %rdx
	movl	$1, %edi
	leaq	.LC2(%rip), %rsi
	call	__printf_chk@PLT
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L10
	addq	$56, %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 n;
  long tt,t,pt,cnt=0;
  scanf("%d %ld",&n,&tt);
  scanf("%ld",&pt);
  cnt+=tt;
  for(int i=1;i<n;i++){
    scanf("%ld",&t);
    cnt+=tt;
    if(t-pt<tt)
      cnt-=tt-(t-pt);
    pt=t;
  }
  printf("%ld\n",cnt);
}
2 4
0 2
 1 0
0
 2 4
0 4
 4 1000000000
0 1100 1000000 1000000000
 4 1000000000
0 1100 1000000 1010000000
 9 10
0 3 5 7 100 110 200 272 311
 4 1000010000
0 1000 1000000 1000000000
 4 1000000000
0 1100 1100000 1010000000
 9 10
0 3 5 7 000 110 200 272 311
 4 1000010001
0 1000 1000000 1000000000

6
 0
 8
 2000000000
 2001000000
 67
 2000010000
 2001100000
 50
 2000010001

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 n;
  long tt,t,pt,cnt=0;
  scanf("%d %ld",&n,&tt);
  scanf("%ld",&pt);
  cnt+=tt;
  for(int i=1;i<n;i++){
    scanf("%ld",&t);
    cnt+=tt;
    if(t-pt<tt)
      cnt-=tt-(t-pt);
    pt=t;
  }
  printf("%ld\n",cnt);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movl	$1, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	-24(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L3
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rcx
	subq	%rcx, %rdx
	subq	%rdx, %rax
	subq	%rax, -16(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L4
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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 %ld"
.LC1:
	.string	"%ld"
.LC2:
	.string	"%ld\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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movq	$0, -16(%rbp)
	leaq	-40(%rbp), %rdx
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movl	$1, -44(%rbp)
	jmp	.L2
.L4:
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movq	-40(%rbp), %rax
	addq	%rax, -16(%rbp)
	movq	-32(%rbp), %rax
	movq	-24(%rbp), %rcx
	subq	%rcx, %rax
	movq	%rax, %rdx
	movq	-40(%rbp), %rax
	cmpq	%rax, %rdx
	jge	.L3
	movq	-40(%rbp), %rax
	movq	-32(%rbp), %rdx
	movq	-24(%rbp), %rcx
	subq	%rcx, %rdx
	subq	%rdx, %rax
	subq	%rax, -16(%rbp)
.L3:
	movq	-32(%rbp), %rax
	movq	%rax, -24(%rbp)
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L4
	movq	-16(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	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:
