#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 *, float);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float arr[3], temp;
  int i;
  for (i = 0; i < 3; i++)
    scanf("%f", &arr[i]);
  temp = arr[0];
  for (i = 0; i < 3; i++) {
    if (arr[i] > temp)
      temp = arr[i];
  }
  printf("Max of above nos. is %f", temp);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1169 <main+0x49>
movslq -0x18(%rbp),%rax
lea    -0x10(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xebf(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1136 <main+0x16>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    11ba <main+0x9a>
movslq -0x18(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
ucomiss -0x14(%rbp),%xmm0
jbe    11a7 <main+0x87>
movslq -0x18(%rbp),%rax
movss  -0x10(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    11ac <main+0x8c>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    117a <main+0x5a>
movss  -0x14(%rbp),%xmm0
lea    0xe3a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xee9(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm1
movss  0xc(%rsp),%xmm0
maxss  0x4(%rsp),%xmm1
maxss  %xmm1,%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [24 x i8] c"Max of above nos. is %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x float]
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %4
br label %5
5: ; preds = %13, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %16
8: ; preds = %5
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %10
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %11)
br label %13
13: ; preds = %8
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %5
16: ; preds = %5
%17 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 0
%18 = load float, float* %17
store float %18, float* %3
store i32 0, i32* %4
br label %19
19: ; preds = %35, %16
%20 = load i32, i32* %4
%21 = icmp slt i32 %20, 3
br i1 %21, label %22, label %38
22: ; preds = %19
%23 = load i32, i32* %4
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %24
%26 = load float, float* %25
%27 = load float, float* %3
%28 = fcmp ogt float %26, %27
br i1 %28, label %29, label %34
29: ; preds = %22
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds [3 x float], [3 x float]* %2, i64 0, i64 %31
%33 = load float, float* %32
store float %33, float* %3
br label %34
34: ; preds = %29, %22
br label %35
35: ; preds = %34
%36 = load i32, i32* %4
%37 = add nsw i32 %36, 1
store i32 %37, i32* %4
br label %19
38: ; preds = %19
%39 = load float, float* %3
%40 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %39)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [24 x i8] c"Max of above nos. is %f\00"
define i32 @main() {
%1 = alloca [3 x float]
%2 = bitcast [3 x float]* %1 to i8*
%3 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%5 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %5)
%7 = getelementptr inbounds [3 x float], [3 x float]* %1, i64 0, i64 2
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %7)
%9 = load float, float* %3
%10 = load float, float* %5
%11 = fcmp ogt float %10, %9
%12 = select i1 %11, float %10, float %9
%13 = load float, float* %7
%14 = fcmp ogt float %13, %12
%15 = select i1 %14, float %13, float %12
%16 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), float %15)
ret i32 0
}