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>
int min(int x,int y){
    if(x<y) return x;
    else return y;
}
int main(void){
    int n,k,i,ans=0;
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        int tmp=min(a[i],k-a[i]);
        ans+=tmp;
    }
    printf("%d",ans*2);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%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	.L5
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L24
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L6:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L7
	movq	%r14, %r13
	movq	%r14, %r12
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	movl	-60(%rbp), %esi
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %eax
	movd	%esi, %xmm5
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm4
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	0(%r13), %xmm1
	movdqa	%xmm4, %xmm3
	addq	$16, %r13
	psubd	%xmm1, %xmm3
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %r13
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %cl
	je	.L12
.L9:
	movslq	%eax, %rdi
	leaq	(%r14,%rdi,4), %r9
	movl	%esi, %edi
	movl	(%r9), %r8d
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	%edi, %edx
	leal	1(%rax), %edi
	cmpl	%edi, %ecx
	jle	.L12
	movl	4(%r9), %r8d
	movl	%esi, %edi
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	$2, %eax
	addl	%edi, %edx
	cmpl	%eax, %ecx
	jle	.L12
	movl	8(%r9), %eax
	subl	%eax, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	addl	%esi, %edx
.L12:
	addl	%edx, %edx
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L7:
	xorl	%edx, %edx
	jmp	.L12
.L15:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%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	.L5
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L24
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L6:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L7
	movq	%r14, %r13
	movq	%r14, %r12
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	movl	-60(%rbp), %esi
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %eax
	movd	%esi, %xmm5
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm4
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	0(%r13), %xmm1
	movdqa	%xmm4, %xmm3
	addq	$16, %r13
	psubd	%xmm1, %xmm3
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %r13
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %cl
	je	.L12
.L9:
	movslq	%eax, %rdi
	leaq	(%r14,%rdi,4), %r9
	movl	%esi, %edi
	movl	(%r9), %r8d
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	%edi, %edx
	leal	1(%rax), %edi
	cmpl	%edi, %ecx
	jle	.L12
	movl	4(%r9), %r8d
	movl	%esi, %edi
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	$2, %eax
	addl	%edi, %edx
	cmpl	%eax, %ecx
	jle	.L12
	movl	8(%r9), %eax
	subl	%eax, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	addl	%esi, %edx
.L12:
	addl	%edx, %edx
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L7:
	xorl	%edx, %edx
	jmp	.L12
.L15:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%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	.L5
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L24
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L6:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L7
	movq	%r14, %r13
	movq	%r14, %r12
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	movl	-60(%rbp), %esi
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %eax
	movd	%esi, %xmm5
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm4
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	0(%r13), %xmm1
	movdqa	%xmm4, %xmm3
	addq	$16, %r13
	psubd	%xmm1, %xmm3
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %r13
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %cl
	je	.L12
.L9:
	movslq	%eax, %rdi
	leaq	(%r14,%rdi,4), %r9
	movl	%esi, %edi
	movl	(%r9), %r8d
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	%edi, %edx
	leal	1(%rax), %edi
	cmpl	%edi, %ecx
	jle	.L12
	movl	4(%r9), %r8d
	movl	%esi, %edi
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	$2, %eax
	addl	%edi, %edx
	cmpl	%eax, %ecx
	jle	.L12
	movl	8(%r9), %eax
	subl	%eax, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	addl	%esi, %edx
.L12:
	addl	%edx, %edx
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L7:
	xorl	%edx, %edx
	jmp	.L12
.L15:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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>
int min(int x,int y){
    if(x<y) return x;
    else return y;
}
int main(void){
    int n,k,i,ans=0;
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        int tmp=min(a[i],k-a[i]);
        ans+=tmp;
    }
    printf("%d",ans*2);
    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
int min(int x,int y){
    if(x<y) return x;
    else return y;
}
int main(void){
    int n,k,i,ans=0;
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        int tmp=min(a[i],k-a[i]);
        ans+=tmp;
    }
    printf("%d",ans*2);
    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:

1
18
2
 2
9
2 6
 5
20
11 12 9 17 15
 1
23
1
 1
23
0
 1
25
-1
 1
10
3
 5
20
11 12 9 17 1
 2
9
1 6
 5
20
8 12 9 17 15

