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

```c
a,b;g(x,y){return y?g(y,x%y):x;}main(r){scanf("%d%d",&a,&b);b=b/g(a,b);for(a=2;a*a<=b;a++)if(b%a==0)for(r*=a;b%a==0;b/=a);a=!printf("%d\n",r*b);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r8d
.L3:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L5
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	b(%rip), %rdx
	movl	%edi, %ebx
	xorl	%eax, %eax
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	b(%rip), %ecx
	movl	a(%rip), %eax
	testl	%ecx, %ecx
	je	.L9
	movl	%ecx, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %esi
.L10:
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L16
	movl	$2, a(%rip)
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, b(%rip)
	movl	%eax, %ecx
	cmpl	$3, %eax
	jle	.L11
	xorl	%edi, %edi
	movl	$2, %esi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %esi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jg	.L25
.L14:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L12
	imull	%esi, %ebx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jle	.L14
.L25:
	movl	%esi, a(%rip)
	testb	%dil, %dil
	je	.L11
	movl	%ecx, b(%rip)
.L11:
	imull	%ebx, %ecx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%ecx, %esi
	call	printf@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, a(%rip)
	xorl	%eax, %eax
	ret
.L9:
	.cfi_restore_state
	movl	$2, a(%rip)
	jmp	.L11
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r8d
.L3:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L5
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	b(%rip), %rdx
	movl	%edi, %ebx
	xorl	%eax, %eax
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	b(%rip), %ecx
	movl	a(%rip), %eax
	testl	%ecx, %ecx
	je	.L9
	movl	%ecx, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %esi
.L10:
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L16
	movl	$2, a(%rip)
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, b(%rip)
	movl	%eax, %ecx
	cmpl	$3, %eax
	jle	.L11
	xorl	%edi, %edi
	movl	$2, %esi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %esi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jg	.L25
.L14:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L12
	imull	%esi, %ebx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jle	.L14
.L25:
	movl	%esi, a(%rip)
	testb	%dil, %dil
	je	.L11
	movl	%ecx, b(%rip)
.L11:
	imull	%ebx, %ecx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%ecx, %esi
	call	printf@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, a(%rip)
	xorl	%eax, %eax
	ret
.L9:
	.cfi_restore_state
	movl	$2, a(%rip)
	jmp	.L11
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r8d
.L3:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L5
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	b(%rip), %rdx
	movl	%edi, %ebx
	xorl	%eax, %eax
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	b(%rip), %ecx
	movl	a(%rip), %eax
	testl	%ecx, %ecx
	je	.L9
	movl	%ecx, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %esi
.L10:
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L16
	movl	$2, a(%rip)
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, b(%rip)
	movl	%eax, %ecx
	cmpl	$3, %eax
	jle	.L11
	xorl	%edi, %edi
	movl	$2, %esi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %esi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jg	.L25
.L14:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L12
	imull	%esi, %ebx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jle	.L14
.L25:
	movl	%esi, a(%rip)
	testb	%dil, %dil
	je	.L11
	movl	%ecx, b(%rip)
.L11:
	imull	%ebx, %ecx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%ecx, %esi
	call	printf@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, a(%rip)
	xorl	%eax, %eax
	ret
.L9:
	.cfi_restore_state
	movl	$2, a(%rip)
	jmp	.L11
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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
a,b;g(x,y){return y?g(y,x%y):x;}main(r){scanf("%d%d",&a,&b);b=b/g(a,b);for(a=2;a*a<=b;a++)if(b%a==0)for(r*=a;b%a==0;b/=a);a=!printf("%d\n",r*b);}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
a,b;g(x,y){return y?g(y,x%y):x;}main(r){scanf("%d%d",&a,&b);b=b/g(a,b);for(a=2;a*a<=b;a++)if(b%a==0)for(r*=a;b%a==0;b/=a);a=!printf("%d\n",r*b);}```

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:

1 3
 1 6
 3 2
 4 5
 3 10
 3 14
 2 14
 2 17
 3 11
 2 39

3
 6
 2
 5
 10
 14
 7
 17
 11
 39

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

```c
a,b;g(x,y){return y?g(y,x%y):x;}main(r){scanf("%d%d",&a,&b);b=b/g(a,b);for(a=2;a*a<=b;a++)if(b%a==0)for(r*=a;b%a==0;b/=a);a=!printf("%d\n",r*b);}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r8d
.L3:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L5
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	b(%rip), %rdx
	movl	%edi, %ebx
	xorl	%eax, %eax
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	b(%rip), %ecx
	movl	a(%rip), %eax
	testl	%ecx, %ecx
	je	.L9
	movl	%ecx, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %esi
.L10:
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L16
	movl	$2, a(%rip)
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, b(%rip)
	movl	%eax, %ecx
	cmpl	$3, %eax
	jle	.L11
	xorl	%edi, %edi
	movl	$2, %esi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %esi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jg	.L25
.L14:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L12
	imull	%esi, %ebx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jle	.L14
.L25:
	movl	%esi, a(%rip)
	testb	%dil, %dil
	je	.L11
	movl	%ecx, b(%rip)
.L11:
	imull	%ebx, %ecx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%ecx, %esi
	call	printf@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, a(%rip)
	xorl	%eax, %eax
	ret
.L9:
	.cfi_restore_state
	movl	$2, a(%rip)
	jmp	.L11
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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
	.p2align 4
	.globl	g
	.type	g, @function
g:
.LFB0:
	.cfi_startproc
	endbr64
	movl	%edi, %eax
	movl	%esi, %r8d
	testl	%esi, %esi
	jne	.L3
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	movl	%edx, %r8d
.L3:
	cltd
	idivl	%r8d
	movl	%r8d, %eax
	testl	%edx, %edx
	jne	.L5
	movl	%r8d, %eax
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	movl	%edi, %r8d
	movl	%r8d, %eax
	ret
	.cfi_endproc
.LFE0:
	.size	g, .-g
	.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:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	b(%rip), %rdx
	movl	%edi, %ebx
	xorl	%eax, %eax
	leaq	a(%rip), %rsi
	leaq	.LC0(%rip), %rdi
	call	scanf@PLT
	movl	b(%rip), %ecx
	movl	a(%rip), %eax
	testl	%ecx, %ecx
	je	.L9
	movl	%ecx, %esi
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%edx, %esi
.L10:
	cltd
	idivl	%esi
	movl	%esi, %eax
	testl	%edx, %edx
	jne	.L16
	movl	$2, a(%rip)
	movl	%ecx, %eax
	cltd
	idivl	%esi
	movl	%eax, b(%rip)
	movl	%eax, %ecx
	cmpl	$3, %eax
	jle	.L11
	xorl	%edi, %edi
	movl	$2, %esi
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L12:
	addl	$1, %esi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jg	.L25
.L14:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	.L12
	imull	%esi, %ebx
	.p2align 4,,10
	.p2align 3
.L13:
	movl	%ecx, %eax
	cltd
	idivl	%esi
	cltd
	movl	%eax, %ecx
	idivl	%esi
	testl	%edx, %edx
	je	.L13
	addl	$1, %esi
	movl	$1, %edi
	movl	%esi, %eax
	imull	%esi, %eax
	cmpl	%ecx, %eax
	jle	.L14
.L25:
	movl	%esi, a(%rip)
	testb	%dil, %dil
	je	.L11
	movl	%ecx, b(%rip)
.L11:
	imull	%ebx, %ecx
	xorl	%eax, %eax
	leaq	.LC1(%rip), %rdi
	movl	%ecx, %esi
	call	printf@PLT
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	testl	%eax, %eax
	sete	%al
	movzbl	%al, %eax
	movl	%eax, a(%rip)
	xorl	%eax, %eax
	ret
.L9:
	.cfi_restore_state
	movl	$2, a(%rip)
	jmp	.L11
	.cfi_endproc
.LFE1:
	.size	main, .-main
	.globl	b
	.bss
	.align 4
	.type	b, @object
	.size	b, 4
b:
	.zero	4
	.globl	a
	.align 4
	.type	a, @object
	.size	a, 4
a:
	.zero	4
	.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:
```