#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*/ initialise(int *, int *, int *, int *, int *, double *,
                              double *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mc_sampling(int, int, int, int, int, int, double, double,
                               double *, double *, double *);
int /*<<< orphan*/ output(int, int, double, double, double *, double *);
int main() {
  int number_blocks, number_cycles, max_variations, thermalization;
  int dimension, number_particles;
  double initial_correlation, delta_correlation, lowest_correlation;
  double *cumulative_e, *cumulative_e2;
  dimension = 3;
  initialise(&number_blocks, &number_particles, &max_variations, &number_cycles,
             &thermalization, &initial_correlation, &delta_correlation);
  cumulative_e = (double *)malloc((max_variations + 1) * sizeof(double));
  cumulative_e2 = (double *)malloc((max_variations + 1) * sizeof(double));
  mc_sampling(dimension, number_blocks, number_particles, max_variations,
              thermalization, number_cycles, initial_correlation,
              delta_correlation, &lowest_correlation, cumulative_e,
              cumulative_e2);
  output(max_variations, number_cycles, delta_correlation, lowest_correlation,
         cumulative_e, cumulative_e2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x18(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x28(%rbp),%r9
lea    -0x30(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <initialise@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0xc(%rbp),%r9d
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%rax
lea    -0x38(%rbp),%r11
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1050 <mc_sampling@plt>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mov    -0x40(%rbp),%rdx
mov    -0x48(%rbp),%rcx
call   1030 <output@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x38,%rsp
sub    $0x8,%rsp
lea    0x28(%rsp),%rax
lea    0x24(%rsp),%rdi
lea    0x1c(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x18(%rsp),%rcx
lea    0x20(%rsp),%r8
lea    0x38(%rsp),%r9
push   %rax
call   1060 <initialise@plt>
add    $0x10,%rsp
mov    0xc(%rsp),%eax
lea    0x8(,%rax,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    0xc(%rsp),%eax
lea    0x8(,%rax,8),%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    0x1c(%rsp),%esi
mov    0x14(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    0x18(%rsp),%r8d
mov    0x10(%rsp),%r9d
movsd  0x30(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
sub    $0x8,%rsp
lea    0x30(%rsp),%rax
mov    $0x3,%edi
push   %rbx
push   %r14
push   %rax
call   1050 <mc_sampling@plt>
add    $0x20,%rsp
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%esi
movsd  0x20(%rsp),%xmm0
movsd  0x28(%rsp),%xmm1
mov    %r14,%rdx
mov    %rbx,%rcx
call   1030 <output@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double*
%12 = alloca double*
store i32 0, i32* %1
store i32 3, i32* %6
%13 = call i32 @initialise(i32* %2, i32* %7, i32* %4, i32* %3, i32* %5, double* %8, double* %9)
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 8
%18 = trunc i64 %17 to i32
%19 = call i64 @malloc(i32 %18)
%20 = inttoptr i64 %19 to double*
store double* %20, double** %11
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = mul i64 %23, 8
%25 = trunc i64 %24 to i32
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to double*
store double* %27, double** %12
%28 = load i32, i32* %6
%29 = load i32, i32* %2
%30 = load i32, i32* %7
%31 = load i32, i32* %4
%32 = load i32, i32* %5
%33 = load i32, i32* %3
%34 = load double, double* %8
%35 = load double, double* %9
%36 = load double*, double** %11
%37 = load double*, double** %12
%38 = call i32 @mc_sampling(i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, i32 %33, double %34, double %35, double* %10, double* %36, double* %37)
%39 = load i32, i32* %4
%40 = load i32, i32* %3
%41 = load double, double* %9
%42 = load double, double* %10
%43 = load double*, double** %11
%44 = load double*, double** %12
%45 = call i32 @output(i32 %39, i32 %40, double %41, double %42, double* %43, double* %44)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast i32* %1 to i8*
%10 = bitcast i32* %2 to i8*
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast double* %6 to i8*
%15 = bitcast double* %7 to i8*
%16 = bitcast double* %8 to i8*
%17 = call i32 @initialise(i32* %1, i32* %5, i32* %3, i32* %2, i32* %4, double* %6, double* %7)
%18 = load i32, i32* %3
%19 = shl i32 %18, 3
%20 = add i32 %19, 8
%21 = call i64 @malloc(i32 %20)
%22 = inttoptr i64 %21 to double*
%23 = load i32, i32* %3
%24 = shl i32 %23, 3
%25 = add i32 %24, 8
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to double*
%28 = load i32, i32* %1
%29 = load i32, i32* %5
%30 = load i32, i32* %3
%31 = load i32, i32* %4
%32 = load i32, i32* %2
%33 = load double, double* %6
%34 = load double, double* %7
%35 = call i32 @mc_sampling(i32 3, i32 %28, i32 %29, i32 %30, i32 %31, i32 %32, double %33, double %34, double* %8, double* %22, double* %27)
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = load double, double* %7
%39 = load double, double* %8
%40 = call i32 @output(i32 %36, i32 %37, double %38, double %39, double* %22, double* %27)
ret i32 0
}