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>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n,m,x;scanf("%d%d%d",&n,&m,&x);
   int a[101];
   for(int i = 0;i < m;i++){
      scanf("%d",&a[i]);
   }
   int c1=0,c2=0;
   for(int i = 0;i < m;i++){
      if(a[i]<x)c1++;
      else c2++;
   }
   //printf("%d,%d\n",c1,c2);
   printf("%d",MIN(c1,c2));
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leal	-1(%rax), %edx
	movl	12(%rsp), %edi
	cmpl	$3, %edx
	jbe	.L19
	movl	%eax, %edx
	movd	%edi, %xmm5
	pxor	%xmm2, %xmm2
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm5, %xmm4
	movdqa	%xmm2, %xmm1
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rdx
.L5:
	movdqa	%xmm4, %xmm0
	pcmpgtd	(%r12), %xmm0
	movq	%rdx, %r12
	psubd	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L27
	movdqa	%xmm2, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L7
.L4:
	movslq	%esi, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jg	.L28
	addl	$1, %ecx
.L10:
	leal	1(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L11
	addl	$1, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L13
	addl	$1, %edx
.L14:
	addl	$3, %esi
	cmpl	%esi, %eax
	jle	.L7
	movslq	%esi, %rsi
	cmpl	16(%rsp,%rsi,4), %edi
	jg	.L15
	addl	$1, %ecx
.L7:
	cmpl	%ecx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	cmovg	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$440, %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
.L28:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L10
.L11:
	addl	$1, %ecx
	jmp	.L12
.L13:
	addl	$1, %ecx
	jmp	.L14
.L15:
	addl	$1, %edx
	jmp	.L7
.L2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L19:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	inf
	.section	.rodata
	.align 4
	.type	inf, @object
	.size	inf, 4
inf:
	.long	1000000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leal	-1(%rax), %edx
	movl	12(%rsp), %edi
	cmpl	$3, %edx
	jbe	.L19
	movl	%eax, %edx
	movd	%edi, %xmm5
	pxor	%xmm2, %xmm2
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm5, %xmm4
	movdqa	%xmm2, %xmm1
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rdx
.L5:
	movdqa	%xmm4, %xmm0
	pcmpgtd	(%r12), %xmm0
	movq	%rdx, %r12
	psubd	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L27
	movdqa	%xmm2, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L7
.L4:
	movslq	%esi, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jg	.L28
	addl	$1, %ecx
.L10:
	leal	1(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L11
	addl	$1, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L13
	addl	$1, %edx
.L14:
	addl	$3, %esi
	cmpl	%esi, %eax
	jle	.L7
	movslq	%esi, %rsi
	cmpl	16(%rsp,%rsi,4), %edi
	jg	.L15
	addl	$1, %ecx
.L7:
	cmpl	%ecx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	cmovg	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$440, %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
.L28:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L10
.L11:
	addl	$1, %ecx
	jmp	.L12
.L13:
	addl	$1, %ecx
	jmp	.L14
.L15:
	addl	$1, %edx
	jmp	.L7
.L2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L19:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	inf
	.section	.rodata
	.align 4
	.type	inf, @object
	.size	inf, 4
inf:
	.long	1000000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leal	-1(%rax), %edx
	movl	12(%rsp), %edi
	cmpl	$3, %edx
	jbe	.L19
	movl	%eax, %edx
	movd	%edi, %xmm5
	pxor	%xmm2, %xmm2
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm5, %xmm4
	movdqa	%xmm2, %xmm1
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rdx
.L5:
	movdqa	%xmm4, %xmm0
	pcmpgtd	(%r12), %xmm0
	movq	%rdx, %r12
	psubd	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L27
	movdqa	%xmm2, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L7
.L4:
	movslq	%esi, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jg	.L28
	addl	$1, %ecx
.L10:
	leal	1(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L11
	addl	$1, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L13
	addl	$1, %edx
.L14:
	addl	$3, %esi
	cmpl	%esi, %eax
	jle	.L7
	movslq	%esi, %rsi
	cmpl	16(%rsp,%rsi,4), %edi
	jg	.L15
	addl	$1, %ecx
.L7:
	cmpl	%ecx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	cmovg	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$440, %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
.L28:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L10
.L11:
	addl	$1, %ecx
	jmp	.L12
.L13:
	addl	$1, %ecx
	jmp	.L14
.L15:
	addl	$1, %edx
	jmp	.L7
.L2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L19:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	inf
	.section	.rodata
	.align 4
	.type	inf, @object
	.size	inf, 4
inf:
	.long	1000000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n,m,x;scanf("%d%d%d",&n,&m,&x);
   int a[101];
   for(int i = 0;i < m;i++){
      scanf("%d",&a[i]);
   }
   int c1=0,c2=0;
   for(int i = 0;i < m;i++){
      if(a[i]<x)c1++;
      else c2++;
   }
   //printf("%d,%d\n",c1,c2);
   printf("%d",MIN(c1,c2));
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n,m,x;scanf("%d%d%d",&n,&m,&x);
   int a[101];
   for(int i = 0;i < m;i++){
      scanf("%d",&a[i]);
   }
   int c1=0,c2=0;
   for(int i = 0;i < m;i++){
      if(a[i]<x)c1++;
      else c2++;
   }
   //printf("%d,%d\n",c1,c2);
   printf("%d",MIN(c1,c2));
}```

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:

5 3 3
1 2 4

1
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>
#include <stdlib.h>
#include <string.h>

#define MAX(a,b) (a > b ? a : b)
#define MIN(a,b) (a < b ? a : b)
const int inf = 1000000000; // 10^9

int main(){
   int n,m,x;scanf("%d%d%d",&n,&m,&x);
   int a[101];
   for(int i = 0;i < m;i++){
      scanf("%d",&a[i]);
   }
   int c1=0,c2=0;
   for(int i = 0;i < m;i++){
      if(a[i]<x)c1++;
      else c2++;
   }
   //printf("%d,%d\n",c1,c2);
   printf("%d",MIN(c1,c2));
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d%d%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leal	-1(%rax), %edx
	movl	12(%rsp), %edi
	cmpl	$3, %edx
	jbe	.L19
	movl	%eax, %edx
	movd	%edi, %xmm5
	pxor	%xmm2, %xmm2
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm5, %xmm4
	movdqa	%xmm2, %xmm1
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rdx
.L5:
	movdqa	%xmm4, %xmm0
	pcmpgtd	(%r12), %xmm0
	movq	%rdx, %r12
	psubd	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L27
	movdqa	%xmm2, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L7
.L4:
	movslq	%esi, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jg	.L28
	addl	$1, %ecx
.L10:
	leal	1(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L11
	addl	$1, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L13
	addl	$1, %edx
.L14:
	addl	$3, %esi
	cmpl	%esi, %eax
	jle	.L7
	movslq	%esi, %rsi
	cmpl	16(%rsp,%rsi,4), %edi
	jg	.L15
	addl	$1, %ecx
.L7:
	cmpl	%ecx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	cmovg	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$440, %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
.L28:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L10
.L11:
	addl	$1, %ecx
	jmp	.L12
.L13:
	addl	$1, %ecx
	jmp	.L14
.L15:
	addl	$1, %edx
	jmp	.L7
.L2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L19:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	inf
	.section	.rodata
	.align 4
	.type	inf, @object
	.size	inf, 4
inf:
	.long	1000000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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%d"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$440, %rsp
	.cfi_def_cfa_offset 480
	movq	%fs:40, %rax
	movq	%rax, 424(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %rcx
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	16(%rsp), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	8(%rsp), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L2
	leal	-1(%rax), %edx
	movl	12(%rsp), %edi
	cmpl	$3, %edx
	jbe	.L19
	movl	%eax, %edx
	movd	%edi, %xmm5
	pxor	%xmm2, %xmm2
	movdqa	.LC2(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm5, %xmm4
	movdqa	%xmm2, %xmm1
	leal	-1(%rdx), %ecx
	leaq	16(%r12), %rdx
	salq	$4, %rcx
	addq	%rdx, %rcx
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rdx
.L5:
	movdqa	%xmm4, %xmm0
	pcmpgtd	(%r12), %xmm0
	movq	%rdx, %r12
	psubd	%xmm0, %xmm1
	pandn	%xmm3, %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rdx, %rcx
	jne	.L27
	movdqa	%xmm2, %xmm0
	movl	%eax, %esi
	psrldq	$8, %xmm0
	andl	$-4, %esi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movdqa	%xmm1, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm2, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L7
.L4:
	movslq	%esi, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jg	.L28
	addl	$1, %ecx
.L10:
	leal	1(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L11
	addl	$1, %edx
.L12:
	leal	2(%rsi), %r8d
	cmpl	%r8d, %eax
	jle	.L7
	movslq	%r8d, %r8
	cmpl	16(%rsp,%r8,4), %edi
	jle	.L13
	addl	$1, %edx
.L14:
	addl	$3, %esi
	cmpl	%esi, %eax
	jle	.L7
	movslq	%esi, %rsi
	cmpl	16(%rsp,%rsi,4), %edi
	jg	.L15
	addl	$1, %ecx
.L7:
	cmpl	%ecx, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	cmovg	%ecx, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movq	424(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$440, %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
.L28:
	.cfi_restore_state
	addl	$1, %edx
	jmp	.L10
.L11:
	addl	$1, %ecx
	jmp	.L12
.L13:
	addl	$1, %ecx
	jmp	.L14
.L15:
	addl	$1, %edx
	jmp	.L7
.L2:
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L7
.L19:
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%edx, %edx
	jmp	.L4
.L29:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.size	main, .-main
	.globl	inf
	.section	.rodata
	.align 4
	.type	inf, @object
	.size	inf, 4
inf:
	.long	1000000000
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC2:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:
```