#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 gcd(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
scalar_t__ scanf(char *, int *, int *);
int main(void) {
  int x, y;
  while (scanf("%d %d", &x, &y) != EOF) {
    if (x > 0 && y > 0)
      printf("%d %d %d\n", x, y, gcd(x, y));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     11a7 <main+0x77>
cmpl   $0x0,-0x8(%rbp)
jle    11a2 <main+0x72>
cmpl   $0x0,-0xc(%rbp)
jle    11a2 <main+0x72>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <gcd@plt>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    %eax,%ecx
lea    0xe69(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x2e92(%rip),%r14
cmp    (%r14),%rax
jne    116c <main+0x3c>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe8d(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r13
jmp    1193 <main+0x63>
nopl   (%rax)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <scanf@plt>
cmp    (%r14),%rax
je     115b <main+0x2b>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jle    1180 <main+0x50>
mov    (%rsp),%ebx
test   %ebx,%ebx
jle    1180 <main+0x50>
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <gcd@plt>
lea    0xe54(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    %eax,%ecx
call   1030 <printf@plt>
jmp    1180 <main+0x50>

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %21, %0
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i64, i64* @EOF
%7 = icmp ne i64 %5, %6
br i1 %7, label %8, label %22
8: ; preds = %4
%9 = load i32, i32* %2
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %21
11: ; preds = %8
%12 = load i32, i32* %3
%13 = icmp sgt i32 %12, 0
br i1 %13, label %14, label %21
14: ; preds = %11
%15 = load i32, i32* %2
%16 = load i32, i32* %3
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = call i32 @gcd(i32 %17, i32 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %16, i32 %19)
br label %21
21: ; preds = %14, %11, %8
br label %4
22: ; preds = %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@EOF = global i64 0
@.str.1 = [10 x i8] c"%d %d %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %21, label %8
8: ; preds = %0, %17
%9 = load i32, i32* %1
%10 = icmp sgt i32 %9, 0
%11 = load i32, i32* %2
%12 = icmp sgt i32 %11, 0
%13 = select i1 %10, i1 %12, i1 false
br i1 %13, label %14, label %17
14: ; preds = %8
%15 = call i32 @gcd(i32 %9, i32 %11)
%16 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %11, i32 %15)
br label %17
17: ; preds = %14, %8
%18 = call i64 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%19 = load i64, i64* @EOF
%20 = icmp eq i64 %18, %19
br i1 %20, label %21, label %8
21: ; preds = %17, %0
ret i32 0
}