#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 */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
main() {
  typedef double tata;
  double *a;
  register double x, y, z, t, u;
  time_t now;
  struct tm *date;
  char s[80];
  int i, j;
  x = 1.2;
  y = 1.3;
  z = 1.4;
  t = 1.5;
  u = 1.6;
  a = (double *)malloc(16000 * sizeof(tata));
  for (j = 0; j < 8000; j++) {
    a[j] = 0.0;
  }
  i = sizeof(tata);
  printf("length of tata is %ld\n", i);
  time(&now);
  date = localtime(&now);
  strftime(s, 80, "%c", date);
  printf("start at:%s\n", s);
  for (i = 0; i < 320000; i++) {
    for (j = 0; j < 1000; j++) {
      a[j] = a[j] + (((x * y) + z) * x + t) * x + i;
    }
  }
  y = 2.345;
  printf("point 2,y= %G\n", a[0]);
  time(&now);
  date = localtime(&now);
  strftime(s, 80, "%c", date);
  printf("end at:%s after 112 Mflops\n", s);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb6(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xea1(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe8c(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  0xe77(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xe62(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    $0x1f400,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0xa8(%rbp)
cmpl   $0x1f40,-0xa8(%rbp)
jge    11f2 <main+0xa2>
mov    -0x10(%rbp),%rax
movslq -0xa8(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    11bb <main+0x6b>
movl   $0x8,-0xa4(%rbp)
mov    -0xa4(%rbp),%esi
lea    0xe27(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x3c(%rbp),%rdi
call   1050 <time@plt>
lea    -0x3c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x48(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x50,%esi
lea    0xe0a(%rip),%rdx
call   1070 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0xa4(%rbp)
cmpl   $0x4e200,-0xa4(%rbp)
jge    131a <main+0x1ca>
movl   $0x0,-0xa8(%rbp)
cmpl   $0x3e8,-0xa8(%rbp)
jge    1301 <main+0x1b1>
mov    -0x10(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm3
movsd  -0x28(%rbp),%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm3
movsd  -0x30(%rbp),%xmm2
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
movsd  -0x18(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0xa4(%rbp),%xmm1
ff
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0xa8(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xa8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa8(%rbp)
jmp    127b <main+0x12b>
jmp    1306 <main+0x1b6>
mov    -0xa4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xa4(%rbp)
jmp    1261 <main+0x111>
movsd  0xd06(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
lea    0xd21(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    -0x3c(%rbp),%rdi
call   1050 <time@plt>
lea    -0x3c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x48(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0x48(%rbp),%rcx
mov    $0x50,%esi
lea    0xcdd(%rip),%rdx
call   1070 <strftime@plt>
lea    -0xa0(%rbp),%rsi
lea    0xce9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    $0x1f400,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
xor    %ebp,%ebp
mov    $0xfa00,%edx
mov    %rax,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
lea    0xe8b(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xc(%rsp),%r14
mov    %r14,%rdi
call   1060 <time@plt>
mov    %r14,%rdi
call   1030 <localtime@plt>
lea    0xe7a(%rip),%rdx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1080 <strftime@plt>
lea    0xe61(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xorpd  %xmm0,%xmm0
movapd 0xe19(%rip),%xmm1
movsd  0xe21(%rip),%xmm2
nop
movapd %xmm0,%xmm3
unpcklpd %xmm0,%xmm3
mov    $0x6,%eax
nopl   (%rax)
movupd -0x30(%rbx,%rax,8),%xmm4
movupd -0x20(%rbx,%rax,8),%xmm5
movupd -0x10(%rbx,%rax,8),%xmm6
movupd (%rbx,%rax,8),%xmm7
addpd  %xmm1,%xmm4
addpd  %xmm1,%xmm5
addpd  %xmm3,%xmm4
addpd  %xmm3,%xmm5
movupd %xmm4,-0x30(%rbx,%rax,8)
movupd %xmm5,-0x20(%rbx,%rax,8)
addpd  %xmm1,%xmm6
addpd  %xmm1,%xmm7
addpd  %xmm3,%xmm6
addpd  %xmm3,%xmm7
movupd %xmm6,-0x10(%rbx,%rax,8)
movupd %xmm7,(%rbx,%rax,8)
add    $0x8,%rax
cmp    $0x3ee,%rax
jne    1200 <main+0xa0>
addsd  %xmm2,%xmm0
add    $0x1,%ebp
cmp    $0x4e200,%ebp
jne    11f0 <main+0x90>
movsd  (%rbx),%xmm0
lea    0xdcb(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1060 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0xd98(%rip),%rdx
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x50,%esi
mov    %rax,%rcx
call   1080 <strftime@plt>
lea    0xd9b(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [23 x i8] c"length of tata is %ld\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"start at:%s\0A\00"
@.str.3 = [15 x i8] c"point 2,y= %G\0A\00"
@.str.4 = [28 x i8] c"end at:%s after 112 Mflops\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca %struct.tm*
%10 = alloca [80 x i8]
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store double 1.200000e+00, double* %3
store double 1.300000e+00, double* %4
store double 1.400000e+00, double* %5
store double 1.500000e+00, double* %6
store double 1.600000e+00, double* %7
%13 = call i64 @malloc(i32 128000)
%14 = inttoptr i64 %13 to double*
store double* %14, double** %2
store i32 0, i32* %12
br label %15
15: ; preds = %23, %0
%16 = load i32, i32* %12
%17 = icmp slt i32 %16, 8000
br i1 %17, label %18, label %26
18: ; preds = %15
%19 = load double*, double** %2
%20 = load i32, i32* %12
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds double, double* %19, i64 %21
store double 0.000000e+00, double* %22
br label %23
23: ; preds = %18
%24 = load i32, i32* %12
%25 = add nsw i32 %24, 1
store i32 %25, i32* %12
br label %15
26: ; preds = %15
store i32 8, i32* %11
%27 = load i32, i32* %11
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %27)
%29 = call i32 @time(i32* %8)
%30 = call %struct.tm* @localtime(i32* %8)
store %struct.tm* %30, %struct.tm** %9
%31 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%32 = load %struct.tm*, %struct.tm** %9
%33 = call i32 @strftime(i8* %31, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %32)
%34 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %34)
store i32 0, i32* %11
br label %36
36: ; preds = %69, %26
%37 = load i32, i32* %11
%38 = icmp slt i32 %37, 320000
br i1 %38, label %39, label %72
39: ; preds = %36
store i32 0, i32* %12
br label %40
40: ; preds = %65, %39
%41 = load i32, i32* %12
%42 = icmp slt i32 %41, 1000
br i1 %42, label %43, label %68
43: ; preds = %40
%44 = load double*, double** %2
%45 = load i32, i32* %12
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds double, double* %44, i64 %46
%48 = load double, double* %47
%49 = load double, double* %3
%50 = load double, double* %4
%51 = load double, double* %5
%52 = call double @llvm.fmuladd.f64(double %49, double %50, double %51)
%53 = load double, double* %3
%54 = load double, double* %6
%55 = call double @llvm.fmuladd.f64(double %52, double %53, double %54)
%56 = load double, double* %3
%57 = call double @llvm.fmuladd.f64(double %55, double %56, double %48)
%58 = load i32, i32* %11
%59 = sitofp i32 %58 to double
%60 = fadd double %57, %59
%61 = load double*, double** %2
%62 = load i32, i32* %12
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
store double %60, double* %64
br label %65
65: ; preds = %43
%66 = load i32, i32* %12
%67 = add nsw i32 %66, 1
store i32 %67, i32* %12
br label %40
68: ; preds = %40
br label %69
69: ; preds = %68
%70 = load i32, i32* %11
%71 = add nsw i32 %70, 1
store i32 %71, i32* %11
br label %36
72: ; preds = %36
store double 2.345000e+00, double* %4
%73 = load double*, double** %2
%74 = getelementptr inbounds double, double* %73, i64 0
%75 = load double, double* %74
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %75)
%77 = call i32 @time(i32* %8)
%78 = call %struct.tm* @localtime(i32* %8)
store %struct.tm* %78, %struct.tm** %9
%79 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%80 = load %struct.tm*, %struct.tm** %9
%81 = call i32 @strftime(i8* %79, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %80)
%82 = getelementptr inbounds [80 x i8], [80 x i8]* %10, i64 0, i64 0
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %82)
%84 = load i32, i32* %1
ret i32 %84
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [23 x i8] c"length of tata is %ld\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [13 x i8] c"start at:%s\0A\00"
@.str.3 = [15 x i8] c"point 2,y= %G\0A\00"
@.str.4 = [28 x i8] c"end at:%s after 112 Mflops\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%5 = tail call i64 @malloc(i32 128000)
%6 = inttoptr i64 %5 to double*
%7 = inttoptr i64 %5 to i8*
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 8)
%9 = call i32 @time(i32* %1)
%10 = call %struct.tm* @localtime(i32* %1)
%11 = call i32 @strftime(i8* %4, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %0, %49
%14 = phi i32 [ 0, %0 ], [ %50, %49 ]
%15 = sitofp i32 %14 to double
%16 = insertelement <2 x double> poison, double %15, i64 0
%17 = shufflevector <2 x double> %16, <2 x double> poison, <2 x i32> zeroinitializer
%18 = insertelement <2 x double> poison, double %15, i64 0
%19 = shufflevector <2 x double> %18, <2 x double> poison, <2 x i32> zeroinitializer
br label %20
20: ; preds = %20, %13
%21 = phi i64 [ 0, %13 ], [ %47, %20 ]
%22 = getelementptr inbounds double, double* %6, i64 %21
%23 = bitcast double* %22 to <2 x double>*
%24 = load <2 x double>, <2 x double>* %23
%25 = getelementptr inbounds double, double* %22, i64 2
%26 = bitcast double* %25 to <2 x double>*
%27 = load <2 x double>, <2 x double>* %26
%28 = fadd <2 x double> %24, <double 0x40183FE5C91D14E3, double 0x40183FE5C91D14E3>
%29 = fadd <2 x double> %27, <double 0x40183FE5C91D14E3, double 0x40183FE5C91D14E3>
%30 = fadd <2 x double> %28, %17
%31 = fadd <2 x double> %29, %19
%32 = bitcast double* %22 to <2 x double>*
store <2 x double> %30, <2 x double>* %32
%33 = bitcast double* %25 to <2 x double>*
store <2 x double> %31, <2 x double>* %33
%34 = or i64 %21, 4
%35 = getelementptr inbounds double, double* %6, i64 %34
%36 = bitcast double* %35 to <2 x double>*
%37 = load <2 x double>, <2 x double>* %36
%38 = getelementptr inbounds double, double* %35, i64 2
%39 = bitcast double* %38 to <2 x double>*
%40 = load <2 x double>, <2 x double>* %39
%41 = fadd <2 x double> %37, <double 0x40183FE5C91D14E3, double 0x40183FE5C91D14E3>
%42 = fadd <2 x double> %40, <double 0x40183FE5C91D14E3, double 0x40183FE5C91D14E3>
%43 = fadd <2 x double> %41, %17
%44 = fadd <2 x double> %42, %19
%45 = bitcast double* %35 to <2 x double>*
store <2 x double> %43, <2 x double>* %45
%46 = bitcast double* %38 to <2 x double>*
store <2 x double> %44, <2 x double>* %46
%47 = add nuw nsw i64 %21, 8
%48 = icmp eq i64 %47, 1000
br i1 %48, label %49, label %20
49: ; preds = %20
%50 = add nuw nsw i32 %14, 1
%51 = icmp eq i32 %50, 320000
br i1 %51, label %52, label %13
52: ; preds = %49
%53 = load double, double* %6
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), double %53)
%55 = call i32 @time(i32* %1)
%56 = call %struct.tm* @localtime(i32* %1)
%57 = call i32 @strftime(i8* %4, i32 80, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), %struct.tm* %56)
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.4, i64 0, i64 0), i8* %4)
ret i32 0
}