#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*/ dtoa(char *, float);
double offCalc(float *, int);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ rand();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  char pcBuffer[30], *aux;
  float Value = -1.3;
  float V[11];
  int i;
  srand((unsigned)time(NULL));
  for (i = 0; i < 11; i++)
    V[i] = (float)rand() / (float)100;
  dtoa(pcBuffer, Value);
  printf("Hello world!\n");
  printf("string %s", pcBuffer);
  for (i = 1; i < 11; i++)
    printf("%f\n", V[i]);
  printf("offCalc %f", offCalc(V, 11));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x3c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
movl   $0x0,-0x74(%rbp)
cmpl   $0xb,-0x74(%rbp)
jge    11d0 <main+0x70>
mov    $0x0,%al
call   1080 <rand@plt>
cvtsi2ss %rax,%xmm0
movss  0xe50(%rip),%xmm1
divss  %xmm1,%xmm0
movslq -0x74(%rbp),%rax
movss  %xmm0,-0x70(%rbp,%rax,4)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1196 <main+0x36>
lea    -0x30(%rbp),%rdi
movss  -0x3c(%rbp),%xmm0
call   1050 <dtoa@plt>
lea    0xe23(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x74(%rbp)
cmpl   $0xb,-0x74(%rbp)
jge    1239 <main+0xd9>
movslq -0x74(%rbp),%rax
movss  -0x70(%rbp,%rax,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdfc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1205 <main+0xa5>
lea    -0x70(%rbp),%rdi
mov    $0xb,%esi
call   1030 <offCalc@plt>
lea    0xdd6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
xor    %edi,%edi
call   1080 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1090 <rand@plt>
cvtsi2ss %r14,%xmm2
cvtsi2ss %r15,%xmm0
unpcklps %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %rbx,%xmm0
cvtsi2ss %rax,%xmm1
unpcklps %xmm1,%xmm0
movlhps %xmm0,%xmm2
divps  0xe2a(%rip),%xmm2
movaps %xmm2,0x50(%rsp)
movaps %xmm2,0x20(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1090 <rand@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1090 <rand@plt>
xorps  %xmm2,%xmm2
cvtsi2ss %r14,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %r15,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %rbx,%xmm1
unpcklps %xmm0,%xmm2
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
unpcklps %xmm0,%xmm1
movlhps %xmm1,%xmm2
divps  0xdcb(%rip),%xmm2
movaps %xmm2,0x10(%rsp)
movaps %xmm2,0x30(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0xdba(%rip),%xmm0
movss  %xmm0,0xc(%rsp)
movss  %xmm0,0x40(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0xd97(%rip),%xmm0
movss  %xmm0,0x8(%rsp)
movss  %xmm0,0x44(%rsp)
xor    %eax,%eax
call   1090 <rand@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
divss  0xd74(%rip),%xmm0
movss  %xmm0,0x4(%rsp)
movss  %xmm0,0x48(%rsp)
lea    0x60(%rsp),%rbx
movss  0xd5f(%rip),%xmm0
mov    %rbx,%rdi
call   1060 <dtoa@plt>
lea    0xd6d(%rip),%rdi
call   1030 <puts@plt>
lea    0xd48(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
movss  0x24(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd37(%rip),%rbx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x28(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps 0x50(%rsp),%xmm0
shufps $0xff,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps 0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps 0x10(%rsp),%xmm0
shufps $0x55,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps 0x10(%rsp),%xmm0
movhlps %xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movaps 0x10(%rsp),%xmm0
shufps $0xff,%xmm0,%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x20(%rsp),%rdi
mov    $0xb,%esi
call   1040 <offCalc@plt>
lea    0xc5d(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
@.str.1 = [10 x i8] c"string %s\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.3 = [11 x i8] c"offCalc %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [30 x i8]
%3 = alloca i8*
%4 = alloca float
%5 = alloca [11 x float]
%6 = alloca i32
store i32 0, i32* %1
store float 0xBFF4CCCCC0000000, float* %4
%7 = call i64 @time(i32* null)
%8 = trunc i64 %7 to i32
%9 = call i32 @srand(i32 %8)
store i32 0, i32* %6
br label %10
10: ; preds = %20, %0
%11 = load i32, i32* %6
%12 = icmp slt i32 %11, 11
br i1 %12, label %13, label %23
13: ; preds = %10
%14 = call i64 (...) @rand()
%15 = sitofp i64 %14 to float
%16 = fdiv float %15, 1.000000e+02
%17 = load i32, i32* %6
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [11 x float], [11 x float]* %5, i64 0, i64 %18
store float %16, float* %19
br label %20
20: ; preds = %13
%21 = load i32, i32* %6
%22 = add nsw i32 %21, 1
store i32 %22, i32* %6
br label %10
23: ; preds = %10
%24 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%25 = load float, float* %4
%26 = call i32 @dtoa(i8* %24, float %25)
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%28 = getelementptr inbounds [30 x i8], [30 x i8]* %2, i64 0, i64 0
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %28)
store i32 1, i32* %6
br label %30
30: ; preds = %40, %23
%31 = load i32, i32* %6
%32 = icmp slt i32 %31, 11
br i1 %32, label %33, label %43
33: ; preds = %30
%34 = load i32, i32* %6
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [11 x float], [11 x float]* %5, i64 0, i64 %35
%37 = load float, float* %36
%38 = fpext float %37 to double
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %38)
br label %40
40: ; preds = %33
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %30
43: ; preds = %30
%44 = getelementptr inbounds [11 x float], [11 x float]* %5, i64 0, i64 0
%45 = call double @offCalc(float* %44, i32 11)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %45)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [10 x i8] c"string %s\00"
@.str.2 = [4 x i8] c"%f\0A\00"
@.str.3 = [11 x i8] c"offCalc %f\00"
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = alloca [30 x i8]
%2 = alloca [11 x float]
%3 = getelementptr inbounds [30 x i8], [30 x i8]* %1, i64 0, i64 0
%4 = bitcast [11 x float]* %2 to i8*
%5 = tail call i64 @time(i32* null)
%6 = trunc i64 %5 to i32
%7 = tail call i32 @srand(i32 %6)
%8 = tail call i64 (...) @rand()
%9 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 0
%10 = tail call i64 (...) @rand()
%11 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 1
%12 = tail call i64 (...) @rand()
%13 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 2
%14 = tail call i64 (...) @rand()
%15 = insertelement <4 x i64> poison, i64 %8, i64 0
%16 = insertelement <4 x i64> %15, i64 %10, i64 1
%17 = insertelement <4 x i64> %16, i64 %12, i64 2
%18 = insertelement <4 x i64> %17, i64 %14, i64 3
%19 = sitofp <4 x i64> %18 to <4 x float>
%20 = fdiv <4 x float> %19, <float 1.000000e+02, float 1.000000e+02, float 1.000000e+02, float 1.000000e+02>
%21 = bitcast [11 x float]* %2 to <4 x float>*
store <4 x float> %20, <4 x float>* %21
%22 = tail call i64 (...) @rand()
%23 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 4
%24 = tail call i64 (...) @rand()
%25 = tail call i64 (...) @rand()
%26 = tail call i64 (...) @rand()
%27 = insertelement <4 x i64> poison, i64 %22, i64 0
%28 = insertelement <4 x i64> %27, i64 %24, i64 1
%29 = insertelement <4 x i64> %28, i64 %25, i64 2
%30 = insertelement <4 x i64> %29, i64 %26, i64 3
%31 = sitofp <4 x i64> %30 to <4 x float>
%32 = fdiv <4 x float> %31, <float 1.000000e+02, float 1.000000e+02, float 1.000000e+02, float 1.000000e+02>
%33 = bitcast float* %23 to <4 x float>*
store <4 x float> %32, <4 x float>* %33
%34 = tail call i64 (...) @rand()
%35 = sitofp i64 %34 to float
%36 = fdiv float %35, 1.000000e+02
%37 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 8
store float %36, float* %37
%38 = tail call i64 (...) @rand()
%39 = sitofp i64 %38 to float
%40 = fdiv float %39, 1.000000e+02
%41 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 9
store float %40, float* %41
%42 = tail call i64 (...) @rand()
%43 = sitofp i64 %42 to float
%44 = fdiv float %43, 1.000000e+02
%45 = getelementptr inbounds [11 x float], [11 x float]* %2, i64 0, i64 10
store float %44, float* %45
%46 = call i32 @dtoa(i8* %3, float 0xBFF4CCCCC0000000)
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%49 = load float, float* %11
%50 = fpext float %49 to double
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %50)
%52 = load float, float* %13
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %53)
%55 = extractelement <4 x float> %20, i64 3
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %56)
%58 = extractelement <4 x float> %32, i64 0
%59 = fpext float %58 to double
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %59)
%61 = extractelement <4 x float> %32, i64 1
%62 = fpext float %61 to double
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %62)
%64 = extractelement <4 x float> %32, i64 2
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %65)
%67 = extractelement <4 x float> %32, i64 3
%68 = fpext float %67 to double
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %68)
%70 = fpext float %36 to double
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %70)
%72 = fpext float %40 to double
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %72)
%74 = fpext float %44 to double
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %74)
%76 = call double @offCalc(float* %9, i32 11)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), double %76)
ret i32 0
}