#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, const char *argv[]) {
  int num1, num2, num3;
  int highscore;
  printf("Enter 3 numbers: ");
  scanf("%d%d%d", &num1, &num2, &num3);
  if (num1 > num2 && num1 > num3)
    highscore = num1;
  else if (num2 > num3)
    highscore = num2;
  else
    highscore = num3;
  printf("Highest number is: %d", highscore);
  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    0xec7(%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    117f <main+0x5f>
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    117f <main+0x5f>
mov    -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11a1 <main+0x81>
mov    -0x18(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    1196 <main+0x76>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    119c <main+0x7c>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
jmp    11a1 <main+0x81>
mov    -0x20(%rbp),%esi
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%eax
mov    0xc(%rsp),%ecx
cmp    %ecx,%eax
mov    %ecx,%edx
cmovg  %eax,%edx
mov    0x14(%rsp),%edi
cmp    %ecx,%edi
mov    %edx,%esi
cmovg  %edi,%esi
cmp    %eax,%edi
cmovle %edx,%esi
lea    0xea6(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Enter 3 numbers: \00"
@.str.1 = [7 x i8] c"%d%d%d\00"
@.str.2 = [22 x i8] c"Highest number is: %d\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 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 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
%15 = icmp sgt i32 %11, %14
%16 = select i1 %13, i1 %15, i1 false
%17 = icmp sgt i32 %12, %14
%18 = select i1 %17, i32 %12, i32 %14
%19 = select i1 %16, i32 %11, i32 %18
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), i32 %19)
ret i32 0
}