#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 *);
int main() {
  int a, b, min, i, out;
  while (scanf("%d%d", &a, &b) != EOF) {
    out = 0;
    if (a >= b)
      min = b;
    else
      min = a;
    for (i = 1; i <= min; i++)
      if (a % i == 0 && b % i == 0)
        out++;
    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>
mov    0x2e9e(%rip),%rcx
cmp    (%rcx),%rax
je     11da <main+0xba>
movl   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jl     1171 <main+0x51>
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1177 <main+0x57>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     11c6 <main+0xa6>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    11b3 <main+0x93>
mov    -0xc(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    11b3 <main+0x93>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b8 <main+0x98>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117e <main+0x5e>
mov    -0x18(%rbp),%esi
lea    0xe35(%rip),%rdi
call   1030 <printf@plt>
jmp    112f <main+0xf>
xor    %eax,%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    0xece(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x2ea2(%rip),%r13
cmp    0x0(%r13),%rax
jne    115d <main+0x3d>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe9c(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%r14
jmp    1192 <main+0x72>
xchg   %ax,%ax
xor    %esi,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r14,%rdx
call   1040 <scanf@plt>
cmp    0x0(%r13),%rax
je     114c <main+0x2c>
mov    0x4(%rsp),%ecx
mov    (%rsp),%edi
cmp    %edi,%ecx
mov    %edi,%ebx
cmovl  %ecx,%ebx
test   %ebx,%ebx
jle    1170 <main+0x50>
neg    %ebx
mov    $0x1,%ebp
xor    %esi,%esi
jmp    11c2 <main+0xa2>
nop
lea    (%rbx,%rbp,1),%eax
add    $0x1,%eax
mov    %ebp,%edx
add    $0x1,%edx
mov    %edx,%ebp
cmp    $0x1,%eax
je     1172 <main+0x52>
mov    %ecx,%eax
cltd
idiv   %ebp
test   %edx,%edx
jne    11b0 <main+0x90>
mov    %edi,%eax
cltd
idiv   %ebp
cmp    $0x1,%edx
adc    $0x0,%esi
jmp    11b0 <main+0x90>

LLVM IR (-O0):
@.str = [5 x i8] c"%d%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
%6 = alloca i32
store i32 0, i32* %1
br label %7
7: ; preds = %41, %0
%8 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%9 = load i64, i64* @EOF
%10 = icmp ne i64 %8, %9
br i1 %10, label %11, label %44
11: ; preds = %7
store i32 0, i32* %6
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = icmp sge i32 %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load i32, i32* %3
store i32 %16, i32* %4
br label %19
17: ; preds = %11
%18 = load i32, i32* %2
store i32 %18, i32* %4
br label %19
19: ; preds = %17, %15
store i32 1, i32* %5
br label %20
20: ; preds = %38, %19
%21 = load i32, i32* %5
%22 = load i32, i32* %4
%23 = icmp sle i32 %21, %22
br i1 %23, label %24, label %41
24: ; preds = %20
%25 = load i32, i32* %2
%26 = load i32, i32* %5
%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* %5
%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* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %37
37: ; preds = %34, %29, %24
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %20
41: ; preds = %20
%42 = load i32, i32* %6
%43 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %42)
br label %7
44: ; preds = %7
ret i32 0
}

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