#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 */
double compute_energy(int *, double);
double compute_magnetiza(int *, double);
double drand48();
double exp(double);
int /*<<< orphan*/ get_neighbors(int *, double, int, int *);
int *init_lattice(double);
int /*<<< orphan*/ printf(char *, double, double, double);
int random_between(int /*<<< orphan*/, double);
void *markovChain(double T, double n_side, int n_steps, int numT) {
  int neigh[4];
  int i_flip = 0;
  int i, j;
  double r;
  double delta_E;
  int *lattice;
  double beta = 1.0 / T;
  double E;
  double M;
  double alpha;
  double h;
  double Mp = 0;
  double Ep = 0;
  double Ep2 = 0;
  lattice = init_lattice(n_side);
  E = compute_energy(lattice, n_side);
  M = compute_magnetiza(lattice, n_side);
  for (i = 0; i < n_steps; i++) {
    i_flip = random_between(0, n_side * n_side - 1);
    get_neighbors(lattice, n_side, i_flip, neigh);
    h = 0.0;
    for (j = 0; j < 4; j++) {
      h += lattice[neigh[j]];
    }
    delta_E = 2.0 * h * lattice[i_flip];
    r = 1.0 < exp(-beta * delta_E) ? 1.0 : exp(-beta * delta_E);
    alpha = drand48();
    if (alpha < r) {
      lattice[i_flip] = -lattice[i_flip];
      E = E + delta_E;
    }
    M = compute_magnetiza(lattice, n_side);
    if (i > n_steps * 0.9) {
      Ep += E / (n_steps * 0.1);
      Ep2 += E * E / (n_steps * 0.1);
      Mp += Mp / (n_steps * 0.1);
    }
  }
  printf("%f %f %f\n", T, Ep2 - (Ep * Ep), Mp);
}


