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

```c
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
int main(void){
    int n,i,num,j,t,o;
    char line[9],line1[5];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&num);
        printf("Case %d:\n",i+1);
        for(o=0;j=0,memset(line1,'0',sizeof(line1)),memset(line,0,sizeof(line)),o<10;o++){
            num*=num;
            sprintf(line,"%d",num);
            while(line[j]) j++;
            j-=3;
            for(t=0;t<4 && j >= 0;j--,t++)
                line1[3-t]=line[j];
            line1[4]=0;
           printf("%d\n",num=atoi(line1));
        }
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"Case %d:\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	20(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	26(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	31(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	movl	$10, %r12d
	call	__isoc99_scanf@PLT
	movl	%r15d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	.p2align 4,,10
	.p2align 3
.L6:
	movl	20(%rsp), %r8d
	xorl	%eax, %eax
	movq	%r13, %rcx
	movl	$9, %edx
	movl	$1, %esi
	movq	%rbx, %rdi
	imull	%r8d, %r8d
	movl	%r8d, 20(%rsp)
	call	__sprintf_chk@PLT
	cmpb	$0, 31(%rsp)
	je	.L3
	cmpb	$0, 32(%rsp)
	je	.L3
	cmpb	$0, 33(%rsp)
	je	.L3
	cmpb	$0, 34(%rsp)
	je	.L4
	cmpb	$0, 35(%rsp)
	je	.L10
	cmpb	$0, 36(%rsp)
	je	.L11
	cmpb	$0, 37(%rsp)
	je	.L12
	cmpb	$1, 38(%rsp)
	movl	$6, %eax
	sbbl	$-1, %eax
.L5:
	leal	-2(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 29(%rsp)
	leal	-3(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 28(%rsp)
	movl	%eax, %edx
	subl	$4, %edx
	js	.L3
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 27(%rsp)
	subl	$5, %eax
	js	.L3
	cltq
	movzbl	31(%rsp,%rax), %eax
	movb	%al, 26(%rsp)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movb	$0, 30(%rsp)
	call	strtol@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	movl	%eax, 20(%rsp)
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	subl	$1, %r12d
	jne	.L6
	cmpl	16(%rsp), %r15d
	jl	.L7
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L4:
	.cfi_restore_state
	movzbl	31(%rsp), %eax
	movb	%al, 29(%rsp)
	jmp	.L3
.L10:
	movl	$3, %eax
	jmp	.L5
.L11:
	movl	$4, %eax
	jmp	.L5
.L12:
	movl	$5, %eax
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"Case %d:\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	20(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	26(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	31(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	movl	$10, %r12d
	call	__isoc99_scanf@PLT
	movl	%r15d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	.p2align 4,,10
	.p2align 3
.L6:
	movl	20(%rsp), %r8d
	xorl	%eax, %eax
	movq	%r13, %rcx
	movl	$9, %edx
	movl	$1, %esi
	movq	%rbx, %rdi
	imull	%r8d, %r8d
	movl	%r8d, 20(%rsp)
	call	__sprintf_chk@PLT
	cmpb	$0, 31(%rsp)
	je	.L3
	cmpb	$0, 32(%rsp)
	je	.L3
	cmpb	$0, 33(%rsp)
	je	.L3
	cmpb	$0, 34(%rsp)
	je	.L4
	cmpb	$0, 35(%rsp)
	je	.L10
	cmpb	$0, 36(%rsp)
	je	.L11
	cmpb	$0, 37(%rsp)
	je	.L12
	cmpb	$1, 38(%rsp)
	movl	$6, %eax
	sbbl	$-1, %eax
.L5:
	leal	-2(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 29(%rsp)
	leal	-3(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 28(%rsp)
	movl	%eax, %edx
	subl	$4, %edx
	js	.L3
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 27(%rsp)
	subl	$5, %eax
	js	.L3
	cltq
	movzbl	31(%rsp,%rax), %eax
	movb	%al, 26(%rsp)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movb	$0, 30(%rsp)
	call	strtol@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	movl	%eax, 20(%rsp)
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	subl	$1, %r12d
	jne	.L6
	cmpl	16(%rsp), %r15d
	jl	.L7
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L4:
	.cfi_restore_state
	movzbl	31(%rsp), %eax
	movb	%al, 29(%rsp)
	jmp	.L3
.L10:
	movl	$3, %eax
	jmp	.L5
.L11:
	movl	$4, %eax
	jmp	.L5
.L12:
	movl	$5, %eax
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"Case %d:\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	20(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	26(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	31(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	movl	$10, %r12d
	call	__isoc99_scanf@PLT
	movl	%r15d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	.p2align 4,,10
	.p2align 3
.L6:
	movl	20(%rsp), %r8d
	xorl	%eax, %eax
	movq	%r13, %rcx
	movl	$9, %edx
	movl	$1, %esi
	movq	%rbx, %rdi
	imull	%r8d, %r8d
	movl	%r8d, 20(%rsp)
	call	__sprintf_chk@PLT
	cmpb	$0, 31(%rsp)
	je	.L3
	cmpb	$0, 32(%rsp)
	je	.L3
	cmpb	$0, 33(%rsp)
	je	.L3
	cmpb	$0, 34(%rsp)
	je	.L4
	cmpb	$0, 35(%rsp)
	je	.L10
	cmpb	$0, 36(%rsp)
	je	.L11
	cmpb	$0, 37(%rsp)
	je	.L12
	cmpb	$1, 38(%rsp)
	movl	$6, %eax
	sbbl	$-1, %eax
.L5:
	leal	-2(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 29(%rsp)
	leal	-3(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 28(%rsp)
	movl	%eax, %edx
	subl	$4, %edx
	js	.L3
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 27(%rsp)
	subl	$5, %eax
	js	.L3
	cltq
	movzbl	31(%rsp,%rax), %eax
	movb	%al, 26(%rsp)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movb	$0, 30(%rsp)
	call	strtol@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	movl	%eax, 20(%rsp)
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	subl	$1, %r12d
	jne	.L6
	cmpl	16(%rsp), %r15d
	jl	.L7
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L4:
	.cfi_restore_state
	movzbl	31(%rsp), %eax
	movb	%al, 29(%rsp)
	jmp	.L3
.L10:
	movl	$3, %eax
	jmp	.L5
.L11:
	movl	$4, %eax
	jmp	.L5
.L12:
	movl	$5, %eax
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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>
#include <stdlib.h>
#include <memory.h>
int main(void){
    int n,i,num,j,t,o;
    char line[9],line1[5];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&num);
        printf("Case %d:\n",i+1);
        for(o=0;j=0,memset(line1,'0',sizeof(line1)),memset(line,0,sizeof(line)),o<10;o++){
            num*=num;
            sprintf(line,"%d",num);
            while(line[j]) j++;
            j-=3;
            for(t=0;t<4 && j >= 0;j--,t++)
                line1[3-t]=line[j];
            line1[4]=0;
           printf("%d\n",num=atoi(line1));
        }
    }
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
int main(void){
    int n,i,num,j,t,o;
    char line[9],line1[5];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&num);
        printf("Case %d:\n",i+1);
        for(o=0;j=0,memset(line1,'0',sizeof(line1)),memset(line,0,sizeof(line)),o<10;o++){
            num*=num;
            sprintf(line,"%d",num);
            while(line[j]) j++;
            j-=3;
            for(t=0;t<4 && j >= 0;j--,t++)
                line1[3-t]=line[j];
            line1[4]=0;
           printf("%d\n",num=atoi(line1));
        }
    }
    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:

2
210
567
 2
210
225
 2
272
225
 2
272
153
 2
499
153
 2
711
153
 2
390
153
 2
390
297
 2
191
297
 2
191
461

Case 1:
441
1944
7791
6996
9440
1136
2904
4332
7662
7062
Case 2:
3214
3297
8702
7248
5335
4622
3628
1623
6341
2082
 Case 1:
441
1944
7791
6996
9440
1136
2904
4332
7662
7062
Case 2:
506
2560
5536
6472
8867
6236
8876
7833
3558
6593
 Case 1:
739
5461
8225
6506
3280
7584
5170
7289
1295
6770
Case 2:
506
2560
5536
6472
8867
6236
8876
7833
3558
6593
 Case 1:
739
5461
8225
6506
3280
7584
5170
7289
1295
6770
Case 2:
234
547
2992
9520
6304
7404
8192
1088
1837
3745
 Case 1:
2490
2001
40
16
2
0
0
0
0
0
Case 2:
234
547
2992
9520
6304
7404
8192
1088
1837
3745
 Case 1:
5055
5530
5809
7444
4131
651
4238
9606
2752
5735
Case 2:
234
547
2992
9520
6304
7404
8192
1088
1837
3745
 Case 1:
1521
3134
8219
5519
4593
956
9139
5213
1753
730
Case 2:
234
547
2992
9520
6304
7404
8192
1088
1837
3745
 Case 1:
1521
3134
8219
5519
4593
956
9139
5213
1753
730
Case 2:
882
7779
5128
2963
7793
7308
4068
5486
961
9235
 Case 1:
364
1324
7529
6858
321
1030
609
3708
7492
1300
Case 2:
882
7779
5128
2963
7793
7308
4068
5486
961
9235
 Case 1:
364
1324
7529
6858
321
1030
609
3708
7492
1300
Case 2:
2125
5156
5843
1406
9768
4138
1230
5129
3066
4003

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

```c
#include <stdio.h>
#include <stdlib.h>
#include <memory.h>
int main(void){
    int n,i,num,j,t,o;
    char line[9],line1[5];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d",&num);
        printf("Case %d:\n",i+1);
        for(o=0;j=0,memset(line1,'0',sizeof(line1)),memset(line,0,sizeof(line)),o<10;o++){
            num*=num;
            sprintf(line,"%d",num);
            while(line[j]) j++;
            j-=3;
            for(t=0;t<4 && j >= 0;j--,t++)
                line1[3-t]=line[j];
            line1[4]=0;
           printf("%d\n",num=atoi(line1));
        }
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"Case %d:\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	20(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	26(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	31(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	movl	$10, %r12d
	call	__isoc99_scanf@PLT
	movl	%r15d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	.p2align 4,,10
	.p2align 3
.L6:
	movl	20(%rsp), %r8d
	xorl	%eax, %eax
	movq	%r13, %rcx
	movl	$9, %edx
	movl	$1, %esi
	movq	%rbx, %rdi
	imull	%r8d, %r8d
	movl	%r8d, 20(%rsp)
	call	__sprintf_chk@PLT
	cmpb	$0, 31(%rsp)
	je	.L3
	cmpb	$0, 32(%rsp)
	je	.L3
	cmpb	$0, 33(%rsp)
	je	.L3
	cmpb	$0, 34(%rsp)
	je	.L4
	cmpb	$0, 35(%rsp)
	je	.L10
	cmpb	$0, 36(%rsp)
	je	.L11
	cmpb	$0, 37(%rsp)
	je	.L12
	cmpb	$1, 38(%rsp)
	movl	$6, %eax
	sbbl	$-1, %eax
.L5:
	leal	-2(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 29(%rsp)
	leal	-3(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 28(%rsp)
	movl	%eax, %edx
	subl	$4, %edx
	js	.L3
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 27(%rsp)
	subl	$5, %eax
	js	.L3
	cltq
	movzbl	31(%rsp,%rax), %eax
	movb	%al, 26(%rsp)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movb	$0, 30(%rsp)
	call	strtol@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	movl	%eax, 20(%rsp)
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	subl	$1, %r12d
	jne	.L6
	cmpl	16(%rsp), %r15d
	jl	.L7
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L4:
	.cfi_restore_state
	movzbl	31(%rsp), %eax
	movb	%al, 29(%rsp)
	jmp	.L3
.L10:
	movl	$3, %eax
	jmp	.L5
.L11:
	movl	$4, %eax
	jmp	.L5
.L12:
	movl	$5, %eax
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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"
.LC1:
	.string	"Case %d:\n"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB51:
	.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
	leaq	.LC0(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movq	%r13, %rdi
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$56, %rsp
	.cfi_def_cfa_offset 112
	movq	%fs:40, %rax
	movq	%rax, 40(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %eax
	testl	%eax, %eax
	jle	.L2
	leaq	20(%rsp), %rax
	xorl	%r15d, %r15d
	leaq	26(%rsp), %rbp
	movq	%rax, 8(%rsp)
	leaq	31(%rsp), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L7:
	movq	8(%rsp), %rsi
	movq	%r13, %rdi
	xorl	%eax, %eax
	addl	$1, %r15d
	movl	$10, %r12d
	call	__isoc99_scanf@PLT
	movl	%r15d, %edx
	movl	$1, %edi
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	.p2align 4,,10
	.p2align 3
.L6:
	movl	20(%rsp), %r8d
	xorl	%eax, %eax
	movq	%r13, %rcx
	movl	$9, %edx
	movl	$1, %esi
	movq	%rbx, %rdi
	imull	%r8d, %r8d
	movl	%r8d, 20(%rsp)
	call	__sprintf_chk@PLT
	cmpb	$0, 31(%rsp)
	je	.L3
	cmpb	$0, 32(%rsp)
	je	.L3
	cmpb	$0, 33(%rsp)
	je	.L3
	cmpb	$0, 34(%rsp)
	je	.L4
	cmpb	$0, 35(%rsp)
	je	.L10
	cmpb	$0, 36(%rsp)
	je	.L11
	cmpb	$0, 37(%rsp)
	je	.L12
	cmpb	$1, 38(%rsp)
	movl	$6, %eax
	sbbl	$-1, %eax
.L5:
	leal	-2(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 29(%rsp)
	leal	-3(%rax), %edx
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 28(%rsp)
	movl	%eax, %edx
	subl	$4, %edx
	js	.L3
	movslq	%edx, %rdx
	movzbl	31(%rsp,%rdx), %edx
	movb	%dl, 27(%rsp)
	subl	$5, %eax
	js	.L3
	cltq
	movzbl	31(%rsp,%rax), %eax
	movb	%al, 26(%rsp)
.L3:
	movl	$10, %edx
	xorl	%esi, %esi
	movq	%rbp, %rdi
	movb	$0, 30(%rsp)
	call	strtol@PLT
	movq	%r14, %rsi
	movl	$1, %edi
	movl	%eax, 20(%rsp)
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	$808464432, 0(%rbp)
	movb	$48, 4(%rbp)
	movq	$0, (%rbx)
	movb	$0, 8(%rbx)
	subl	$1, %r12d
	jne	.L6
	cmpl	16(%rsp), %r15d
	jl	.L7
.L2:
	movq	40(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L19
	addq	$56, %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
.L4:
	.cfi_restore_state
	movzbl	31(%rsp), %eax
	movb	%al, 29(%rsp)
	jmp	.L3
.L10:
	movl	$3, %eax
	jmp	.L5
.L11:
	movl	$4, %eax
	jmp	.L5
.L12:
	movl	$5, %eax
	jmp	.L5
.L19:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE51:
	.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:
```