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

```c
/*
  AOJ #2799
  title:Yamanote-line Game
  @kankichi573
 */
#include <stdio.h>
int N,p[1000],d;

int main()
{
  int i,ret;

  scanf("%d %d",&N,&d);
  for(i=0;i<N;i++)
    scanf("%d",&p[i]);
  for(i=0,ret=0;i<N;i++)
    if(p[i]>d)
      ret += (p[i]-d);
  if(ret==0)
    printf("kusoge\n");
  else
    printf("%d\n",ret);
  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	"kusoge"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	d(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	p(%rip), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L15
	leal	-1(%rax), %edx
	movl	d(%rip), %esi
	cmpl	$2, %edx
	jbe	.L16
	movl	%eax, %edx
	movd	%esi, %xmm4
	leaq	16+p(%rip), %rcx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%r12), %xmm0
	addq	$16, %r12
	movdqa	%xmm0, %xmm3
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm2, %xmm3
	pand	%xmm3, %xmm0
	paddd	%xmm0, %xmm1
	cmpq	%r12, %rdx
	jne	.L5
	movdqa	%xmm1, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jl	.L24
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jle	.L6
.L8:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jge	.L10
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L9
.L11:
	movslq	%ecx, %rcx
	movl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %esi
	jge	.L6
	subl	%esi, %eax
	addl	%eax, %edx
.L6:
	testl	%edx, %edx
	je	.L15
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L24:
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jg	.L8
	jmp	.L9
.L10:
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jg	.L11
	jmp	.L6
.L16:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 4000
p:
	.zero	4000
	.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:
```

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	"kusoge"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	d(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	p(%rip), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L15
	leal	-1(%rax), %edx
	movl	d(%rip), %esi
	cmpl	$2, %edx
	jbe	.L16
	movl	%eax, %edx
	movd	%esi, %xmm4
	leaq	16+p(%rip), %rcx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%r12), %xmm0
	addq	$16, %r12
	movdqa	%xmm0, %xmm3
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm2, %xmm3
	pand	%xmm3, %xmm0
	paddd	%xmm0, %xmm1
	cmpq	%r12, %rdx
	jne	.L5
	movdqa	%xmm1, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jl	.L24
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jle	.L6
.L8:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jge	.L10
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L9
.L11:
	movslq	%ecx, %rcx
	movl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %esi
	jge	.L6
	subl	%esi, %eax
	addl	%eax, %edx
.L6:
	testl	%edx, %edx
	je	.L15
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L24:
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jg	.L8
	jmp	.L9
.L10:
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jg	.L11
	jmp	.L6
.L16:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 4000
p:
	.zero	4000
	.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
```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"kusoge"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	d(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	p(%rip), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L15
	leal	-1(%rax), %edx
	movl	d(%rip), %esi
	cmpl	$2, %edx
	jbe	.L16
	movl	%eax, %edx
	movd	%esi, %xmm4
	leaq	16+p(%rip), %rcx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%r12), %xmm0
	addq	$16, %r12
	movdqa	%xmm0, %xmm3
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm2, %xmm3
	pand	%xmm3, %xmm0
	paddd	%xmm0, %xmm1
	cmpq	%r12, %rdx
	jne	.L5
	movdqa	%xmm1, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jl	.L24
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jle	.L6
.L8:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jge	.L10
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L9
.L11:
	movslq	%ecx, %rcx
	movl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %esi
	jge	.L6
	subl	%esi, %eax
	addl	%eax, %edx
.L6:
	testl	%edx, %edx
	je	.L15
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L24:
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jg	.L8
	jmp	.L9
.L10:
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jg	.L11
	jmp	.L6
.L16:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 4000
p:
	.zero	4000
	.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:
```
```c
/*
  AOJ #2799
  title:Yamanote-line Game
  @kankichi573
 */
#include <stdio.h>
int N,p[1000],d;

int main()
{
  int i,ret;

  scanf("%d %d",&N,&d);
  for(i=0;i<N;i++)
    scanf("%d",&p[i]);
  for(i=0,ret=0;i<N;i++)
    if(p[i]>d)
      ret += (p[i]-d);
  if(ret==0)
    printf("kusoge\n");
  else
    printf("%d\n",ret);
  return(0);
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
/*
  AOJ #2799
  title:Yamanote-line Game
  @kankichi573
 */
#include <stdio.h>
int N,p[1000],d;

int main()
{
  int i,ret;

  scanf("%d %d",&N,&d);
  for(i=0;i<N;i++)
    scanf("%d",&p[i]);
  for(i=0,ret=0;i<N;i++)
    if(p[i]>d)
      ret += (p[i]-d);
  if(ret==0)
    printf("kusoge\n");
  else
    printf("%d\n",ret);
  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:

5 130
130 170 100 122 140
 3 130
130 170 100 122 140
 1 130
130 170 100 122 86
 1 58
60 60 010 102 86
 1 58
68 60 010 102 166
 6 130
130 170 100 120 140
 5 130
130 170 100 138 140
 1 48
68 5 100 72 104
 1 53
68 4 100 72 104
 6 130
130 170 100 171 140

50
 40
 kusoge
 2
 10
 50
 58
 20
 15
 91

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

```c
/*
  AOJ #2799
  title:Yamanote-line Game
  @kankichi573
 */