4 10 68 2 0 -2 6 60 8 66
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>
int min(int x,int y){
    if(x<y) return x;
    else return y;
}
int main(void){
    int n,k,i,ans=0;
    scanf("%d%d",&n,&k);
    int a[n];
    for(i=0;i<n;i++) scanf("%d",&a[i]);
    for(i=0;i<n;i++){
        int tmp=min(a[i],k-a[i]);
        ans+=tmp;
    }
    printf("%d",ans*2);
    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%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	.L5
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L24
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L6:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L7
	movq	%r14, %r13
	movq	%r14, %r12
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	movl	-60(%rbp), %esi
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %eax
	movd	%esi, %xmm5
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm4
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	0(%r13), %xmm1
	movdqa	%xmm4, %xmm3
	addq	$16, %r13
	psubd	%xmm1, %xmm3
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %r13
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %cl
	je	.L12
.L9:
	movslq	%eax, %rdi
	leaq	(%r14,%rdi,4), %r9
	movl	%esi, %edi
	movl	(%r9), %r8d
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	%edi, %edx
	leal	1(%rax), %edi
	cmpl	%edi, %ecx
	jle	.L12
	movl	4(%r9), %r8d
	movl	%esi, %edi
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	$2, %eax
	addl	%edi, %edx
	cmpl	%eax, %ecx
	jle	.L12
	movl	8(%r9), %eax
	subl	%eax, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	addl	%esi, %edx
.L12:
	addl	%edx, %edx
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L7:
	xorl	%edx, %edx
	jmp	.L12
.L15:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB24:
	.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	%r15
	pushq	%r14
	leaq	-60(%rbp), %rdx
	leaq	-64(%rbp), %rsi
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	movq	%fs:40, %rax
	movq	%rax, -56(%rbp)
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	-64(%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	.L5
.L24:
	subq	$4096, %rsp
	orq	$0, 4088(%rsp)
	cmpq	%rsi, %rsp
	jne	.L24
.L5:
	andl	$4095, %edx
	subq	%rdx, %rsp
	testq	%rdx, %rdx
	jne	.L25
.L6:
	movq	%rsp, %r14
	leaq	.LC1(%rip), %r15
	testl	%ecx, %ecx
	jle	.L7
	movq	%r14, %r13
	movq	%r14, %r12
	leaq	.LC1(%rip), %r15
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L8:
	movq	%r12, %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	-64(%rbp), %ecx
	addq	$4, %r12
	cmpl	%ebx, %ecx
	jg	.L8
	testl	%ecx, %ecx
	jle	.L7
	leal	-1(%rcx), %eax
	movl	-60(%rbp), %esi
	cmpl	$2, %eax
	jbe	.L15
	movl	%ecx, %eax
	movd	%esi, %xmm5
	pxor	%xmm2, %xmm2
	shrl	$2, %eax
	pshufd	$0, %xmm5, %xmm4
	salq	$4, %rax
	addq	%r14, %rax
	.p2align 4,,10
	.p2align 3
.L10:
	movdqu	0(%r13), %xmm1
	movdqa	%xmm4, %xmm3
	addq	$16, %r13
	psubd	%xmm1, %xmm3
	movdqa	%xmm3, %xmm0
	pcmpgtd	%xmm1, %xmm0
	pand	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	por	%xmm1, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %r13
	jne	.L10
	movdqa	%xmm2, %xmm0
	movl	%ecx, %eax
	psrldq	$8, %xmm0
	andl	$-4, %eax
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %edx
	testb	$3, %cl
	je	.L12
.L9:
	movslq	%eax, %rdi
	leaq	(%r14,%rdi,4), %r9
	movl	%esi, %edi
	movl	(%r9), %r8d
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	%edi, %edx
	leal	1(%rax), %edi
	cmpl	%edi, %ecx
	jle	.L12
	movl	4(%r9), %r8d
	movl	%esi, %edi
	subl	%r8d, %edi
	cmpl	%r8d, %edi
	cmovg	%r8d, %edi
	addl	$2, %eax
	addl	%edi, %edx
	cmpl	%eax, %ecx
	jle	.L12
	movl	8(%r9), %eax
	subl	%eax, %esi
	cmpl	%eax, %esi
	cmovg	%eax, %esi
	addl	%esi, %edx
.L12:
	addl	%edx, %edx
	xorl	%eax, %eax
	movq	%r15, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	-56(%rbp), %rax
	subq	%fs:40, %rax
	jne	.L26
	leaq	-40(%rbp), %rsp
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L25:
	.cfi_restore_state
	orq	$0, -8(%rsp,%rdx)
	jmp	.L6
.L7:
	xorl	%edx, %edx
	jmp	.L12
.L15:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L9
.L26:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE24:
	.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:
```