#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 */
scalar_t__ DealignedLength(char *);
int /*<<< orphan*/ FScale(float *, int, float);
int /*<<< orphan*/ FSet(float *, int, double);
float FSum(float *, int);
scalar_t__ isalpha(char);
char toupper(char);
void PositionBasedWeights(char **aseq, int nseq, int alen, float *wgt) {
  int rescount[26];
  int nres;
  int idx, pos;
  int x;
  float norm;
  FSet(wgt, nseq, 0.0);
  for (pos = 0; pos < alen; pos++) {
    for (x = 0; x < 26; x++)
      rescount[x] = 0;
    for (idx = 0; idx < nseq; idx++)
      if (isalpha(aseq[idx][pos]))
        rescount[toupper(aseq[idx][pos]) - 'A']++;
    nres = 0;
    for (x = 0; x < 26; x++)
      if (rescount[x] > 0)
        nres++;
    for (idx = 0; idx < nseq; idx++)
      if (isalpha(aseq[idx][pos]))
        wgt[idx] +=
            1. / (float)(nres * rescount[toupper(aseq[idx][pos]) - 'A']);
  }
  for (idx = 0; idx < nseq; idx++)
    wgt[idx] /= (float)DealignedLength(aseq[idx]);
  norm = (float)nseq / FSum(wgt, nseq);
  FScale(wgt, nseq, norm);
  return;
}


