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) {
	_Bool flag[50000];
	int prime[10000];
	int i, j;
	int n;
	int count;
	int max;
	for (i = 2; i <= 3 || i <= sqrt(50000); i++) {
		for (j = 2; i * j <= 50000; j++) {
			flag[i*j-1] = 1;
		}
	}
	j = 0;
	for (i = 2; i < 50000; i++) {
		if (!flag[i-1]) {
			prime[j++] = i;
		}
	}
	max = j - 1;
	while (scanf("%d", &n)) {
		if (!n)
			break;
		j = max;
		count = 0;
		for (i = 0; i <= j; i++) {
			while (1) {
				if (n - prime[i] > prime[j]) {
					break;
				}
				else if (n - prime[i] < prime[j]) {
					j--;
				}
				else {
					count++;
					break;
				}
				if (i > j)
					break;
			}
		}
		printf("%d\n", count);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-86016(%rsp), %r11
	.cfi_def_cfa 11, 86056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4024, %rsp
	.cfi_def_cfa_offset 90080
	movl	$2, %edx
	movl	$4, %esi
	movq	%fs:40, %rax
	movq	%rax, 90024(%rsp)
	xorl	%eax, %eax
	leaq	40015(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$50000, %eax
	jle	.L3
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$224, %rdx
	jne	.L2
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%ebx, %rdx
	addl	$1, %ebx
	movl	%eax, 16(%rsp,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$50000, %rax
	jne	.L4
	subl	$1, %ebx
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L7
	cmpl	$-1, %ebx
	je	.L16
	movl	%ebx, %eax
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%eax, %rdx
	movl	%r8d, %esi
	subl	(%rdi,%rcx,4), %esi
	leaq	(%rdi,%rdx,4), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	jge	.L10
	subl	$1, %eax
	subq	$4, %rdx
	cmpl	%ecx, %eax
	jl	.L9
.L11:
	cmpl	(%rdx), %esi
	jle	.L25
.L9:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jge	.L12
.L8:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rcx
	addl	$1, %r9d
	cmpl	%ecx, %eax
	jge	.L12
	jmp	.L8
.L7:
	movq	90024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$90040, %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
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L8
.L26:
	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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-86016(%rsp), %r11
	.cfi_def_cfa 11, 86056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4024, %rsp
	.cfi_def_cfa_offset 90080
	movl	$2, %edx
	movl	$4, %esi
	movq	%fs:40, %rax
	movq	%rax, 90024(%rsp)
	xorl	%eax, %eax
	leaq	40015(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$50000, %eax
	jle	.L3
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$224, %rdx
	jne	.L2
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%ebx, %rdx
	addl	$1, %ebx
	movl	%eax, 16(%rsp,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$50000, %rax
	jne	.L4
	subl	$1, %ebx
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L7
	cmpl	$-1, %ebx
	je	.L16
	movl	%ebx, %eax
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%eax, %rdx
	movl	%r8d, %esi
	subl	(%rdi,%rcx,4), %esi
	leaq	(%rdi,%rdx,4), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	jge	.L10
	subl	$1, %eax
	subq	$4, %rdx
	cmpl	%ecx, %eax
	jl	.L9
.L11:
	cmpl	(%rdx), %esi
	jle	.L25
.L9:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jge	.L12
.L8:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rcx
	addl	$1, %r9d
	cmpl	%ecx, %eax
	jge	.L12
	jmp	.L8
.L7:
	movq	90024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$90040, %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
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L8
.L26:
	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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-86016(%rsp), %r11
	.cfi_def_cfa 11, 86056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4024, %rsp
	.cfi_def_cfa_offset 90080
	movl	$2, %edx
	movl	$4, %esi
	movq	%fs:40, %rax
	movq	%rax, 90024(%rsp)
	xorl	%eax, %eax
	leaq	40015(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$50000, %eax
	jle	.L3
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$224, %rdx
	jne	.L2
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%ebx, %rdx
	addl	$1, %ebx
	movl	%eax, 16(%rsp,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$50000, %rax
	jne	.L4
	subl	$1, %ebx
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L7
	cmpl	$-1, %ebx
	je	.L16
	movl	%ebx, %eax
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%eax, %rdx
	movl	%r8d, %esi
	subl	(%rdi,%rcx,4), %esi
	leaq	(%rdi,%rdx,4), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	jge	.L10
	subl	$1, %eax
	subq	$4, %rdx
	cmpl	%ecx, %eax
	jl	.L9
.L11:
	cmpl	(%rdx), %esi
	jle	.L25
.L9:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jge	.L12
.L8:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rcx
	addl	$1, %r9d
	cmpl	%ecx, %eax
	jge	.L12
	jmp	.L8
.L7:
	movq	90024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$90040, %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
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L8
.L26:
	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>

int main(void) {
	_Bool flag[50000];
	int prime[10000];
	int i, j;
	int n;
	int count;
	int max;
	for (i = 2; i <= 3 || i <= sqrt(50000); i++) {
		for (j = 2; i * j <= 50000; j++) {
			flag[i*j-1] = 1;
		}
	}
	j = 0;
	for (i = 2; i < 50000; i++) {
		if (!flag[i-1]) {
			prime[j++] = i;
		}
	}
	max = j - 1;
	while (scanf("%d", &n)) {
		if (!n)
			break;
		j = max;
		count = 0;
		for (i = 0; i <= j; i++) {
			while (1) {
				if (n - prime[i] > prime[j]) {
					break;
				}
				else if (n - prime[i] < prime[j]) {
					j--;
				}
				else {
					count++;
					break;
				}
				if (i > j)
					break;
			}
		}
		printf("%d\n", count);
	}
	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) {
	_Bool flag[50000];
	int prime[10000];
	int i, j;
	int n;
	int count;
	int max;
	for (i = 2; i <= 3 || i <= sqrt(50000); i++) {
		for (j = 2; i * j <= 50000; j++) {
			flag[i*j-1] = 1;
		}
	}
	j = 0;
	for (i = 2; i < 50000; i++) {
		if (!flag[i-1]) {
			prime[j++] = i;
		}
	}
	max = j - 1;
	while (scanf("%d", &n)) {
		if (!n)
			break;
		j = max;
		count = 0;
		for (i = 0; i <= j; i++) {
			while (1) {
				if (n - prime[i] > prime[j]) {
					break;
				}
				else if (n - prime[i] < prime[j]) {
					j--;
				}
				else {
					count++;
					break;
				}
				if (i > j)
					break;
			}
		}
		printf("%d\n", count);
	}
	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:

10
22
0
 10
34
0
 10
28
0
 10
31
0
 10
3
0
 10
0
0
 10
48
0
 10
106
0
 10
140
0
 10
160
0

2
3
 2
4
 2
2
 2
1
 2
0
 2
 2
5
 2
6
 2
7
 2
8

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) {
	_Bool flag[50000];
	int prime[10000];
	int i, j;
	int n;
	int count;
	int max;
	for (i = 2; i <= 3 || i <= sqrt(50000); i++) {
		for (j = 2; i * j <= 50000; j++) {
			flag[i*j-1] = 1;
		}
	}
	j = 0;
	for (i = 2; i < 50000; i++) {
		if (!flag[i-1]) {
			prime[j++] = i;
		}
	}
	max = j - 1;
	while (scanf("%d", &n)) {
		if (!n)
			break;
		j = max;
		count = 0;
		for (i = 0; i <= j; i++) {
			while (1) {
				if (n - prime[i] > prime[j]) {
					break;
				}
				else if (n - prime[i] < prime[j]) {
					j--;
				}
				else {
					count++;
					break;
				}
				if (i > j)
					break;
			}
		}
		printf("%d\n", count);
	}
	return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-86016(%rsp), %r11
	.cfi_def_cfa 11, 86056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4024, %rsp
	.cfi_def_cfa_offset 90080
	movl	$2, %edx
	movl	$4, %esi
	movq	%fs:40, %rax
	movq	%rax, 90024(%rsp)
	xorl	%eax, %eax
	leaq	40015(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$50000, %eax
	jle	.L3
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$224, %rdx
	jne	.L2
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%ebx, %rdx
	addl	$1, %ebx
	movl	%eax, 16(%rsp,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$50000, %rax
	jne	.L4
	subl	$1, %ebx
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L7
	cmpl	$-1, %ebx
	je	.L16
	movl	%ebx, %eax
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%eax, %rdx
	movl	%r8d, %esi
	subl	(%rdi,%rcx,4), %esi
	leaq	(%rdi,%rdx,4), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	jge	.L10
	subl	$1, %eax
	subq	$4, %rdx
	cmpl	%ecx, %eax
	jl	.L9
.L11:
	cmpl	(%rdx), %esi
	jle	.L25
.L9:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jge	.L12
.L8:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rcx
	addl	$1, %r9d
	cmpl	%ecx, %eax
	jge	.L12
	jmp	.L8
.L7:
	movq	90024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$90040, %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
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L8
.L26:
	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\n"
.LC1:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	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
	leaq	-86016(%rsp), %r11
	.cfi_def_cfa 11, 86056
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$4024, %rsp
	.cfi_def_cfa_offset 90080
	movl	$2, %edx
	movl	$4, %esi
	movq	%fs:40, %rax
	movq	%rax, 90024(%rsp)
	xorl	%eax, %eax
	leaq	40015(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%rsi, %rax
	.p2align 4,,10
	.p2align 3
.L3:
	movb	$1, (%rcx,%rax)
	addq	%rdx, %rax
	cmpl	$50000, %eax
	jle	.L3
	addq	$1, %rdx
	addq	$2, %rsi
	cmpq	$224, %rdx
	jne	.L2
	movl	$2, %eax
	xorl	%ebx, %ebx
	.p2align 4,,10
	.p2align 3
.L4:
	cmpb	$0, (%rcx,%rax)
	jne	.L5
	movslq	%ebx, %rdx
	addl	$1, %ebx
	movl	%eax, 16(%rsp,%rdx,4)
.L5:
	addq	$1, %rax
	cmpq	$50000, %rax
	jne	.L4
	subl	$1, %ebx
	leaq	12(%rsp), %r12
	leaq	.LC1(%rip), %rbp
	leaq	.LC0(%rip), %r13
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	testl	%eax, %eax
	je	.L7
	movl	12(%rsp), %r8d
	testl	%r8d, %r8d
	je	.L7
	cmpl	$-1, %ebx
	je	.L16
	movl	%ebx, %eax
	xorl	%ecx, %ecx
	leaq	16(%rsp), %rdi
	xorl	%r9d, %r9d
	.p2align 4,,10
	.p2align 3
.L12:
	movslq	%eax, %rdx
	movl	%r8d, %esi
	subl	(%rdi,%rcx,4), %esi
	leaq	(%rdi,%rdx,4), %rdx
	jmp	.L11
	.p2align 4,,10
	.p2align 3
.L25:
	jge	.L10
	subl	$1, %eax
	subq	$4, %rdx
	cmpl	%ecx, %eax
	jl	.L9
.L11:
	cmpl	(%rdx), %esi
	jle	.L25
.L9:
	addq	$1, %rcx
	cmpl	%ecx, %eax
	jge	.L12
.L8:
	movl	%r9d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L6
	.p2align 4,,10
	.p2align 3
.L10:
	addq	$1, %rcx
	addl	$1, %r9d
	cmpl	%ecx, %eax
	jge	.L12
	jmp	.L8
.L7:
	movq	90024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L26
	addq	$90040, %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
.L16:
	.cfi_restore_state
	xorl	%r9d, %r9d
	jmp	.L8
.L26:
	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:
```