#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 a[3];
  printf("enter three values:");
  scanf("%d %d %d", &a[0], &a[1], &a[2]);
  if (a[0] > a[1] && a[0] > a[2])
    printf("%d is the largest element", a[0]);
  else if (a[1] > a[2] && a[1] > a[0])
    printf("%d is the largest element", a[1]);
  else if (a[2] > a[0] && a[2] > a[1])
    printf("%d is the largest element", a[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x10(%rbp),%rsi
lea    -0x10(%rbp),%rdx
add    $0x4,%rdx
lea    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    0xebc(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    118b <main+0x6b>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    118b <main+0x6b>
mov    -0x10(%rbp),%esi
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11ec <main+0xcc>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jle    11b9 <main+0x99>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11b9 <main+0x99>
mov    -0xc(%rbp),%esi
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    11e2 <main+0xc2>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    11e2 <main+0xc2>
mov    -0x8(%rbp),%esi
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e7 <main+0xc7>
jmp    11ec <main+0xcc>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rdx
lea    0x14(%rsp),%rcx
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%ecx
mov    0x10(%rsp),%eax
mov    0x14(%rsp),%esi
cmp    %eax,%ecx
jle    1165 <main+0x45>
cmp    %esi,%ecx
jle    1165 <main+0x45>
mov    %ecx,%esi
jmp    1179 <main+0x59>
cmp    %esi,%eax
jle    1171 <main+0x51>
cmp    %ecx,%eax
jle    1171 <main+0x51>
mov    %eax,%esi
jmp    1179 <main+0x59>
cmp    %ecx,%esi
jle    1187 <main+0x67>
cmp    %eax,%esi
jle    1187 <main+0x67>
lea    0xe9d(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"enter three values:\00"
@.str.1 = [9 x i8] c"%d %d %d\00"
@.str.2 = [26 x i8] c"%d is the largest element\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%6 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32* %4, i32* %5, i32* %6)
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%9 = load i32, i32* %8
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%11 = load i32, i32* %10
%12 = icmp sgt i32 %9, %11
br i1 %12, label %13, label %23
13: ; preds = %0
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = load i32, i32* %14
%16 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%17 = load i32, i32* %16
%18 = icmp sgt i32 %15, %17
br i1 %18, label %19, label %23
19: ; preds = %13
%20 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%21 = load i32, i32* %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %21)
br label %57
23: ; preds = %13, %0
%24 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%25 = load i32, i32* %24
%26 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%27 = load i32, i32* %26
%28 = icmp sgt i32 %25, %27
br i1 %28, label %29, label %39
29: ; preds = %23
%30 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%31 = load i32, i32* %30
%32 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%33 = load i32, i32* %32
%34 = icmp sgt i32 %31, %33
br i1 %34, label %35, label %39
35: ; preds = %29
%36 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%37 = load i32, i32* %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %56
39: ; preds = %29, %23
%40 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%41 = load i32, i32* %40
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%43 = load i32, i32* %42
%44 = icmp sgt i32 %41, %43
br i1 %44, label %45, label %55
45: ; preds = %39
%46 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%47 = load i32, i32* %46
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 1
%49 = load i32, i32* %48
%50 = icmp sgt i32 %47, %49
br i1 %50, label %51, label %55
51: ; preds = %45
%52 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%53 = load i32, i32* %52
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %53)
br label %55
55: ; preds = %51, %45, %39
br label %56
56: ; preds = %55, %35
br label %57
57: ; preds = %56, %19
ret i32 0
}

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