#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 */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int a, b;
  scanf("%d%d", &a, &b);
  int c;
  int out = 0;
  for (c = 1; c < a | c < b; c++) {
    if (a % c == 0 && b % c == 0) {
      out = c;
    }
  }
  printf("%d\n", out);
  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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x10(%rbp),%ecx
cmp    -0xc(%rbp),%ecx
setl   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     11b2 <main+0x92>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    119f <main+0x7f>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    119f <main+0x7f>
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    11a4 <main+0x84>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1151 <main+0x31>
mov    -0x14(%rbp),%esi
lea    0xe49(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%r9d
mov    (%rsp),%r8d
cmp    $0x1,%r9d
jg     114c <main+0x2c>
xor    %esi,%esi
cmp    $0x2,%r8d
jl     1187 <main+0x67>
xor    %esi,%esi
mov    $0x2,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
lea    -0x1(%rdi),%ecx
mov    %r9d,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    117a <main+0x5a>
mov    %r8d,%eax
cltd
idiv   %ecx
test   %edx,%edx
cmove  %ecx,%esi
lea    0x1(%rdi),%eax
cmp    %r9d,%edi
jl     1160 <main+0x40>
cmp    %r8d,%edi
jl     1160 <main+0x40>
lea    0xe77(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

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