#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 powf(double, float);
void phredScore2Prob(float *dest, int *src, int count) {
  int i;
  for (i = 0; i < count; i++) {
    dest[i] = powf(10.0, -(float)src[i] / 10.0);
  }
}


x86 assembly (clang, -O0):
<phredScore2Prob>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    118c <phredScore2Prob+0x7c>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
cvtsi2ssl (%rax,%rcx,4),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea4(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm1
movsd  0xe94(%rip),%xmm0
call   1030 <powf@plt>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <phredScore2Prob+0x1a>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phredScore2Prob>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
test   %edx,%edx
jle    11c1 <phredScore2Prob+0xb1>
mov    %rsi,%r15
mov    %rdi,%r14
mov    %edx,%r12d
cmp    $0x1,%edx
jne    1133 <phredScore2Prob+0x23>
xor    %ebx,%ebx
jmp    1197 <phredScore2Prob+0x87>
mov    %r12d,%r13d
and    $0xfffffffe,%r13d
xor    %ebx,%ebx
nopl   0x0(%rax)
xorps  %xmm1,%xmm1
cvtsi2ssl (%r15,%rbx,4),%xmm1
movss  0xeaf(%rip),%xmm0
divss  %xmm0,%xmm1
movsd  0xeab(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,(%r14,%rbx,4)
xorps  %xmm1,%xmm1
cvtsi2ssl 0x4(%r15,%rbx,4),%xmm1
divss  0xe86(%rip),%xmm1
movsd  0xe86(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,0x4(%r14,%rbx,4)
add    $0x2,%rbx
cmp    %rbx,%r13
jne    1140 <phredScore2Prob+0x30>
test   $0x1,%r12b
je     11c1 <phredScore2Prob+0xb1>
xorps  %xmm1,%xmm1
cvtsi2ssl (%r15,%rbx,4),%xmm1
divss  0xe52(%rip),%xmm1
movsd  0xe52(%rip),%xmm0
call   1030 <powf@plt>
movss  %xmm0,(%r14,%rbx,4)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @phredScore2Prob(float* %0, i32* %1, i32 %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store float* %0, float** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %28, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %6
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %31
12: ; preds = %8
%13 = load i32*, i32** %5
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i32, i32* %13, i64 %15
%17 = load i32, i32* %16
%18 = sitofp i32 %17 to float
%19 = fneg float %18
%20 = fpext float %19 to double
%21 = fdiv double %20, 1.000000e+01
%22 = fptrunc double %21 to float
%23 = call float @powf(double 1.000000e+01, float %22)
%24 = load float*, float** %4
%25 = load i32, i32* %7
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds float, float* %24, i64 %26
store float %23, float* %27
br label %28
28: ; preds = %12
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %8
31: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @phredScore2Prob(float* nocapture writeonly %0, i32* nocapture %1, i32 %2) {
%4 = icmp sgt i32 %2, 0
br i1 %4, label %5, label %40
5: ; preds = %3
%6 = zext i32 %2 to i64
%7 = and i64 %6, 1
%8 = icmp eq i32 %2, 1
br i1 %8, label %30, label %9
9: ; preds = %5
%10 = and i64 %6, 4294967294
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %27, %11 ]
%13 = phi i64 [ 0, %9 ], [ %28, %11 ]
%14 = getelementptr inbounds i32, i32* %1, i64 %12
%15 = load i32, i32* %14
%16 = sitofp i32 %15 to float
%17 = fdiv float %16, -1.000000e+01
%18 = tail call float @powf(double 1.000000e+01, float %17)
%19 = getelementptr inbounds float, float* %0, i64 %12
store float %18, float* %19
%20 = or i64 %12, 1
%21 = getelementptr inbounds i32, i32* %1, i64 %20
%22 = load i32, i32* %21
%23 = sitofp i32 %22 to float
%24 = fdiv float %23, -1.000000e+01
%25 = tail call float @powf(double 1.000000e+01, float %24)
%26 = getelementptr inbounds float, float* %0, i64 %20
store float %25, float* %26
%27 = add nuw nsw i64 %12, 2
%28 = add i64 %13, 2
%29 = icmp eq i64 %28, %10
br i1 %29, label %30, label %11
30: ; preds = %11, %5
%31 = phi i64 [ 0, %5 ], [ %27, %11 ]
%32 = icmp eq i64 %7, 0
br i1 %32, label %40, label %33
33: ; preds = %30
%34 = getelementptr inbounds i32, i32* %1, i64 %31
%35 = load i32, i32* %34
%36 = sitofp i32 %35 to float
%37 = fdiv float %36, -1.000000e+01
%38 = tail call float @powf(double 1.000000e+01, float %37)
%39 = getelementptr inbounds float, float* %0, i64 %31
store float %38, float* %39
br label %40
40: ; preds = %33, %30, %3
ret void
}