#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 atoi(char *);
int gcd(int, int);
int lcm(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(int argc, char *argv[]) {
  int x, y;
  int r, t;
  if (argc == 3) {
    x = atoi(argv[1]);
    y = atoi(argv[2]);
    r = gcd(x, y);
    t = lcm(x, y);
  } else {
    printf("Input a number: X Y :");
    scanf("%d %d", &x, &y);
    r = gcd(x, y);
    t = lcm(x, y);
  }
  printf("ºÇÂç¸øÌó¿ô = %d, ºÇ¾®¸øÇÜ¿ô = %d\n", r, t);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    11b1 <main+0x61>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <gcd@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <lcm@plt>
mov    %eax,-0x20(%rbp)
jmp    11ef <main+0x9f>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe50(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1050 <scanf@plt>
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1060 <gcd@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x18(%rbp),%esi
call   1040 <lcm@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
cmp    $0x3,%edi
jne    1190 <main+0x40>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebp
mov    %eax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
mov    %eax,0x8(%rsp)
mov    %ebp,%edi
mov    %eax,%esi
call   1060 <gcd@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebx,%esi
jmp    11cc <main+0x7c>
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe71(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1060 <gcd@plt>
mov    %eax,%r14d
mov    0xc(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <lcm@plt>
lea    0xe44(%rip),%rdi
mov    %r14d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Input a number: X Y :\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [54 x i8] c"\C2\BA\C3\87\C3\82\C3\A7\C2\B8\C3\B8\C3\8C\C3\B3\C2\BF\C3\B4 = %d, \C2\BA\C3\87\C2\BE\C2\AE\C2\B8\C3\B8\C3\87\C3\9C\C2\BF\C3\B4 = %d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 3
br i1 %11, label %12, label %27
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %6
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %7
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = call i32 @gcd(i32 %21, i32 %22)
store i32 %23, i32* %8
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = call i32 @lcm(i32 %24, i32 %25)
store i32 %26, i32* %9
br label %36
27: ; preds = %2
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7)
%30 = load i32, i32* %6
%31 = load i32, i32* %7
%32 = call i32 @gcd(i32 %30, i32 %31)
store i32 %32, i32* %8
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = call i32 @lcm(i32 %33, i32 %34)
store i32 %35, i32* %9
br label %36
36: ; preds = %27, %12
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %37, i32 %38)
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"Input a number: X Y :\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [54 x i8] c"\C2\BA\C3\87\C3\82\C3\A7\C2\B8\C3\B8\C3\8C\C3\B3\C2\BF\C3\B4 = %d, \C2\BA\C3\87\C2\BE\C2\AE\C2\B8\C3\B8\C3\87\C3\9C\C2\BF\C3\B4 = %d\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %3 to i8*
%6 = bitcast i32* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %8, label %17
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
store i32 %11, i32* %3
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = load i8*, i8** %12
%14 = tail call i32 @atoi(i8* %13)
store i32 %14, i32* %4
%15 = tail call i32 @gcd(i32 %11, i32 %14)
%16 = tail call i32 @lcm(i32 %11, i32 %14)
br label %26
17: ; preds = %2
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%19 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4)
%20 = load i32, i32* %3
%21 = load i32, i32* %4
%22 = call i32 @gcd(i32 %20, i32 %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = call i32 @lcm(i32 %23, i32 %24)
br label %26
26: ; preds = %17, %8
%27 = phi i32 [ %15, %8 ], [ %22, %17 ]
%28 = phi i32 [ %16, %8 ], [ %25, %17 ]
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.2, i64 0, i64 0), i32 %27, i32 %28)
ret i32 0
}