Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))

int main(void) {
	int N, T, X = 0;
	
	scanf("%d %d", &N, &T);
	
	int arr[N];
	
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
	}
	
	for (int i = 0; i < N - 1; i++) {
		X += MIN(T, (arr[i + 1] - arr[i]));
	}

	X += T;
	
	printf("%d\n", X);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-48(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	movq	%rsp, %r13
	testl	%ecx, %ecx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L6
.L5:
	leal	-1(%rcx), %r8d
	movl	-44(%rbp), %esi
	testl	%r8d, %r8d
	jle	.L15
	leal	-2(%rcx), %r9d
	cmpl	$2, %r9d
	jbe	.L16
	movl	%r8d, %edx
	movd	%esi, %xmm6
	pxor	%xmm2, %xmm2
	movq	%r13, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm3
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r13,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	4(%rax), %xmm1
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm4
	addq	$16, %rax
	psubd	%xmm5, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm4
	pandn	%xmm1, %xmm0
	por	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm2, %xmm0
	movl	%r8d, %edi
	psrldq	$8, %xmm0
	andl	$-4, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %r8b
	je	.L7
.L8:
	movslq	%edi, %r10
	leal	1(%rdi), %eax
	leaq	0(%r13,%r10,4), %r11
	cmpl	%r9d, %eax
	jge	.L12
	cmpl	$-2147483647, %ecx
	je	.L12
	leal	2(%rdi), %eax
	movl	(%r11), %r11d
	cltq
.L13:
	movl	-4(%r13,%rax,4), %r10d
	movl	%eax, %edi
	movl	%r10d, %ecx
	subl	%r11d, %ecx
	movl	0(%r13,%rax,4), %r11d
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%edx, %ecx
	movl	%r11d, %edx
	subl	%r10d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$2, %rax
	addl	%ecx, %edx
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r9d
	jg	.L13
	movslq	%edi, %r10
	leal	1(%rdi), %eax
.L12:
	leaq	0(%r13,%r10,4), %r9
	movl	4(%r9), %r10d
	movl	%r10d, %ecx
	subl	(%r9), %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%ecx, %edx
	cmpl	%eax, %r8d
	jle	.L7
	movl	8(%r9), %ecx
	movl	%ecx, %eax
	subl	%r10d, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	$2, %edi
	addl	%eax, %edx
	cmpl	%edi, %r8d
	jle	.L7
	movl	12(%r9), %eax
	subl	%ecx, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %edx
.L7:
	addl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L33:
	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:
```

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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-48(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	movq	%rsp, %r13
	testl	%ecx, %ecx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L6
.L5:
	leal	-1(%rcx), %r8d
	movl	-44(%rbp), %esi
	testl	%r8d, %r8d
	jle	.L15
	leal	-2(%rcx), %r9d
	cmpl	$2, %r9d
	jbe	.L16
	movl	%r8d, %edx
	movd	%esi, %xmm6
	pxor	%xmm2, %xmm2
	movq	%r13, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm3
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r13,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	4(%rax), %xmm1
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm4
	addq	$16, %rax
	psubd	%xmm5, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm4
	pandn	%xmm1, %xmm0
	por	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm2, %xmm0
	movl	%r8d, %edi
	psrldq	$8, %xmm0
	andl	$-4, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %r8b
	je	.L7
.L8:
	movslq	%edi, %r10
	leal	1(%rdi), %eax
	leaq	0(%r13,%r10,4), %r11
	cmpl	%r9d, %eax
	jge	.L12
	cmpl	$-2147483647, %ecx
	je	.L12
	leal	2(%rdi), %eax
	movl	(%r11), %r11d
	cltq
.L13:
	movl	-4(%r13,%rax,4), %r10d
	movl	%eax, %edi
	movl	%r10d, %ecx
	subl	%r11d, %ecx
	movl	0(%r13,%rax,4), %r11d
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%edx, %ecx
	movl	%r11d, %edx
	subl	%r10d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$2, %rax
	addl	%ecx, %edx
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r9d
	jg	.L13
	movslq	%edi, %r10
	leal	1(%rdi), %eax
.L12:
	leaq	0(%r13,%r10,4), %r9
	movl	4(%r9), %r10d
	movl	%r10d, %ecx
	subl	(%r9), %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%ecx, %edx
	cmpl	%eax, %r8d
	jle	.L7
	movl	8(%r9), %ecx
	movl	%ecx, %eax
	subl	%r10d, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	$2, %edi
	addl	%eax, %edx
	cmpl	%edi, %r8d
	jle	.L7
	movl	12(%r9), %eax
	subl	%ecx, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %edx
.L7:
	addl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L33:
	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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-48(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	movq	%rsp, %r13
	testl	%ecx, %ecx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L6
.L5:
	leal	-1(%rcx), %r8d
	movl	-44(%rbp), %esi
	testl	%r8d, %r8d
	jle	.L15
	leal	-2(%rcx), %r9d
	cmpl	$2, %r9d
	jbe	.L16
	movl	%r8d, %edx
	movd	%esi, %xmm6
	pxor	%xmm2, %xmm2
	movq	%r13, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm3
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r13,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	4(%rax), %xmm1
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm4
	addq	$16, %rax
	psubd	%xmm5, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm4
	pandn	%xmm1, %xmm0
	por	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm2, %xmm0
	movl	%r8d, %edi
	psrldq	$8, %xmm0
	andl	$-4, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %r8b
	je	.L7
.L8:
	movslq	%edi, %r10
	leal	1(%rdi), %eax
	leaq	0(%r13,%r10,4), %r11
	cmpl	%r9d, %eax
	jge	.L12
	cmpl	$-2147483647, %ecx
	je	.L12
	leal	2(%rdi), %eax
	movl	(%r11), %r11d
	cltq
.L13:
	movl	-4(%r13,%rax,4), %r10d
	movl	%eax, %edi
	movl	%r10d, %ecx
	subl	%r11d, %ecx
	movl	0(%r13,%rax,4), %r11d
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%edx, %ecx
	movl	%r11d, %edx
	subl	%r10d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$2, %rax
	addl	%ecx, %edx
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r9d
	jg	.L13
	movslq	%edi, %r10
	leal	1(%rdi), %eax
.L12:
	leaq	0(%r13,%r10,4), %r9
	movl	4(%r9), %r10d
	movl	%r10d, %ecx
	subl	(%r9), %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%ecx, %edx
	cmpl	%eax, %r8d
	jle	.L7
	movl	8(%r9), %ecx
	movl	%ecx, %eax
	subl	%r10d, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	$2, %edi
	addl	%eax, %edx
	cmpl	%edi, %r8d
	jle	.L7
	movl	12(%r9), %eax
	subl	%ecx, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %edx
.L7:
	addl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L33:
	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:
```
```c
#include <stdio.h>

#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))

int main(void) {
	int N, T, X = 0;
	
	scanf("%d %d", &N, &T);
	
	int arr[N];
	
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
	}
	
	for (int i = 0; i < N - 1; i++) {
		X += MIN(T, (arr[i + 1] - arr[i]));
	}

	X += T;
	
	printf("%d\n", X);
	return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))

int main(void) {
	int N, T, X = 0;
	
	scanf("%d %d", &N, &T);
	
	int arr[N];
	
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
	}
	
	for (int i = 0; i < N - 1; i++) {
		X += MIN(T, (arr[i + 1] - arr[i]));
	}

	X += T;
	
	printf("%d\n", X);
	return 0;
}```

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.
Optimized Assembly Code:

2 4
0 3

7

Given the following C code and assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

#define MIN(X, Y) (((X) < (Y)) ? (X) : (Y))

int main(void) {
	int N, T, X = 0;
	
	scanf("%d %d", &N, &T);
	
	int arr[N];
	
	for (int i = 0; i < N; i++) {
		scanf("%d", &arr[i]);
	}
	
	for (int i = 0; i < N - 1; i++) {
		X += MIN(T, (arr[i + 1] - arr[i]));
	}

	X += T;
	
	printf("%d\n", X);
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-48(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	movq	%rsp, %r13
	testl	%ecx, %ecx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L6
.L5:
	leal	-1(%rcx), %r8d
	movl	-44(%rbp), %esi
	testl	%r8d, %r8d
	jle	.L15
	leal	-2(%rcx), %r9d
	cmpl	$2, %r9d
	jbe	.L16
	movl	%r8d, %edx
	movd	%esi, %xmm6
	pxor	%xmm2, %xmm2
	movq	%r13, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm3
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r13,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	4(%rax), %xmm1
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm4
	addq	$16, %rax
	psubd	%xmm5, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm4
	pandn	%xmm1, %xmm0
	por	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm2, %xmm0
	movl	%r8d, %edi
	psrldq	$8, %xmm0
	andl	$-4, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %r8b
	je	.L7
.L8:
	movslq	%edi, %r10
	leal	1(%rdi), %eax
	leaq	0(%r13,%r10,4), %r11
	cmpl	%r9d, %eax
	jge	.L12
	cmpl	$-2147483647, %ecx
	je	.L12
	leal	2(%rdi), %eax
	movl	(%r11), %r11d
	cltq
.L13:
	movl	-4(%r13,%rax,4), %r10d
	movl	%eax, %edi
	movl	%r10d, %ecx
	subl	%r11d, %ecx
	movl	0(%r13,%rax,4), %r11d
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%edx, %ecx
	movl	%r11d, %edx
	subl	%r10d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$2, %rax
	addl	%ecx, %edx
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r9d
	jg	.L13
	movslq	%edi, %r10
	leal	1(%rdi), %eax
.L12:
	leaq	0(%r13,%r10,4), %r9
	movl	4(%r9), %r10d
	movl	%r10d, %ecx
	subl	(%r9), %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%ecx, %edx
	cmpl	%eax, %r8d
	jle	.L7
	movl	8(%r9), %ecx
	movl	%ecx, %eax
	subl	%r10d, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	$2, %edi
	addl	%eax, %edx
	cmpl	%edi, %r8d
	jle	.L7
	movl	12(%r9), %eax
	subl	%ecx, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %edx
.L7:
	addl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L33:
	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:
```

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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rdi
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	pushq	%r14
	pushq	%r13
	leaq	-44(%rbp), %rdx
	leaq	-48(%rbp), %rsi
	pushq	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset 14, -24
	.cfi_offset 13, -32
	.cfi_offset 12, -40
	.cfi_offset 3, -48
	movq	%fs:40, %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-48(%rbp), %rax
	movq	%rsp, %rsi
	movq	%rax, %rcx
	leaq	15(,%rax,4), %rax
	movq	%rax, %rdx
	andq	$-4096, %rax
	subq	%rax, %rsi
	andq	$-16, %rdx
	cmpq	%rsi, %rsp
	je	.L3
.L31:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L31
.L3:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L32
.L4:
	movq	%rsp, %r13
	testl	%ecx, %ecx
	jle	.L5
	movq	%r13, %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r12, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-48(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L6
.L5:
	leal	-1(%rcx), %r8d
	movl	-44(%rbp), %esi
	testl	%r8d, %r8d
	jle	.L15
	leal	-2(%rcx), %r9d
	cmpl	$2, %r9d
	jbe	.L16
	movl	%r8d, %edx
	movd	%esi, %xmm6
	pxor	%xmm2, %xmm2
	movq	%r13, %rax
	shrl	$2, %edx
	pshufd	$0, %xmm6, %xmm3
	subl	$1, %edx
	salq	$4, %rdx
	leaq	16(%r13,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L9:
	movdqu	4(%rax), %xmm1
	movdqu	(%rax), %xmm5
	movdqa	%xmm3, %xmm4
	addq	$16, %rax
	psubd	%xmm5, %xmm1
	movdqa	%xmm1, %xmm0
	pcmpgtd	%xmm3, %xmm0
	pand	%xmm0, %xmm4
	pandn	%xmm1, %xmm0
	por	%xmm4, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rax
	jne	.L9
	movdqa	%xmm2, %xmm0
	movl	%r8d, %edi
	psrldq	$8, %xmm0
	andl	$-4, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %r8b
	je	.L7
.L8:
	movslq	%edi, %r10
	leal	1(%rdi), %eax
	leaq	0(%r13,%r10,4), %r11
	cmpl	%r9d, %eax
	jge	.L12
	cmpl	$-2147483647, %ecx
	je	.L12
	leal	2(%rdi), %eax
	movl	(%r11), %r11d
	cltq
.L13:
	movl	-4(%r13,%rax,4), %r10d
	movl	%eax, %edi
	movl	%r10d, %ecx
	subl	%r11d, %ecx
	movl	0(%r13,%rax,4), %r11d
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%edx, %ecx
	movl	%r11d, %edx
	subl	%r10d, %edx
	cmpl	%esi, %edx
	cmovg	%esi, %edx
	addq	$2, %rax
	addl	%ecx, %edx
	leal	-1(%rax), %ecx
	cmpl	%ecx, %r9d
	jg	.L13
	movslq	%edi, %r10
	leal	1(%rdi), %eax
.L12:
	leaq	0(%r13,%r10,4), %r9
	movl	4(%r9), %r10d
	movl	%r10d, %ecx
	subl	(%r9), %ecx
	cmpl	%esi, %ecx
	cmovg	%esi, %ecx
	addl	%ecx, %edx
	cmpl	%eax, %r8d
	jle	.L7
	movl	8(%r9), %ecx
	movl	%ecx, %eax
	subl	%r10d, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	$2, %edi
	addl	%eax, %edx
	cmpl	%edi, %r8d
	jle	.L7
	movl	12(%r9), %eax
	subl	%ecx, %eax
	cmpl	%esi, %eax
	cmovg	%esi, %eax
	addl	%eax, %edx
.L7:
	addl	%esi, %edx
	xorl	%eax, %eax
	leaq	.LC2(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-40(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L33
	leaq	-32(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L32:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L4
.L15:
	xorl	%edx, %edx
	jmp	.L7
.L16:
	xorl	%edi, %edi
	xorl	%edx, %edx
	jmp	.L8
.L33:
	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:
```