void BeamFormWeights_StrictFP(int beam, float *weights) {
#pragma STDC FP_CONTRACT OFF
  int i;
  for (i = 0; i < 12; i++) {
    if (i == beam) {
      weights[2 * i] = 1;
      weights[2 * i + 1] = 0;
    } else {
      weights[2 * i] = 0;
      weights[2 * i + 1] = 0;
    }
  }
}


x86 assembly (clang, -O0):
<BeamFormWeights_StrictFP>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    119f <BeamFormWeights_StrictFP+0x9f>
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jne    115f <BeamFormWeights_StrictFP+0x5f>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
movss  0xec3(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    118c <BeamFormWeights_StrictFP+0x8c>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    1191 <BeamFormWeights_StrictFP+0x91>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1112 <BeamFormWeights_StrictFP+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<BeamFormWeights_StrictFP>:
mov    %edi,%r8d
lea    (%r8,%r8,1),%rax
xor    %edx,%edx
xor    %edi,%edi
jmp    1137 <BeamFormWeights_StrictFP+0x37>
nopl   (%rax)
movl   $0x3f800000,(%rsi,%rax,4)
mov    %rax,%rcx
shl    $0x2,%rcx
or     $0x4,%rcx
movl   $0x0,(%rsi,%rcx,1)
add    $0x2,%rdi
add    $0x4,%rdx
cmp    $0xc,%rdi
je     1183 <BeamFormWeights_StrictFP+0x83>
cmp    %rdx,%rax
jne    1150 <BeamFormWeights_StrictFP+0x50>
movl   $0x3f800000,(%rsi,%rax,4)
mov    %rax,%rcx
jmp    115a <BeamFormWeights_StrictFP+0x5a>
nopl   0x0(%rax,%rax,1)
movl   $0x0,(%rsi,%rdx,4)
mov    %rdx,%rcx
shl    $0x2,%rcx
or     $0x4,%rcx
movl   $0x0,(%rsi,%rcx,1)
mov    %rdi,%rcx
or     $0x1,%rcx
cmp    %r8,%rcx
je     1110 <BeamFormWeights_StrictFP+0x10>
lea    0x2(%rdx),%rcx
movl   $0x0,0x8(%rsi,%rdx,4)
jmp    111a <BeamFormWeights_StrictFP+0x1a>
ret

LLVM IR (-O0):
define void @BeamFormWeights_StrictFP(i32 %0, float* %1) {
%3 = alloca i32
%4 = alloca float*
%5 = alloca i32
store i32 %0, i32* %3
store float* %1, float** %4
store i32 0, i32* %5
br label %6
6: ; preds = %38, %2
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 12
br i1 %8, label %9, label %41
9: ; preds = %6
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp eq i32 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %9
%14 = load float*, float** %4
%15 = load i32, i32* %5
%16 = mul nsw i32 2, %15
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* %14, i64 %17
store float 1.000000e+00, float* %18
%19 = load float*, float** %4
%20 = load i32, i32* %5
%21 = mul nsw i32 2, %20
%22 = add nsw i32 %21, 1
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds float, float* %19, i64 %23
store float 0.000000e+00, float* %24
br label %37
25: ; preds = %9
%26 = load float*, float** %4
%27 = load i32, i32* %5
%28 = mul nsw i32 2, %27
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds float, float* %26, i64 %29
store float 0.000000e+00, float* %30
%31 = load float*, float** %4
%32 = load i32, i32* %5
%33 = mul nsw i32 2, %32
%34 = add nsw i32 %33, 1
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds float, float* %31, i64 %35
store float 0.000000e+00, float* %36
br label %37
37: ; preds = %25, %13
br label %38
38: ; preds = %37
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %6
41: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @BeamFormWeights_StrictFP(i32 %0, float* nocapture writeonly %1) {
%3 = zext i32 %0 to i64
%4 = shl nuw nsw i64 %3, 1
%5 = getelementptr inbounds float, float* %1, i64 %4
br label %6
6: ; preds = %23, %2
%7 = phi i64 [ 0, %2 ], [ %27, %23 ]
%8 = icmp eq i64 %7, %3
br i1 %8, label %9, label %10
9: ; preds = %6
store float 1.000000e+00, float* %5
br label %13
10: ; preds = %6
%11 = shl nuw nsw i64 %7, 1
%12 = getelementptr inbounds float, float* %1, i64 %11
store float 0.000000e+00, float* %12
br label %13
13: ; preds = %9, %10
%14 = phi i64 [ %4, %9 ], [ %11, %10 ]
%15 = or i64 %14, 1
%16 = getelementptr inbounds float, float* %1, i64 %15
store float 0.000000e+00, float* %16
%17 = or i64 %7, 1
%18 = icmp eq i64 %17, %3
br i1 %18, label %22, label %19
19: ; preds = %13
%20 = shl nuw nsw i64 %17, 1
%21 = getelementptr inbounds float, float* %1, i64 %20
store float 0.000000e+00, float* %21
br label %23
22: ; preds = %13
store float 1.000000e+00, float* %5
br label %23
23: ; preds = %22, %19
%24 = phi i64 [ %4, %22 ], [ %20, %19 ]
%25 = or i64 %24, 1
%26 = getelementptr inbounds float, float* %1, i64 %25
store float 0.000000e+00, float* %26
%27 = add nuw nsw i64 %7, 2
%28 = icmp eq i64 %27, 12
br i1 %28, label %29, label %6
29: ; preds = %23
ret void
}