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 main(void){
    int N, M, P;
    int i,sum;

    while (1){
		int X[100] = {};
		sum=0;
		scanf("%d %d %d",&N,&M,&P);
        if (N == 0 && M == 0 && P == 0){
            break;
        }
        for (i = 0; i < N; i++){
            scanf("%d", &X[i]);
        }

        for (i = 0; i < N; i++){
            sum = sum + X[i];
        }
		if(X[M-1]==0){
			printf("0\n");
		}
		else{
			printf("%d\n", sum*(100-P)/X[M-1]);
		}
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	(%rsp), %rsi
	movl	$50, %ecx
	movq	%r12, %rdi
	rep stosq
	movq	%r15, %rcx
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L24
	movl	24(%rsp), %ecx
	movl	%ecx, %eax
	orl	28(%rsp), %eax
	je	.L25
.L6:
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L12
.L28:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	jle	.L26
	movq	%r12, %rbx
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L7
	movl	24(%rsp), %ecx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rax
.L9:
	paddd	(%rbx), %xmm0
	movq	%rax, %rbx
	cmpq	%rdx, %rax
	jne	.L27
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %sil
	je	.L6
.L8:
	movslq	%eax, %rdi
	addl	32(%rsp,%rdi,4), %edx
	leal	1(%rax), %edi
	cmpl	%edi, %esi
	jle	.L6
	movslq	%edi, %rdi
	addl	$2, %eax
	addl	32(%rsp,%rdi,4), %edx
	cmpl	%eax, %esi
	jle	.L6
	subl	$1, %ecx
	cltq
	movslq	%ecx, %rcx
	addl	32(%rsp,%rax,4), %edx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L28
.L12:
	movl	$100, %eax
	subl	28(%rsp), %eax
	movl	$1, %edi
	imull	%edx, %eax
	leaq	.LC3(%rip), %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L25:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	24(%rsp), %ecx
	xorl	%edx, %edx
	jmp	.L6
.L29:
	call	__stack_chk_fail@PLT
.L16:
	xorl	%edx, %edx
	jmp	.L6
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	(%rsp), %rsi
	movl	$50, %ecx
	movq	%r12, %rdi
	rep stosq
	movq	%r15, %rcx
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L24
	movl	24(%rsp), %ecx
	movl	%ecx, %eax
	orl	28(%rsp), %eax
	je	.L25
.L6:
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L12
.L28:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	jle	.L26
	movq	%r12, %rbx
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L7
	movl	24(%rsp), %ecx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rax
.L9:
	paddd	(%rbx), %xmm0
	movq	%rax, %rbx
	cmpq	%rdx, %rax
	jne	.L27
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %sil
	je	.L6
.L8:
	movslq	%eax, %rdi
	addl	32(%rsp,%rdi,4), %edx
	leal	1(%rax), %edi
	cmpl	%edi, %esi
	jle	.L6
	movslq	%edi, %rdi
	addl	$2, %eax
	addl	32(%rsp,%rdi,4), %edx
	cmpl	%eax, %esi
	jle	.L6
	subl	$1, %ecx
	cltq
	movslq	%ecx, %rcx
	addl	32(%rsp,%rax,4), %edx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L28
.L12:
	movl	$100, %eax
	subl	28(%rsp), %eax
	movl	$1, %edi
	imull	%edx, %eax
	leaq	.LC3(%rip), %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L25:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	24(%rsp), %ecx
	xorl	%edx, %edx
	jmp	.L6
.L29:
	call	__stack_chk_fail@PLT
.L16:
	xorl	%edx, %edx
	jmp	.L6
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	(%rsp), %rsi
	movl	$50, %ecx
	movq	%r12, %rdi
	rep stosq
	movq	%r15, %rcx
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L24
	movl	24(%rsp), %ecx
	movl	%ecx, %eax
	orl	28(%rsp), %eax
	je	.L25
.L6:
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L12
.L28:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	jle	.L26
	movq	%r12, %rbx
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L7
	movl	24(%rsp), %ecx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rax
.L9:
	paddd	(%rbx), %xmm0
	movq	%rax, %rbx
	cmpq	%rdx, %rax
	jne	.L27
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %sil
	je	.L6
.L8:
	movslq	%eax, %rdi
	addl	32(%rsp,%rdi,4), %edx
	leal	1(%rax), %edi
	cmpl	%edi, %esi
	jle	.L6
	movslq	%edi, %rdi
	addl	$2, %eax
	addl	32(%rsp,%rdi,4), %edx
	cmpl	%eax, %esi
	jle	.L6
	subl	$1, %ecx
	cltq
	movslq	%ecx, %rcx
	addl	32(%rsp,%rax,4), %edx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L28
.L12:
	movl	$100, %eax
	subl	28(%rsp), %eax
	movl	$1, %edi
	imull	%edx, %eax
	leaq	.LC3(%rip), %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L25:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	24(%rsp), %ecx
	xorl	%edx, %edx
	jmp	.L6
.L29:
	call	__stack_chk_fail@PLT
.L16:
	xorl	%edx, %edx
	jmp	.L6
	.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>
int main(void){
    int N, M, P;
    int i,sum;

    while (1){
		int X[100] = {};
		sum=0;
		scanf("%d %d %d",&N,&M,&P);
        if (N == 0 && M == 0 && P == 0){
            break;
        }
        for (i = 0; i < N; i++){
            scanf("%d", &X[i]);
        }

        for (i = 0; i < N; i++){
            sum = sum + X[i];
        }
		if(X[M-1]==0){
			printf("0\n");
		}
		else{
			printf("%d\n", sum*(100-P)/X[M-1]);
		}
    }
    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 main(void){
    int N, M, P;
    int i,sum;

    while (1){
		int X[100] = {};
		sum=0;
		scanf("%d %d %d",&N,&M,&P);
        if (N == 0 && M == 0 && P == 0){
            break;
        }
        for (i = 0; i < N; i++){
            scanf("%d", &X[i]);
        }

        for (i = 0; i < N; i++){
            sum = sum + X[i];
        }
		if(X[M-1]==0){
			printf("0\n");
		}
		else{
			printf("%d\n", sum*(100-P)/X[M-1]);
		}
    }
    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:

3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
1
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0
 3 2 50
1
2
1
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 10
8
0
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 16
8
0
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 16
8
0
2
0 0 0
 3 2 50
1
2
3
4 4 75
1
2
3
1
3 1 10
8
1
1
0 0 0
 3 2 50
1
4
3
4 4 65
1
2
3
0
3 1 2
8
2
1
0 0 0
 3 2 50
1
2
3
4 4 65
1
2
3
0
3 1 22
8
0
2
0 0 0
 3 2 94
1
2
3
4 4 65
1
2
3
0
3 1 10
8
2
1
0 0 0

150
0
112
 150
0
123
 100
0
123
 150
0
101
 150
0
94
 150
0
105
 150
175
112
 100
0
134
 150
0
97
 18
0
123

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 main(void){
    int N, M, P;
    int i,sum;

    while (1){
		int X[100] = {};
		sum=0;
		scanf("%d %d %d",&N,&M,&P);
        if (N == 0 && M == 0 && P == 0){
            break;
        }
        for (i = 0; i < N; i++){
            scanf("%d", &X[i]);
        }

        for (i = 0; i < N; i++){
            sum = sum + X[i];
        }
		if(X[M-1]==0){
			printf("0\n");
		}
		else{
			printf("%d\n", sum*(100-P)/X[M-1]);
		}
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	(%rsp), %rsi
	movl	$50, %ecx
	movq	%r12, %rdi
	rep stosq
	movq	%r15, %rcx
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L24
	movl	24(%rsp), %ecx
	movl	%ecx, %eax
	orl	28(%rsp), %eax
	je	.L25
.L6:
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L12
.L28:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	jle	.L26
	movq	%r12, %rbx
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L7
	movl	24(%rsp), %ecx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rax
.L9:
	paddd	(%rbx), %xmm0
	movq	%rax, %rbx
	cmpq	%rdx, %rax
	jne	.L27
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %sil
	je	.L6
.L8:
	movslq	%eax, %rdi
	addl	32(%rsp,%rdi,4), %edx
	leal	1(%rax), %edi
	cmpl	%edi, %esi
	jle	.L6
	movslq	%edi, %rdi
	addl	$2, %eax
	addl	32(%rsp,%rdi,4), %edx
	cmpl	%eax, %esi
	jle	.L6
	subl	$1, %ecx
	cltq
	movslq	%ecx, %rcx
	addl	32(%rsp,%rax,4), %edx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L28
.L12:
	movl	$100, %eax
	subl	28(%rsp), %eax
	movl	$1, %edi
	imull	%edx, %eax
	leaq	.LC3(%rip), %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L25:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	24(%rsp), %ecx
	xorl	%edx, %edx
	jmp	.L6
.L29:
	call	__stack_chk_fail@PLT
.L16:
	xorl	%edx, %edx
	jmp	.L6
	.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 %d"
.LC1:
	.string	"%d"
.LC2:
	.string	"0"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	.LC1(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$456, %rsp
	.cfi_def_cfa_offset 512
	movq	%fs:40, %rax
	movq	%rax, 440(%rsp)
	xorl	%eax, %eax
	leaq	24(%rsp), %rax
	leaq	32(%rsp), %r12
	movq	%rax, 8(%rsp)
	leaq	20(%rsp), %rax
	leaq	28(%rsp), %r15
	movq	%rax, (%rsp)
	.p2align 4,,10
	.p2align 3
.L14:
	movq	8(%rsp), %rdx
	xorl	%eax, %eax
	movq	(%rsp), %rsi
	movl	$50, %ecx
	movq	%r12, %rdi
	rep stosq
	movq	%r15, %rcx
	leaq	.LC0(%rip), %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %edx
	testl	%edx, %edx
	jne	.L24
	movl	24(%rsp), %ecx
	movl	%ecx, %eax
	orl	28(%rsp), %eax
	je	.L25
.L6:
	subl	$1, %ecx
	movslq	%ecx, %rcx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	jne	.L12
.L28:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L24:
	jle	.L26
	movq	%r12, %rbx
	movq	%r12, %r14
	xorl	%r13d, %r13d
	.p2align 4,,10
	.p2align 3
.L7:
	movq	%r14, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L7
	movl	24(%rsp), %ecx
	testl	%esi, %esi
	jle	.L16
	leal	-1(%rsi), %eax
	cmpl	$2, %eax
	jbe	.L17
	movl	%esi, %eax
	pxor	%xmm0, %xmm0
	shrl	$2, %eax
	leal	-1(%rax), %edx
	leaq	16(%r12), %rax
	salq	$4, %rdx
	addq	%rax, %rdx
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L27:
	addq	$16, %rax
.L9:
	paddd	(%rbx), %xmm0
	movq	%rax, %rbx
	cmpq	%rdx, %rax
	jne	.L27
	movdqa	%xmm0, %xmm1
	movl	%esi, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	testb	$3, %sil
	je	.L6
.L8:
	movslq	%eax, %rdi
	addl	32(%rsp,%rdi,4), %edx
	leal	1(%rax), %edi
	cmpl	%edi, %esi
	jle	.L6
	movslq	%edi, %rdi
	addl	$2, %eax
	addl	32(%rsp,%rdi,4), %edx
	cmpl	%eax, %esi
	jle	.L6
	subl	$1, %ecx
	cltq
	movslq	%ecx, %rcx
	addl	32(%rsp,%rax,4), %edx
	movl	32(%rsp,%rcx,4), %ecx
	testl	%ecx, %ecx
	je	.L28
.L12:
	movl	$100, %eax
	subl	28(%rsp), %eax
	movl	$1, %edi
	imull	%edx, %eax
	leaq	.LC3(%rip), %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L14
.L17:
	xorl	%edx, %edx
	xorl	%eax, %eax
	jmp	.L8
.L25:
	movq	440(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L29
	addq	$456, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L26:
	.cfi_restore_state
	movl	24(%rsp), %ecx
	xorl	%edx, %edx
	jmp	.L6
.L29:
	call	__stack_chk_fail@PLT
.L16:
	xorl	%edx, %edx
	jmp	.L6
	.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:
```