#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 /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int i, j, a, b;
  printf("Enter the two numbers\n");
  scanf("%d %d", &a, &b);
  if (a == b) {
    printf("%d is the lcm", a);
  } else {
    for (i = 1; i <= a * b; i++) {
      if (i % a == 0 && i % b == 0 && a * b % i == 0)
        printf("%d is the lcm of the given number", i);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed3(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    1173 <main+0x53>
mov    -0x10(%rbp),%esi
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <main+0xc9>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
imul   -0x14(%rbp),%ecx
cmp    %ecx,%eax
jg     11e4 <main+0xc4>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x10(%rbp)
cmp    $0x0,%edx
jne    11d1 <main+0xb1>
mov    -0x8(%rbp),%eax
cltd
idivl  -0x14(%rbp)
cmp    $0x0,%edx
jne    11d1 <main+0xb1>
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
cltd
idivl  -0x8(%rbp)
cmp    $0x0,%edx
jne    11d1 <main+0xb1>
mov    -0x8(%rbp),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d6 <main+0xb6>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x5a>
jmp    11e9 <main+0xc9>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
lea    0xeba(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edi
cmp    %edi,%esi
jne    116e <main+0x3e>
lea    0xea1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11cc <main+0x9c>
mov    %edi,%ecx
imul   %esi,%ecx
test   %ecx,%ecx
jle    11cc <main+0x9c>
lea    0xe96(%rip),%rbx
xor    %ebp,%ebp
jmp    1199 <main+0x69>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%ecx
imul   %esi,%ecx
cmp    %ecx,%ebp
jge    11cc <main+0x9c>
add    $0x1,%ebp
mov    %ebp,%eax
cltd
idiv   %esi
test   %edx,%edx
jne    1190 <main+0x60>
mov    %ebp,%eax
cltd
idiv   %edi
test   %edx,%edx
jne    1190 <main+0x60>
mov    %ecx,%eax
cltd
idiv   %ebp
test   %edx,%edx
jne    1190 <main+0x60>
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%esi
mov    (%rsp),%edi
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter the two numbers\0A\00"
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"%d is the lcm\00"
@.str.3 = [34 x i8] c"%d is the lcm of the given number\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 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5)
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = icmp eq i32 %8, %9
br i1 %10, label %11, label %14
11: ; preds = %0
%12 = load i32, i32* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %46
14: ; preds = %0
store i32 1, i32* %2
br label %15
15: ; preds = %42, %14
%16 = load i32, i32* %2
%17 = load i32, i32* %4
%18 = load i32, i32* %5
%19 = mul nsw i32 %17, %18
%20 = icmp sle i32 %16, %19
br i1 %20, label %21, label %45
21: ; preds = %15
%22 = load i32, i32* %2
%23 = load i32, i32* %4
%24 = srem i32 %22, %23
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %41
26: ; preds = %21
%27 = load i32, i32* %2
%28 = load i32, i32* %5
%29 = srem i32 %27, %28
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %41
31: ; preds = %26
%32 = load i32, i32* %4
%33 = load i32, i32* %5
%34 = mul nsw i32 %32, %33
%35 = load i32, i32* %2
%36 = srem i32 %34, %35
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %31
%39 = load i32, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %38, %31, %26, %21
br label %42
42: ; preds = %41
%43 = load i32, i32* %2
%44 = add nsw i32 %43, 1
store i32 %44, i32* %2
br label %15
45: ; preds = %15
br label %46
46: ; preds = %45, %11
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%d %d\00"
@.str.2 = [14 x i8] c"%d is the lcm\00"
@.str.3 = [34 x i8] c"%d is the lcm of the given number\00"
@str = [22 x i8] c"Enter the two numbers\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1, i32* %2)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = icmp eq i32 %7, %8
br i1 %9, label %13, label %10
10: ; preds = %0
%11 = mul nsw i32 %8, %7
%12 = icmp slt i32 %11, 1
br i1 %12, label %38, label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %38
15: ; preds = %10, %32
%16 = phi i32 [ %33, %32 ], [ %8, %10 ]
%17 = phi i32 [ %34, %32 ], [ %7, %10 ]
%18 = phi i32 [ %36, %32 ], [ %11, %10 ]
%19 = phi i32 [ %35, %32 ], [ 1, %10 ]
%20 = srem i32 %19, %17
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %32
22: ; preds = %15
%23 = srem i32 %19, %16
%24 = icmp eq i32 %23, 0
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = srem i32 %18, %19
%27 = icmp eq i32 %26, 0
br i1 %27, label %28, label %32
28: ; preds = %25
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.3, i64 0, i64 0), i32 %19)
%30 = load i32, i32* %1
%31 = load i32, i32* %2
br label %32
32: ; preds = %15, %22, %25, %28
%33 = phi i32 [ %16, %15 ], [ %16, %22 ], [ %16, %25 ], [ %31, %28 ]
%34 = phi i32 [ %17, %15 ], [ %17, %22 ], [ %17, %25 ], [ %30, %28 ]
%35 = add nuw nsw i32 %19, 1
%36 = mul nsw i32 %33, %34
%37 = icmp slt i32 %19, %36
br i1 %37, label %15, label %38
38: ; preds = %32, %10, %13
ret i32 0
}