#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 pow(double, double);
void calculProba(double **pheromone, double **heuristic, double **probability,
                 int n, int m, double alpha, double beta) {
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < m; ++j) {
      probability[i][j] =
          pow(pheromone[i][j], alpha) + pow(heuristic[i][j], beta);
    }
  }
}


x86 assembly (clang, -O0):
<calculProba>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11e0 <calculProba+0xd0>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    11cd <calculProba+0xbd>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x28(%rbp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,-0x40(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x30(%rbp),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  %xmm1,%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x38(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    114f <calculProba+0x3f>
jmp    11d2 <calculProba+0xc2>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    113c <calculProba+0x2c>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calculProba>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r8d,0xc(%rsp)
test   %ecx,%ecx
jle    1283 <calculProba+0x173>
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    %ecx,%eax
mov    %rax,0x30(%rsp)
mov    0xc(%rsp),%r13d
mov    %r13,0x28(%rsp)
and    $0xfffffffe,%r13d
xor    %r12d,%r12d
movsd  %xmm1,0x20(%rsp)
movsd  %xmm0,0x18(%rsp)
jmp    116f <calculProba+0x5f>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    0x30(%rsp),%r12
je     1283 <calculProba+0x173>
cmpl   $0x0,0xc(%rsp)
jle    1160 <calculProba+0x50>
cmpl   $0x1,0xc(%rsp)
jne    1190 <calculProba+0x80>
xor    %r14d,%r14d
jmp    1232 <calculProba+0x122>
cs nopw 0x0(%rax,%rax,1)
nop
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rbx,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
movsd  0x18(%rsp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x0(%rbp,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
movsd  0x20(%rsp),%xmm1
call   1030 <pow@plt>
addsd  0x10(%rsp),%xmm0
mov    (%r15,%r12,8),%rax
movsd  %xmm0,(%rax,%r14,8)
mov    (%rbx,%r12,8),%rax
movsd  0x8(%rax,%r14,8),%xmm0
movsd  0x18(%rsp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x0(%rbp,%r12,8),%rax
movsd  0x8(%rax,%r14,8),%xmm0
movsd  0x20(%rsp),%xmm1
call   1030 <pow@plt>
addsd  0x10(%rsp),%xmm0
mov    (%r15,%r12,8),%rax
movsd  %xmm0,0x8(%rax,%r14,8)
add    $0x2,%r14
cmp    %r14,%r13
jne    11a0 <calculProba+0x90>
testb  $0x1,0x28(%rsp)
je     1160 <calculProba+0x50>
mov    (%rbx,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
movsd  0x18(%rsp),%xmm1
call   1030 <pow@plt>
movsd  %xmm0,0x10(%rsp)
mov    0x0(%rbp,%r12,8),%rax
movsd  (%rax,%r14,8),%xmm0
movsd  0x20(%rsp),%xmm1
call   1030 <pow@plt>
addsd  0x10(%rsp),%xmm0
mov    (%r15,%r12,8),%rax
movsd  %xmm0,(%rax,%r14,8)
jmp    1160 <calculProba+0x50>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @calculProba(double** %0, double** %1, double** %2, i32 %3, i32 %4, double %5, double %6) {
%8 = alloca double**
%9 = alloca double**
%10 = alloca double**
%11 = alloca i32
%12 = alloca i32
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
store double** %0, double*** %8
store double** %1, double*** %9
store double** %2, double*** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store double %5, double* %13
store double %6, double* %14
store i32 0, i32* %15
br label %17
17: ; preds = %62, %7
%18 = load i32, i32* %15
%19 = load i32, i32* %11
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %65
21: ; preds = %17
store i32 0, i32* %16
br label %22
22: ; preds = %58, %21
%23 = load i32, i32* %16
%24 = load i32, i32* %12
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %61
26: ; preds = %22
%27 = load double**, double*** %8
%28 = load i32, i32* %15
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds double*, double** %27, i64 %29
%31 = load double*, double** %30
%32 = load i32, i32* %16
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
%35 = load double, double* %34
%36 = load double, double* %13
%37 = call double @pow(double %35, double %36)
%38 = load double**, double*** %9
%39 = load i32, i32* %15
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds double*, double** %38, i64 %40
%42 = load double*, double** %41
%43 = load i32, i32* %16
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds double, double* %42, i64 %44
%46 = load double, double* %45
%47 = load double, double* %14
%48 = call double @pow(double %46, double %47)
%49 = fadd double %37, %48
%50 = load double**, double*** %10
%51 = load i32, i32* %15
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds double*, double** %50, i64 %52
%54 = load double*, double** %53
%55 = load i32, i32* %16
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
store double %49, double* %57
br label %58
58: ; preds = %26
%59 = load i32, i32* %16
%60 = add nsw i32 %59, 1
store i32 %60, i32* %16
br label %22
61: ; preds = %22
br label %62
62: ; preds = %61
%63 = load i32, i32* %15
%64 = add nsw i32 %63, 1
store i32 %64, i32* %15
br label %17
65: ; preds = %17
ret void
}

LLVM IR (-O2):
define void @calculProba(double** nocapture %0, double** nocapture %1, double** nocapture %2, i32 %3, i32 %4, double %5, double %6) {
%8 = icmp sgt i32 %3, 0
br i1 %8, label %9, label %23
9: ; preds = %7
%10 = icmp sgt i32 %4, 0
%11 = zext i32 %3 to i64
%12 = zext i32 %4 to i64
%13 = and i64 %12, 1
%14 = icmp eq i32 %4, 1
%15 = and i64 %12, 4294967294
%16 = icmp eq i64 %13, 0
br label %17
17: ; preds = %9, %38
%18 = phi i64 [ 0, %9 ], [ %39, %38 ]
br i1 %10, label %19, label %38
19: ; preds = %17
%20 = getelementptr inbounds double*, double** %0, i64 %18
%21 = getelementptr inbounds double*, double** %1, i64 %18
%22 = getelementptr inbounds double*, double** %2, i64 %18
br i1 %14, label %24, label %41
23: ; preds = %38, %7
ret void
24: ; preds = %41, %19
%25 = phi i64 [ 0, %19 ], [ %67, %41 ]
br i1 %16, label %38, label %26
26: ; preds = %24
%27 = load double*, double** %20
%28 = getelementptr inbounds double, double* %27, i64 %25
%29 = load double, double* %28
%30 = tail call double @pow(double %29, double %5)
%31 = load double*, double** %21
%32 = getelementptr inbounds double, double* %31, i64 %25
%33 = load double, double* %32
%34 = tail call double @pow(double %33, double %6)
%35 = fadd double %30, %34
%36 = load double*, double** %22
%37 = getelementptr inbounds double, double* %36, i64 %25
store double %35, double* %37
br label %38
38: ; preds = %26, %24, %17
%39 = add nuw nsw i64 %18, 1
%40 = icmp eq i64 %39, %11
br i1 %40, label %23, label %17
41: ; preds = %19, %41
%42 = phi i64 [ %67, %41 ], [ 0, %19 ]
%43 = phi i64 [ %68, %41 ], [ 0, %19 ]
%44 = load double*, double** %20
%45 = getelementptr inbounds double, double* %44, i64 %42
%46 = load double, double* %45
%47 = tail call double @pow(double %46, double %5)
%48 = load double*, double** %21
%49 = getelementptr inbounds double, double* %48, i64 %42
%50 = load double, double* %49
%51 = tail call double @pow(double %50, double %6)
%52 = fadd double %47, %51
%53 = load double*, double** %22
%54 = getelementptr inbounds double, double* %53, i64 %42
store double %52, double* %54
%55 = or i64 %42, 1
%56 = load double*, double** %20
%57 = getelementptr inbounds double, double* %56, i64 %55
%58 = load double, double* %57
%59 = tail call double @pow(double %58, double %5)
%60 = load double*, double** %21
%61 = getelementptr inbounds double, double* %60, i64 %55
%62 = load double, double* %61
%63 = tail call double @pow(double %62, double %6)
%64 = fadd double %59, %63
%65 = load double*, double** %22
%66 = getelementptr inbounds double, double* %65, i64 %55
store double %64, double* %66
%67 = add nuw nsw i64 %42, 2
%68 = add i64 %43, 2
%69 = icmp eq i64 %68, %15
br i1 %69, label %24, label %41
}