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>
#define MAX 7368791
char flag[MAX+1];
int m;
int n;
int main(void){
    int i,j;
    while(1){
        scanf("%d%d", &m, &n);
        if(m==0 && n==0) break;
        for(i=0; i<=MAX; i++) flag[i] = 0;
        for(i=0; i<n; i++){
            for(j=m; j<=MAX; j += m)
                flag[j] = 1;
            while(flag[m]==1) m++;
        }
        printf("%d\n",m);
    }
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 7368792
flag:
	.zero	7368792
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L4:
	cmpl	$7368791, -8(%rbp)
	jle	.L5
	movl	$0, -8(%rbp)
	jmp	.L6
.L11:
	movl	m(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	m(%rip), %eax
	addl	%eax, -4(%rbp)
.L7:
	cmpl	$7368791, -4(%rbp)
	jle	.L8
	jmp	.L9
.L10:
	movl	m(%rip), %eax
	addl	$1, %eax
	movl	%eax, m(%rip)
.L9:
	movl	m(%rip), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$1, %al
	je	.L10
	addl	$1, -8(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	movl	$0, %eax
	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%d"
.LC1:
	.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
	leaq	flag(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-1(%r13), %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	m(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	leaq	n(%rip), %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %r12d
	movl	n(%rip), %r15d
	movl	%r12d, %eax
	orl	%r15d, %eax
	je	.L2
	xorl	%esi, %esi
	movl	$7368792, %edx
	movq	%r13, %rdi
	call	memset@PLT
	testl	%r15d, %r15d
	jle	.L3
	movl	%r12d, %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rcx
	movq	%rcx, %rax
	cmpl	$7368791, %edx
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movb	$1, 0(%r13,%rax)
	addq	%rcx, %rax
	cmpl	$7368791, %eax
	jle	.L7
.L8:
	leal	1(%rdx), %eax
	cmpb	$1, 0(%r13,%rcx)
	cltq
	jne	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edx
	addq	$1, %rax
	cmpb	$1, (%r14,%rax)
	je	.L9
	movl	$1, %edi
.L6:
	addl	$1, %esi
	cmpl	%esi, %r15d
	jne	.L10
	testb	%dil, %dil
	je	.L3
	movl	%edx, m(%rip)
	movl	%edx, %r12d
.L3:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
.L2:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 7368792
flag:
	.zero	7368792
	.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%d"
.LC1:
	.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
	leaq	flag(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	leaq	-1(%r13), %r14
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	leaq	m(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	.LC0(%rip), %rbx
	subq	$8, %rsp
	.cfi_def_cfa_offset 64
	.p2align 4,,10
	.p2align 3
.L11:
	xorl	%eax, %eax
	leaq	n(%rip), %rdx
	movq	%rbp, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	m(%rip), %r12d
	movl	n(%rip), %r15d
	movl	%r12d, %eax
	orl	%r15d, %eax
	je	.L2
	xorl	%esi, %esi
	movl	$7368792, %edx
	movq	%r13, %rdi
	call	memset@PLT
	testl	%r15d, %r15d
	jle	.L3
	movl	%r12d, %edx
	xorl	%edi, %edi
	xorl	%esi, %esi
	.p2align 4,,10
	.p2align 3
.L10:
	movslq	%edx, %rcx
	movq	%rcx, %rax
	cmpl	$7368791, %edx
	jg	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	movb	$1, 0(%r13,%rax)
	addq	%rcx, %rax
	cmpl	$7368791, %eax
	jle	.L7
.L8:
	leal	1(%rdx), %eax
	cmpb	$1, 0(%r13,%rcx)
	cltq
	jne	.L6
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%eax, %edx
	addq	$1, %rax
	cmpb	$1, (%r14,%rax)
	je	.L9
	movl	$1, %edi
.L6:
	addl	$1, %esi
	cmpl	%esi, %r15d
	jne	.L10
	testb	%dil, %dil
	je	.L3
	movl	%edx, m(%rip)
	movl	%edx, %r12d
.L3:
	movl	%r12d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L11
.L2:
	addq	$8, %rsp
	.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
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.globl	n
	.bss
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	flag
	.align 32
	.type	flag, @object
	.size	flag, 7368792
flag:
	.zero	7368792
	.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>
#define MAX 7368791
char flag[MAX+1];
int m;
int n;
int main(void){
    int i,j;
    while(1){
        scanf("%d%d", &m, &n);
        if(m==0 && n==0) break;
        for(i=0; i<=MAX; i++) flag[i] = 0;
        for(i=0; i<n; i++){
            for(j=m; j<=MAX; j += m)
                flag[j] = 1;
            while(flag[m]==1) m++;
        }
        printf("%d\n",m);
    }
    return 0;
}


3 2
3 4
10 20
100 50
2 500000
0 0
 3 2
3 4
13 20
100 50
2 500000
0 0
 3 2
3 4
22 20
100 50
2 500000
0 0
 3 1
3 4
10 20
100 50
3 500000
0 0
 3 2
3 4
13 20
100 50
4 500000
0 0
 3 2
3 4
10 20
100 52
2 500000
0 0
 6 1
3 4
10 20
100 50
3 500000
0 0
 6 1
3 4
10 20
100 50
3 202868
0 0
 2 2
3 4
13 22
100 50
4 500000
0 0
 3 1
3 4
10 20
101 50
2 500000
0 0

5
11
47
150
7368791
 5
11
43
150
7368791
 5
11
42
150
7368791
 4
11
47
150
7368791
 5
11
43
150
7368787
 5
11
47
152
7368791
 7
11
47
150
7368791
 7
11
47
150
2792771
 5
11
49
150
7368787
 4
11
47
151
7368791

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>
#define MAX 7368791
char flag[MAX+1];
int m;
int n;
int main(void){
    int i,j;
    while(1){
        scanf("%d%d", &m, &n);
        if(m==0 && n==0) break;
        for(i=0; i<=MAX; i++) flag[i] = 0;
        for(i=0; i<n; i++){
            for(j=m; j<=MAX; j += m)
                flag[j] = 1;
            while(flag[m]==1) m++;
        }
        printf("%d\n",m);
    }
    return 0;
}

```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 7368792
flag:
	.zero	7368792
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L4:
	cmpl	$7368791, -8(%rbp)
	jle	.L5
	movl	$0, -8(%rbp)
	jmp	.L6
.L11:
	movl	m(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	m(%rip), %eax
	addl	%eax, -4(%rbp)
.L7:
	cmpl	$7368791, -4(%rbp)
	jle	.L8
	jmp	.L9
.L10:
	movl	m(%rip), %eax
	addl	$1, %eax
	movl	%eax, m(%rip)
.L9:
	movl	m(%rip), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$1, %al
	je	.L10
	addl	$1, -8(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	movl	$0, %eax
	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
	.globl	flag
	.bss
	.align 32
	.type	flag, @object
	.size	flag, 7368792
flag:
	.zero	7368792
	.globl	m
	.align 4
	.type	m, @object
	.size	m, 4
m:
	.zero	4
	.globl	n
	.align 4
	.type	n, @object
	.size	n, 4
n:
	.zero	4
	.section	.rodata
.LC0:
	.string	"%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
	subq	$16, %rsp
.L12:
	leaq	n(%rip), %rax
	movq	%rax, %rdx
	leaq	m(%rip), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	m(%rip), %eax
	testl	%eax, %eax
	jne	.L2
	movl	n(%rip), %eax
	testl	%eax, %eax
	je	.L15
.L2:
	movl	$0, -8(%rbp)
	jmp	.L4
.L5:
	movl	-8(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$0, (%rax,%rdx)
	addl	$1, -8(%rbp)
.L4:
	cmpl	$7368791, -8(%rbp)
	jle	.L5
	movl	$0, -8(%rbp)
	jmp	.L6
.L11:
	movl	m(%rip), %eax
	movl	%eax, -4(%rbp)
	jmp	.L7
.L8:
	movl	-4(%rbp), %eax
	cltq
	leaq	flag(%rip), %rdx
	movb	$1, (%rax,%rdx)
	movl	m(%rip), %eax
	addl	%eax, -4(%rbp)
.L7:
	cmpl	$7368791, -4(%rbp)
	jle	.L8
	jmp	.L9
.L10:
	movl	m(%rip), %eax
	addl	$1, %eax
	movl	%eax, m(%rip)
.L9:
	movl	m(%rip), %eax
	cltq
	leaq	flag(%rip), %rdx
	movzbl	(%rax,%rdx), %eax
	cmpb	$1, %al
	je	.L10
	addl	$1, -8(%rbp)
.L6:
	movl	n(%rip), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L11
	movl	m(%rip), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L12
.L15:
	nop
	movl	$0, %eax
	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:
