#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 */
float computeExternal(int, float, float *);
void computePostCollisionDistributions(int *node, float *currentCell,
                                       int *flagField, float *fractionField,
                                       const float *const tau_inv,
                                       const float *const feq,
                                       const float *const feqAtm, float density,
                                       float *extForces, int *n) {
  int i;
  float fi;
  for (i = 0; i < 19; i++) {
    fi = currentCell[i];
    currentCell[i] = fi - (fi - feq[i]) * (*tau_inv) +
                     computeExternal(i, density, extForces);
  }
}


x86 assembly (clang, -O0):
<computePostCollisionDistributions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movss  %xmm0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x13,-0x38(%rbp)
jge    11d5 <computePostCollisionDistributions+0xc5>
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movss  %xmm0,-0x3c(%rbp)
movss  -0x3c(%rbp),%xmm1
movss  -0x3c(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
mov    -0x28(%rbp),%rax
movss  (%rax),%xmm2
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x40(%rbp)
mov    -0x38(%rbp),%edi
movss  -0x34(%rbp),%xmm0
mov    0x18(%rbp),%rsi
call   1030 <computeExternal@plt>
movaps %xmm0,%xmm1
movss  -0x40(%rbp),%xmm0
addss  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movslq -0x38(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1148 <computePostCollisionDistributions+0x38>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<computePostCollisionDistributions>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0x8(%rsp)
mov    %r9,%r14
mov    %r8,%r15
mov    %rsi,%r13
mov    0x48(%rsp),%r12
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  0x0(%r13,%rbx,4),%xmm1
movaps %xmm1,%xmm0
subss  (%r14,%rbx,4),%xmm0
mulss  (%r15),%xmm0
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mov    %ebx,%edi
movss  0x8(%rsp),%xmm0
mov    %r12,%rsi
call   1030 <computeExternal@plt>
addss  0xc(%rsp),%xmm0
movss  %xmm0,0x0(%r13,%rbx,4)
add    $0x1,%rbx
cmp    $0x13,%rbx
jne    1140 <computePostCollisionDistributions+0x30>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @computePostCollisionDistributions(i32* nocapture readnone %0, float* nocapture %1, i32* nocapture readnone %2, float* nocapture readnone %3, float* nocapture %4, float* nocapture %5, float* nocapture readnone %6, float %7, float* %8, i32* nocapture readnone %9) {
br label %11
11: ; preds = %10, %11
%12 = phi i64 [ 0, %10 ], [ %24, %11 ]
%13 = getelementptr inbounds float, float* %1, i64 %12
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %5, i64 %12
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = load float, float* %4
%19 = fneg float %17
%20 = tail call float @llvm.fmuladd.f32(float %19, float %18, float %14)
%21 = trunc i64 %12 to i32
%22 = tail call float @computeExternal(i32 %21, float %7, float* %8)
%23 = fadd float %20, %22
store float %23, float* %13
%24 = add nuw nsw i64 %12, 1
%25 = icmp eq i64 %24, 19
br i1 %25, label %26, label %11
26: ; preds = %11
ret void
}