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

```c
#include <stdio.h>
int main() {
	int x;
	scanf("%d", &x);
	int ri = 100,
		sa = 101,
		cu = 102,
		cak = 103,
		can = 104,
		pc = 105;
	int anc = 0;
	int sum;
	switch (x % 10)
	{
	case 0:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 1:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + sa;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 2:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cu;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 3:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 4:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 5:
		for (int i = 0; i < 1000; i++) {
			for (int j = 1; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 6:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 7:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 8:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 9:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 999; j += 2) {
				sum = ri * i + pc * j + can + pc;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	default:
		break;
	}
	printf("%d", anc);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$100, -36(%rbp)
	movl	$101, -32(%rbp)
	movl	$102, -28(%rbp)
	movl	$103, -24(%rbp)
	movl	$104, -20(%rbp)
	movl	$105, -16(%rbp)
	movl	$0, -120(%rbp)
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	cmpl	$9, %edx
	ja	.L107
	movl	%edx, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, -116(%rbp)
	jmp	.L14
.L21:
	movl	$0, -112(%rbp)
	jmp	.L15
.L18:
	movl	-36(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	movl	$1, -120(%rbp)
	jmp	.L17
.L16:
	addl	$2, -112(%rbp)
.L15:
	cmpl	$999, -112(%rbp)
	jle	.L18
.L17:
	cmpl	$1, -120(%rbp)
	je	.L108
	addl	$1, -116(%rbp)
.L14:
	cmpl	$999, -116(%rbp)
	jle	.L21
	jmp	.L22
.L108:
	nop
	jmp	.L22
.L12:
	movl	$0, -108(%rbp)
	jmp	.L23
.L30:
	movl	$0, -104(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	imull	-108(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-104(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L25
	movl	$1, -120(%rbp)
	jmp	.L26
.L25:
	addl	$2, -104(%rbp)
.L24:
	cmpl	$999, -104(%rbp)
	jle	.L27
.L26:
	cmpl	$1, -120(%rbp)
	je	.L109
	addl	$1, -108(%rbp)
.L23:
	cmpl	$999, -108(%rbp)
	jle	.L30
	jmp	.L22
.L109:
	nop
	jmp	.L22
.L11:
	movl	$0, -100(%rbp)
	jmp	.L31
.L38:
	movl	$0, -96(%rbp)
	jmp	.L32
.L35:
	movl	-36(%rbp), %eax
	imull	-100(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-96(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L33
	movl	$1, -120(%rbp)
	jmp	.L34
.L33:
	addl	$2, -96(%rbp)
.L32:
	cmpl	$999, -96(%rbp)
	jle	.L35
.L34:
	cmpl	$1, -120(%rbp)
	je	.L110
	addl	$1, -100(%rbp)
.L31:
	cmpl	$999, -100(%rbp)
	jle	.L38
	jmp	.L22
.L110:
	nop
	jmp	.L22
.L10:
	movl	$0, -92(%rbp)
	jmp	.L39
.L46:
	movl	$0, -88(%rbp)
	jmp	.L40
.L43:
	movl	-36(%rbp), %eax
	imull	-92(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L41
	movl	$1, -120(%rbp)
	jmp	.L42
.L41:
	addl	$2, -88(%rbp)
.L40:
	cmpl	$999, -88(%rbp)
	jle	.L43
.L42:
	cmpl	$1, -120(%rbp)
	je	.L111
	addl	$1, -92(%rbp)
.L39:
	cmpl	$999, -92(%rbp)
	jle	.L46
	jmp	.L22
.L111:
	nop
	jmp	.L22
.L9:
	movl	$0, -84(%rbp)
	jmp	.L47
.L54:
	movl	$0, -80(%rbp)
	jmp	.L48
.L51:
	movl	-36(%rbp), %eax
	imull	-84(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-80(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L49
	movl	$1, -120(%rbp)
	jmp	.L50
.L49:
	addl	$2, -80(%rbp)
.L48:
	cmpl	$999, -80(%rbp)
	jle	.L51
.L50:
	cmpl	$1, -120(%rbp)
	je	.L112
	addl	$1, -84(%rbp)
.L47:
	cmpl	$999, -84(%rbp)
	jle	.L54
	jmp	.L22
.L112:
	nop
	jmp	.L22
.L8:
	movl	$0, -76(%rbp)
	jmp	.L55
.L62:
	movl	$1, -72(%rbp)
	jmp	.L56
.L59:
	movl	-36(%rbp), %eax
	imull	-76(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L57
	movl	$1, -120(%rbp)
	jmp	.L58
.L57:
	addl	$2, -72(%rbp)
.L56:
	cmpl	$999, -72(%rbp)
	jle	.L59
.L58:
	cmpl	$1, -120(%rbp)
	je	.L113
	addl	$1, -76(%rbp)
.L55:
	cmpl	$999, -76(%rbp)
	jle	.L62
	jmp	.L22
.L113:
	nop
	jmp	.L22
.L7:
	movl	$0, -68(%rbp)
	jmp	.L63
.L70:
	movl	$0, -64(%rbp)
	jmp	.L64
.L67:
	movl	-36(%rbp), %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-64(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L65
	movl	$1, -120(%rbp)
	jmp	.L66
.L65:
	addl	$2, -64(%rbp)
.L64:
	cmpl	$999, -64(%rbp)
	jle	.L67
.L66:
	cmpl	$1, -120(%rbp)
	je	.L114
	addl	$1, -68(%rbp)
.L63:
	cmpl	$999, -68(%rbp)
	jle	.L70
	jmp	.L22
.L114:
	nop
	jmp	.L22
.L6:
	movl	$0, -60(%rbp)
	jmp	.L71
.L78:
	movl	$0, -56(%rbp)
	jmp	.L72
.L75:
	movl	-36(%rbp), %eax
	imull	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L73
	movl	$1, -120(%rbp)
	jmp	.L74
.L73:
	addl	$2, -56(%rbp)
.L72:
	cmpl	$999, -56(%rbp)
	jle	.L75
.L74:
	cmpl	$1, -120(%rbp)
	je	.L115
	addl	$1, -60(%rbp)
.L71:
	cmpl	$999, -60(%rbp)
	jle	.L78
	jmp	.L22
.L115:
	nop
	jmp	.L22
.L5:
	movl	$0, -52(%rbp)
	jmp	.L79
.L86:
	movl	$0, -48(%rbp)
	jmp	.L80
.L83:
	movl	-36(%rbp), %eax
	imull	-52(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-48(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L81
	movl	$1, -120(%rbp)
	jmp	.L82
.L81:
	addl	$2, -48(%rbp)
.L80:
	cmpl	$999, -48(%rbp)
	jle	.L83
.L82:
	cmpl	$1, -120(%rbp)
	je	.L116
	addl	$1, -52(%rbp)
.L79:
	cmpl	$999, -52(%rbp)
	jle	.L86
	jmp	.L22
.L116:
	nop
	jmp	.L22
.L3:
	movl	$0, -44(%rbp)
	jmp	.L87
.L94:
	movl	$0, -40(%rbp)
	jmp	.L88
.L91:
	movl	-36(%rbp), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L89
	movl	$1, -120(%rbp)
	jmp	.L90
.L89:
	addl	$2, -40(%rbp)
.L88:
	cmpl	$998, -40(%rbp)
	jle	.L91
.L90:
	cmpl	$1, -120(%rbp)
	je	.L117
	addl	$1, -44(%rbp)
.L87:
	cmpl	$999, -44(%rbp)
	jle	.L94
	jmp	.L22
.L117:
	nop
	jmp	.L22
.L107:
	nop
.L22:
	movl	-120(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L96
	call	__stack_chk_fail@PLT
.L96:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB1:
	.section	.text.startup,"ax",@progbits
.LHOTB1:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdx
	movq	%rdx, %rax
	imulq	$1717986919, %rdx, %rdx
	movl	%eax, %ecx
	sarl	$31, %ecx
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	movl	%eax, %edx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	cmpl	$9, %edx
	ja	.L35
	leaq	.L4(%rip), %rsi
	movl	%edx, %ecx
	movslq	(%rsi,%rcx,4), %rcx
	addq	%rsi, %rcx
	notrack jmp	*%rcx
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L36-.L4
	.long	.L37-.L4
	.long	.L38-.L4
	.long	.L39-.L4
	.long	.L40-.L4
	.long	.L41-.L4
	.long	.L42-.L4
	.long	.L43-.L4
	.long	.L44-.L4
	.long	.L45-.L4
	.section	.text.startup
.L44:
	movl	$105208, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	leal	-105000(%rcx), %edx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L90:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L89
.L30:
	cmpl	%edx, %eax
	jne	.L90
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %edx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L91
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	movl	$105209, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	leal	-105000(%rcx), %edx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L93:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L92
.L32:
	cmpl	%edx, %eax
	jne	.L93
	jmp	.L54
.L36:
	xorl	%edi, %edi
	movl	$105000, %esi
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L95:
	addl	$210, %ecx
	cmpl	%ecx, %esi
	je	.L94
.L14:
	cmpl	%ecx, %eax
	jne	.L95
	jmp	.L54
.L40:
	movl	$105104, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	leal	-105000(%rcx), %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L97:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L96
.L22:
	cmpl	%edx, %eax
	jne	.L97
	jmp	.L54
.L38:
	movl	$105102, %ecx
	.p2align 4,,10
	.p2align 3
.L11:
	leal	-105000(%rcx), %edx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L99:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L98
.L18:
	cmpl	%edx, %eax
	jne	.L99
	jmp	.L54
.L42:
	movl	$105206, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-105000(%rcx), %edx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L101:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L100
.L26:
	cmpl	%edx, %eax
	jne	.L101
	jmp	.L54
.L37:
	movl	$105101, %esi
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-105000(%rsi), %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%ecx, %eax
	je	.L2
	addl	$210, %ecx
	cmpl	%ecx, %esi
	jne	.L16
	addl	$100, %esi
	cmpl	$205101, %esi
	jne	.L12
	xorl	%edx, %edx
	jmp	.L2
.L41:
	movl	$105105, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-105000(%rcx), %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L103:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L102
.L24:
	cmpl	%edx, %eax
	jne	.L103
	jmp	.L54
.L39:
	movl	$105103, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	leal	-105000(%rcx), %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L105:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L104
.L20:
	cmpl	%edx, %eax
	jne	.L105
	jmp	.L54
.L43:
	movl	$105207, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-105000(%rcx), %edx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L107:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L106
.L28:
	cmpl	%edx, %eax
	jne	.L107
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L89:
	leal	100(%rdx), %ecx
	cmpl	$205108, %edx
	jne	.L5
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L92:
	leal	100(%rdx), %ecx
	cmpl	$205109, %edx
	jne	.L3
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L100:
	leal	100(%rdx), %ecx
	cmpl	$205106, %edx
	jne	.L7
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L96:
	addl	$100, %ecx
	cmpl	$205104, %ecx
	jne	.L9
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L102:
	addl	$100, %ecx
	cmpl	$205105, %ecx
	jne	.L8
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L98:
	addl	$100, %ecx
	cmpl	$205102, %ecx
	jne	.L11
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L104:
	addl	$100, %ecx
	cmpl	$205103, %ecx
	jne	.L10
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L94:
	addl	$100, %esi
	addl	$100, %edi
	cmpl	$205000, %esi
	jne	.L13
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L106:
	leal	100(%rdx), %ecx
	cmpl	$205107, %edx
	jne	.L6
	xorl	%edx, %edx
	jmp	.L2
.L91:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB23:
.L35:
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -16
	xorl	%edx, %edx
	jmp	.L2
	.cfi_endproc
.LFE23:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE1:
	.section	.text.startup
.LHOTE1:
	.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
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
	.section	.text.unlikely,"ax",@progbits
.LCOLDB1:
	.section	.text.startup,"ax",@progbits
.LHOTB1:
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	leaq	.LC0(%rip), %rbp
	movq	%rbp, %rdi
	subq	$16, %rsp
	.cfi_def_cfa_offset 32
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rdx
	movq	%rdx, %rax
	imulq	$1717986919, %rdx, %rdx
	movl	%eax, %ecx
	sarl	$31, %ecx
	sarq	$34, %rdx
	subl	%ecx, %edx
	leal	(%rdx,%rdx,4), %ecx
	movl	%eax, %edx
	addl	%ecx, %ecx
	subl	%ecx, %edx
	cmpl	$9, %edx
	ja	.L35
	leaq	.L4(%rip), %rsi
	movl	%edx, %ecx
	movslq	(%rsi,%rcx,4), %rcx
	addq	%rsi, %rcx
	notrack jmp	*%rcx
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L36-.L4
	.long	.L37-.L4
	.long	.L38-.L4
	.long	.L39-.L4
	.long	.L40-.L4
	.long	.L41-.L4
	.long	.L42-.L4
	.long	.L43-.L4
	.long	.L44-.L4
	.long	.L45-.L4
	.section	.text.startup
.L44:
	movl	$105208, %ecx
	.p2align 4,,10
	.p2align 3
.L5:
	leal	-105000(%rcx), %edx
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L90:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L89
.L30:
	cmpl	%edx, %eax
	jne	.L90
	.p2align 4,,10
	.p2align 3
.L54:
	movl	$1, %edx
.L2:
	xorl	%eax, %eax
	movq	%rbp, %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L91
	addq	$16, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbp
	.cfi_def_cfa_offset 8
	ret
.L45:
	.cfi_restore_state
	movl	$105209, %ecx
	.p2align 4,,10
	.p2align 3
.L3:
	leal	-105000(%rcx), %edx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L93:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L92
.L32:
	cmpl	%edx, %eax
	jne	.L93
	jmp	.L54
.L36:
	xorl	%edi, %edi
	movl	$105000, %esi
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%edi, %ecx
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L95:
	addl	$210, %ecx
	cmpl	%ecx, %esi
	je	.L94
.L14:
	cmpl	%ecx, %eax
	jne	.L95
	jmp	.L54
.L40:
	movl	$105104, %ecx
	.p2align 4,,10
	.p2align 3
.L9:
	leal	-105000(%rcx), %edx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L97:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L96
.L22:
	cmpl	%edx, %eax
	jne	.L97
	jmp	.L54
.L38:
	movl	$105102, %ecx
	.p2align 4,,10
	.p2align 3
.L11:
	leal	-105000(%rcx), %edx
	jmp	.L18
	.p2align 4,,10
	.p2align 3
.L99:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L98
.L18:
	cmpl	%edx, %eax
	jne	.L99
	jmp	.L54
.L42:
	movl	$105206, %ecx
	.p2align 4,,10
	.p2align 3
.L7:
	leal	-105000(%rcx), %edx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L101:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L100
.L26:
	cmpl	%edx, %eax
	jne	.L101
	jmp	.L54
.L37:
	movl	$105101, %esi
	.p2align 4,,10
	.p2align 3
.L12:
	leal	-105000(%rsi), %ecx
	.p2align 4,,10
	.p2align 3
.L16:
	cmpl	%ecx, %eax
	je	.L2
	addl	$210, %ecx
	cmpl	%ecx, %esi
	jne	.L16
	addl	$100, %esi
	cmpl	$205101, %esi
	jne	.L12
	xorl	%edx, %edx
	jmp	.L2
.L41:
	movl	$105105, %ecx
	.p2align 4,,10
	.p2align 3
.L8:
	leal	-105000(%rcx), %edx
	jmp	.L24
	.p2align 4,,10
	.p2align 3
.L103:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L102
.L24:
	cmpl	%edx, %eax
	jne	.L103
	jmp	.L54
.L39:
	movl	$105103, %ecx
	.p2align 4,,10
	.p2align 3
.L10:
	leal	-105000(%rcx), %edx
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L105:
	addl	$210, %edx
	cmpl	%edx, %ecx
	je	.L104
.L20:
	cmpl	%edx, %eax
	jne	.L105
	jmp	.L54
.L43:
	movl	$105207, %ecx
	.p2align 4,,10
	.p2align 3
.L6:
	leal	-105000(%rcx), %edx
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L107:
	addl	$210, %edx
	cmpl	%ecx, %edx
	je	.L106
.L28:
	cmpl	%edx, %eax
	jne	.L107
	jmp	.L54
	.p2align 4,,10
	.p2align 3
.L89:
	leal	100(%rdx), %ecx
	cmpl	$205108, %edx
	jne	.L5
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L92:
	leal	100(%rdx), %ecx
	cmpl	$205109, %edx
	jne	.L3
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L100:
	leal	100(%rdx), %ecx
	cmpl	$205106, %edx
	jne	.L7
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L96:
	addl	$100, %ecx
	cmpl	$205104, %ecx
	jne	.L9
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L102:
	addl	$100, %ecx
	cmpl	$205105, %ecx
	jne	.L8
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L98:
	addl	$100, %ecx
	cmpl	$205102, %ecx
	jne	.L11
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L104:
	addl	$100, %ecx
	cmpl	$205103, %ecx
	jne	.L10
	xorl	%edx, %edx
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L94:
	addl	$100, %esi
	addl	$100, %edi
	cmpl	$205000, %esi
	jne	.L13
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L106:
	leal	100(%rdx), %ecx
	cmpl	$205107, %edx
	jne	.L6
	xorl	%edx, %edx
	jmp	.L2
.L91:
	call	__stack_chk_fail@PLT
	.cfi_endproc
	.section	.text.unlikely
	.cfi_startproc
	.type	main.cold, @function
main.cold:
.LFSB23:
.L35:
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -16
	xorl	%edx, %edx
	jmp	.L2
	.cfi_endproc
.LFE23:
	.section	.text.startup
	.size	main, .-main
	.section	.text.unlikely
	.size	main.cold, .-main.cold
.LCOLDE1:
	.section	.text.startup
.LHOTE1:
	.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:

#include <stdio.h>
int main() {
	int x;
	scanf("%d", &x);
	int ri = 100,
		sa = 101,
		cu = 102,
		cak = 103,
		can = 104,
		pc = 105;
	int anc = 0;
	int sum;
	switch (x % 10)
	{
	case 0:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 1:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + sa;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 2:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cu;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 3:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 4:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 5:
		for (int i = 0; i < 1000; i++) {
			for (int j = 1; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 6:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 7:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 8:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 9:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 999; j += 2) {
				sum = ri * i + pc * j + can + pc;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	default:
		break;
	}
	printf("%d", anc);
}
386
 0
 59
 115
 10
 53
 3
 84
 4
 97

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

```c
#include <stdio.h>
int main() {
	int x;
	scanf("%d", &x);
	int ri = 100,
		sa = 101,
		cu = 102,
		cak = 103,
		can = 104,
		pc = 105;
	int anc = 0;
	int sum;
	switch (x % 10)
	{
	case 0:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 1:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + sa;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 2:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cu;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 3:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 4:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 5:
		for (int i = 0; i < 1000; i++) {
			for (int j = 1; j < 1000; j += 2) {
				sum = ri * i + pc * j;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 6:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 7:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + cak + can;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 8:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 1000; j += 2) {
				sum = ri * i + pc * j + can * 2;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	case 9:
		for (int i = 0; i < 1000; i++) {
			for (int j = 0; j < 999; j += 2) {
				sum = ri * i + pc * j + can + pc;
				if (x == sum) {
					anc = 1;
					break;
				}
			}
			if (anc == 1)break;
		}
		break;
	default:
		break;
	}
	printf("%d", anc);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$100, -36(%rbp)
	movl	$101, -32(%rbp)
	movl	$102, -28(%rbp)
	movl	$103, -24(%rbp)
	movl	$104, -20(%rbp)
	movl	$105, -16(%rbp)
	movl	$0, -120(%rbp)
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	cmpl	$9, %edx
	ja	.L107
	movl	%edx, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, -116(%rbp)
	jmp	.L14
.L21:
	movl	$0, -112(%rbp)
	jmp	.L15
.L18:
	movl	-36(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	movl	$1, -120(%rbp)
	jmp	.L17
.L16:
	addl	$2, -112(%rbp)
.L15:
	cmpl	$999, -112(%rbp)
	jle	.L18
.L17:
	cmpl	$1, -120(%rbp)
	je	.L108
	addl	$1, -116(%rbp)
.L14:
	cmpl	$999, -116(%rbp)
	jle	.L21
	jmp	.L22
.L108:
	nop
	jmp	.L22
.L12:
	movl	$0, -108(%rbp)
	jmp	.L23
.L30:
	movl	$0, -104(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	imull	-108(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-104(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L25
	movl	$1, -120(%rbp)
	jmp	.L26
.L25:
	addl	$2, -104(%rbp)
.L24:
	cmpl	$999, -104(%rbp)
	jle	.L27
.L26:
	cmpl	$1, -120(%rbp)
	je	.L109
	addl	$1, -108(%rbp)
.L23:
	cmpl	$999, -108(%rbp)
	jle	.L30
	jmp	.L22
.L109:
	nop
	jmp	.L22
.L11:
	movl	$0, -100(%rbp)
	jmp	.L31
.L38:
	movl	$0, -96(%rbp)
	jmp	.L32
.L35:
	movl	-36(%rbp), %eax
	imull	-100(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-96(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L33
	movl	$1, -120(%rbp)
	jmp	.L34
.L33:
	addl	$2, -96(%rbp)
.L32:
	cmpl	$999, -96(%rbp)
	jle	.L35
.L34:
	cmpl	$1, -120(%rbp)
	je	.L110
	addl	$1, -100(%rbp)
.L31:
	cmpl	$999, -100(%rbp)
	jle	.L38
	jmp	.L22
.L110:
	nop
	jmp	.L22
.L10:
	movl	$0, -92(%rbp)
	jmp	.L39
.L46:
	movl	$0, -88(%rbp)
	jmp	.L40
.L43:
	movl	-36(%rbp), %eax
	imull	-92(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L41
	movl	$1, -120(%rbp)
	jmp	.L42
.L41:
	addl	$2, -88(%rbp)
.L40:
	cmpl	$999, -88(%rbp)
	jle	.L43
.L42:
	cmpl	$1, -120(%rbp)
	je	.L111
	addl	$1, -92(%rbp)
.L39:
	cmpl	$999, -92(%rbp)
	jle	.L46
	jmp	.L22
.L111:
	nop
	jmp	.L22
.L9:
	movl	$0, -84(%rbp)
	jmp	.L47
.L54:
	movl	$0, -80(%rbp)
	jmp	.L48
.L51:
	movl	-36(%rbp), %eax
	imull	-84(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-80(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L49
	movl	$1, -120(%rbp)
	jmp	.L50
.L49:
	addl	$2, -80(%rbp)
.L48:
	cmpl	$999, -80(%rbp)
	jle	.L51
.L50:
	cmpl	$1, -120(%rbp)
	je	.L112
	addl	$1, -84(%rbp)
.L47:
	cmpl	$999, -84(%rbp)
	jle	.L54
	jmp	.L22
.L112:
	nop
	jmp	.L22
.L8:
	movl	$0, -76(%rbp)
	jmp	.L55
.L62:
	movl	$1, -72(%rbp)
	jmp	.L56
.L59:
	movl	-36(%rbp), %eax
	imull	-76(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L57
	movl	$1, -120(%rbp)
	jmp	.L58
.L57:
	addl	$2, -72(%rbp)
.L56:
	cmpl	$999, -72(%rbp)
	jle	.L59
.L58:
	cmpl	$1, -120(%rbp)
	je	.L113
	addl	$1, -76(%rbp)
.L55:
	cmpl	$999, -76(%rbp)
	jle	.L62
	jmp	.L22
.L113:
	nop
	jmp	.L22
.L7:
	movl	$0, -68(%rbp)
	jmp	.L63
.L70:
	movl	$0, -64(%rbp)
	jmp	.L64
.L67:
	movl	-36(%rbp), %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-64(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L65
	movl	$1, -120(%rbp)
	jmp	.L66
.L65:
	addl	$2, -64(%rbp)
.L64:
	cmpl	$999, -64(%rbp)
	jle	.L67
.L66:
	cmpl	$1, -120(%rbp)
	je	.L114
	addl	$1, -68(%rbp)
.L63:
	cmpl	$999, -68(%rbp)
	jle	.L70
	jmp	.L22
.L114:
	nop
	jmp	.L22
.L6:
	movl	$0, -60(%rbp)
	jmp	.L71
.L78:
	movl	$0, -56(%rbp)
	jmp	.L72
.L75:
	movl	-36(%rbp), %eax
	imull	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L73
	movl	$1, -120(%rbp)
	jmp	.L74
.L73:
	addl	$2, -56(%rbp)
.L72:
	cmpl	$999, -56(%rbp)
	jle	.L75
.L74:
	cmpl	$1, -120(%rbp)
	je	.L115
	addl	$1, -60(%rbp)
.L71:
	cmpl	$999, -60(%rbp)
	jle	.L78
	jmp	.L22
.L115:
	nop
	jmp	.L22
.L5:
	movl	$0, -52(%rbp)
	jmp	.L79
.L86:
	movl	$0, -48(%rbp)
	jmp	.L80
.L83:
	movl	-36(%rbp), %eax
	imull	-52(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-48(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L81
	movl	$1, -120(%rbp)
	jmp	.L82
.L81:
	addl	$2, -48(%rbp)
.L80:
	cmpl	$999, -48(%rbp)
	jle	.L83
.L82:
	cmpl	$1, -120(%rbp)
	je	.L116
	addl	$1, -52(%rbp)
.L79:
	cmpl	$999, -52(%rbp)
	jle	.L86
	jmp	.L22
.L116:
	nop
	jmp	.L22
.L3:
	movl	$0, -44(%rbp)
	jmp	.L87
.L94:
	movl	$0, -40(%rbp)
	jmp	.L88
.L91:
	movl	-36(%rbp), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L89
	movl	$1, -120(%rbp)
	jmp	.L90
.L89:
	addl	$2, -40(%rbp)
.L88:
	cmpl	$998, -40(%rbp)
	jle	.L91
.L90:
	cmpl	$1, -120(%rbp)
	je	.L117
	addl	$1, -44(%rbp)
.L87:
	cmpl	$999, -44(%rbp)
	jle	.L94
	jmp	.L22
.L117:
	nop
	jmp	.L22
.L107:
	nop
.L22:
	movl	-120(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L96
	call	__stack_chk_fail@PLT
.L96:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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.
train
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	addq	$-128, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-124(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$100, -36(%rbp)
	movl	$101, -32(%rbp)
	movl	$102, -28(%rbp)
	movl	$103, -24(%rbp)
	movl	$104, -20(%rbp)
	movl	$105, -16(%rbp)
	movl	$0, -120(%rbp)
	movl	-124(%rbp), %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax
	shrq	$32, %rax
	sarl	$2, %eax
	movl	%ecx, %esi
	sarl	$31, %esi
	subl	%esi, %eax
	movl	%eax, %edx
	movl	%edx, %eax
	sall	$2, %eax
	addl	%edx, %eax
	addl	%eax, %eax
	subl	%eax, %ecx
	movl	%ecx, %edx
	cmpl	$9, %edx
	ja	.L107
	movl	%edx, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L4(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L4(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L4:
	.long	.L13-.L4
	.long	.L12-.L4
	.long	.L11-.L4
	.long	.L10-.L4
	.long	.L9-.L4
	.long	.L8-.L4
	.long	.L7-.L4
	.long	.L6-.L4
	.long	.L5-.L4
	.long	.L3-.L4
	.text
.L13:
	movl	$0, -116(%rbp)
	jmp	.L14
.L21:
	movl	$0, -112(%rbp)
	jmp	.L15
.L18:
	movl	-36(%rbp), %eax
	imull	-116(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-112(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L16
	movl	$1, -120(%rbp)
	jmp	.L17
.L16:
	addl	$2, -112(%rbp)
.L15:
	cmpl	$999, -112(%rbp)
	jle	.L18
.L17:
	cmpl	$1, -120(%rbp)
	je	.L108
	addl	$1, -116(%rbp)
.L14:
	cmpl	$999, -116(%rbp)
	jle	.L21
	jmp	.L22
.L108:
	nop
	jmp	.L22
.L12:
	movl	$0, -108(%rbp)
	jmp	.L23
.L30:
	movl	$0, -104(%rbp)
	jmp	.L24
.L27:
	movl	-36(%rbp), %eax
	imull	-108(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-104(%rbp), %eax
	addl	%eax, %edx
	movl	-32(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L25
	movl	$1, -120(%rbp)
	jmp	.L26
.L25:
	addl	$2, -104(%rbp)
.L24:
	cmpl	$999, -104(%rbp)
	jle	.L27
.L26:
	cmpl	$1, -120(%rbp)
	je	.L109
	addl	$1, -108(%rbp)
.L23:
	cmpl	$999, -108(%rbp)
	jle	.L30
	jmp	.L22
.L109:
	nop
	jmp	.L22
.L11:
	movl	$0, -100(%rbp)
	jmp	.L31
.L38:
	movl	$0, -96(%rbp)
	jmp	.L32
.L35:
	movl	-36(%rbp), %eax
	imull	-100(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-96(%rbp), %eax
	addl	%eax, %edx
	movl	-28(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L33
	movl	$1, -120(%rbp)
	jmp	.L34
.L33:
	addl	$2, -96(%rbp)
.L32:
	cmpl	$999, -96(%rbp)
	jle	.L35
.L34:
	cmpl	$1, -120(%rbp)
	je	.L110
	addl	$1, -100(%rbp)
.L31:
	cmpl	$999, -100(%rbp)
	jle	.L38
	jmp	.L22
.L110:
	nop
	jmp	.L22
.L10:
	movl	$0, -92(%rbp)
	jmp	.L39
.L46:
	movl	$0, -88(%rbp)
	jmp	.L40
.L43:
	movl	-36(%rbp), %eax
	imull	-92(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-88(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L41
	movl	$1, -120(%rbp)
	jmp	.L42
.L41:
	addl	$2, -88(%rbp)
.L40:
	cmpl	$999, -88(%rbp)
	jle	.L43
.L42:
	cmpl	$1, -120(%rbp)
	je	.L111
	addl	$1, -92(%rbp)
.L39:
	cmpl	$999, -92(%rbp)
	jle	.L46
	jmp	.L22
.L111:
	nop
	jmp	.L22
.L9:
	movl	$0, -84(%rbp)
	jmp	.L47
.L54:
	movl	$0, -80(%rbp)
	jmp	.L48
.L51:
	movl	-36(%rbp), %eax
	imull	-84(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-80(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L49
	movl	$1, -120(%rbp)
	jmp	.L50
.L49:
	addl	$2, -80(%rbp)
.L48:
	cmpl	$999, -80(%rbp)
	jle	.L51
.L50:
	cmpl	$1, -120(%rbp)
	je	.L112
	addl	$1, -84(%rbp)
.L47:
	cmpl	$999, -84(%rbp)
	jle	.L54
	jmp	.L22
.L112:
	nop
	jmp	.L22
.L8:
	movl	$0, -76(%rbp)
	jmp	.L55
.L62:
	movl	$1, -72(%rbp)
	jmp	.L56
.L59:
	movl	-36(%rbp), %eax
	imull	-76(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-72(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L57
	movl	$1, -120(%rbp)
	jmp	.L58
.L57:
	addl	$2, -72(%rbp)
.L56:
	cmpl	$999, -72(%rbp)
	jle	.L59
.L58:
	cmpl	$1, -120(%rbp)
	je	.L113
	addl	$1, -76(%rbp)
.L55:
	cmpl	$999, -76(%rbp)
	jle	.L62
	jmp	.L22
.L113:
	nop
	jmp	.L22
.L7:
	movl	$0, -68(%rbp)
	jmp	.L63
.L70:
	movl	$0, -64(%rbp)
	jmp	.L64
.L67:
	movl	-36(%rbp), %eax
	imull	-68(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-64(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L65
	movl	$1, -120(%rbp)
	jmp	.L66
.L65:
	addl	$2, -64(%rbp)
.L64:
	cmpl	$999, -64(%rbp)
	jle	.L67
.L66:
	cmpl	$1, -120(%rbp)
	je	.L114
	addl	$1, -68(%rbp)
.L63:
	cmpl	$999, -68(%rbp)
	jle	.L70
	jmp	.L22
.L114:
	nop
	jmp	.L22
.L6:
	movl	$0, -60(%rbp)
	jmp	.L71
.L78:
	movl	$0, -56(%rbp)
	jmp	.L72
.L75:
	movl	-36(%rbp), %eax
	imull	-60(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-56(%rbp), %eax
	addl	%eax, %edx
	movl	-24(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L73
	movl	$1, -120(%rbp)
	jmp	.L74
.L73:
	addl	$2, -56(%rbp)
.L72:
	cmpl	$999, -56(%rbp)
	jle	.L75
.L74:
	cmpl	$1, -120(%rbp)
	je	.L115
	addl	$1, -60(%rbp)
.L71:
	cmpl	$999, -60(%rbp)
	jle	.L78
	jmp	.L22
.L115:
	nop
	jmp	.L22
.L5:
	movl	$0, -52(%rbp)
	jmp	.L79
.L86:
	movl	$0, -48(%rbp)
	jmp	.L80
.L83:
	movl	-36(%rbp), %eax
	imull	-52(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-48(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L81
	movl	$1, -120(%rbp)
	jmp	.L82
.L81:
	addl	$2, -48(%rbp)
.L80:
	cmpl	$999, -48(%rbp)
	jle	.L83
.L82:
	cmpl	$1, -120(%rbp)
	je	.L116
	addl	$1, -52(%rbp)
.L79:
	cmpl	$999, -52(%rbp)
	jle	.L86
	jmp	.L22
.L116:
	nop
	jmp	.L22
.L3:
	movl	$0, -44(%rbp)
	jmp	.L87
.L94:
	movl	$0, -40(%rbp)
	jmp	.L88
.L91:
	movl	-36(%rbp), %eax
	imull	-44(%rbp), %eax
	movl	%eax, %edx
	movl	-16(%rbp), %eax
	imull	-40(%rbp), %eax
	addl	%eax, %edx
	movl	-20(%rbp), %eax
	addl	%eax, %edx
	movl	-16(%rbp), %eax
	addl	%edx, %eax
	movl	%eax, -12(%rbp)
	movl	-124(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jne	.L89
	movl	$1, -120(%rbp)
	jmp	.L90
.L89:
	addl	$2, -40(%rbp)
.L88:
	cmpl	$998, -40(%rbp)
	jle	.L91
.L90:
	cmpl	$1, -120(%rbp)
	je	.L117
	addl	$1, -44(%rbp)
.L87:
	cmpl	$999, -44(%rbp)
	jle	.L94
	jmp	.L22
.L117:
	nop
	jmp	.L22
.L107:
	nop
.L22:
	movl	-120(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L96
	call	__stack_chk_fail@PLT
.L96:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
