#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*/ lin_solve(int, int, float *, float *, float, int);
void diffuse(int N, int b, float *value, float *value_prev, float diff,
             float dt) {
  float alpha = dt * diff * N * N * N;
  lin_solve(N, b, value, value_prev, alpha, 1 + 6 * alpha);
}


x86 assembly (clang, -O0):
<diffuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
movss  %xmm1,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
mulss  -0x1c(%rbp),%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
cvtsi2ssl -0x4(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x24(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movss  -0x24(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
movss  0xe86(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0xe7e(%rip),%xmm2
addss  %xmm2,%xmm1
cvttss2si %xmm1,%r8d
call   1030 <lin_solve@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<diffuse>:
mulss  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2ss %edi,%xmm1
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
movss  0xed1(%rip),%xmm1
mulss  %xmm0,%xmm1
addss  0xec9(%rip),%xmm1
cvttss2si %xmm1,%r8d
jmp    1030 <lin_solve@plt>

LLVM IR (-O0):
define void @diffuse(i32 %0, i32 %1, float* %2, float* %3, float %4, float %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca float*
%10 = alloca float*
%11 = alloca float
%12 = alloca float
%13 = alloca float
store i32 %0, i32* %7
store i32 %1, i32* %8
store float* %2, float** %9
store float* %3, float** %10
store float %4, float* %11
store float %5, float* %12
%14 = load float, float* %12
%15 = load float, float* %11
%16 = fmul float %14, %15
%17 = load i32, i32* %7
%18 = sitofp i32 %17 to float
%19 = fmul float %16, %18
%20 = load i32, i32* %7
%21 = sitofp i32 %20 to float
%22 = fmul float %19, %21
%23 = load i32, i32* %7
%24 = sitofp i32 %23 to float
%25 = fmul float %22, %24
store float %25, float* %13
%26 = load i32, i32* %7
%27 = load i32, i32* %8
%28 = load float*, float** %9
%29 = load float*, float** %10
%30 = load float, float* %13
%31 = load float, float* %13
%32 = call float @llvm.fmuladd.f32(float 6.000000e+00, float %31, float 1.000000e+00)
%33 = fptosi float %32 to i32
%34 = call i32 @lin_solve(i32 %26, i32 %27, float* %28, float* %29, float %30, i32 %33)
ret void
}

LLVM IR (-O2):
define void @diffuse(i32 %0, i32 %1, float* %2, float* %3, float %4, float %5) {
%7 = fmul float %4, %5
%8 = sitofp i32 %0 to float
%9 = fmul float %7, %8
%10 = fmul float %9, %8
%11 = fmul float %10, %8
%12 = tail call float @llvm.fmuladd.f32(float %11, float 6.000000e+00, float 1.000000e+00)
%13 = fptosi float %12 to i32
%14 = tail call i32 @lin_solve(i32 %0, i32 %1, float* %2, float* %3, float %11, i32 %13)
ret void
}