#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 */
float dizi_toplam(float *, int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ scanf(char *, float *);
int main() {
  float sicakliklar[7];
  int i;
  for (i = 0; i < 7; i++) {
    printf("%d. gun: ", i + 1);
    float x;
    scanf("%f", &x);
    sicakliklar[i] = x;
  }
  float toplam = dizi_toplam(sicakliklar, 7);
  printf("toplam: %f\n", toplam);
  float ortalama = toplam / 7.0;
  printf("ortalama: %f\n", ortalama);
  for (i = 0; i < 7; i++) {
    if (sicakliklar[i] < ortalama) {
      printf("%d. gun = %f\n", i + 1, sicakliklar[i]);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    1191 <main+0x61>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea7(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x28(%rbp),%xmm0
movslq -0x24(%rbp),%rax
movss  %xmm0,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1146 <main+0x16>
lea    -0x20(%rbp),%rdi
mov    $0x7,%esi
call   1030 <dizi_toplam@plt>
movss  %xmm0,-0x2c(%rbp)
cvttss2si -0x2c(%rbp),%esi
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x2c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xe38(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
cvttss2si -0x30(%rbp),%esi
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    1246 <main+0x116>
movslq -0x24(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm1
movss  -0x30(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1233 <main+0x103>
mov    -0x24(%rbp),%esi
add    $0x1,%esi
movslq -0x24(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe03(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1238 <main+0x108>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ef <main+0xbf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xec4(%rip),%r14
mov    %r14,%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb8(%rip),%rbx
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x10(%rsp)
mov    %r14,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
mov    %r14,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x18(%rsp)
mov    %r14,%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x1c(%rsp)
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
mov    %r14,%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
mov    %r14,%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x28(%rsp)
lea    0x10(%rsp),%rdi
mov    $0x7,%esi
call   1030 <dizi_toplam@plt>
movss  %xmm0,0x8(%rsp)
cvttss2si %xmm0,%esi
lea    0xd9b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
divss  0xd75(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
cvttss2si %xmm0,%esi
lea    0xd81(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    12cb <main+0x19b>
cvtss2sd %xmm0,%xmm0
lea    0xd6c(%rip),%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    12f3 <main+0x1c3>
cvtss2sd %xmm0,%xmm0
lea    0xd44(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x18(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    131b <main+0x1eb>
cvtss2sd %xmm0,%xmm0
lea    0xd1c(%rip),%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x1c(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1343 <main+0x213>
cvtss2sd %xmm0,%xmm0
lea    0xcf4(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x20(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    136b <main+0x23b>
cvtss2sd %xmm0,%xmm0
lea    0xccc(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x24(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1393 <main+0x263>
cvtss2sd %xmm0,%xmm0
lea    0xca4(%rip),%rdi
mov    $0x6,%esi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x28(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    13bb <main+0x28b>
cvtss2sd %xmm0,%xmm0
lea    0xc7c(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%d. gun: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"toplam: %f\0A\00"
@.str.3 = [14 x i8] c"ortalama: %f\0A\00"
@.str.4 = [14 x i8] c"%d. gun = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x float]
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store i32 0, i32* %3
br label %7
7: ; preds = %19, %0
%8 = load i32, i32* %3
%9 = icmp slt i32 %8, 7
br i1 %9, label %10, label %22
10: ; preds = %7
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%15 = load float, float* %4
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 %17
store float %15, float* %18
br label %19
19: ; preds = %10
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %7
22: ; preds = %7
%23 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 0
%24 = call float @dizi_toplam(float* %23, i32 7)
store float %24, float* %5
%25 = load float, float* %5
%26 = fptosi float %25 to i32
%27 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %26)
%28 = load float, float* %5
%29 = fpext float %28 to double
%30 = fdiv double %29, 7.000000e+00
%31 = fptrunc double %30 to float
store float %31, float* %6
%32 = load float, float* %6
%33 = fptosi float %32 to i32
%34 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %33)
store i32 0, i32* %3
br label %35
35: ; preds = %55, %22
%36 = load i32, i32* %3
%37 = icmp slt i32 %36, 7
br i1 %37, label %38, label %58
38: ; preds = %35
%39 = load i32, i32* %3
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 %40
%42 = load float, float* %41
%43 = load float, float* %6
%44 = fcmp olt float %42, %43
br i1 %44, label %45, label %54
45: ; preds = %38
%46 = load i32, i32* %3
%47 = add nsw i32 %46, 1
%48 = load i32, i32* %3
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 %49
%51 = load float, float* %50
%52 = fpext float %51 to double
%53 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %47, double %52)
br label %54
54: ; preds = %45, %38
br label %55
55: ; preds = %54
%56 = load i32, i32* %3
%57 = add nsw i32 %56, 1
store i32 %57, i32* %3
br label %35
58: ; preds = %35
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"%d. gun: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [12 x i8] c"toplam: %f\0A\00"
@.str.3 = [14 x i8] c"ortalama: %f\0A\00"
@.str.4 = [14 x i8] c"%d. gun = %f\0A\00"
define i32 @main() {
%1 = alloca [7 x float]
%2 = alloca float
%3 = bitcast [7 x float]* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 1)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 0
store float %7, float* %8
%9 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 2)
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%11 = load float, float* %2
%12 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 1
store float %11, float* %12
%13 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 3)
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%15 = load float, float* %2
%16 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 2
store float %15, float* %16
%17 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 4)
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%19 = load float, float* %2
%20 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 3
store float %19, float* %20
%21 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 5)
%22 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%23 = load float, float* %2
%24 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 4
store float %23, float* %24
%25 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 6)
%26 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%27 = load float, float* %2
%28 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 5
store float %27, float* %28
%29 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 7)
%30 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%31 = load float, float* %2
%32 = getelementptr inbounds [7 x float], [7 x float]* %1, i64 0, i64 6
store float %31, float* %32
%33 = call float @dizi_toplam(float* %8, i32 7)
%34 = fptosi float %33 to i32
%35 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32 %34)
%36 = fdiv float %33, 7.000000e+00
%37 = fptosi float %36 to i32
%38 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = load float, float* %8
%40 = fcmp olt float %39, %36
br i1 %40, label %41, label %44
41: ; preds = %0
%42 = fpext float %39 to double
%43 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 1, double %42)
br label %44
44: ; preds = %0, %41
%45 = load float, float* %12
%46 = fcmp olt float %45, %36
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = fpext float %45 to double
%49 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 2, double %48)
br label %50
50: ; preds = %47, %44
%51 = load float, float* %16
%52 = fcmp olt float %51, %36
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = fpext float %51 to double
%55 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 3, double %54)
br label %56
56: ; preds = %53, %50
%57 = load float, float* %20
%58 = fcmp olt float %57, %36
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = fpext float %57 to double
%61 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 4, double %60)
br label %62
62: ; preds = %59, %56
%63 = load float, float* %24
%64 = fcmp olt float %63, %36
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = fpext float %63 to double
%67 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 5, double %66)
br label %68
68: ; preds = %65, %62
%69 = load float, float* %28
%70 = fcmp olt float %69, %36
br i1 %70, label %71, label %74
71: ; preds = %68
%72 = fpext float %69 to double
%73 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 6, double %72)
br label %74
74: ; preds = %71, %68
%75 = load float, float* %32
%76 = fcmp olt float %75, %36
br i1 %76, label %77, label %80
77: ; preds = %74
%78 = fpext float %75 to double
%79 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 7, double %78)
br label %80
80: ; preds = %77, %74
ret i32 0
}