#include <stdio.h>
int N,p[1000],d;

int main()
{
  int i,ret;

  scanf("%d %d",&N,&d);
  for(i=0;i<N;i++)
    scanf("%d",&p[i]);
  for(i=0,ret=0;i<N;i++)
    if(p[i]>d)
      ret += (p[i]-d);
  if(ret==0)
    printf("kusoge\n");
  else
    printf("%d\n",ret);
  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	"kusoge"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	d(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	p(%rip), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L15
	leal	-1(%rax), %edx
	movl	d(%rip), %esi
	cmpl	$2, %edx
	jbe	.L16
	movl	%eax, %edx
	movd	%esi, %xmm4
	leaq	16+p(%rip), %rcx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%r12), %xmm0
	addq	$16, %r12
	movdqa	%xmm0, %xmm3
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm2, %xmm3
	pand	%xmm3, %xmm0
	paddd	%xmm0, %xmm1
	cmpq	%r12, %rdx
	jne	.L5
	movdqa	%xmm1, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jl	.L24
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jle	.L6
.L8:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jge	.L10
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L9
.L11:
	movslq	%ecx, %rcx
	movl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %esi
	jge	.L6
	subl	%esi, %eax
	addl	%eax, %edx
.L6:
	testl	%edx, %edx
	je	.L15
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L24:
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jg	.L8
	jmp	.L9
.L10:
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jg	.L11
	jmp	.L6
.L16:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 4000
p:
	.zero	4000
	.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:
```

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	"kusoge"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	leaq	d(%rip), %rdx
	leaq	N(%rip), %rsi
	xorl	%eax, %eax
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	testl	%eax, %eax
	jle	.L15
	leaq	p(%rip), %r12
	xorl	%ebx, %ebx
	leaq	.LC1(%rip), %r14
	movq	%r12, %r13
	movq	%r12, %rbp
	.p2align 4,,10
	.p2align 3
.L3:
	movq	%rbp, %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	addl	$1, %ebx
	call	__isoc99_scanf@PLT
	movl	N(%rip), %eax
	addq	$4, %rbp
	cmpl	%ebx, %eax
	jg	.L3
	testl	%eax, %eax
	jle	.L15
	leal	-1(%rax), %edx
	movl	d(%rip), %esi
	cmpl	$2, %edx
	jbe	.L16
	movl	%eax, %edx
	movd	%esi, %xmm4
	leaq	16+p(%rip), %rcx
	shrl	$2, %edx
	pshufd	$0, %xmm4, %xmm2
	pxor	%xmm1, %xmm1
	subl	$1, %edx
	salq	$4, %rdx
	addq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L5:
	movdqa	(%r12), %xmm0
	addq	$16, %r12
	movdqa	%xmm0, %xmm3
	pcmpgtd	%xmm2, %xmm0
	psubd	%xmm2, %xmm3
	pand	%xmm3, %xmm0
	paddd	%xmm0, %xmm1
	cmpq	%r12, %rdx
	jne	.L5
	movdqa	%xmm1, %xmm0
	movl	%eax, %ecx
	psrldq	$8, %xmm0
	andl	$-4, %ecx
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm1
	movd	%xmm1, %edx
	testb	$3, %al
	je	.L6
.L4:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jl	.L24
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jle	.L6
.L8:
	movslq	%ecx, %rdi
	movl	0(%r13,%rdi,4), %edi
	cmpl	%edi, %esi
	jge	.L10
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jle	.L9
.L11:
	movslq	%ecx, %rcx
	movl	0(%r13,%rcx,4), %eax
	cmpl	%eax, %esi
	jge	.L6
	subl	%esi, %eax
	addl	%eax, %edx
.L6:
	testl	%edx, %edx
	je	.L15
.L9:
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L14:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
.L15:
	.cfi_restore_state
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
.L24:
	subl	%esi, %edi
	addl	$1, %ecx
	addl	%edi, %edx
	cmpl	%ecx, %eax
	jg	.L8
	jmp	.L9
.L10:
	addl	$1, %ecx
	cmpl	%ecx, %eax
	jg	.L11
	jmp	.L6
.L16:
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	jmp	.L4
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	d
	.bss
	.align 4
	.type	d, @object
	.size	d, 4
d:
	.zero	4
	.globl	p
	.align 32
	.type	p, @object
	.size	p, 4000
p:
	.zero	4000
	.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:
```