int initBelief(double *belief, int xStart, int yStart) {
  int i;
  int s[] = {[0 ... 4 - 1] = 0};
  int stateSizes[] = {[0 ... 4 - 1] = 5};
  for (i = 0; i < 625; i++) {
    ind2state(s, stateSizes, i);
    if ((s[0] == xStart) && (s[1] == yStart)) {
      belief[i] = 1.0 / (5 * 5);
    }
  }
}


x86 assembly (clang, -O0):
<initBelief>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
mov    0xec7(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x271,-0x1c(%rbp)
jge    11be <initBelief+0x9e>
lea    -0x30(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    $0x0,%al
call   1030 <ind2state@plt>
mov    -0x30(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11ab <initBelief+0x8b>
mov    -0x2c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11ab <initBelief+0x8b>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  0xe5a(%rip),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    11b0 <initBelief+0x90>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    115f <initBelief+0x3f>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initBelief>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%r14
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps 0xecc(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rsp,%r15
lea    0x10(%rsp),%r12
xor    %ebx,%ebx
jmp    115d <initBelief+0x4d>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rbx
cmp    $0x271,%rbx
je     1188 <initBelief+0x78>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1030 <ind2state@plt>
cmp    %ebp,(%rsp)
jne    1150 <initBelief+0x40>
cmp    %r13d,0x4(%rsp)
jne    1150 <initBelief+0x40>
movabs $0x3fa47ae147ae147b,%rax
7a a4 3f
mov    %rax,(%r14,%rbx,8)
jmp    1150 <initBelief+0x40>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.initBelief.stateSizes = [4 x i32] [i32 5, i32 5, i32 5, i32 5]
define i32 @initBelief(double* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca double*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [4 x i32]
%10 = alloca [4 x i32]
store double* %0, double** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
%11 = bitcast [4 x i32]* %9 to i8*
%12 = bitcast [4 x i32]* %10 to i8*
store i32 0, i32* %8
br label %13
13: ; preds = %36, %3
%14 = load i32, i32* %8
%15 = icmp slt i32 %14, 625
br i1 %15, label %16, label %39
16: ; preds = %13
%17 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%18 = getelementptr inbounds [4 x i32], [4 x i32]* %10, i64 0, i64 0
%19 = load i32, i32* %8
%20 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @ind2state to i32 (i32*, i32*, i32, ...)*)(i32* %17, i32* %18, i32 %19)
%21 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%22 = load i32, i32* %21
%23 = load i32, i32* %6
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %35
25: ; preds = %16
%26 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 1
%27 = load i32, i32* %26
%28 = load i32, i32* %7
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %35
30: ; preds = %25
%31 = load double*, double** %5
%32 = load i32, i32* %8
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds double, double* %31, i64 %33
store double 4.000000e-02, double* %34
br label %35
35: ; preds = %30, %25, %16
br label %36
36: ; preds = %35
%37 = load i32, i32* %8
%38 = add nsw i32 %37, 1
store i32 %38, i32* %8
br label %13
39: ; preds = %13
%40 = load i32, i32* %4
ret i32 %40
}

LLVM IR (-O2):
@__const.initBelief.stateSizes = [4 x i32] [i32 5, i32 5, i32 5, i32 5]
define i32 @initBelief(double* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = alloca [4 x i32]
%5 = alloca [4 x i32]
%6 = bitcast [4 x i32]* %4 to i8*
%7 = bitcast [4 x i32]* %5 to i8*
%8 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%9 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%10 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 1
br label %11
11: ; preds = %3, %22
%12 = phi i64 [ 0, %3 ], [ %23, %22 ]
%13 = trunc i64 %12 to i32
%14 = call i32 (i32*, i32*, i32, ...) bitcast (i32 (...)* @ind2state to i32 (i32*, i32*, i32, ...)*)(i32* %8, i32* %9, i32 %13)
%15 = load i32, i32* %8
%16 = icmp eq i32 %15, %1
%17 = load i32, i32* %10
%18 = icmp eq i32 %17, %2
%19 = select i1 %16, i1 %18, i1 false
br i1 %19, label %20, label %22
20: ; preds = %11
%21 = getelementptr inbounds double, double* %0, i64 %12
store double 4.000000e-02, double* %21
br label %22
22: ; preds = %11, %20
%23 = add nuw nsw i64 %12, 1
%24 = icmp eq i64 %23, 625
br i1 %24, label %25, label %11
25: ; preds = %22
ret i32 undef
}