#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 */
long long gcd(long long, long long);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, long long *, long long *);
int main() {
  long long int A, B, g;
  scanf("%lld %lld", &A, &B);
  g = gcd(A, B);
  for (int i = 0; i < g; i++) {
    printf("1");
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1050 <gcd@plt>
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movslq -0x24(%rbp),%rax
cmp    -0x20(%rbp),%rax
jge    1193 <main+0x63>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    116b <main+0x3b>
lea    0xe72(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xec4(%rip),%rdi
lea    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x8(%rsp),%rdi
mov    (%rsp),%rsi
call   1050 <gcd@plt>
test   %rax,%rax
jle    1170 <main+0x40>
mov    %rax,%rbx
nop
mov    $0x31,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [10 x i8] c"%lld %lld\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca i64
%3 = bitcast i64* %1 to i8*
%4 = bitcast i64* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = call i64 @gcd(i64 %6, i64 %7)
%9 = icmp sgt i64 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %12, %0
%11 = call i32 @putchar(i32 10)
ret i32 0
12: ; preds = %0, %12
%13 = phi i64 [ %15, %12 ], [ 0, %0 ]
%14 = call i32 @putchar(i32 49)
%15 = add nuw nsw i64 %13, 1
%16 = icmp eq i64 %15, %8
br i1 %16, label %10, label %12
}