#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*/ getchar();
int /*<<< orphan*/ printf(char *, int, int);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int max, min, n, m;
  scanf("%d%d", &n, &m);
  max = n > m ? n : m;
  min = n > m ? m : n;
  for (; max % n != 0 || max % m != 0; max++)
    ;
  for (; n % min != 0 || m % min != 0; min--)
    ;
  printf("%3d%3d", max, min);
  getchar();
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    116a <main+0x3a>
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1170 <main+0x40>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    118d <main+0x5d>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
jmp    1193 <main+0x63>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x1d(%rbp)
jne    11be <main+0x8e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0x1d(%rbp)
mov    -0x1d(%rbp),%al
test   $0x1,%al
jne    11ce <main+0x9e>
jmp    11e1 <main+0xb1>
jmp    11d3 <main+0xa3>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1199 <main+0x69>
jmp    11e6 <main+0xb6>
mov    -0x10(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x1e(%rbp)
jne    120b <main+0xdb>
mov    -0x14(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0x1e(%rbp)
mov    -0x1e(%rbp),%al
test   $0x1,%al
jne    121b <main+0xeb>
jmp    122e <main+0xfe>
jmp    1220 <main+0xf0>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    11e6 <main+0xb6>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xdca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
mov    (%rsp),%r8d
cmp    %r8d,%edi
mov    %r8d,%esi
cmovg  %edi,%esi
jmp    1163 <main+0x33>
nopl   0x0(%rax,%rax,1)
add    $0x1,%esi
mov    %esi,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1160 <main+0x30>
mov    %esi,%eax
cltd
idiv   %r8d
test   %edx,%edx
jne    1160 <main+0x30>
cmp    %r8d,%edi
mov    %edi,%ecx
cmovg  %r8d,%ecx
jmp    1193 <main+0x63>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ecx
mov    %edi,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1190 <main+0x60>
mov    %r8d,%eax
cltd
idiv   %ecx
test   %edx,%edx
jne    1190 <main+0x60>
lea    0xe58(%rip),%rdi
mov    %ecx,%edx
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%d%d\00"
@.str.1 = [7 x i8] c"%3d%3d\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* %4, i32* %5)
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sgt i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %0
%11 = load i32, i32* %4
br label %14
12: ; preds = %0
%13 = load i32, i32* %5
br label %14
14: ; preds = %12, %10
%15 = phi i32 [ %11, %10 ], [ %13, %12 ]
store i32 %15, i32* %2
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = icmp sgt i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %14
%20 = load i32, i32* %5
br label %23
21: ; preds = %14
%22 = load i32, i32* %4
br label %23
23: ; preds = %21, %19
%24 = phi i32 [ %20, %19 ], [ %22, %21 ]
store i32 %24, i32* %3
br label %25
25: ; preds = %38, %23
%26 = load i32, i32* %2
%27 = load i32, i32* %4
%28 = srem i32 %26, %27
%29 = icmp ne i32 %28, 0
br i1 %29, label %35, label %30
30: ; preds = %25
%31 = load i32, i32* %2
%32 = load i32, i32* %5
%33 = srem i32 %31, %32
%34 = icmp ne i32 %33, 0
br label %35
35: ; preds = %30, %25
%36 = phi i1 [ true, %25 ], [ %34, %30 ]
br i1 %36, label %37, label %41
37: ; preds = %35
br label %38
38: ; preds = %37
%39 = load i32, i32* %2
%40 = add nsw i32 %39, 1
store i32 %40, i32* %2
br label %25
41: ; preds = %35
br label %42
42: ; preds = %55, %41
%43 = load i32, i32* %4
%44 = load i32, i32* %3
%45 = srem i32 %43, %44
%46 = icmp ne i32 %45, 0
br i1 %46, label %52, label %47
47: ; preds = %42
%48 = load i32, i32* %5
%49 = load i32, i32* %3
%50 = srem i32 %48, %49
%51 = icmp ne i32 %50, 0
br label %52
52: ; preds = %47, %42
%53 = phi i1 [ true, %42 ], [ %51, %47 ]
br i1 %53, label %54, label %58
54: ; preds = %52
br label %55
55: ; preds = %54
%56 = load i32, i32* %3
%57 = add nsw i32 %56, -1
store i32 %57, i32* %3
br label %42
58: ; preds = %52
%59 = load i32, i32* %2
%60 = load i32, i32* %3
%61 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %59, i32 %60)
%62 = call i32 (...) @getchar()
%63 = call i32 (...) @getchar()
ret i32 0
}

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