#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, c, m, n;
  scanf("%d %d", &a, &b);
  m = a;
  n = b;
  while (b != 0) {
    c = a % b;
    a = b;
    b = c;
  }
  printf("×î´ó¹«Ô¼ÊýÎª:%d\n", a);
  printf("×îÐ¡¹«±¶ÊýÎª:%d\n", m * n / a);
  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    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1174 <main+0x54>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    114f <main+0x2f>
mov    -0x8(%rbp),%esi
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
lea    0xe8c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xed6(%rip),%rdi
mov    %rsp,%rsi
lea    0x4(%rsp),%rdx
call   1040 <scanf@plt>
mov    (%rsp),%ebp
mov    0x4(%rsp),%ebx
mov    %ebp,%esi
test   %ebx,%ebx
je     1166 <main+0x46>
mov    %ebx,%edx
mov    %ebp,%esi
nopl   0x0(%rax,%rax,1)
mov    %esi,%eax
mov    %edx,%esi
cltd
idiv   %esi
test   %edx,%edx
jne    1150 <main+0x30>
mov    %esi,(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
imul   %ebp,%ebx
mov    %ebx,%eax
cltd
idivl  (%rsp)
lea    0xea1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [29 x i8] c"\C3\97\C3\AE\C2\B4\C3\B3\C2\B9\C2\AB\C3\94\C2\BC\C3\8A\C3\BD\C3\8E\C2\AA:%d\0A\00"
@.str.2 = [29 x i8] c"\C3\97\C3\AE\C3\90\C2\A1\C2\B9\C2\AB\C2\B1\C2\B6\C3\8A\C3\BD\C3\8E\C2\AA:%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
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
%8 = load i32, i32* %2
store i32 %8, i32* %5
%9 = load i32, i32* %3
store i32 %9, i32* %6
br label %10
10: ; preds = %13, %0
%11 = load i32, i32* %3
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = srem i32 %14, %15
store i32 %16, i32* %4
%17 = load i32, i32* %3
store i32 %17, i32* %2
%18 = load i32, i32* %4
store i32 %18, i32* %3
br label %10
19: ; preds = %10
%20 = load i32, i32* %2
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = mul nsw i32 %22, %23
%25 = load i32, i32* %2
%26 = sdiv i32 %24, %25
%27 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [29 x i8] c"\C3\97\C3\AE\C2\B4\C3\B3\C2\B9\C2\AB\C3\94\C2\BC\C3\8A\C3\BD\C3\8E\C2\AA:%d\0A\00"
@.str.2 = [29 x i8] c"\C3\97\C3\AE\C3\90\C2\A1\C2\B9\C2\AB\C2\B1\C2\B6\C3\8A\C3\BD\C3\8E\C2\AA:%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 i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %0, %9
%10 = phi i32 [ %12, %9 ], [ %7, %0 ]
%11 = phi i32 [ %10, %9 ], [ %6, %0 ]
%12 = srem i32 %11, %10
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %9
14: ; preds = %9
store i32 %10, i32* %1
store i32 0, i32* %2
br label %15
15: ; preds = %14, %0
%16 = phi i32 [ %10, %14 ], [ %6, %0 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = mul nsw i32 %7, %6
%19 = load i32, i32* %1
%20 = sdiv i32 %18, %19
%21 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i32 %20)
ret i32 0
}