#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 *);
int main(int argc, char const *argv[]) {
  int num1, num2, num3;
  printf("enter the numbers:\n");
  scanf("%d%d%d", &num1, &num2, &num3);
  if (num1 > num2) {
    if (num1 > num3) {
      printf("num1 %d is greater\n", num1);
    } else {
      printf("num3 %d is greater\n", num3);
    }
  } else {
    if (num2 > num3) {
      printf("num2 %d is greater\n", num2);
    } else {
      printf("num3 %d is greater \n", num3);
    }
  }
  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)
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x1c(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jle    11a0 <main+0x80>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    118a <main+0x6a>
mov    -0x14(%rbp),%esi
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    119b <main+0x7b>
mov    -0x1c(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    11c2 <main+0xa2>
mov    -0x18(%rbp),%esi
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <main+0xb3>
mov    -0x1c(%rbp),%esi
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xf1d(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x14(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    0xc(%rsp),%esi
cmp    %ecx,%eax
jle    117a <main+0x4a>
cmp    %esi,%eax
jle    1189 <main+0x59>
lea    0xe91(%rip),%rdi
mov    %eax,%esi
jmp    1199 <main+0x69>
cmp    %esi,%ecx
jle    1192 <main+0x62>
lea    0xeaa(%rip),%rdi
mov    %ecx,%esi
jmp    1199 <main+0x69>
lea    0xe8b(%rip),%rdi
jmp    1199 <main+0x69>
lea    0xeaa(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter the numbers:\0A\00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [20 x i8] c"num1 %d is greater\0A\00"
@.str.3 = [20 x i8] c"num3 %d is greater\0A\00"
@.str.4 = [20 x i8] c"num2 %d is greater\0A\00"
@.str.5 = [21 x i8] c"num3 %d is greater \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
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %6, i32* %7, i32* %8)
%11 = load i32, i32* %6
%12 = load i32, i32* %7
%13 = icmp sgt i32 %11, %12
br i1 %13, label %14, label %25
14: ; preds = %2
%15 = load i32, i32* %6
%16 = load i32, i32* %8
%17 = icmp sgt i32 %15, %16
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32, i32* %6
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %24
21: ; preds = %14
%22 = load i32, i32* %8
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %22)
br label %24
24: ; preds = %21, %18
br label %36
25: ; preds = %2
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = icmp sgt i32 %26, %27
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = load i32, i32* %7
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %30)
br label %35
32: ; preds = %25
%33 = load i32, i32* %8
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %32, %29
br label %36
36: ; preds = %35, %24
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [20 x i8] c"num1 %d is greater\0A\00"
@.str.3 = [20 x i8] c"num3 %d is greater\0A\00"
@.str.4 = [20 x i8] c"num2 %d is greater\0A\00"
@.str.5 = [21 x i8] c"num3 %d is greater \0A\00"
@str = [19 x i8] c"enter the numbers:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast i32* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32* %3, i32* %4, i32* %5)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp sgt i32 %11, %12
%14 = load i32, i32* %5
br i1 %13, label %15, label %21
15: ; preds = %2
%16 = icmp sgt i32 %11, %14
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i32 %11)
br label %27
19: ; preds = %15
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0), i32 %14)
br label %27
21: ; preds = %2
%22 = icmp sgt i32 %12, %14
br i1 %22, label %23, label %25
23: ; preds = %21
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %12)
br label %27
25: ; preds = %21
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %14)
br label %27
27: ; preds = %23, %25, %17, %19
ret i32 0
}