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 <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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.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
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	movl	$2097152, -216(%rbp)
	movl	$0, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -220(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	jmp	.L7
.L14:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L8
	movl	-224(%rbp), %eax
	cmpl	-220(%rbp), %eax
	jl	.L9
	movl	-224(%rbp), %eax
	subl	-220(%rbp), %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -224(%rbp)
	jmp	.L11
.L8:
	movl	-224(%rbp), %edx
	movl	-220(%rbp), %eax
	addl	%eax, %edx
	movl	-216(%rbp), %eax
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, -224(%rbp)
.L11:
	movl	-220(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L12
	movl	$5, %eax
	jmp	.L13
.L12:
	movl	$4, %eax
.L13:
	subl	%eax, -228(%rbp)
.L7:
	cmpl	$0, -228(%rbp)
	jns	.L14
	movl	-224(%rbp), %eax
	imull	$90, %eax, %eax
	movl	%eax, -224(%rbp)
	movl	-224(%rbp), %edx
	movl	-216(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -212(%rbp)
	movl	-224(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$1, -216(%rbp)
	jle	.L15
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-208(%rbp), %eax
	cmpb	$35, %al
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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
	.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
	.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:

#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;
}
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 unoptimized 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;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	gcd
	.type	gcd, @function
gcd:
.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
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	movl	$2097152, -216(%rbp)
	movl	$0, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -220(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	jmp	.L7
.L14:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L8
	movl	-224(%rbp), %eax
	cmpl	-220(%rbp), %eax
	jl	.L9
	movl	-224(%rbp), %eax
	subl	-220(%rbp), %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -224(%rbp)
	jmp	.L11
.L8:
	movl	-224(%rbp), %edx
	movl	-220(%rbp), %eax
	addl	%eax, %edx
	movl	-216(%rbp), %eax
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, -224(%rbp)
.L11:
	movl	-220(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L12
	movl	$5, %eax
	jmp	.L13
.L12:
	movl	$4, %eax
.L13:
	subl	%eax, -228(%rbp)
.L7:
	cmpl	$0, -228(%rbp)
	jns	.L14
	movl	-224(%rbp), %eax
	imull	$90, %eax, %eax
	movl	%eax, -224(%rbp)
	movl	-224(%rbp), %edx
	movl	-216(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -212(%rbp)
	movl	-224(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$1, -216(%rbp)
	jle	.L15
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-208(%rbp), %eax
	cmpb	$35, %al
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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	gcd
	.type	gcd, @function
gcd:
.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
	movl	%edi, -4(%rbp)
	movl	%esi, -8(%rbp)
	cmpl	$0, -8(%rbp)
	je	.L2
	movl	-4(%rbp), %eax
	cltd
	idivl	-8(%rbp)
	movl	-8(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	jmp	.L4
.L2:
	movl	-4(%rbp), %eax
.L4:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	gcd, .-gcd
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"/%d"
.LC2:
	.string	""
.LC3:
	.string	"%s"
	.text
	.globl	main
	.type	main, @function
main:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	jmp	.L6
.L16:
	movl	$2097152, -216(%rbp)
	movl	$0, -224(%rbp)
	movl	-216(%rbp), %eax
	movl	%eax, -220(%rbp)
	leaq	-208(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	subl	$1, %eax
	movl	%eax, -228(%rbp)
	jmp	.L7
.L14:
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L8
	movl	-224(%rbp), %eax
	cmpl	-220(%rbp), %eax
	jl	.L9
	movl	-224(%rbp), %eax
	subl	-220(%rbp), %eax
	jmp	.L10
.L9:
	movl	$0, %eax
.L10:
	movl	%eax, -224(%rbp)
	jmp	.L11
.L8:
	movl	-224(%rbp), %edx
	movl	-220(%rbp), %eax
	addl	%eax, %edx
	movl	-216(%rbp), %eax
	cmpl	%edx, %eax
	cmovg	%edx, %eax
	movl	%eax, -224(%rbp)
.L11:
	movl	-220(%rbp), %eax
	movl	%eax, %edx
	shrl	$31, %edx
	addl	%edx, %eax
	sarl	%eax
	movl	%eax, -220(%rbp)
	movl	-228(%rbp), %eax
	cltq
	movzbl	-208(%rbp,%rax), %eax
	cmpb	$104, %al
	jne	.L12
	movl	$5, %eax
	jmp	.L13
.L12:
	movl	$4, %eax
.L13:
	subl	%eax, -228(%rbp)
.L7:
	cmpl	$0, -228(%rbp)
	jns	.L14
	movl	-224(%rbp), %eax
	imull	$90, %eax, %eax
	movl	%eax, -224(%rbp)
	movl	-224(%rbp), %edx
	movl	-216(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	gcd
	movl	%eax, -212(%rbp)
	movl	-224(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -224(%rbp)
	movl	-216(%rbp), %eax
	cltd
	idivl	-212(%rbp)
	movl	%eax, -216(%rbp)
	movl	-224(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	cmpl	$1, -216(%rbp)
	jle	.L15
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L15:
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
.L6:
	leaq	-208(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC3(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movzbl	-208(%rbp), %eax
	cmpb	$35, %al
	jne	.L16
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L18
	call	__stack_chk_fail@PLT
.L18:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.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:
