#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*/ printf(char *, int);
scalar_t__ scanf(char *, int *);
int main() {
  int num1, num2, i, j;
  while (scanf("%d", &num1) != EOF) {
    scanf("%d", &num2);
    if (num1 < num2)
      j = num1;
    else
      j = num2;
    for (i = j; i >= 1; i--) {
      if (num1 % i == 0 && num2 % i == 0) {
        printf("%d\n", i);
        break;
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%rcx
cmp    (%rcx),%rax
je     11d8 <main+0xb8>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <main+0x56>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    117c <main+0x5c>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x1,-0x10(%rbp)
jl     11d3 <main+0xb3>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c0 <main+0xa0>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11c0 <main+0xa0>
mov    -0x10(%rbp),%esi
lea    0xe4d(%rip),%rdi
call   1030 <printf@plt>
jmp    11d3 <main+0xb3>
jmp    11c5 <main+0xa5>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1182 <main+0x62>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%rdi
lea    0x8(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2ea3(%rip),%r13
cmp    0x0(%r13),%rax
jne    115b <main+0x3b>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
lea    0xe9e(%rip),%rbx
lea    0xc(%rsp),%r14
lea    0xe95(%rip),%r15
lea    0x8(%rsp),%r12
jmp    1191 <main+0x71>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r12,%rsi
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
je     114b <main+0x2b>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
mov    0x8(%rsp),%ecx
mov    0xc(%rsp),%edi
cmp    %edi,%ecx
mov    %edi,%esi
cmovl  %ecx,%esi
test   %esi,%esi
jg     11ca <main+0xaa>
jmp    1180 <main+0x60>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rsi),%eax
cmp    $0x1,%esi
mov    %eax,%esi
jle    1180 <main+0x60>
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    11c0 <main+0xa0>
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    11c0 <main+0xa0>
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
br label %6
6: ; preds = %41, %0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %42
10: ; preds = %6
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = load i32, i32* %2
store i32 %16, i32* %5
br label %19
17: ; preds = %10
%18 = load i32, i32* %3
store i32 %18, i32* %5
br label %19
19: ; preds = %17, %15
%20 = load i32, i32* %5
store i32 %20, i32* %4
br label %21
21: ; preds = %38, %19
%22 = load i32, i32* %4
%23 = icmp sge i32 %22, 1
br i1 %23, label %24, label %41
24: ; preds = %21
%25 = load i32, i32* %2
%26 = load i32, i32* %4
%27 = srem i32 %25, %26
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %37
29: ; preds = %24
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = srem i32 %30, %31
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %29
%35 = load i32, i32* %4
%36 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %35)
br label %41
37: ; preds = %29, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %4
%40 = add nsw i32 %39, -1
store i32 %40, i32* %4
br label %21
41: ; preds = %34, %21
br label %6
42: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%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 ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %31, label %8
8: ; preds = %0, %27
%9 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = icmp slt i32 %10, %11
%13 = select i1 %12, i32 %10, i32 %11
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %27
15: ; preds = %8, %24
%16 = phi i32 [ %25, %24 ], [ %13, %8 ]
%17 = srem i32 %10, %16
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %24
19: ; preds = %15
%20 = srem i32 %11, %16
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %27
24: ; preds = %15, %19
%25 = add nsw i32 %16, -1
%26 = icmp sgt i32 %16, 1
br i1 %26, label %15, label %27
27: ; preds = %24, %8, %22
%28 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%29 = load i64, i64* @EOF
%30 = icmp eq i64 %28, %29
br i1 %30, label %31, label %8
31: ; preds = %27, %0
ret i32 0
}