#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 */
unsigned long calc_gcd(unsigned long, unsigned long);
int /*<<< orphan*/ printf(char *, unsigned long);
int /*<<< orphan*/ scanf(char *, unsigned long *, unsigned long *);
int main(void) {
  unsigned long a, b, pa, pb, gcd;
  scanf("%ld %ld", &a, &b);
  gcd = calc_gcd(a, b);
  pa = a / gcd;
  pb = b / gcd;
  printf("%lu\n", gcd * pa * pb);
  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   1050 <scanf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <calc_gcd@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x30(%rbp)
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x30(%rbp)
mov    %rax,-0x28(%rbp)
mov    -0x30(%rbp),%rsi
imul   -0x20(%rbp),%rsi
imul   -0x28(%rbp),%rsi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
call   1040 <calc_gcd@plt>
mov    %rax,%rcx
mov    0x10(%rsp),%rsi
mov    0x8(%rsp),%rax
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
je     117c <main+0x4c>
xor    %edx,%edx
div    %rcx
mov    %rax,%rdi
jmp    1182 <main+0x52>
xor    %edx,%edx
div    %ecx
mov    %eax,%edi
mov    %rcx,%rax
or     %rsi,%rax
shr    $0x20,%rax
je     1198 <main+0x68>
mov    %rsi,%rax
xor    %edx,%edx
div    %rcx
jmp    119e <main+0x6e>
mov    %esi,%eax
xor    %edx,%edx
div    %ecx
sub    %rdx,%rsi
imul   %rdi,%rsi
lea    0xe5c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [5 x i8] c"%lu\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32 0, i32* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %2, i64* %3)
%8 = load i64, i64* %2
%9 = load i64, i64* %3
%10 = call i64 @calc_gcd(i64 %8, i64 %9)
store i64 %10, i64* %6
%11 = load i64, i64* %2
%12 = load i64, i64* %6
%13 = udiv i64 %11, %12
store i64 %13, i64* %4
%14 = load i64, i64* %3
%15 = load i64, i64* %6
%16 = udiv i64 %14, %15
store i64 %16, i64* %5
%17 = load i64, i64* %6
%18 = load i64, i64* %4
%19 = mul i64 %17, %18
%20 = load i64, i64* %5
%21 = mul i64 %19, %20
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"%ld %ld\00"
@.str.1 = [5 x i8] c"%lu\0A\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 ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i64* %1, i64* %2)
%6 = load i64, i64* %1
%7 = load i64, i64* %2
%8 = call i64 @calc_gcd(i64 %6, i64 %7)
%9 = load i64, i64* %1
%10 = load i64, i64* %2
%11 = udiv i64 %10, %8
%12 = urem i64 %9, %8
%13 = sub i64 %9, %12
%14 = mul i64 %13, %11
%15 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %14)
ret i32 0
}