x86 assembly (clang, -O0):
<PositionBasedWeights>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
xorps  %xmm0,%xmm0
call   1080 <FSet@plt>
movl   $0x0,-0x8c(%rbp)
mov    -0x8c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    13ad <PositionBasedWeights+0x24d>
movl   $0x0,-0x90(%rbp)
cmpl   $0x1a,-0x90(%rbp)
jge    11db <PositionBasedWeights+0x7b>
movslq -0x90(%rbp),%rax
movl   $0x0,-0x80(%rbp,%rax,4)
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    11ab <PositionBasedWeights+0x4b>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1268 <PositionBasedWeights+0x108>
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     124f <PositionBasedWeights+0xef>
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
movsbl %al,%eax
sub    $0x41,%eax
cltq
mov    -0x80(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x80(%rbp,%rax,4)
jmp    1254 <PositionBasedWeights+0xf4>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    11e5 <PositionBasedWeights+0x85>
movl   $0x0,-0x84(%rbp)
movl   $0x0,-0x90(%rbp)
cmpl   $0x1a,-0x90(%rbp)
jge    12c3 <PositionBasedWeights+0x163>
movslq -0x90(%rbp),%rax
cmpl   $0x0,-0x80(%rbp,%rax,4)
jle    12aa <PositionBasedWeights+0x14a>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    12af <PositionBasedWeights+0x14f>
mov    -0x90(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x90(%rbp)
jmp    127c <PositionBasedWeights+0x11c>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1394 <PositionBasedWeights+0x234>
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1070 <isalpha@plt>
cmp    $0x0,%rax
je     137b <PositionBasedWeights+0x21b>
mov    -0x84(%rbp),%eax
mov    %eax,-0x98(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x8c(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%cl
mov    -0x98(%rbp),%eax
movsbl %cl,%ecx
sub    $0x41,%ecx
movslq %ecx,%rcx
imul   -0x80(%rbp,%rcx,4),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xcaa(%rip),%xmm1
divsd  %xmm0,%xmm1
mov    -0x18(%rbp),%rax
movslq -0x88(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
jmp    1380 <PositionBasedWeights+0x220>
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    12cd <PositionBasedWeights+0x16d>
jmp    1399 <PositionBasedWeights+0x239>
mov    -0x8c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8c(%rbp)
jmp    1192 <PositionBasedWeights+0x32>
movl   $0x0,-0x88(%rbp)
mov    -0x88(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    140c <PositionBasedWeights+0x2ac>
mov    -0x8(%rbp),%rax
movslq -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <DealignedLength@plt>
cvtsi2ss %rax,%xmm1
mov    -0x18(%rbp),%rax
movslq -0x88(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x88(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x88(%rbp)
jmp    13b7 <PositionBasedWeights+0x257>
cvtsi2ssl -0xc(%rbp),%xmm0
movss  %xmm0,-0x9c(%rbp)
ff
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <FSum@plt>
movaps %xmm0,%xmm1
movss  -0x9c(%rbp),%xmm0
ff
divss  %xmm1,%xmm0
movss  %xmm0,-0x94(%rbp)
ff
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
movss  -0x94(%rbp),%xmm0
ff
call   1050 <FScale@plt>
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PositionBasedWeights>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rcx,%r12
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%r14
xorps  %xmm0,%xmm0
mov    %rcx,%rdi
call   1080 <FSet@plt>
mov    %ebx,0x1c(%rsp)
mov    %ebx,%r13d
test   %r15d,%r15d
jle    166c <PositionBasedWeights+0x50c>
mov    %r15d,%eax
mov    %rax,0xc0(%rsp)
xor    %ebx,%ebx
mov    %r12,0xb8(%rsp)
jmp    11c2 <PositionBasedWeights+0x62>
xchg   %ax,%ax
add    $0x1,%rbx
cmp    0xc0(%rsp),%rbx
je     166c <PositionBasedWeights+0x50c>
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movq   $0x0,0xb0(%rsp)
mov    $0x0,%ebp
movl   $0x0,0x8(%rsp)
movl   $0x0,0x18(%rsp)
movl   $0x0,0x38(%rsp)
movl   $0x0,0x34(%rsp)
movl   $0x0,0x30(%rsp)
movl   $0x0,0x2c(%rsp)
movl   $0x0,0x28(%rsp)
movl   $0x0,0x24(%rsp)
movl   $0x0,0x20(%rsp)
mov    $0x0,%r9d
mov    $0x0,%r10d
mov    $0x0,%r11d
mov    $0x0,%r15d
mov    $0x0,%r8d
mov    $0x0,%edi
mov    $0x0,%esi
mov    $0x0,%edx
mov    $0x0,%ecx
mov    $0x0,%eax
cmpl   $0x0,0x1c(%rsp)
jle    1361 <PositionBasedWeights+0x201>
xor    %ebp,%ebp
jmp    1299 <PositionBasedWeights+0x139>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r13
je     12d0 <PositionBasedWeights+0x170>
mov    (%r14,%rbp,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     1290 <PositionBasedWeights+0x130>
mov    (%r14,%rbp,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1030 <toupper@plt>
movsbq %al,%rax
addl   $0x1,-0xb4(%rsp,%rax,4)
01
jmp    1290 <PositionBasedWeights+0x130>
cs nopw 0x0(%rax,%rax,1)
mov    0x50(%rsp),%eax
mov    0x54(%rsp),%ecx
mov    0x58(%rsp),%edx
mov    0x5c(%rsp),%esi
mov    0x60(%rsp),%edi
mov    0x64(%rsp),%r8d
mov    0x68(%rsp),%r15d
mov    0x6c(%rsp),%r11d
mov    0x70(%rsp),%r10d
mov    0x74(%rsp),%r9d
mov    0x78(%rsp),%ebp
mov    %ebp,0x20(%rsp)
mov    0x7c(%rsp),%ebp
mov    %ebp,0x24(%rsp)
mov    0x80(%rsp),%ebp
mov    %ebp,0x28(%rsp)
mov    0x84(%rsp),%ebp
mov    %ebp,0x2c(%rsp)
mov    0x88(%rsp),%ebp
mov    %ebp,0x30(%rsp)
mov    0x8c(%rsp),%ebp
mov    %ebp,0x34(%rsp)
mov    0x90(%rsp),%ebp
mov    %ebp,0x38(%rsp)
mov    0x94(%rsp),%ebp
mov    %ebp,0x18(%rsp)
mov    0x98(%rsp),%ebp
mov    %ebp,0x8(%rsp)
mov    0x9c(%rsp),%ebp
test   %eax,%eax
setg   0x13(%rsp)
test   %ecx,%ecx
setg   0x11(%rsp)
test   %edx,%edx
setg   0x12(%rsp)
test   %esi,%esi
setg   0x14(%rsp)
test   %edi,%edi
setg   0x15(%rsp)
mov    %ebp,%edi
test   %r8d,%r8d
setg   %sil
mov    %r9d,%eax
test   %r15d,%r15d
setg   %bpl
test   %r11d,%r11d
setg   %r8b
test   %r10d,%r10d
setg   0x16(%rsp)
test   %r9d,%r9d
setg   0x3c(%rsp)
cmpl   $0x0,0x20(%rsp)
setg   0x17(%rsp)
cmpl   $0x0,0x24(%rsp)
setg   0x40(%rsp)
cmpl   $0x0,0x28(%rsp)
setg   0x44(%rsp)
cmpl   $0x0,0x2c(%rsp)
setg   0x48(%rsp)
cmpl   $0x0,0x30(%rsp)
setg   0x4c(%rsp)
cmpl   $0x0,0x34(%rsp)
setg   0x20(%rsp)
cmpl   $0x0,0x38(%rsp)
setg   0x24(%rsp)
cmpl   $0x0,0x18(%rsp)
setg   0x28(%rsp)
cmpl   $0x0,0x8(%rsp)
setg   0x2c(%rsp)
test   %edi,%edi
setg   0x30(%rsp)
cmpl   $0x0,0xa0(%rsp)
setg   0x34(%rsp)
cmpl   $0x0,0xa4(%rsp)
setg   0x38(%rsp)
cmpl   $0x0,0xa8(%rsp)
setg   %dil
cmpl   $0x0,0xac(%rsp)
setg   %dl
cmpl   $0x0,0xb0(%rsp)
setg   %cl
xor    %r15d,%r15d
cmpl   $0x0,0xb4(%rsp)
setg   %al
cmpl   $0x0,0x1c(%rsp)
jle    11b0 <PositionBasedWeights+0x50>
mov    %al,0x10(%rsp)
mov    %cl,0xf(%rsp)
mov    %dl,0xe(%rsp)
mov    %dil,0xd(%rsp)
xor    %ecx,%ecx
mov    0x13(%rsp),%al
mov    %al,%cl
mov    %ecx,0x8(%rsp)
xor    %edi,%edi
mov    0x11(%rsp),%al
mov    %al,%dil
xor    %ecx,%ecx
mov    0x12(%rsp),%al
mov    %al,%cl
xor    %edx,%edx
mov    0x14(%rsp),%al
mov    %al,%dl
mov    %esi,%r9d
mov    %ebp,%esi
xor    %ebp,%ebp
mov    0x15(%rsp),%al
mov    %al,%bpl
xor    %r11d,%r11d
xor    %r12d,%r12d
mov    %r8d,%r10d
xor    %r8d,%r8d
mov    %r9b,%r8b
xor    %r9d,%r9d
mov    %sil,%r9b
xor    %esi,%esi
mov    %r10b,%sil
mov    %esi,%r10d
mov    0x16(%rsp),%sil
mov    %sil,%r12b
add    0x8(%rsp),%edi
add    %edi,%ecx
add    %ecx,%edx
add    %edx,%ebp
add    %ebp,%r8d
add    %r8d,%r9d
add    %r9d,%r10d
add    %r10d,%r12d
mov    0x3c(%rsp),%al
mov    %al,%r11b
add    %r12d,%r11d
mov    0xb8(%rsp),%r12
xor    %ecx,%ecx
mov    0x17(%rsp),%al
mov    %al,%cl
add    %r11d,%ecx
mov    %ecx,0x3c(%rsp)
xor    %ecx,%ecx
mov    0x40(%rsp),%al
mov    %al,%cl
mov    %ecx,0x40(%rsp)
xor    %ecx,%ecx
mov    0x44(%rsp),%al
mov    %al,%cl
mov    %ecx,0x44(%rsp)
xor    %ecx,%ecx
mov    0x48(%rsp),%al
mov    %al,%cl
mov    %ecx,0x48(%rsp)
xor    %ecx,%ecx
mov    0x4c(%rsp),%al
mov    %al,%cl
mov    %ecx,0x4c(%rsp)
xor    %eax,%eax
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %esi,%esi
xor    %r10d,%r10d
xor    %r9d,%r9d
movl   $0x0,0x18(%rsp)
xor    %r11d,%r11d
movl   $0x0,0x8(%rsp)
xor    %edi,%edi
mov    0x20(%rsp),%dl
mov    %dl,%dil
mov    0x24(%rsp),%dl
mov    %dl,%al
mov    0x28(%rsp),%dl
mov    %dl,%cl
mov    0x2c(%rsp),%dl
mov    %dl,%r8b
mov    0x30(%rsp),%dl
mov    %dl,%sil
mov    0x34(%rsp),%dl
mov    %dl,%r10b
mov    0x38(%rsp),%bpl
mov    %bpl,%r9b
mov    0xd(%rsp),%dl
mov    0x18(%rsp),%ebp
mov    %dl,%bpl
mov    %ebp,0x18(%rsp)
mov    0xe(%rsp),%dl
mov    %dl,%r11b
mov    0xf(%rsp),%dl
mov    0x8(%rsp),%ebp
mov    %dl,%bpl
mov    %ebp,0x8(%rsp)
mov    0x10(%rsp),%dl
mov    %dl,%r15b
mov    0x40(%rsp),%edx
add    0x3c(%rsp),%edx
mov    0x44(%rsp),%ebp
add    %edx,%ebp
mov    0x48(%rsp),%edx
add    %ebp,%edx
mov    0x4c(%rsp),%ebp
add    %edx,%ebp
add    %ebp,%edi
add    %edi,%eax
add    %eax,%ecx
add    %ecx,%r8d
add    %r8d,%esi
add    %esi,%r10d
add    %r10d,%r9d
mov    0x18(%rsp),%eax
add    %r9d,%eax
add    %eax,%r11d
mov    0x8(%rsp),%eax
add    %r11d,%eax
add    %eax,%r15d
xor    %ebp,%ebp
jmp    160d <PositionBasedWeights+0x4ad>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r13
je     11b0 <PositionBasedWeights+0x50>
mov    (%r14,%rbp,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1070 <isalpha@plt>
test   %rax,%rax
je     1600 <PositionBasedWeights+0x4a0>
mov    (%r14,%rbp,8),%rax
movsbl (%rax,%rbx,1),%edi
call   1030 <toupper@plt>
movsbq %al,%rax
mov    -0xb4(%rsp,%rax,4),%eax
imul   %r15d,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x9b2(%rip),%xmm1
divsd  %xmm0,%xmm1
movss  (%r12,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,(%r12,%rbp,4)
jmp    1600 <PositionBasedWeights+0x4a0>
cmpl   $0x0,0x1c(%rsp)
jle    16aa <PositionBasedWeights+0x54a>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    (%r14,%rbx,8),%rdi
call   1060 <DealignedLength@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
movss  (%r12,%rbx,4),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,(%r12,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1680 <PositionBasedWeights+0x520>
mov    0x1c(%rsp),%ebx
xorps  %xmm0,%xmm0
cvtsi2ss %ebx,%xmm0
movss  %xmm0,0x8(%rsp)
mov    %r12,%rdi
mov    %ebx,%esi
call   1040 <FSum@plt>
movss  0x8(%rsp),%xmm1
divss  %xmm0,%xmm1
mov    %r12,%rdi
mov    %ebx,%esi
movaps %xmm1,%xmm0
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <FScale@plt>

LLVM IR (-O0):
define void @PositionBasedWeights(i8** %0, i32 %1, i32 %2, float* %3) {
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca float*
%9 = alloca [26 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca float
store i8** %0, i8*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store float* %3, float** %8
%15 = load float*, float** %8
%16 = load i32, i32* %6
%17 = call i32 @FSet(float* %15, i32 %16, double 0.000000e+00)
store i32 0, i32* %12
br label %18
18: ; preds = %139, %4
%19 = load i32, i32* %12
%20 = load i32, i32* %7
%21 = icmp slt i32 %19, %20
br i1 %21, label %22, label %142
22: ; preds = %18
store i32 0, i32* %13
br label %23
23: ; preds = %30, %22
%24 = load i32, i32* %13
%25 = icmp slt i32 %24, 26
br i1 %25, label %26, label %33
26: ; preds = %23
%27 = load i32, i32* %13
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %28
store i32 0, i32* %29
br label %30
30: ; preds = %26
%31 = load i32, i32* %13
%32 = add nsw i32 %31, 1
store i32 %32, i32* %13
br label %23
33: ; preds = %23
store i32 0, i32* %11
br label %34
34: ; preds = %68, %33
%35 = load i32, i32* %11
%36 = load i32, i32* %6
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %71
38: ; preds = %34
%39 = load i8**, i8*** %5
%40 = load i32, i32* %11
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = load i32, i32* %12
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i8, i8* %43, i64 %45
%47 = load i8, i8* %46
%48 = call i64 @isalpha(i8 signext %47)
%49 = icmp ne i64 %48, 0
br i1 %49, label %50, label %67
50: ; preds = %38
%51 = load i8**, i8*** %5
%52 = load i32, i32* %11
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8*, i8** %51, i64 %53
%55 = load i8*, i8** %54
%56 = load i32, i32* %12
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = call signext i8 @toupper(i8 signext %59)
%61 = sext i8 %60 to i32
%62 = sub nsw i32 %61, 65
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %63
%65 = load i32, i32* %64
%66 = add nsw i32 %65, 1
store i32 %66, i32* %64
br label %67
67: ; preds = %50, %38
br label %68
68: ; preds = %67
%69 = load i32, i32* %11
%70 = add nsw i32 %69, 1
store i32 %70, i32* %11
br label %34
71: ; preds = %34
store i32 0, i32* %10
store i32 0, i32* %13
br label %72
72: ; preds = %85, %71
%73 = load i32, i32* %13
%74 = icmp slt i32 %73, 26
br i1 %74, label %75, label %88
75: ; preds = %72
%76 = load i32, i32* %13
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %77
%79 = load i32, i32* %78
%80 = icmp sgt i32 %79, 0
br i1 %80, label %81, label %84
81: ; preds = %75
%82 = load i32, i32* %10
%83 = add nsw i32 %82, 1
store i32 %83, i32* %10
br label %84
84: ; preds = %81, %75
br label %85
85: ; preds = %84
%86 = load i32, i32* %13
%87 = add nsw i32 %86, 1
store i32 %87, i32* %13
br label %72
88: ; preds = %72
store i32 0, i32* %11
br label %89
89: ; preds = %135, %88
%90 = load i32, i32* %11
%91 = load i32, i32* %6
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %138
93: ; preds = %89
%94 = load i8**, i8*** %5
%95 = load i32, i32* %11
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds i8*, i8** %94, i64 %96
%98 = load i8*, i8** %97
%99 = load i32, i32* %12
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds i8, i8* %98, i64 %100
%102 = load i8, i8* %101
%103 = call i64 @isalpha(i8 signext %102)
%104 = icmp ne i64 %103, 0
br i1 %104, label %105, label %134
105: ; preds = %93
%106 = load i32, i32* %10
%107 = load i8**, i8*** %5
%108 = load i32, i32* %11
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds i8*, i8** %107, i64 %109
%111 = load i8*, i8** %110
%112 = load i32, i32* %12
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds i8, i8* %111, i64 %113
%115 = load i8, i8* %114
%116 = call signext i8 @toupper(i8 signext %115)
%117 = sext i8 %116 to i32
%118 = sub nsw i32 %117, 65
%119 = sext i32 %118 to i64
%120 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %119
%121 = load i32, i32* %120
%122 = mul nsw i32 %106, %121
%123 = sitofp i32 %122 to float
%124 = fpext float %123 to double
%125 = fdiv double 1.000000e+00, %124
%126 = load float*, float** %8
%127 = load i32, i32* %11
%128 = sext i32 %127 to i64
%129 = getelementptr inbounds float, float* %126, i64 %128
%130 = load float, float* %129
%131 = fpext float %130 to double
%132 = fadd double %131, %125
%133 = fptrunc double %132 to float
store float %133, float* %129
br label %134
134: ; preds = %105, %93
br label %135
135: ; preds = %134
%136 = load i32, i32* %11
%137 = add nsw i32 %136, 1
store i32 %137, i32* %11
br label %89
138: ; preds = %89
br label %139
139: ; preds = %138
%140 = load i32, i32* %12
%141 = add nsw i32 %140, 1
store i32 %141, i32* %12
br label %18
142: ; preds = %18
store i32 0, i32* %11
br label %143
143: ; preds = %161, %142
%144 = load i32, i32* %11
%145 = load i32, i32* %6
%146 = icmp slt i32 %144, %145
br i1 %146, label %147, label %164
147: ; preds = %143
%148 = load i8**, i8*** %5
%149 = load i32, i32* %11
%150 = sext i32 %149 to i64
%151 = getelementptr inbounds i8*, i8** %148, i64 %150
%152 = load i8*, i8** %151
%153 = call i64 @DealignedLength(i8* %152)
%154 = sitofp i64 %153 to float
%155 = load float*, float** %8
%156 = load i32, i32* %11
%157 = sext i32 %156 to i64
%158 = getelementptr inbounds float, float* %155, i64 %157
%159 = load float, float* %158
%160 = fdiv float %159, %154
store float %160, float* %158
br label %161
161: ; preds = %147
%162 = load i32, i32* %11
%163 = add nsw i32 %162, 1
store i32 %163, i32* %11
br label %143
164: ; preds = %143
%165 = load i32, i32* %6
%166 = sitofp i32 %165 to float
%167 = load float*, float** %8
%168 = load i32, i32* %6
%169 = call float @FSum(float* %167, i32 %168)
%170 = fdiv float %166, %169
store float %170, float* %14
%171 = load float*, float** %8
%172 = load i32, i32* %6
%173 = load float, float* %14
%174 = call i32 @FScale(float* %171, i32 %172, float %173)
ret void
}

LLVM IR (-O2):
define void @PositionBasedWeights(i8** nocapture %0, i32 %1, i32 %2, float* %3) {
%5 = alloca [26 x i32]
%6 = bitcast [26 x i32]* %5 to i8*
%7 = tail call i32 @FSet(float* %3, i32 %1, double 0.000000e+00)
%8 = icmp sgt i32 %2, 0
br i1 %8, label %9, label %42
9: ; preds = %4
%10 = icmp sgt i32 %1, 0
%11 = zext i32 %2 to i64
%12 = zext i32 %1 to i64
%13 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 0
%14 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 1
%15 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 2
%16 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 3
%17 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 4
%18 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 5
%19 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 6
%20 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 7
%21 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 8
%22 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 9
%23 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 10
%24 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 11
%25 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 12
%26 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 13
%27 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 14
%28 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 15
%29 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 16
%30 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 17
%31 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 18
%32 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 19
%33 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 20
%34 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 21
%35 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 22
%36 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 23
%37 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 24
%38 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 25
%39 = zext i32 %1 to i64
br label %40
40: ; preds = %9, %221
%41 = phi i64 [ 0, %9 ], [ %222, %221 ]
br i1 %10, label %171, label %67
42: ; preds = %221, %4
%43 = icmp sgt i32 %1, 0
br i1 %43, label %44, label %235
44: ; preds = %42
%45 = zext i32 %1 to i64
br label %224
46: ; preds = %189
%47 = load i32, i32* %13
%48 = load i32, i32* %14
%49 = load i32, i32* %15
%50 = load i32, i32* %16
%51 = load i32, i32* %17
%52 = load i32, i32* %18
%53 = load i32, i32* %19
%54 = load i32, i32* %20
%55 = load i32, i32* %21
%56 = load i32, i32* %22
%57 = load i32, i32* %23
%58 = load i32, i32* %24
%59 = load i32, i32* %25
%60 = load i32, i32* %26
%61 = load i32, i32* %27
%62 = load i32, i32* %28
%63 = load i32, i32* %29
%64 = load i32, i32* %30
%65 = load i32, i32* %31
%66 = load i32, i32* %32
br label %67
67: ; preds = %46, %40
%68 = phi i32 [ %66, %46 ], [ 0, %40 ]
%69 = phi i32 [ %65, %46 ], [ 0, %40 ]
%70 = phi i32 [ %64, %46 ], [ 0, %40 ]
%71 = phi i32 [ %63, %46 ], [ 0, %40 ]
%72 = phi i32 [ %62, %46 ], [ 0, %40 ]
%73 = phi i32 [ %61, %46 ], [ 0, %40 ]
%74 = phi i32 [ %60, %46 ], [ 0, %40 ]
%75 = phi i32 [ %59, %46 ], [ 0, %40 ]
%76 = phi i32 [ %58, %46 ], [ 0, %40 ]
%77 = phi i32 [ %57, %46 ], [ 0, %40 ]
%78 = phi i32 [ %56, %46 ], [ 0, %40 ]
%79 = phi i32 [ %55, %46 ], [ 0, %40 ]
%80 = phi i32 [ %54, %46 ], [ 0, %40 ]
%81 = phi i32 [ %53, %46 ], [ 0, %40 ]
%82 = phi i32 [ %52, %46 ], [ 0, %40 ]
%83 = phi i32 [ %51, %46 ], [ 0, %40 ]
%84 = phi i32 [ %50, %46 ], [ 0, %40 ]
%85 = phi i32 [ %49, %46 ], [ 0, %40 ]
%86 = phi i32 [ %48, %46 ], [ 0, %40 ]
%87 = phi i32 [ %47, %46 ], [ 0, %40 ]
%88 = icmp sgt i32 %87, 0
%89 = zext i1 %88 to i32
%90 = icmp sgt i32 %86, 0
%91 = zext i1 %90 to i32
%92 = add nuw nsw i32 %89, %91
%93 = icmp sgt i32 %85, 0
%94 = zext i1 %93 to i32
%95 = add nuw nsw i32 %92, %94
%96 = icmp sgt i32 %84, 0
%97 = zext i1 %96 to i32
%98 = add nuw nsw i32 %95, %97
%99 = icmp sgt i32 %83, 0
%100 = zext i1 %99 to i32
%101 = add nuw nsw i32 %98, %100
%102 = icmp sgt i32 %82, 0
%103 = zext i1 %102 to i32
%104 = add nuw nsw i32 %101, %103
%105 = icmp sgt i32 %81, 0
%106 = zext i1 %105 to i32
%107 = add nuw nsw i32 %104, %106
%108 = icmp sgt i32 %80, 0
%109 = zext i1 %108 to i32
%110 = add nuw nsw i32 %107, %109
%111 = icmp sgt i32 %79, 0
%112 = zext i1 %111 to i32
%113 = add nuw nsw i32 %110, %112
%114 = icmp sgt i32 %78, 0
%115 = zext i1 %114 to i32
%116 = add nuw nsw i32 %113, %115
%117 = icmp sgt i32 %77, 0
%118 = zext i1 %117 to i32
%119 = add nuw nsw i32 %116, %118
%120 = icmp sgt i32 %76, 0
%121 = zext i1 %120 to i32
%122 = add nuw nsw i32 %119, %121
%123 = icmp sgt i32 %75, 0
%124 = zext i1 %123 to i32
%125 = add nuw nsw i32 %122, %124
%126 = icmp sgt i32 %74, 0
%127 = zext i1 %126 to i32
%128 = add nuw nsw i32 %125, %127
%129 = icmp sgt i32 %73, 0
%130 = zext i1 %129 to i32
%131 = add nuw nsw i32 %128, %130
%132 = icmp sgt i32 %72, 0
%133 = zext i1 %132 to i32
%134 = add nuw nsw i32 %131, %133
%135 = icmp sgt i32 %71, 0
%136 = zext i1 %135 to i32
%137 = add nuw nsw i32 %134, %136
%138 = icmp sgt i32 %70, 0
%139 = zext i1 %138 to i32
%140 = add nuw nsw i32 %137, %139
%141 = icmp sgt i32 %69, 0
%142 = zext i1 %141 to i32
%143 = add nuw nsw i32 %140, %142
%144 = icmp sgt i32 %68, 0
%145 = zext i1 %144 to i32
%146 = add nuw nsw i32 %143, %145
%147 = load i32, i32* %33
%148 = icmp sgt i32 %147, 0
%149 = zext i1 %148 to i32
%150 = add nuw nsw i32 %146, %149
%151 = load i32, i32* %34
%152 = icmp sgt i32 %151, 0
%153 = zext i1 %152 to i32
%154 = add nuw nsw i32 %150, %153
%155 = load i32, i32* %35
%156 = icmp sgt i32 %155, 0
%157 = zext i1 %156 to i32
%158 = add nuw nsw i32 %154, %157
%159 = load i32, i32* %36
%160 = icmp sgt i32 %159, 0
%161 = zext i1 %160 to i32
%162 = add nuw nsw i32 %158, %161
%163 = load i32, i32* %37
%164 = icmp sgt i32 %163, 0
%165 = zext i1 %164 to i32
%166 = add nuw nsw i32 %162, %165
%167 = load i32, i32* %38
%168 = icmp sgt i32 %167, 0
%169 = zext i1 %168 to i32
%170 = add nuw nsw i32 %166, %169
br i1 %10, label %192, label %221
171: ; preds = %40, %189
%172 = phi i64 [ %190, %189 ], [ 0, %40 ]
%173 = getelementptr inbounds i8*, i8** %0, i64 %172
%174 = load i8*, i8** %173
%175 = getelementptr inbounds i8, i8* %174, i64 %41
%176 = load i8, i8* %175
%177 = tail call i64 @isalpha(i8 signext %176)
%178 = icmp eq i64 %177, 0
br i1 %178, label %189, label %179
179: ; preds = %171
%180 = load i8*, i8** %173
%181 = getelementptr inbounds i8, i8* %180, i64 %41
%182 = load i8, i8* %181
%183 = tail call signext i8 @toupper(i8 signext %182)
%184 = sext i8 %183 to i64
%185 = add nsw i64 %184, -65
%186 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 %185
%187 = load i32, i32* %186
%188 = add nsw i32 %187, 1
store i32 %188, i32* %186
br label %189
189: ; preds = %171, %179
%190 = add nuw nsw i64 %172, 1
%191 = icmp eq i64 %190, %12
br i1 %191, label %46, label %171
192: ; preds = %67, %218
%193 = phi i64 [ %219, %218 ], [ 0, %67 ]
%194 = getelementptr inbounds i8*, i8** %0, i64 %193
%195 = load i8*, i8** %194
%196 = getelementptr inbounds i8, i8* %195, i64 %41
%197 = load i8, i8* %196
%198 = tail call i64 @isalpha(i8 signext %197)
%199 = icmp eq i64 %198, 0
br i1 %199, label %218, label %200
200: ; preds = %192
%201 = load i8*, i8** %194
%202 = getelementptr inbounds i8, i8* %201, i64 %41
%203 = load i8, i8* %202
%204 = tail call signext i8 @toupper(i8 signext %203)
%205 = sext i8 %204 to i64
%206 = add nsw i64 %205, -65
%207 = getelementptr inbounds [26 x i32], [26 x i32]* %5, i64 0, i64 %206
%208 = load i32, i32* %207
%209 = mul nsw i32 %208, %170
%210 = sitofp i32 %209 to float
%211 = fpext float %210 to double
%212 = fdiv double 1.000000e+00, %211
%213 = getelementptr inbounds float, float* %3, i64 %193
%214 = load float, float* %213
%215 = fpext float %214 to double
%216 = fadd double %212, %215
%217 = fptrunc double %216 to float
store float %217, float* %213
br label %218
218: ; preds = %192, %200
%219 = add nuw nsw i64 %193, 1
%220 = icmp eq i64 %219, %39
br i1 %220, label %221, label %192
221: ; preds = %218, %67
%222 = add nuw nsw i64 %41, 1
%223 = icmp eq i64 %222, %11
br i1 %223, label %42, label %40
224: ; preds = %44, %224
%225 = phi i64 [ 0, %44 ], [ %233, %224 ]
%226 = getelementptr inbounds i8*, i8** %0, i64 %225
%227 = load i8*, i8** %226
%228 = tail call i64 @DealignedLength(i8* %227)
%229 = sitofp i64 %228 to float
%230 = getelementptr inbounds float, float* %3, i64 %225
%231 = load float, float* %230
%232 = fdiv float %231, %229
store float %232, float* %230
%233 = add nuw nsw i64 %225, 1
%234 = icmp eq i64 %233, %45
br i1 %234, label %235, label %224
235: ; preds = %224, %42
%236 = sitofp i32 %1 to float
%237 = tail call float @FSum(float* %3, i32 %1)
%238 = fdiv float %236, %237
%239 = tail call i32 @FScale(float* %3, i32 %1, float %238)
ret void
}