#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 min = b;
  if (a < b) {
    min = a;
  }
  for (; a % min != 0 || b % min != 0; min--) {
  }
  printf("%d", min);
  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>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115b <main+0x3b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <main+0x40>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x11(%rbp)
jne    1185 <main+0x65>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1195 <main+0x75>
jmp    11a8 <main+0x88>
jmp    119a <main+0x7a>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1160 <main+0x40>
mov    -0x10(%rbp),%esi
lea    0xe50(%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    (%rsp),%ecx
mov    0x4(%rsp),%edi
cmp    %ecx,%edi
mov    %ecx,%esi
cmovl  %edi,%esi
jmp    1153 <main+0x33>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffff,%esi
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1150 <main+0x30>
mov    %ecx,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1150 <main+0x30>
lea    0xe96(%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 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%6 = load i32, i32* %3
store i32 %6, i32* %4
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* %2
store i32 %11, i32* %4
br label %12
12: ; preds = %10, %0
br label %13
13: ; preds = %26, %12
%14 = load i32, i32* %2
%15 = load i32, i32* %4
%16 = srem i32 %14, %15
%17 = icmp ne i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = load i32, i32* %3
%20 = load i32, i32* %4
%21 = srem i32 %19, %20
%22 = icmp ne i32 %21, 0
br label %23
23: ; preds = %18, %13
%24 = phi i1 [ true, %13 ], [ %22, %18 ]
br i1 %24, label %25, label %29
25: ; preds = %23
br label %26
26: ; preds = %25
%27 = load i32, i32* %4
%28 = add nsw i32 %27, -1
store i32 %28, i32* %4
br label %13
29: ; preds = %23
%30 = load i32, i32* %4
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %30)
ret i32 0
}

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