void letter_permutations(double empty_array[26], char partial_array[],
                         int text_length) {
  register int i, totalSum;
  totalSum = 0;
  fill_doublearray_with(empty_array, 0, 26);
  for (i = 0; i < text_length; i++) {
    int c = partial_array[i] - 'a';
    if (c < 26 && c > 0) {
      empty_array[c]++;
      totalSum++;
    }
  }
  for (i = 0; i < 26; i++)
    empty_array[i] = (double)((empty_array[i]) * 100 / totalSum);
}


x86 assembly (clang, -O0):
<letter_permutations>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1a,%edx
mov    $0x0,%al
call   1030 <fill_doublearray_with@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ab <letter_permutations+0x9b>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
sub    $0x61,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x1a,-0x20(%rbp)
jge    1198 <letter_permutations+0x88>
cmpl   $0x0,-0x20(%rbp)
jle    1198 <letter_permutations+0x88>
mov    -0x8(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsd  0xe83(%rip),%xmm0
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    119d <letter_permutations+0x8d>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1143 <letter_permutations+0x33>
movl   $0x0,-0x18(%rbp)
cmpl   $0x1a,-0x18(%rbp)
jge    11f5 <letter_permutations+0xe5>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  0xe34(%rip),%xmm0
mulsd  (%rax,%rcx,8),%xmm0
cvtsi2sdl -0x1c(%rbp),%xmm1
divsd  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <letter_permutations+0xa2>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<letter_permutations>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %ebp,%ebp
xor    %esi,%esi
mov    $0x1a,%edx
xor    %eax,%eax
call   1030 <fill_doublearray_with@plt>
test   %r15d,%r15d
jle    1174 <letter_permutations+0x64>
mov    %r15d,%eax
cmp    $0x1,%r15d
jne    1298 <letter_permutations+0x188>
xor    %ecx,%ecx
xor    %ebp,%ebp
test   $0x1,%al
je     1174 <letter_permutations+0x64>
movzbl (%r14,%rcx,1),%eax
lea    -0x62(%rax),%ecx
cmp    $0x18,%cl
ja     1174 <letter_permutations+0x64>
movsd  -0x308(%rbx,%rax,8),%xmm0
ff ff
addsd  0xe98(%rip),%xmm0
movsd  %xmm0,-0x308(%rbx,%rax,8)
ff ff
add    $0x1,%ebp
xorps  %xmm0,%xmm0
cvtsi2sd %ebp,%xmm0
unpcklpd %xmm0,%xmm0
movapd 0xe89(%rip),%xmm1
movupd (%rbx),%xmm2
movupd 0x10(%rbx),%xmm3
movupd 0x20(%rbx),%xmm4
movupd 0x30(%rbx),%xmm5
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,(%rbx)
mulpd  %xmm1,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x10(%rbx)
mulpd  %xmm1,%xmm4
divpd  %xmm0,%xmm4
movupd %xmm4,0x20(%rbx)
mulpd  %xmm1,%xmm5
divpd  %xmm0,%xmm5
movupd %xmm5,0x30(%rbx)
movupd 0x40(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x40(%rbx)
movupd 0x50(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x50(%rbx)
movupd 0x60(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x60(%rbx)
movupd 0x70(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x70(%rbx)
movupd 0x80(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x80(%rbx)
movupd 0x90(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0x90(%rbx)
movupd 0xa0(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0xa0(%rbx)
movupd 0xb0(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0xb0(%rbx)
movupd 0xc0(%rbx),%xmm2
mulpd  %xmm1,%xmm2
divpd  %xmm0,%xmm2
movupd %xmm2,0xc0(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%edx
and    $0xfffffffe,%edx
xor    %ecx,%ecx
movsd  0xd59(%rip),%xmm0
xor    %ebp,%ebp
jmp    12bd <letter_permutations+0x1ad>
nopl   0x0(%rax,%rax,1)
add    $0x2,%rcx
cmp    %rcx,%rdx
je     1146 <letter_permutations+0x36>
movzbl (%r14,%rcx,1),%esi
lea    -0x62(%rsi),%edi
cmp    $0x18,%dil
ja     12e4 <letter_permutations+0x1d4>
movsd  -0x308(%rbx,%rsi,8),%xmm1
ff ff
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x308(%rbx,%rsi,8)
ff ff
add    $0x1,%ebp
movzbl 0x1(%r14,%rcx,1),%esi
lea    -0x62(%rsi),%edi
cmp    $0x18,%dil
ja     12b0 <letter_permutations+0x1a0>
movsd  -0x308(%rbx,%rsi,8),%xmm1
ff ff
addsd  %xmm0,%xmm1
movsd  %xmm1,-0x308(%rbx,%rsi,8)
ff ff
add    $0x1,%ebp
jmp    12b0 <letter_permutations+0x1a0>

LLVM IR (-O0):
define void @letter_permutations(double* %0, i8* %1, i32 %2) {
%4 = alloca double*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store double* %0, double** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
store i32 0, i32* %8
%10 = load double*, double** %4
%11 = call i32 (double*, i32, i32, ...) bitcast (i32 (...)* @fill_doublearray_with to i32 (double*, i32, i32, ...)*)(double* %10, i32 0, i32 26)
store i32 0, i32* %7
br label %12
12: ; preds = %39, %3
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %42
16: ; preds = %12
%17 = load i8*, i8** %5
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = sub nsw i32 %22, 97
store i32 %23, i32* %9
%24 = load i32, i32* %9
%25 = icmp slt i32 %24, 26
br i1 %25, label %26, label %38
26: ; preds = %16
%27 = load i32, i32* %9
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %38
29: ; preds = %26
%30 = load double*, double** %4
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = getelementptr inbounds double, double* %30, i64 %32
%34 = load double, double* %33
%35 = fadd double %34, 1.000000e+00
store double %35, double* %33
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %38
38: ; preds = %29, %26, %16
br label %39
39: ; preds = %38
%40 = load i32, i32* %7
%41 = add nsw i32 %40, 1
store i32 %41, i32* %7
br label %12
42: ; preds = %12
store i32 0, i32* %7
br label %43
43: ; preds = %60, %42
%44 = load i32, i32* %7
%45 = icmp slt i32 %44, 26
br i1 %45, label %46, label %63
46: ; preds = %43
%47 = load double*, double** %4
%48 = load i32, i32* %7
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds double, double* %47, i64 %49
%51 = load double, double* %50
%52 = fmul double %51, 1.000000e+02
%53 = load i32, i32* %8
%54 = sitofp i32 %53 to double
%55 = fdiv double %52, %54
%56 = load double*, double** %4
%57 = load i32, i32* %7
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds double, double* %56, i64 %58
store double %55, double* %59
br label %60
60: ; preds = %46
%61 = load i32, i32* %7
%62 = add nsw i32 %61, 1
store i32 %62, i32* %7
br label %43
63: ; preds = %43
ret void
}

LLVM IR (-O2):
define void @letter_permutations(double* %0, i8* nocapture %1, i32 %2) {
%4 = tail call i32 (double*, i32, i32, ...) bitcast (i32 (...)* @fill_doublearray_with to i32 (double*, i32, i32, ...)*)(double* %0, i32 0, i32 26)
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %29
6: ; preds = %3
%7 = zext i32 %2 to i64
%8 = and i64 %7, 1
%9 = icmp eq i32 %2, 1
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = and i64 %7, 4294967294
br label %111
12: ; preds = %140, %6
%13 = phi i32 [ undef, %6 ], [ %141, %140 ]
%14 = phi i64 [ 0, %6 ], [ %142, %140 ]
%15 = phi i32 [ 0, %6 ], [ %141, %140 ]
%16 = icmp eq i64 %8, 0
br i1 %16, label %29, label %17
17: ; preds = %12
%18 = getelementptr inbounds i8, i8* %1, i64 %14
%19 = load i8, i8* %18
%20 = add i8 %19, -98
%21 = icmp ult i8 %20, 25
br i1 %21, label %22, label %29
22: ; preds = %17
%23 = zext i8 %19 to i64
%24 = add nsw i64 %23, -97
%25 = getelementptr inbounds double, double* %0, i64 %24
%26 = load double, double* %25
%27 = fadd double %26, 1.000000e+00
store double %27, double* %25
%28 = add nsw i32 %15, 1
br label %29
29: ; preds = %12, %22, %17, %3
%30 = phi i32 [ 0, %3 ], [ %13, %12 ], [ %28, %22 ], [ %15, %17 ]
%31 = sitofp i32 %30 to double
%32 = insertelement <2 x double> poison, double %31, i64 0
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%34 = bitcast double* %0 to <2 x double>*
%35 = load <2 x double>, <2 x double>* %34
%36 = fmul <2 x double> %35, <double 1.000000e+02, double 1.000000e+02>
%37 = fdiv <2 x double> %36, %33
%38 = bitcast double* %0 to <2 x double>*
store <2 x double> %37, <2 x double>* %38
%39 = getelementptr inbounds double, double* %0, i64 2
%40 = bitcast double* %39 to <2 x double>*
%41 = load <2 x double>, <2 x double>* %40
%42 = fmul <2 x double> %41, <double 1.000000e+02, double 1.000000e+02>
%43 = fdiv <2 x double> %42, %33
%44 = bitcast double* %39 to <2 x double>*
store <2 x double> %43, <2 x double>* %44
%45 = getelementptr inbounds double, double* %0, i64 4
%46 = bitcast double* %45 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = fmul <2 x double> %47, <double 1.000000e+02, double 1.000000e+02>
%49 = fdiv <2 x double> %48, %33
%50 = bitcast double* %45 to <2 x double>*
store <2 x double> %49, <2 x double>* %50
%51 = getelementptr inbounds double, double* %0, i64 6
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = fmul <2 x double> %53, <double 1.000000e+02, double 1.000000e+02>
%55 = fdiv <2 x double> %54, %33
%56 = bitcast double* %51 to <2 x double>*
store <2 x double> %55, <2 x double>* %56
%57 = getelementptr inbounds double, double* %0, i64 8
%58 = bitcast double* %57 to <2 x double>*
%59 = load <2 x double>, <2 x double>* %58
%60 = fmul <2 x double> %59, <double 1.000000e+02, double 1.000000e+02>
%61 = fdiv <2 x double> %60, %33
%62 = bitcast double* %57 to <2 x double>*
store <2 x double> %61, <2 x double>* %62
%63 = getelementptr inbounds double, double* %0, i64 10
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = fmul <2 x double> %65, <double 1.000000e+02, double 1.000000e+02>
%67 = fdiv <2 x double> %66, %33
%68 = bitcast double* %63 to <2 x double>*
store <2 x double> %67, <2 x double>* %68
%69 = getelementptr inbounds double, double* %0, i64 12
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = fmul <2 x double> %71, <double 1.000000e+02, double 1.000000e+02>
%73 = fdiv <2 x double> %72, %33
%74 = bitcast double* %69 to <2 x double>*
store <2 x double> %73, <2 x double>* %74
%75 = getelementptr inbounds double, double* %0, i64 14
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = fmul <2 x double> %77, <double 1.000000e+02, double 1.000000e+02>
%79 = fdiv <2 x double> %78, %33
%80 = bitcast double* %75 to <2 x double>*
store <2 x double> %79, <2 x double>* %80
%81 = getelementptr inbounds double, double* %0, i64 16
%82 = bitcast double* %81 to <2 x double>*
%83 = load <2 x double>, <2 x double>* %82
%84 = fmul <2 x double> %83, <double 1.000000e+02, double 1.000000e+02>
%85 = fdiv <2 x double> %84, %33
%86 = bitcast double* %81 to <2 x double>*
store <2 x double> %85, <2 x double>* %86
%87 = getelementptr inbounds double, double* %0, i64 18
%88 = bitcast double* %87 to <2 x double>*
%89 = load <2 x double>, <2 x double>* %88
%90 = fmul <2 x double> %89, <double 1.000000e+02, double 1.000000e+02>
%91 = fdiv <2 x double> %90, %33
%92 = bitcast double* %87 to <2 x double>*
store <2 x double> %91, <2 x double>* %92
%93 = getelementptr inbounds double, double* %0, i64 20
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = fmul <2 x double> %95, <double 1.000000e+02, double 1.000000e+02>
%97 = fdiv <2 x double> %96, %33
%98 = bitcast double* %93 to <2 x double>*
store <2 x double> %97, <2 x double>* %98
%99 = getelementptr inbounds double, double* %0, i64 22
%100 = bitcast double* %99 to <2 x double>*
%101 = load <2 x double>, <2 x double>* %100
%102 = fmul <2 x double> %101, <double 1.000000e+02, double 1.000000e+02>
%103 = fdiv <2 x double> %102, %33
%104 = bitcast double* %99 to <2 x double>*
store <2 x double> %103, <2 x double>* %104
%105 = getelementptr inbounds double, double* %0, i64 24
%106 = bitcast double* %105 to <2 x double>*
%107 = load <2 x double>, <2 x double>* %106
%108 = fmul <2 x double> %107, <double 1.000000e+02, double 1.000000e+02>
%109 = fdiv <2 x double> %108, %33
%110 = bitcast double* %105 to <2 x double>*
store <2 x double> %109, <2 x double>* %110
ret void
111: ; preds = %140, %10
%112 = phi i64 [ 0, %10 ], [ %142, %140 ]
%113 = phi i32 [ 0, %10 ], [ %141, %140 ]
%114 = phi i64 [ 0, %10 ], [ %143, %140 ]
%115 = getelementptr inbounds i8, i8* %1, i64 %112
%116 = load i8, i8* %115
%117 = add i8 %116, -98
%118 = icmp ult i8 %117, 25
br i1 %118, label %119, label %126
119: ; preds = %111
%120 = zext i8 %116 to i64
%121 = add nsw i64 %120, -97
%122 = getelementptr inbounds double, double* %0, i64 %121
%123 = load double, double* %122
%124 = fadd double %123, 1.000000e+00
store double %124, double* %122
%125 = add nsw i32 %113, 1
br label %126
126: ; preds = %119, %111
%127 = phi i32 [ %125, %119 ], [ %113, %111 ]
%128 = or i64 %112, 1
%129 = getelementptr inbounds i8, i8* %1, i64 %128
%130 = load i8, i8* %129
%131 = add i8 %130, -98
%132 = icmp ult i8 %131, 25
br i1 %132, label %133, label %140
133: ; preds = %126
%134 = zext i8 %130 to i64
%135 = add nsw i64 %134, -97
%136 = getelementptr inbounds double, double* %0, i64 %135
%137 = load double, double* %136
%138 = fadd double %137, 1.000000e+00
store double %138, double* %136
%139 = add nsw i32 %127, 1
br label %140
140: ; preds = %133, %126
%141 = phi i32 [ %139, %133 ], [ %127, %126 ]
%142 = add nuw nsw i64 %112, 2
%143 = add i64 %114, 2
%144 = icmp eq i64 %143, %11
br i1 %144, label %12, label %111
}