#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ EOF;
int /*<<< orphan*/ puts(int /*<<< orphan*/);
scalar_t__ scanf(char *, char *, char *);
int /*<<< orphan*/ str_gcd(char *, char *);
int main(void) {
  char str1[1024], str2[1024], *ans;
  while (scanf("%s %s", str1, str2) != EOF)
    puts(str_gcd(str1, str2));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rsi
lea    -0x810(%rbp),%rdx
lea    0xea9(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
je     118b <main+0x5b>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1050 <str_gcd@plt>
mov    %eax,%edi
call   1030 <puts@plt>
jmp    1142 <main+0x12>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x808,%rsp
lea    0xebb(%rip),%rdi
lea    0x400(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x2e8c(%rip),%r12
cmp    (%r12),%rax
je     11a6 <main+0x76>
lea    0x400(%rsp),%r14
mov    %rsp,%rbx
lea    0xe8c(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <str_gcd@plt>
mov    %eax,%edi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%s %s\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca i32
%2 = alloca [1024 x i8]
%3 = alloca [1024 x i8]
%4 = alloca i8*
store i32 0, i32* %1
br label %5
5: ; preds = %11, %0
%6 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%13 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%14 = call i32 @str_gcd(i8* %12, i8* %13)
%15 = call i32 @puts(i32 %14)
br label %5
16: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%s %s\00"
@EOF = global i64 0
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %0, %8
%9 = call i32 @str_gcd(i8* %3, i8* %4)
%10 = call i32 @puts(i32 %9)
%11 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%12 = load i64, i64* @EOF
%13 = icmp eq i64 %11, %12
br i1 %13, label %14, label %8
14: ; preds = %8, %0
ret i32 0
}