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

```c
//
//  main.c
//  Dirichlet's Theorem on Arithmetic Progressions
//
//  Created by x15071xx on 2016/06/06.
//  Copyright ?? 2016??´ AIT. All rights reserved.
//
//dm+a=n
//n???d??§?????£???a?????????&&?´???°?????°
#include <stdio.h>
#include <math.h>
#define NUM 1000000

int main(int argc, const char * argv[]) {
    
    int a,d,n,i,j;
    int hurui[NUM] = {0},count_n = 0;
    
    for (i=0; i<=NUM; i++) {
        hurui[i]=1;
    }
    hurui[1]=0;
    
    for (i=2; i<= NUM; i++) {
        if (hurui[i] == 1) {
            for(j = 2 * i; j <= NUM; j += i)
                hurui[j] = 0;
            
        }
    }
    
    while (1) {
        
        scanf("%d %d %d",&a,&d,&n);
        
        if(a==0&&d==0&&n==0){
            break;
        }
        
        for (i = a; i < NUM; i+=d) {
            if (hurui[i] == 1) {
                count_n++;
                if (count_n==n) {
                    printf("%d\n",i);
                    break;
                }
            }
        }
        count_n=0;
        
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-3997696(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2368, %rsp
	movl	%edi, -4000052(%rbp)
	movq	%rsi, -4000064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4000016(%rbp), %rax
	movl	$4000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -4000020(%rbp)
	movl	$0, -4000028(%rbp)
	jmp	.L2
.L3:
	movl	-4000028(%rbp), %eax
	cltq
	movl	$1, -4000016(%rbp,%rax,4)
	addl	$1, -4000028(%rbp)
.L2:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L3
	movl	$0, -4000012(%rbp)
	movl	$2, -4000028(%rbp)
	jmp	.L4
.L8:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-4000028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -4000024(%rbp)
	jmp	.L6
.L7:
	movl	-4000024(%rbp), %eax
	cltq
	movl	$0, -4000016(%rbp,%rax,4)
	movl	-4000028(%rbp), %eax
	addl	%eax, -4000024(%rbp)
.L6:
	cmpl	$1000000, -4000024(%rbp)
	jle	.L7
.L5:
	addl	$1, -4000028(%rbp)
.L4:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L8
.L15:
	leaq	-4000032(%rbp), %rcx
	leaq	-4000036(%rbp), %rdx
	leaq	-4000040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4000040(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000036(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000032(%rbp), %eax
	testl	%eax, %eax
	je	.L19
.L9:
	movl	-4000040(%rbp), %eax
	movl	%eax, -4000028(%rbp)
	jmp	.L11
.L14:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -4000020(%rbp)
	movl	-4000032(%rbp), %eax
	cmpl	%eax, -4000020(%rbp)
	jne	.L12
	movl	-4000028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-4000036(%rbp), %eax
	addl	%eax, -4000028(%rbp)
.L11:
	cmpl	$999999, -4000028(%rbp)
	jle	.L14
.L13:
	movl	$0, -4000020(%rbp)
	jmp	.L15
.L19:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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
.LC1:
	.string	"%d %d %d"
.LC2:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997752
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000096
	movl	$4000000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r15
	movq	%r15, %rdi
	call	memset@PLT
	movdqa	.LC0(%rip), %xmm0
	leaq	4000016(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L2:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L2
	movl	$1, 4000016(%rsp)
	movl	$4, %ecx
	movl	$2, %eax
	movl	$0, 20(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	$1000001, %rax
	je	.L29
.L4:
	cmpl	$1, (%r15,%rax,4)
	jne	.L6
	cmpq	$1000000, %rcx
	ja	.L6
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$0, (%r15,%rdx,4)
	addq	%rax, %rdx
	cmpl	$1000000, %edx
	jle	.L7
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	$1000001, %rax
	jne	.L4
.L29:
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	4(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L8
	movl	8(%rsp), %edx
	movl	12(%rsp), %esi
	movl	%edx, %edi
	orl	%esi, %edi
	je	.L30
	xorl	%ecx, %ecx
	cmpl	$1, %edx
	je	.L17
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rax
	cmpl	$999999, %eax
	jg	.L25
.L17:
	cmpl	$1, (%r15,%rax,4)
	movl	%eax, %edx
	jne	.L15
	addl	$1, %ecx
	cmpl	%esi, %ecx
	jne	.L15
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$999999, %eax
	jg	.L25
	movl	8(%rsp), %edx
	movl	12(%rsp), %esi
	xorl	%ecx, %ecx
	cmpl	$1, %edx
	je	.L17
.L31:
	movslq	%edx, %rcx
	xorl	%edi, %edi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	addq	%rcx, %rax
	cmpl	$999999, %eax
	jg	.L25
.L14:
	cmpl	$1, (%r15,%rax,4)
	movl	%eax, %edx
	jne	.L13
	addl	$1, %edi
	cmpl	%edi, %esi
	jne	.L13
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
.L30:
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$4000040, %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
.L32:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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
.LC1:
	.string	"%d %d %d"
.LC2:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-3997696(%rsp), %r11
	.cfi_def_cfa 11, 3997752
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$2344, %rsp
	.cfi_def_cfa_offset 4000096
	movl	$4000000, %edx
	xorl	%esi, %esi
	movq	%fs:40, %rax
	movq	%rax, 4000024(%rsp)
	xorl	%eax, %eax
	leaq	16(%rsp), %r15
	movq	%r15, %rdi
	call	memset@PLT
	movdqa	.LC0(%rip), %xmm0
	leaq	4000016(%rsp), %rdx
	.p2align 4,,10
	.p2align 3
.L2:
	movaps	%xmm0, (%rax)
	addq	$16, %rax
	cmpq	%rdx, %rax
	jne	.L2
	movl	$1, 4000016(%rsp)
	movl	$4, %ecx
	movl	$2, %eax
	movl	$0, 20(%rsp)
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	$1000001, %rax
	je	.L29
.L4:
	cmpl	$1, (%r15,%rax,4)
	jne	.L6
	cmpq	$1000000, %rcx
	ja	.L6
	movq	%rcx, %rdx
	.p2align 4,,10
	.p2align 3
.L7:
	movl	$0, (%r15,%rdx,4)
	addq	%rax, %rdx
	cmpl	$1000000, %edx
	jle	.L7
	addq	$1, %rax
	addq	$2, %rcx
	cmpq	$1000001, %rax
	jne	.L4
.L29:
	leaq	12(%rsp), %r13
	leaq	8(%rsp), %r12
	leaq	4(%rsp), %rbp
	leaq	.LC1(%rip), %rbx
	leaq	.LC2(%rip), %r14
	.p2align 4,,10
	.p2align 3
.L25:
	movq	%r13, %rcx
	movq	%r12, %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jne	.L8
	movl	8(%rsp), %edx
	movl	12(%rsp), %esi
	movl	%edx, %edi
	orl	%esi, %edi
	je	.L30
	xorl	%ecx, %ecx
	cmpl	$1, %edx
	je	.L17
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L15:
	addq	$1, %rax
	cmpl	$999999, %eax
	jg	.L25
.L17:
	cmpl	$1, (%r15,%rax,4)
	movl	%eax, %edx
	jne	.L15
	addl	$1, %ecx
	cmpl	%esi, %ecx
	jne	.L15
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L8:
	cmpl	$999999, %eax
	jg	.L25
	movl	8(%rsp), %edx
	movl	12(%rsp), %esi
	xorl	%ecx, %ecx
	cmpl	$1, %edx
	je	.L17
.L31:
	movslq	%edx, %rcx
	xorl	%edi, %edi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L13:
	addq	%rcx, %rax
	cmpl	$999999, %eax
	jg	.L25
.L14:
	cmpl	$1, (%r15,%rax,4)
	movl	%eax, %edx
	jne	.L13
	addl	$1, %edi
	cmpl	%edi, %esi
	jne	.L13
	movq	%r14, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L25
.L30:
	movq	4000024(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$4000040, %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
.L32:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	1
	.long	1
	.long	1
	.long	1
	.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:

//
//  main.c
//  Dirichlet's Theorem on Arithmetic Progressions
//
//  Created by x15071xx on 2016/06/06.
//  Copyright ?? 2016??´ AIT. All rights reserved.
//
//dm+a=n
//n???d??§?????£???a?????????&&?´???°?????°
#include <stdio.h>
#include <math.h>
#define NUM 1000000

int main(int argc, const char * argv[]) {
    
    int a,d,n,i,j;
    int hurui[NUM] = {0},count_n = 0;
    
    for (i=0; i<=NUM; i++) {
        hurui[i]=1;
    }
    hurui[1]=0;
    
    for (i=2; i<= NUM; i++) {
        if (hurui[i] == 1) {
            for(j = 2 * i; j <= NUM; j += i)
                hurui[j] = 0;
            
        }
    }
    
    while (1) {
        
        scanf("%d %d %d",&a,&d,&n);
        
        if(a==0&&d==0&&n==0){
            break;
        }
        
        for (i = a; i < NUM; i+=d) {
            if (hurui[i] == 1) {
                count_n++;
                if (count_n==n) {
                    printf("%d\n",i);
                    break;
                }
            }
        }
        count_n=0;
        
    }
    return 0;
}
367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
37 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 50 85
1 1 1
9075 337 210
307 24 79
331 221 177
259 170 40
269 75 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 33 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 87 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 170 40
37 58 146
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
19 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
103 230 1
27 104 185
253 145 85
1 1 1
9075 337 210
307 24 79
331 221 345
259 33 40
269 58 102
0 0 0
 367 186 151
179 10 203
271 37 39
73 230 1
19 104 185
253 87 85
1 1 1
10208 337 210
307 24 79
331 221 177
259 170 40
269 58 102
0 0 0

92809
6709
12037
103
93523
43579
2
899429
5107
412717
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
24919
 92809
6709
12037
103
93523
14503
2
899429
5107
412717
22699
38669
 92809
6709
12037
103
93523
43579
2
925163
5107
412717
22699
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
6199
25673
 92809
6709
12037
103
93523
43579
2
899429
5107
842341
22699
36809
 92809
6709
12037
103
91019
43579
2
925163
5107
412717
22699
25673
 92809
6709
12037
103
93523
94793
2
899429
5107
842341
6199
25673
 92809
6709
12037
73
91019
43579
2
925163
5107
412717
22699
25673

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

```c
//
//  main.c
//  Dirichlet's Theorem on Arithmetic Progressions
//
//  Created by x15071xx on 2016/06/06.
//  Copyright ?? 2016??´ AIT. All rights reserved.
//
//dm+a=n
//n???d??§?????£???a?????????&&?´???°?????°
#include <stdio.h>
#include <math.h>
#define NUM 1000000

int main(int argc, const char * argv[]) {
    
    int a,d,n,i,j;
    int hurui[NUM] = {0},count_n = 0;
    
    for (i=0; i<=NUM; i++) {
        hurui[i]=1;
    }
    hurui[1]=0;
    
    for (i=2; i<= NUM; i++) {
        if (hurui[i] == 1) {
            for(j = 2 * i; j <= NUM; j += i)
                hurui[j] = 0;
            
        }
    }
    
    while (1) {
        
        scanf("%d %d %d",&a,&d,&n);
        
        if(a==0&&d==0&&n==0){
            break;
        }
        
        for (i = a; i < NUM; i+=d) {
            if (hurui[i] == 1) {
                count_n++;
                if (count_n==n) {
                    printf("%d\n",i);
                    break;
                }
            }
        }
        count_n=0;
        
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d %d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-3997696(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2368, %rsp
	movl	%edi, -4000052(%rbp)
	movq	%rsi, -4000064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4000016(%rbp), %rax
	movl	$4000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -4000020(%rbp)
	movl	$0, -4000028(%rbp)
	jmp	.L2
.L3:
	movl	-4000028(%rbp), %eax
	cltq
	movl	$1, -4000016(%rbp,%rax,4)
	addl	$1, -4000028(%rbp)
.L2:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L3
	movl	$0, -4000012(%rbp)
	movl	$2, -4000028(%rbp)
	jmp	.L4
.L8:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-4000028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -4000024(%rbp)
	jmp	.L6
.L7:
	movl	-4000024(%rbp), %eax
	cltq
	movl	$0, -4000016(%rbp,%rax,4)
	movl	-4000028(%rbp), %eax
	addl	%eax, -4000024(%rbp)
.L6:
	cmpl	$1000000, -4000024(%rbp)
	jle	.L7
.L5:
	addl	$1, -4000028(%rbp)
.L4:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L8
.L15:
	leaq	-4000032(%rbp), %rcx
	leaq	-4000036(%rbp), %rdx
	leaq	-4000040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4000040(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000036(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000032(%rbp), %eax
	testl	%eax, %eax
	je	.L19
.L9:
	movl	-4000040(%rbp), %eax
	movl	%eax, -4000028(%rbp)
	jmp	.L11
.L14:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -4000020(%rbp)
	movl	-4000032(%rbp), %eax
	cmpl	%eax, -4000020(%rbp)
	jne	.L12
	movl	-4000028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-4000036(%rbp), %eax
	addl	%eax, -4000028(%rbp)
.L11:
	cmpl	$999999, -4000028(%rbp)
	jle	.L14
.L13:
	movl	$0, -4000020(%rbp)
	jmp	.L15
.L19:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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 %d %d"
.LC1:
	.string	"%d\n"
	.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
	leaq	-3997696(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$2368, %rsp
	movl	%edi, -4000052(%rbp)
	movq	%rsi, -4000064(%rbp)
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-4000016(%rbp), %rax
	movl	$4000000, %edx
	movl	$0, %esi
	movq	%rax, %rdi
	call	memset@PLT
	movl	$0, -4000020(%rbp)
	movl	$0, -4000028(%rbp)
	jmp	.L2
.L3:
	movl	-4000028(%rbp), %eax
	cltq
	movl	$1, -4000016(%rbp,%rax,4)
	addl	$1, -4000028(%rbp)
.L2:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L3
	movl	$0, -4000012(%rbp)
	movl	$2, -4000028(%rbp)
	jmp	.L4
.L8:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L5
	movl	-4000028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, -4000024(%rbp)
	jmp	.L6
.L7:
	movl	-4000024(%rbp), %eax
	cltq
	movl	$0, -4000016(%rbp,%rax,4)
	movl	-4000028(%rbp), %eax
	addl	%eax, -4000024(%rbp)
.L6:
	cmpl	$1000000, -4000024(%rbp)
	jle	.L7
.L5:
	addl	$1, -4000028(%rbp)
.L4:
	cmpl	$1000000, -4000028(%rbp)
	jle	.L8
.L15:
	leaq	-4000032(%rbp), %rcx
	leaq	-4000036(%rbp), %rdx
	leaq	-4000040(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-4000040(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000036(%rbp), %eax
	testl	%eax, %eax
	jne	.L9
	movl	-4000032(%rbp), %eax
	testl	%eax, %eax
	je	.L19
.L9:
	movl	-4000040(%rbp), %eax
	movl	%eax, -4000028(%rbp)
	jmp	.L11
.L14:
	movl	-4000028(%rbp), %eax
	cltq
	movl	-4000016(%rbp,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L12
	addl	$1, -4000020(%rbp)
	movl	-4000032(%rbp), %eax
	cmpl	%eax, -4000020(%rbp)
	jne	.L12
	movl	-4000028(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L13
.L12:
	movl	-4000036(%rbp), %eax
	addl	%eax, -4000028(%rbp)
.L11:
	cmpl	$999999, -4000028(%rbp)
	jle	.L14
.L13:
	movl	$0, -4000020(%rbp)
	jmp	.L15
.L19:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