x86 assembly (clang, -O0):
<markovChain>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %edi,-0x1c(%rbp)
mov    %esi,-0x20(%rbp)
movl   $0x0,-0x34(%rbp)
movsd  0xe56(%rip),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x18(%rbp),%xmm0
call   1060 <init_lattice@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1090 <compute_energy@plt>
movsd  %xmm0,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <compute_magnetiza@plt>
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1456 <markovChain+0x2d6>
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xdd6(%rip),%xmm1
addsd  %xmm1,%xmm0
xor    %edi,%edi
call   1030 <random_between@plt>
mov    %eax,-0x34(%rbp)
mov    -0x58(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%esi
lea    -0x30(%rbp),%rdx
call   1040 <get_neighbors@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x80(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x4,-0x3c(%rbp)
jge    1298 <markovChain+0x118>
mov    -0x58(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movslq -0x30(%rbp,%rcx,4),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1264 <markovChain+0xe4>
movsd  0xd70(%rip),%xmm0
mulsd  -0x80(%rbp),%xmm0
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
cvtsi2sdl (%rax,%rcx,4),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
call   1080 <exp@plt>
movsd  0xd17(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1308 <markovChain+0x188>
movsd  0xd05(%rip),%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
jmp    1336 <markovChain+0x1b6>
movsd  -0x60(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  -0x50(%rbp),%xmm0
call   1080 <exp@plt>
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
movsd  %xmm0,-0x48(%rbp)
mov    $0x0,%al
call   10a0 <drand48@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    138a <markovChain+0x20a>
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
xor    %edx,%edx
sub    (%rax,%rcx,4),%edx
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
movsd  -0x68(%rbp),%xmm0
addsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x58(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <compute_magnetiza@plt>
movsd  %xmm0,-0x70(%rbp)
cvtsi2sdl -0x38(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xc69(%rip),%xmm2
mulsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1443 <markovChain+0x2c3>
movsd  -0x68(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xc51(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x68(%rbp),%xmm0
mulsd  -0x68(%rbp),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xc22(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
cvtsi2sdl -0x1c(%rbp),%xmm1
movsd  0xbf5(%rip),%xmm2
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
addsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
jmp    1448 <markovChain+0x2c8>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1210 <markovChain+0x90>
movsd  -0x10(%rbp),%xmm0
movsd  -0x98(%rbp),%xmm2
ff
movsd  -0x90(%rbp),%xmm1
ff
movsd  -0x90(%rbp),%xmm3
ff
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm3,%xmm1
addsd  %xmm2,%xmm1
movsd  -0x88(%rbp),%xmm2
ff
lea    0xb87(%rip),%rdi
call   1050 <printf@plt>
mov    -0x8(%rbp),%rax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<markovChain>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xa8,%rsp
mov    %edi,%r15d
movsd  %xmm1,(%rsp)
movsd  %xmm0,0x10(%rsp)
movapd %xmm1,%xmm0
call   1060 <init_lattice@plt>
mov    %rax,%rbx
mov    %rax,%rdi
movsd  (%rsp),%xmm0
call   1090 <compute_energy@plt>
movaps %xmm0,0x40(%rsp)
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
call   1070 <compute_magnetiza@plt>
test   %r15d,%r15d
jle    13c8 <markovChain+0x248>
movsd  (%rsp),%xmm0
mulsd  %xmm0,%xmm0
movsd  0xe20(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x68(%rsp)
movsd  0x10(%rsp),%xmm2
divsd  %xmm2,%xmm1
movsd  %xmm1,0x60(%rsp)
xorps  %xmm0,%xmm0
cvtsi2sd %r15d,%xmm0
movsd  0xdfe(%rip),%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,0x58(%rsp)
mulsd  0xdf4(%rip),%xmm0
movapd %xmm0,0x90(%rsp)
unpcklpd %xmm0,%xmm0
movapd %xmm0,0x80(%rsp)
xorpd  %xmm0,%xmm0
movapd %xmm0,0x20(%rsp)
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
lea    0x30(%rsp),%r14
xorpd  %xmm3,%xmm3
jmp    127c <markovChain+0xfc>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  0x10(%rsp),%xmm0
movsd  0xdaa(%rip),%xmm1
addsd  %xmm1,%xmm3
add    $0xffffffff,%r15d
je     13df <markovChain+0x25f>
movsd  %xmm3,0x78(%rsp)
xor    %edi,%edi
movsd  0x68(%rsp),%xmm0
call   1030 <random_between@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
mov    %eax,%esi
mov    %r14,%rdx
call   1040 <get_neighbors@plt>
movslq 0x30(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx,%rax,4),%xmm0
movslq 0x34(%rsp),%rax
xorps  %xmm1,%xmm1
cvtsi2sdl (%rbx,%rax,4),%xmm1
movslq 0x38(%rsp),%rax
xorps  %xmm2,%xmm2
cvtsi2sdl (%rbx,%rax,4),%xmm2
addsd  %xmm0,%xmm1
movslq 0x3c(%rsp),%rax
xorps  %xmm0,%xmm0
cvtsi2sdl (%rbx,%rax,4),%xmm0
addsd  %xmm1,%xmm2
addsd  %xmm2,%xmm0
addsd  %xmm0,%xmm0
movslq %ebp,%rbp
xorps  %xmm1,%xmm1
cvtsi2sdl (%rbx,%rbp,4),%xmm1
mulsd  %xmm0,%xmm1
movsd  0x60(%rsp),%xmm0
movsd  %xmm1,0x70(%rsp)
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
call   1080 <exp@plt>
movsd  0xcff(%rip),%xmm1
ucomisd %xmm1,%xmm0
movapd %xmm1,%xmm0
ja     132e <markovChain+0x1ae>
movsd  0x18(%rsp),%xmm0
call   1080 <exp@plt>
movsd  %xmm0,0x18(%rsp)
xor    %eax,%eax
call   10a0 <drand48@plt>
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jbe    135c <markovChain+0x1dc>
negl   (%rbx,%rbp,4)
movapd 0x40(%rsp),%xmm0
addsd  0x70(%rsp),%xmm0
movapd %xmm0,0x40(%rsp)
movsd  (%rsp),%xmm0
mov    %rbx,%rdi
call   1070 <compute_magnetiza@plt>
movsd  0x78(%rsp),%xmm3
ucomisd 0x58(%rsp),%xmm3
jbe    1260 <markovChain+0xe0>
movapd 0x40(%rsp),%xmm1
movapd %xmm1,%xmm0
mulsd  %xmm1,%xmm0
divsd  0x90(%rsp),%xmm0
movsd  0x8(%rsp),%xmm2
addsd  %xmm0,%xmm2
movsd  %xmm2,0x8(%rsp)
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm0
unpcklpd %xmm1,%xmm0
divpd  0x80(%rsp),%xmm0
addpd  %xmm0,%xmm2
movapd %xmm2,0x20(%rsp)
jmp    1260 <markovChain+0xe0>
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
movapd 0x20(%rsp),%xmm2
movapd %xmm2,%xmm3
unpckhpd %xmm2,%xmm3
mulsd  %xmm3,%xmm3
movsd  0x8(%rsp),%xmm1
subsd  %xmm3,%xmm1
lea    0xc1e(%rip),%rdi
call   1050 <printf@plt>
add    $0xa8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%f %f %f\0A\00"
define i8* @markovChain(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca double
%7 = alloca double
%8 = alloca i32
%9 = alloca i32
%10 = alloca [4 x i32]
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca double
%15 = alloca double
%16 = alloca i32*
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
store double %0, double* %6
store double %1, double* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 0, i32* %11
%25 = load double, double* %6
%26 = fdiv double 1.000000e+00, %25
store double %26, double* %17
store double 0.000000e+00, double* %22
store double 0.000000e+00, double* %23
store double 0.000000e+00, double* %24
%27 = load double, double* %7
%28 = call i32* @init_lattice(double %27)
store i32* %28, i32** %16
%29 = load i32*, i32** %16
%30 = load double, double* %7
%31 = call double @compute_energy(i32* %29, double %30)
store double %31, double* %18
%32 = load i32*, i32** %16
%33 = load double, double* %7
%34 = call double @compute_magnetiza(i32* %32, double %33)
store double %34, double* %19
store i32 0, i32* %12
br label %35
35: ; preds = %145, %4
%36 = load i32, i32* %12
%37 = load i32, i32* %8
%38 = icmp slt i32 %36, %37
br i1 %38, label %39, label %148
39: ; preds = %35
%40 = load double, double* %7
%41 = load double, double* %7
%42 = call double @llvm.fmuladd.f64(double %40, double %41, double -1.000000e+00)
%43 = call i32 @random_between(i32 0, double %42)
store i32 %43, i32* %11
%44 = load i32*, i32** %16
%45 = load double, double* %7
%46 = load i32, i32* %11
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
%48 = call i32 @get_neighbors(i32* %44, double %45, i32 %46, i32* %47)
store double 0.000000e+00, double* %21
store i32 0, i32* %13
br label %49
49: ; preds = %64, %39
%50 = load i32, i32* %13
%51 = icmp slt i32 %50, 4
br i1 %51, label %52, label %67
52: ; preds = %49
%53 = load i32*, i32** %16
%54 = load i32, i32* %13
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 %55
%57 = load i32, i32* %56
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds i32, i32* %53, i64 %58
%60 = load i32, i32* %59
%61 = sitofp i32 %60 to double
%62 = load double, double* %21
%63 = fadd double %62, %61
store double %63, double* %21
br label %64
64: ; preds = %52
%65 = load i32, i32* %13
%66 = add nsw i32 %65, 1
store i32 %66, i32* %13
br label %49
67: ; preds = %49
%68 = load double, double* %21
%69 = fmul double 2.000000e+00, %68
%70 = load i32*, i32** %16
%71 = load i32, i32* %11
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i32, i32* %70, i64 %72
%74 = load i32, i32* %73
%75 = sitofp i32 %74 to double
%76 = fmul double %69, %75
store double %76, double* %15
%77 = load double, double* %17
%78 = fneg double %77
%79 = load double, double* %15
%80 = fmul double %78, %79
%81 = call double @exp(double %80)
%82 = fcmp olt double 1.000000e+00, %81
br i1 %82, label %83, label %84
83: ; preds = %67
br label %90
84: ; preds = %67
%85 = load double, double* %17
%86 = fneg double %85
%87 = load double, double* %15
%88 = fmul double %86, %87
%89 = call double @exp(double %88)
br label %90
90: ; preds = %84, %83
%91 = phi double [ 1.000000e+00, %83 ], [ %89, %84 ]
store double %91, double* %14
%92 = call double (...) @drand48()
store double %92, double* %20
%93 = load double, double* %20
%94 = load double, double* %14
%95 = fcmp olt double %93, %94
br i1 %95, label %96, label %110
96: ; preds = %90
%97 = load i32*, i32** %16
%98 = load i32, i32* %11
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds i32, i32* %97, i64 %99
%101 = load i32, i32* %100
%102 = sub nsw i32 0, %101
%103 = load i32*, i32** %16
%104 = load i32, i32* %11
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i32, i32* %103, i64 %105
store i32 %102, i32* %106
%107 = load double, double* %18
%108 = load double, double* %15
%109 = fadd double %107, %108
store double %109, double* %18
br label %110
110: ; preds = %96, %90
%111 = load i32*, i32** %16
%112 = load double, double* %7
%113 = call double @compute_magnetiza(i32* %111, double %112)
store double %113, double* %19
%114 = load i32, i32* %12
%115 = sitofp i32 %114 to double
%116 = load i32, i32* %8
%117 = sitofp i32 %116 to double
%118 = fmul double %117, 9.000000e-01
%119 = fcmp ogt double %115, %118
br i1 %119, label %120, label %144
120: ; preds = %110
%121 = load double, double* %18
%122 = load i32, i32* %8
%123 = sitofp i32 %122 to double
%124 = fmul double %123, 1.000000e-01
%125 = fdiv double %121, %124
%126 = load double, double* %23
%127 = fadd double %126, %125
store double %127, double* %23
%128 = load double, double* %18
%129 = load double, double* %18
%130 = fmul double %128, %129
%131 = load i32, i32* %8
%132 = sitofp i32 %131 to double
%133 = fmul double %132, 1.000000e-01
%134 = fdiv double %130, %133
%135 = load double, double* %24
%136 = fadd double %135, %134
store double %136, double* %24
%137 = load double, double* %22
%138 = load i32, i32* %8
%139 = sitofp i32 %138 to double
%140 = fmul double %139, 1.000000e-01
%141 = fdiv double %137, %140
%142 = load double, double* %22
%143 = fadd double %142, %141
store double %143, double* %22
br label %144
144: ; preds = %120, %110
br label %145
145: ; preds = %144
%146 = load i32, i32* %12
%147 = add nsw i32 %146, 1
store i32 %147, i32* %12
br label %35
148: ; preds = %35
%149 = load double, double* %6
%150 = load double, double* %24
%151 = load double, double* %23
%152 = load double, double* %23
%153 = fneg double %151
%154 = call double @llvm.fmuladd.f64(double %153, double %152, double %150)
%155 = load double, double* %22
%156 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %149, double %154, double %155)
%157 = load i8*, i8** %5
ret i8* %157
}

LLVM IR (-O2):
@.str = [10 x i8] c"%f %f %f\0A\00"
define noalias i8* @markovChain(double %0, double %1, i32 %2, i32 %3) {
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %5 to i8*
%7 = tail call i32* @init_lattice(double %1)
%8 = tail call double @compute_energy(i32* %7, double %1)
%9 = tail call double @compute_magnetiza(i32* %7, double %1)
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %89
11: ; preds = %4
%12 = call double @llvm.fmuladd.f64(double %1, double %1, double -1.000000e+00)
%13 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%14 = fdiv double -1.000000e+00, %0
%15 = sitofp i32 %2 to double
%16 = fmul double %15, 9.000000e-01
%17 = fmul double %15, 1.000000e-01
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 1
%19 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 2
%20 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 3
%21 = insertelement <2 x double> poison, double %17, i64 0
%22 = shufflevector <2 x double> %21, <2 x double> poison, <2 x i32> zeroinitializer
br label %23
23: ; preds = %11, %84
%24 = phi double [ 0.000000e+00, %11 ], [ %85, %84 ]
%25 = phi double [ %8, %11 ], [ %73, %84 ]
%26 = phi i32 [ 0, %11 ], [ %87, %84 ]
%27 = phi <2 x double> [ zeroinitializer, %11 ], [ %86, %84 ]
%28 = call i32 @random_between(i32 0, double %12)
%29 = call i32 @get_neighbors(i32* %7, double %1, i32 %28, i32* %13)
%30 = load i32, i32* %13
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i32, i32* %7, i64 %31
%33 = load i32, i32* %32
%34 = sitofp i32 %33 to double
%35 = load i32, i32* %18
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %7, i64 %36
%38 = load i32, i32* %37
%39 = sitofp i32 %38 to double
%40 = fadd double %34, %39
%41 = load i32, i32* %19
%42 = sext i32 %41 to i64
%43 = getelementptr inbounds i32, i32* %7, i64 %42
%44 = load i32, i32* %43
%45 = sitofp i32 %44 to double
%46 = fadd double %40, %45
%47 = load i32, i32* %20
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %7, i64 %48
%50 = load i32, i32* %49
%51 = sitofp i32 %50 to double
%52 = fadd double %46, %51
%53 = fmul double %52, 2.000000e+00
%54 = sext i32 %28 to i64
%55 = getelementptr inbounds i32, i32* %7, i64 %54
%56 = load i32, i32* %55
%57 = sitofp i32 %56 to double
%58 = fmul double %53, %57
%59 = fmul double %14, %58
%60 = call double @exp(double %59)
%61 = fcmp ogt double %60, 1.000000e+00
br i1 %61, label %64, label %62
62: ; preds = %23
%63 = call double @exp(double %59)
br label %64
64: ; preds = %23, %62
%65 = phi double [ %63, %62 ], [ 1.000000e+00, %23 ]
%66 = call double (...) @drand48()
%67 = fcmp olt double %66, %65
br i1 %67, label %68, label %72
68: ; preds = %64
%69 = load i32, i32* %55
%70 = sub nsw i32 0, %69
store i32 %70, i32* %55
%71 = fadd double %25, %58
br label %72
72: ; preds = %68, %64
%73 = phi double [ %71, %68 ], [ %25, %64 ]
%74 = call double @compute_magnetiza(i32* %7, double %1)
%75 = sitofp i32 %26 to double
%76 = fcmp olt double %16, %75
br i1 %76, label %77, label %84
77: ; preds = %72
%78 = fmul double %73, %73
%79 = fdiv double %78, %17
%80 = fadd double %24, %79
%81 = insertelement <2 x double> %27, double %73, i64 1
%82 = fdiv <2 x double> %81, %22
%83 = fadd <2 x double> %27, %82
br label %84
84: ; preds = %72, %77
%85 = phi double [ %80, %77 ], [ %24, %72 ]
%86 = phi <2 x double> [ %83, %77 ], [ %27, %72 ]
%87 = add nuw nsw i32 %26, 1
%88 = icmp eq i32 %87, %2
br i1 %88, label %89, label %23
89: ; preds = %84, %4
%90 = phi double [ 0.000000e+00, %4 ], [ %85, %84 ]
%91 = phi <2 x double> [ zeroinitializer, %4 ], [ %86, %84 ]
%92 = extractelement <2 x double> %91, i64 1
%93 = fneg double %92
%94 = call double @llvm.fmuladd.f64(double %93, double %92, double %90)
%95 = extractelement <2 x double> %91, i64 0
%96 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), double %0, double %94, double %95)
ret i8* undef
}