#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 max = 0, num;
  for (int i = 0; i < 5; i++) {
    scanf("%f", &num);
    max = max > num ? max : num;
    num = 0;
  }
  printf("%f\n", max);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x5,-0x10(%rbp)
jge    11a0 <main+0x80>
lea    0xeb1(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1176 <main+0x56>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
jmp    1180 <main+0x60>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113e <main+0x1e>
movss  -0x8(%rbp),%xmm0
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
xorps  %xmm0,%xmm0
maxss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
maxss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
maxss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
maxss  (%rsp),%xmm0
movss  %xmm0,0x4(%rsp)
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <scanf@plt>
movss  0x4(%rsp),%xmm0
maxss  (%rsp),%xmm0
movl   $0x0,(%rsp)
lea    0xe28(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store i32 0, i32* %4
br label %5
5: ; preds = %19, %0
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 5
br i1 %7, label %8, label %22
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %3)
%10 = load float, float* %2
%11 = load float, float* %3
%12 = fcmp ogt float %10, %11
br i1 %12, label %13, label %15
13: ; preds = %8
%14 = load float, float* %2
br label %17
15: ; preds = %8
%16 = load float, float* %3
br label %17
17: ; preds = %15, %13
%18 = phi float [ %14, %13 ], [ %16, %15 ]
store float %18, float* %2
store float 0.000000e+00, float* %3
br label %19
19: ; preds = %17
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %5
22: ; preds = %5
%23 = load float, float* %2
%24 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %23)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%4 = load float, float* %1
%5 = fcmp olt float %4, 0.000000e+00
%6 = select i1 %5, float 0.000000e+00, float %4
store float 0.000000e+00, float* %1
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%8 = load float, float* %1
%9 = fcmp ogt float %6, %8
%10 = select i1 %9, float %6, float %8
store float 0.000000e+00, float* %1
%11 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%12 = load float, float* %1
%13 = fcmp ogt float %10, %12
%14 = select i1 %13, float %10, float %12
store float 0.000000e+00, float* %1
%15 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%16 = load float, float* %1
%17 = fcmp ogt float %14, %16
%18 = select i1 %17, float %14, float %16
store float 0.000000e+00, float* %1
%19 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %1)
%20 = load float, float* %1
%21 = fcmp ogt float %18, %20
%22 = select i1 %21, float %18, float %20
store float 0.000000e+00, float* %1
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %22)
ret i32 0
}