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>
#include <stdlib.h>

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i = 1, p[100] = {1}, m[100] = {}, tmp = M;
	while (1) {
		for (p[i] = p[i-1] + 1; p[i] * p[i] <= tmp; p[i]++) if (tmp % p[i] == 0) break;
		if (p[i] * p[i] > tmp) {
			p[i] = tmp;
			m[i] = 1;
			break;
		} else {
			for (m[i] = 0; tmp % p[i] == 0; m[i]++, tmp /= p[i]);
			i++;
		}
	}
	
	int j, k, cand[100] = {}, max = 1;
	while (1) {
		for (j = 1; j <= i; j++) if (cand[j] < m[j]) break;
		if (j > i) break;
		else {
			cand[j]++;
			for (j--; j >= 1; j--) cand[j] = 0;
		}
		tmp = 1;
		for (j = 1; j <= i; j++) {
			for (k = 0; k < cand[j]; k++) tmp *= p[j];
		}
		if (tmp > max && M / tmp >= N) max = tmp;
	}
	
	printf("%d\n", max);
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1236(%rbp)
	leaq	-1216(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1216(%rbp)
	leaq	-816(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-1240(%rbp), %eax
	movl	%eax, -1232(%rbp)
.L10:
	movl	-1236(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	jmp	.L2
.L5:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L28
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
.L2:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L5
	jmp	.L4
.L28:
	nop
.L4:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L6
	movl	-1236(%rbp), %eax
	cltq
	movl	-1232(%rbp), %edx
	movl	%edx, -1216(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	nop
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1220(%rbp)
	jmp	.L24
.L6:
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	jmp	.L8
.L9:
	movl	-1236(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %esi
	movl	-1232(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -1232(%rbp)
.L8:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -1236(%rbp)
	jmp	.L10
.L24:
	movl	$1, -1228(%rbp)
	jmp	.L11
.L14:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L29
	addl	$1, -1228(%rbp)
.L11:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jg	.L30
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
	jmp	.L17
.L18:
	movl	-1228(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
.L17:
	cmpl	$0, -1228(%rbp)
	jg	.L18
	movl	$1, -1232(%rbp)
	movl	$1, -1228(%rbp)
	jmp	.L19
.L22:
	movl	$0, -1224(%rbp)
	jmp	.L20
.L21:
	movl	-1228(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	movl	-1232(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -1232(%rbp)
	addl	$1, -1224(%rbp)
.L20:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -1224(%rbp)
	jl	.L21
	addl	$1, -1228(%rbp)
.L19:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L22
	movl	-1232(%rbp), %eax
	cmpl	-1220(%rbp), %eax
	jle	.L24
	movl	-1240(%rbp), %eax
	cltd
	idivl	-1232(%rbp)
	movl	%eax, %edx
	movl	-1244(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L24
	movl	-1232(%rbp), %eax
	movl	%eax, -1220(%rbp)
	jmp	.L24
.L30:
	nop
	movl	-1220(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$1240, %rsp
	.cfi_def_cfa_offset 1280
	movq	%fs:40, %rax
	movq	%rax, 1224(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	leaq	420(%rsp), %rbp
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %r10
	xorl	%eax, %eax
	movl	12(%rsp), %ebx
	movl	$50, %ecx
	movq	%r10, %rdi
	leaq	20(%rsp), %r11
	movl	$1, %r8d
	rep stosq
	leaq	416(%rsp), %r9
	movl	$50, %ecx
	movl	%ebx, %esi
	movq	%r9, %rdi
	movl	$1, 16(%rsp)
	rep stosq
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%r11), %eax
	leal	1(%rax), %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L3
	addl	$1, %ecx
.L32:
	movl	%ecx, %eax
	movl	%ecx, (%r11)
	imull	%ecx, %eax
	cmpl	%esi, %eax
	jle	.L34
	movslq	%r8d, %rax
	movl	$50, %ecx
	movl	8(%rsp), %r12d
	xorl	%ebp, %ebp
	movl	%esi, 16(%rsp,%rax,4)
	leaq	816(%rsp), %rsi
	movl	$1, %r11d
	addl	$1, %r8d
	movl	$1, 416(%rsp,%rax,4)
	movq	%rsi, %rdi
	xorl	%eax, %eax
	rep stosq
.L22:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi,%rax,4), %edx
	movl	%eax, %ecx
	cmpl	(%r9,%rax,4), %edx
	jl	.L7
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L8
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r11d, %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1240, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	cltq
	addl	$1, %edx
	movl	%ecx, %edi
	movl	%edx, 816(%rsp,%rax,4)
	subl	$1, %edi
	je	.L21
	leal	-2(%rcx), %eax
	movslq	%edi, %rdi
	cltq
	leaq	4(,%rax,4), %rdx
	subq	%rax, %rdi
	leaq	(%rsi,%rdi,4), %rax
	cmpl	$8, %edx
	jnb	.L10
	testb	$4, %dl
	jne	.L36
	testl	%edx, %edx
	je	.L21
	movb	$0, (%rax)
.L21:
	movl	$1, %r13d
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rsi,%r13,4), %edx
	testl	%edx, %edx
	jle	.L18
	movl	(%r10,%r13,4), %edi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %eax
	imull	%edi, %ecx
	cmpl	%eax, %edx
	jne	.L15
.L18:
	addq	$1, %r13
	cmpq	%r8, %r13
	jne	.L14
	cmpl	%r11d, %ecx
	jle	.L22
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cmpl	%r12d, %eax
	cmovge	%ecx, %r11d
	jmp	.L22
.L3:
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	movl	%edi, %r12d
	addl	$1, %edi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %esi
	idivl	%ecx
	testl	%edx, %edx
	je	.L5
	movl	%r12d, 0(%rbp)
	addl	$1, %r8d
	addq	$4, %rbp
	addq	$4, %r11
	jmp	.L6
.L10:
	leaq	8(%rax), %rdi
	movl	%edx, %ecx
	movq	$0, (%rax)
	movq	$0, -8(%rax,%rcx)
	andq	$-8, %rdi
	subq	%rdi, %rax
	addl	%eax, %edx
	movq	%rbp, %rax
	shrl	$3, %edx
	movl	%edx, %ecx
	rep stosq
	jmp	.L21
.L36:
	movl	%edx, %edx
	movl	$0, (%rax)
	movl	$0, -4(%rax,%rdx)
	jmp	.L21
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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
	.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:
.LFB39:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	leaq	.LC0(%rip), %rdi
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	subq	$1240, %rsp
	.cfi_def_cfa_offset 1280
	movq	%fs:40, %rax
	movq	%rax, 1224(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rsi
	leaq	12(%rsp), %rdx
	leaq	420(%rsp), %rbp
	call	__isoc99_scanf@PLT
	leaq	16(%rsp), %r10
	xorl	%eax, %eax
	movl	12(%rsp), %ebx
	movl	$50, %ecx
	movq	%r10, %rdi
	leaq	20(%rsp), %r11
	movl	$1, %r8d
	rep stosq
	leaq	416(%rsp), %r9
	movl	$50, %ecx
	movl	%ebx, %esi
	movq	%r9, %rdi
	movl	$1, 16(%rsp)
	rep stosq
	.p2align 4,,10
	.p2align 3
.L6:
	movl	-4(%r11), %eax
	leal	1(%rax), %ecx
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%esi, %eax
	cltd
	idivl	%ecx
	testl	%edx, %edx
	je	.L3
	addl	$1, %ecx
.L32:
	movl	%ecx, %eax
	movl	%ecx, (%r11)
	imull	%ecx, %eax
	cmpl	%esi, %eax
	jle	.L34
	movslq	%r8d, %rax
	movl	$50, %ecx
	movl	8(%rsp), %r12d
	xorl	%ebp, %ebp
	movl	%esi, 16(%rsp,%rax,4)
	leaq	816(%rsp), %rsi
	movl	$1, %r11d
	addl	$1, %r8d
	movl	$1, 416(%rsp,%rax,4)
	movq	%rsi, %rdi
	xorl	%eax, %eax
	rep stosq
.L22:
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	(%rsi,%rax,4), %edx
	movl	%eax, %ecx
	cmpl	(%r9,%rax,4), %edx
	jl	.L7
	addq	$1, %rax
	cmpq	%r8, %rax
	jne	.L8
	movl	$1, %edi
	xorl	%eax, %eax
	movl	%r11d, %edx
	leaq	.LC1(%rip), %rsi
	call	__printf_chk@PLT
	movq	stdout(%rip), %rdi
	call	fflush@PLT
	movq	1224(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$1240, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 32
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L7:
	.cfi_restore_state
	cltq
	addl	$1, %edx
	movl	%ecx, %edi
	movl	%edx, 816(%rsp,%rax,4)
	subl	$1, %edi
	je	.L21
	leal	-2(%rcx), %eax
	movslq	%edi, %rdi
	cltq
	leaq	4(,%rax,4), %rdx
	subq	%rax, %rdi
	leaq	(%rsi,%rdi,4), %rax
	cmpl	$8, %edx
	jnb	.L10
	testb	$4, %dl
	jne	.L36
	testl	%edx, %edx
	je	.L21
	movb	$0, (%rax)
.L21:
	movl	$1, %r13d
	movl	$1, %ecx
	.p2align 4,,10
	.p2align 3
.L14:
	movl	(%rsi,%r13,4), %edx
	testl	%edx, %edx
	jle	.L18
	movl	(%r10,%r13,4), %edi
	xorl	%eax, %eax
	.p2align 4,,10
	.p2align 3
.L15:
	addl	$1, %eax
	imull	%edi, %ecx
	cmpl	%eax, %edx
	jne	.L15
.L18:
	addq	$1, %r13
	cmpq	%r8, %r13
	jne	.L14
	cmpl	%r11d, %ecx
	jle	.L22
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	cmpl	%r12d, %eax
	cmovge	%ecx, %r11d
	jmp	.L22
.L3:
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%esi, %eax
	movl	%edi, %r12d
	addl	$1, %edi
	cltd
	idivl	%ecx
	cltd
	movl	%eax, %esi
	idivl	%ecx
	testl	%edx, %edx
	je	.L5
	movl	%r12d, 0(%rbp)
	addl	$1, %r8d
	addq	$4, %rbp
	addq	$4, %r11
	jmp	.L6
.L10:
	leaq	8(%rax), %rdi
	movl	%edx, %ecx
	movq	$0, (%rax)
	movq	$0, -8(%rax,%rcx)
	andq	$-8, %rdi
	subq	%rdi, %rax
	addl	%eax, %edx
	movq	%rbp, %rax
	shrl	$3, %edx
	movl	%edx, %ecx
	rep stosq
	jmp	.L21
.L36:
	movl	%edx, %edx
	movl	$0, (%rax)
	movl	$0, -4(%rax,%rdx)
	jmp	.L21
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE39:
	.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:

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i = 1, p[100] = {1}, m[100] = {}, tmp = M;
	while (1) {
		for (p[i] = p[i-1] + 1; p[i] * p[i] <= tmp; p[i]++) if (tmp % p[i] == 0) break;
		if (p[i] * p[i] > tmp) {
			p[i] = tmp;
			m[i] = 1;
			break;
		} else {
			for (m[i] = 0; tmp % p[i] == 0; m[i]++, tmp /= p[i]);
			i++;
		}
	}
	
	int j, k, cand[100] = {}, max = 1;
	while (1) {
		for (j = 1; j <= i; j++) if (cand[j] < m[j]) break;
		if (j > i) break;
		else {
			cand[j]++;
			for (j--; j >= 1; j--) cand[j] = 0;
		}
		tmp = 1;
		for (j = 1; j <= i; j++) {
			for (k = 0; k < cand[j]; k++) tmp *= p[j];
		}
		if (tmp > max && M / tmp >= N) max = tmp;
	}
	
	printf("%d\n", max);
	fflush(stdout);
	return 0;
}
5 123
 100000 1010000000
 110000 1010000000
 100100 1010000000
 5 16
 100100 1010010001
 101100 1010110000
 101100 1000110000
 101000 1000110010
 101000 1100110010

3
 10100
 8080
 10000
 2
 9163
 9736
 9805
 7757
 9655

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>
#include <stdlib.h>

int main()
{
	int N, M;
	scanf("%d %d", &N, &M);
	
	int i = 1, p[100] = {1}, m[100] = {}, tmp = M;
	while (1) {
		for (p[i] = p[i-1] + 1; p[i] * p[i] <= tmp; p[i]++) if (tmp % p[i] == 0) break;
		if (p[i] * p[i] > tmp) {
			p[i] = tmp;
			m[i] = 1;
			break;
		} else {
			for (m[i] = 0; tmp % p[i] == 0; m[i]++, tmp /= p[i]);
			i++;
		}
	}
	
	int j, k, cand[100] = {}, max = 1;
	while (1) {
		for (j = 1; j <= i; j++) if (cand[j] < m[j]) break;
		if (j > i) break;
		else {
			cand[j]++;
			for (j--; j >= 1; j--) cand[j] = 0;
		}
		tmp = 1;
		for (j = 1; j <= i; j++) {
			for (k = 0; k < cand[j]; k++) tmp *= p[j];
		}
		if (tmp > max && M / tmp >= N) max = tmp;
	}
	
	printf("%d\n", max);
	fflush(stdout);
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d %d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1236(%rbp)
	leaq	-1216(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1216(%rbp)
	leaq	-816(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-1240(%rbp), %eax
	movl	%eax, -1232(%rbp)
.L10:
	movl	-1236(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	jmp	.L2
.L5:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L28
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
.L2:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L5
	jmp	.L4
.L28:
	nop
.L4:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L6
	movl	-1236(%rbp), %eax
	cltq
	movl	-1232(%rbp), %edx
	movl	%edx, -1216(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	nop
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1220(%rbp)
	jmp	.L24
.L6:
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	jmp	.L8
.L9:
	movl	-1236(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %esi
	movl	-1232(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -1232(%rbp)
.L8:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -1236(%rbp)
	jmp	.L10
.L24:
	movl	$1, -1228(%rbp)
	jmp	.L11
.L14:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L29
	addl	$1, -1228(%rbp)
.L11:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jg	.L30
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
	jmp	.L17
.L18:
	movl	-1228(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
.L17:
	cmpl	$0, -1228(%rbp)
	jg	.L18
	movl	$1, -1232(%rbp)
	movl	$1, -1228(%rbp)
	jmp	.L19
.L22:
	movl	$0, -1224(%rbp)
	jmp	.L20
.L21:
	movl	-1228(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	movl	-1232(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -1232(%rbp)
	addl	$1, -1224(%rbp)
.L20:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -1224(%rbp)
	jl	.L21
	addl	$1, -1228(%rbp)
.L19:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L22
	movl	-1232(%rbp), %eax
	cmpl	-1220(%rbp), %eax
	jle	.L24
	movl	-1240(%rbp), %eax
	cltd
	idivl	-1232(%rbp)
	movl	%eax, %edx
	movl	-1244(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L24
	movl	-1232(%rbp), %eax
	movl	%eax, -1220(%rbp)
	jmp	.L24
.L30:
	nop
	movl	-1220(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$1248, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-1240(%rbp), %rdx
	leaq	-1244(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$1, -1236(%rbp)
	leaq	-1216(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1216(%rbp)
	leaq	-816(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	-1240(%rbp), %eax
	movl	%eax, -1232(%rbp)
.L10:
	movl	-1236(%rbp), %eax
	subl	$1, %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
	jmp	.L2
.L5:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L28
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -1216(%rbp,%rax,4)
.L2:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L5
	jmp	.L4
.L28:
	nop
.L4:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	imull	%edx, %eax
	cmpl	%eax, -1232(%rbp)
	jge	.L6
	movl	-1236(%rbp), %eax
	cltq
	movl	-1232(%rbp), %edx
	movl	%edx, -1216(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	$1, -816(%rbp,%rax,4)
	nop
	leaq	-416(%rbp), %rdx
	movl	$0, %eax
	movl	$50, %ecx
	movq	%rdx, %rdi
	rep stosq
	movl	$1, -1220(%rbp)
	jmp	.L24
.L6:
	movl	-1236(%rbp), %eax
	cltq
	movl	$0, -816(%rbp,%rax,4)
	jmp	.L8
.L9:
	movl	-1236(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1236(%rbp), %eax
	cltq
	movl	%edx, -816(%rbp,%rax,4)
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %esi
	movl	-1232(%rbp), %eax
	cltd
	idivl	%esi
	movl	%eax, -1232(%rbp)
.L8:
	movl	-1236(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %ecx
	movl	-1232(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%edx, %eax
	testl	%eax, %eax
	je	.L9
	addl	$1, -1236(%rbp)
	jmp	.L10
.L24:
	movl	$1, -1228(%rbp)
	jmp	.L11
.L14:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, %edx
	jl	.L29
	addl	$1, -1228(%rbp)
.L11:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L14
	jmp	.L13
.L29:
	nop
.L13:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jg	.L30
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	leal	1(%rax), %edx
	movl	-1228(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
	jmp	.L17
.L18:
	movl	-1228(%rbp), %eax
	cltq
	movl	$0, -416(%rbp,%rax,4)
	subl	$1, -1228(%rbp)
.L17:
	cmpl	$0, -1228(%rbp)
	jg	.L18
	movl	$1, -1232(%rbp)
	movl	$1, -1228(%rbp)
	jmp	.L19
.L22:
	movl	$0, -1224(%rbp)
	jmp	.L20
.L21:
	movl	-1228(%rbp), %eax
	cltq
	movl	-1216(%rbp,%rax,4), %eax
	movl	-1232(%rbp), %edx
	imull	%edx, %eax
	movl	%eax, -1232(%rbp)
	addl	$1, -1224(%rbp)
.L20:
	movl	-1228(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	cmpl	%eax, -1224(%rbp)
	jl	.L21
	addl	$1, -1228(%rbp)
.L19:
	movl	-1228(%rbp), %eax
	cmpl	-1236(%rbp), %eax
	jle	.L22
	movl	-1232(%rbp), %eax
	cmpl	-1220(%rbp), %eax
	jle	.L24
	movl	-1240(%rbp), %eax
	cltd
	idivl	-1232(%rbp)
	movl	%eax, %edx
	movl	-1244(%rbp), %eax
	cmpl	%eax, %edx
	jl	.L24
	movl	-1232(%rbp), %eax
	movl	%eax, -1220(%rbp)
	jmp	.L24
.L30:
	nop
	movl	-1220(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	movq	stdout(%rip), %rax
	movq	%rax, %rdi
	call	fflush@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L26
	call	__stack_chk_fail@PLT
.L26:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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:
