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 <string.h>
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int main(void)
{
    char s[200];
    while (scanf("%s", s), *s-'#') {
        int i, d=1<<21, n=0, x=d, g;
        for(i=strlen(s)-1;i>=0;i-=4+(s[i]=='h')) {
            if (s[i]=='h')
                n=n<x?0:n-x;
            else
                n=n+x>d?d:n+x;
            x/=2;
        }
        n*=90;
        g=gcd(d, n);
        n/=g, d/=g;
        printf("%d", n);
        if (d>1) printf("/%d", d);
        puts("");
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.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
.LFE35:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$208, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$35, (%rsp)
	je	.L30
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %esi
	testl	%eax, %eax
	je	.L10
	movl	$2097152, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%edx, %ecx
	movl	$2097152, %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	$4, %edx
	subl	%edx, %esi
	js	.L31
.L14:
	movl	%eax, %edx
	shrl	$31, %eax
	movslq	%esi, %rdi
	addl	%edx, %eax
	sarl	%eax
	cmpb	$104, (%rsp,%rdi)
	jne	.L11
	movl	%ecx, %edi
	subl	%edx, %edi
	cmpl	%ecx, %edx
	movl	$5, %edx
	cmovg	%r8d, %edi
	movl	%edi, %ecx
	subl	%edx, %esi
	jns	.L14
.L31:
	imull	$90, %ecx, %esi
	testl	%ecx, %ecx
	je	.L10
	movl	%esi, %ecx
	movl	$2097152, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %ecx
.L15:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L20
	movl	$2097152, %eax
	movl	$1, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%esi, %eax
	movq	%r12, %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r14d
	jle	.L16
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.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
.LFE35:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$208, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$35, (%rsp)
	je	.L30
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %esi
	testl	%eax, %eax
	je	.L10
	movl	$2097152, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%edx, %ecx
	movl	$2097152, %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	$4, %edx
	subl	%edx, %esi
	js	.L31
.L14:
	movl	%eax, %edx
	shrl	$31, %eax
	movslq	%esi, %rdi
	addl	%edx, %eax
	sarl	%eax
	cmpb	$104, (%rsp,%rdi)
	jne	.L11
	movl	%ecx, %edi
	subl	%edx, %edi
	cmpl	%ecx, %edx
	movl	$5, %edx
	cmovg	%r8d, %edi
	movl	%edi, %ecx
	subl	%edx, %esi
	jns	.L14
.L31:
	imull	$90, %ecx, %esi
	testl	%ecx, %ecx
	je	.L10
	movl	%esi, %ecx
	movl	$2097152, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %ecx
.L15:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L20
	movl	$2097152, %eax
	movl	$1, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%esi, %eax
	movq	%r12, %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r14d
	jle	.L16
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.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
.LFE35:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$208, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$35, (%rsp)
	je	.L30
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %esi
	testl	%eax, %eax
	je	.L10
	movl	$2097152, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%edx, %ecx
	movl	$2097152, %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	$4, %edx
	subl	%edx, %esi
	js	.L31
.L14:
	movl	%eax, %edx
	shrl	$31, %eax
	movslq	%esi, %rdi
	addl	%edx, %eax
	sarl	%eax
	cmpb	$104, (%rsp,%rdi)
	jne	.L11
	movl	%ecx, %edi
	subl	%edx, %edi
	cmpl	%ecx, %edx
	movl	$5, %edx
	cmovg	%r8d, %edi
	movl	%edi, %ecx
	subl	%edx, %esi
	jns	.L14
.L31:
	imull	$90, %ecx, %esi
	testl	%ecx, %ecx
	je	.L10
	movl	%esi, %ecx
	movl	$2097152, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %ecx
.L15:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L20
	movl	$2097152, %eax
	movl	$1, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%esi, %eax
	movq	%r12, %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r14d
	jle	.L16
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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 <string.h>
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int main(void)
{
    char s[200];
    while (scanf("%s", s), *s-'#') {
        int i, d=1<<21, n=0, x=d, g;
        for(i=strlen(s)-1;i>=0;i-=4+(s[i]=='h')) {
            if (s[i]=='h')
                n=n<x?0:n-x;
            else
                n=n+x>d?d:n+x;
            x/=2;
        }
        n*=90;
        g=gcd(d, n);
        n/=g, d/=g;
        printf("%d", n);
        if (d>1) printf("/%d", d);
        puts("");
    }
    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 <string.h>
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int main(void)
{
    char s[200];
    while (scanf("%s", s), *s-'#') {
        int i, d=1<<21, n=0, x=d, g;
        for(i=strlen(s)-1;i>=0;i-=4+(s[i]=='h')) {
            if (s[i]=='h')
                n=n<x?0:n-x;
            else
                n=n+x>d?d:n+x;
            x/=2;
        }
        n*=90;
        g=gcd(d, n);
        n/=g, d/=g;
        printf("%d", n);
        if (d>1) printf("/%d", d);
        puts("");
    }
    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:

north
west
northwest
northnorthwest
westwestwestnorth
#
 north
west
northwest
northnorthwest
westwestwestnorth
#

0
90
45
45/2
315/4
 0
90
45
45/2
315/4

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 <string.h>
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; }
int main(void)
{
    char s[200];
    while (scanf("%s", s), *s-'#') {
        int i, d=1<<21, n=0, x=d, g;
        for(i=strlen(s)-1;i>=0;i-=4+(s[i]=='h')) {
            if (s[i]=='h')
                n=n<x?0:n-x;
            else
                n=n+x>d?d:n+x;
            x/=2;
        }
        n*=90;
        g=gcd(d, n);
        n/=g, d/=g;
        printf("%d", n);
        if (d>1) printf("/%d", d);
        puts("");
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.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
.LFE35:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$208, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$35, (%rsp)
	je	.L30
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %esi
	testl	%eax, %eax
	je	.L10
	movl	$2097152, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%edx, %ecx
	movl	$2097152, %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	$4, %edx
	subl	%edx, %esi
	js	.L31
.L14:
	movl	%eax, %edx
	shrl	$31, %eax
	movslq	%esi, %rdi
	addl	%edx, %eax
	sarl	%eax
	cmpb	$104, (%rsp,%rdi)
	jne	.L11
	movl	%ecx, %edi
	subl	%edx, %edi
	cmpl	%ecx, %edx
	movl	$5, %edx
	cmovg	%r8d, %edi
	movl	%edi, %ecx
	subl	%edx, %esi
	jns	.L14
.L31:
	imull	$90, %ecx, %esi
	testl	%ecx, %ecx
	je	.L10
	movl	%esi, %ecx
	movl	$2097152, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %ecx
.L15:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L20
	movl	$2097152, %eax
	movl	$1, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%esi, %eax
	movq	%r12, %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r14d
	jle	.L16
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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
	.p2align 4
	.globl	gcd
	.type	gcd, @function
gcd:
.LFB35:
	.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
.LFE35:
	.size	gcd, .-gcd
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB36:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	leaq	.LC1(%rip), %r13
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	leaq	.LC0(%rip), %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	leaq	.LC3(%rip), %rbp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	subq	$208, %rsp
	.cfi_def_cfa_offset 256
	movq	%fs:40, %rax
	movq	%rax, 200(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	.p2align 4,,10
	.p2align 3
.L9:
	xorl	%eax, %eax
	movq	%rbx, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	cmpb	$35, (%rsp)
	je	.L30
	movq	%rbx, %rdi
	call	strlen@PLT
	leal	-1(%rax), %esi
	testl	%eax, %eax
	je	.L10
	movl	$2097152, %eax
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L11:
	addl	%edx, %ecx
	movl	$2097152, %edx
	cmpl	%edx, %ecx
	cmovg	%edx, %ecx
	movl	$4, %edx
	subl	%edx, %esi
	js	.L31
.L14:
	movl	%eax, %edx
	shrl	$31, %eax
	movslq	%esi, %rdi
	addl	%edx, %eax
	sarl	%eax
	cmpb	$104, (%rsp,%rdi)
	jne	.L11
	movl	%ecx, %edi
	subl	%edx, %edi
	cmpl	%ecx, %edx
	movl	$5, %edx
	cmovg	%r8d, %edi
	movl	%edi, %ecx
	subl	%edx, %esi
	jns	.L14
.L31:
	imull	$90, %ecx, %esi
	testl	%ecx, %ecx
	je	.L10
	movl	%esi, %ecx
	movl	$2097152, %eax
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%edx, %ecx
.L15:
	cltd
	idivl	%ecx
	movl	%ecx, %eax
	testl	%edx, %edx
	jne	.L20
	movl	$2097152, %eax
	movl	$1, %edi
	cltd
	idivl	%ecx
	movl	%eax, %r14d
	movl	%esi, %eax
	movq	%r12, %rsi
	cltd
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	cmpl	$1, %r14d
	jle	.L16
	movl	%r14d, %edx
	movq	%r13, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L16:
	leaq	.LC2(%rip), %rdi
	call	puts@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L30:
	movq	200(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L32
	addq	$208, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	xorl	%edx, %edx
	movq	%r12, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L16
.L32:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE36:
	.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:
```