#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 main(int argc, const char *argv[]) {
  int number;
  printf("===== Exercise 6 =====\n");
  printf("The Greatest Number!\n");
  printf("The number of numbers you'll enter. : ");
  scanf("%i", &number);
  float numbers[number];
  printf("Enter all numbers(Write one number and Enter).:\n");
  for (int i = 0; i < number; i++) {
    scanf("%f", &numbers[i]);
  }
  float greastest = numbers[0];
  for (int k = 0; k < number; k++) {
    if (greastest <= numbers[k + 1]) {
      greastest = numbers[k + 1];
    }
  }
  printf("--> The greasted number is %f.\n", greastest);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x41(%rbp)
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    -0x41(%rbp),%al
lea    0xee6(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11eb <main+0xcb>
mov    -0x40(%rbp),%rsi
movslq -0x2c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11b4 <main+0x94>
mov    -0x40(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1255 <main+0x135>
mov    -0x40(%rbp),%rax
movss  -0x30(%rbp),%xmm1
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
ucomiss %xmm1,%xmm0
jb     1242 <main+0x122>
mov    -0x40(%rbp),%rax
mov    -0x34(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    1247 <main+0x127>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    11ff <main+0xdf>
movss  -0x30(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe27(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf08(%rip),%rdi
call   1030 <puts@plt>
lea    0xf13(%rip),%rdi
call   1030 <puts@plt>
lea    0xea3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebc(%rip),%rdi
lea    -0x2c(%rbp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rsp,%r15
mov    -0x2c(%rbp),%eax
mov    %rsp,%r12
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
lea    0xee1(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x0,-0x2c(%rbp)
jle    11f0 <main+0xc0>
lea    0xe80(%rip),%r14
mov    %r12,%r13
xor    %ebx,%ebx
nop
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
add    $0x1,%rbx
movslq -0x2c(%rbp),%rax
add    $0x4,%r13
cmp    %rax,%rbx
jl     11b0 <main+0x80>
mov    %eax,%ecx
movss  (%r12),%xmm0
test   %ecx,%ecx
jle    11f5 <main+0xc5>
lea    -0x1(%rcx),%rdx
mov    %ecx,%eax
and    $0x3,%eax
cmp    $0x3,%rdx
jae    11fd <main+0xcd>
xor    %edx,%edx
jmp    1282 <main+0x152>
jmp    12bf <main+0x18f>
movaps %xmm0,%xmm1
jmp    12bf <main+0x18f>
and    $0xfffffffc,%ecx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  0x4(%r12,%rdx,4),%xmm1
movss  0x8(%r12,%rdx,4),%xmm2
movaps %xmm0,%xmm3
cmpless %xmm1,%xmm3
andps  %xmm3,%xmm1
andnps %xmm0,%xmm3
orps   %xmm1,%xmm3
movaps %xmm3,%xmm0
cmpless %xmm2,%xmm0
movaps %xmm0,%xmm1
andnps %xmm3,%xmm1
andps  %xmm2,%xmm0
orps   %xmm1,%xmm0
movss  0xc(%r12,%rdx,4),%xmm1
movaps %xmm0,%xmm2
cmpless %xmm1,%xmm2
movaps %xmm2,%xmm3
andnps %xmm0,%xmm3
andps  %xmm1,%xmm2
orps   %xmm3,%xmm2
movss  0x10(%r12,%rdx,4),%xmm1
add    $0x4,%rdx
movaps %xmm2,%xmm0
cmpless %xmm1,%xmm0
movaps %xmm0,%xmm3
andnps %xmm2,%xmm3
andps  %xmm1,%xmm0
orps   %xmm3,%xmm0
cmp    %rdx,%rcx
jne    1210 <main+0xe0>
movaps %xmm0,%xmm1
test   %rax,%rax
je     12bf <main+0x18f>
lea    (%r12,%rdx,4),%rcx
add    $0x4,%rcx
xor    %edx,%edx
movaps %xmm0,%xmm1
nopw   0x0(%rax,%rax,1)
movss  (%rcx,%rdx,4),%xmm2
cmpless %xmm2,%xmm1
andps  %xmm1,%xmm2
andnps %xmm0,%xmm1
orps   %xmm2,%xmm1
add    $0x1,%rdx
movaps %xmm1,%xmm0
cmp    %rdx,%rax
jne    12a0 <main+0x170>
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xd60(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %r15,%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"===== Exercise 6 =====\0A\00"
@.str.1 = [22 x i8] c"The Greatest Number!\0A\00"
@.str.2 = [39 x i8] c"The number of numbers you'll enter. : \00"
@.str.3 = [3 x i8] c"%i\00"
@.str.4 = [49 x i8] c"Enter all numbers(Write one number and Enter).:\0A\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [32 x i8] c"--> The greasted number is %f.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i32
%10 = alloca float
%11 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
%16 = load i32, i32* %6
%17 = zext i32 %16 to i64
%18 = call i8* @llvm.stacksave()
store i8* %18, i8** %7
%19 = alloca float, i64 %17
store i64 %17, i64* %8
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %9
br label %21
21: ; preds = %30, %2
%22 = load i32, i32* %9
%23 = load i32, i32* %6
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %33
25: ; preds = %21
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = getelementptr inbounds float, float* %19, i64 %27
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %28)
br label %30
30: ; preds = %25
%31 = load i32, i32* %9
%32 = add nsw i32 %31, 1
store i32 %32, i32* %9
br label %21
33: ; preds = %21
%34 = getelementptr inbounds float, float* %19, i64 0
%35 = load float, float* %34
store float %35, float* %10
store i32 0, i32* %11
br label %36
36: ; preds = %55, %33
%37 = load i32, i32* %11
%38 = load i32, i32* %6
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %58
40: ; preds = %36
%41 = load float, float* %10
%42 = load i32, i32* %11
%43 = add nsw i32 %42, 1
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds float, float* %19, i64 %44
%46 = load float, float* %45
%47 = fcmp ole float %41, %46
br i1 %47, label %48, label %54
48: ; preds = %40
%49 = load i32, i32* %11
%50 = add nsw i32 %49, 1
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds float, float* %19, i64 %51
%53 = load float, float* %52
store float %53, float* %10
br label %54
54: ; preds = %48, %40
br label %55
55: ; preds = %54
%56 = load i32, i32* %11
%57 = add nsw i32 %56, 1
store i32 %57, i32* %11
br label %36
58: ; preds = %36
%59 = load float, float* %10
%60 = fpext float %59 to double
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %60)
store i32 0, i32* %3
%62 = load i8*, i8** %7
%63 = load i32, i32* %3
ret i32 %63
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c"The number of numbers you'll enter. : \00"
@.str.3 = [3 x i8] c"%i\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [32 x i8] c"--> The greasted number is %f.\0A\00"
@str = [23 x i8] c"===== Exercise 6 =====\00"
@str.7 = [21 x i8] c"The Greatest Number!\00"
@str.8 = [48 x i8] c"Enter all numbers(Write one number and Enter).:\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%9 = load i32, i32* %3
%10 = zext i32 %9 to i64
%11 = call i8* @llvm.stacksave()
%12 = alloca float, i64 %10
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.8, i64 0, i64 0))
%14 = load i32, i32* %3
%15 = icmp sgt i32 %14, 0
br i1 %15, label %26, label %50
16: ; preds = %26
%17 = load float, float* %12
%18 = icmp sgt i32 %31, 0
br i1 %18, label %19, label %50
19: ; preds = %16
%20 = zext i32 %31 to i64
%21 = add nsw i64 %20, -1
%22 = and i64 %20, 3
%23 = icmp ult i64 %21, 3
br i1 %23, label %34, label %24
24: ; preds = %19
%25 = and i64 %20, 4294967292
br label %54
26: ; preds = %2, %26
%27 = phi i64 [ %30, %26 ], [ 0, %2 ]
%28 = getelementptr inbounds float, float* %12, i64 %27
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %28)
%30 = add nuw nsw i64 %27, 1
%31 = load i32, i32* %3
%32 = sext i32 %31 to i64
%33 = icmp slt i64 %30, %32
br i1 %33, label %26, label %16
34: ; preds = %54, %19
%35 = phi float [ undef, %19 ], [ %77, %54 ]
%36 = phi i64 [ 0, %19 ], [ %73, %54 ]
%37 = phi float [ %17, %19 ], [ %77, %54 ]
%38 = icmp eq i64 %22, 0
br i1 %38, label %50, label %39
39: ; preds = %34, %39
%40 = phi i64 [ %43, %39 ], [ %36, %34 ]
%41 = phi float [ %47, %39 ], [ %37, %34 ]
%42 = phi i64 [ %48, %39 ], [ 0, %34 ]
%43 = add nuw nsw i64 %40, 1
%44 = getelementptr inbounds float, float* %12, i64 %43
%45 = load float, float* %44
%46 = fcmp ole float %41, %45
%47 = select i1 %46, float %45, float %41
%48 = add i64 %42, 1
%49 = icmp eq i64 %48, %22
br i1 %49, label %50, label %39
50: ; preds = %34, %39, %2, %16
%51 = phi float [ %17, %16 ], [ undef, %2 ], [ %35, %34 ], [ %47, %39 ]
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.6, i64 0, i64 0), double %52)
ret i32 0
54: ; preds = %54, %24
%55 = phi i64 [ 0, %24 ], [ %73, %54 ]
%56 = phi float [ %17, %24 ], [ %77, %54 ]
%57 = phi i64 [ 0, %24 ], [ %78, %54 ]
%58 = or i64 %55, 1
%59 = getelementptr inbounds float, float* %12, i64 %58
%60 = load float, float* %59
%61 = fcmp ole float %56, %60
%62 = select i1 %61, float %60, float %56
%63 = or i64 %55, 2
%64 = getelementptr inbounds float, float* %12, i64 %63
%65 = load float, float* %64
%66 = fcmp ole float %62, %65
%67 = select i1 %66, float %65, float %62
%68 = or i64 %55, 3
%69 = getelementptr inbounds float, float* %12, i64 %68
%70 = load float, float* %69
%71 = fcmp ole float %67, %70
%72 = select i1 %71, float %70, float %67
%73 = add nuw nsw i64 %55, 4
%74 = getelementptr inbounds float, float* %12, i64 %73
%75 = load float, float* %74
%76 = fcmp ole float %72, %75
%77 = select i1 %76, float %75, float %72
%78 = add i64 %57, 4
%79 = icmp eq i64 %78, %25
br i1 %79, label %34, label %54
}