#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__ ForbackSymscore(char, float *, int);
double log(scalar_t__);
float RandomScore(float *randomseq, char *seq) {
  float ll;
  ll = 0.0;
  for (; *seq != '\0'; seq++)
    ll += ((ForbackSymscore(*seq, randomseq, 1)) > 0
               ? log(ForbackSymscore(*seq, randomseq, 1)) * 1.44269504
               : -999.);
  return ll;
}


x86 assembly (clang, -O0):
<RandomScore>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11dc <RandomScore+0xbc>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
movsbl %al,%edi
call   1030 <ForbackSymscore@plt>
cmp    $0x0,%rax
jle    119e <RandomScore+0x7e>
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
movsbl %al,%edi
call   1030 <ForbackSymscore@plt>
mov    %rax,%rdi
call   1040 <log@plt>
movsd  0xe78(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b0 <RandomScore+0x90>
movsd  0xe5a(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
jmp    11b0 <RandomScore+0x90>
movsd  -0x20(%rbp),%xmm1
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1138 <RandomScore+0x18>
movss  -0x14(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomScore>:
push   %r14
push   %rbx
push   %rax
mov    (%rsi),%al
test   %al,%al
je     11a6 <RandomScore+0x86>
mov    %rsi,%rbx
mov    %rdi,%r14
add    $0x1,%rbx
xorps  %xmm0,%xmm0
jmp    1160 <RandomScore+0x40>
nopl   0x0(%rax)
movss  0x4(%rsp),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     11a9 <RandomScore+0x89>
movss  %xmm0,0x4(%rsp)
movsbl %al,%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <ForbackSymscore@plt>
movsd  0xe82(%rip),%xmm0
test   %rax,%rax
jle    1140 <RandomScore+0x20>
movsbl -0x1(%rbx),%edi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <ForbackSymscore@plt>
mov    %rax,%rdi
call   1040 <log@plt>
mulsd  0xe64(%rip),%xmm0
jmp    1140 <RandomScore+0x20>
xorps  %xmm0,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define float @RandomScore(float* %0, i8* %1) {
%3 = alloca float*
%4 = alloca i8*
%5 = alloca float
store float* %0, float** %3
store i8* %1, i8** %4
store float 0.000000e+00, float* %5
br label %6
6: ; preds = %31, %2
%7 = load i8*, i8** %4
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %34
11: ; preds = %6
%12 = load i8*, i8** %4
%13 = load i8, i8* %12
%14 = load float*, float** %3
%15 = call i64 @ForbackSymscore(i8 signext %13, float* %14, i32 1)
%16 = icmp sgt i64 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %11
%18 = load i8*, i8** %4
%19 = load i8, i8* %18
%20 = load float*, float** %3
%21 = call i64 @ForbackSymscore(i8 signext %19, float* %20, i32 1)
%22 = call double @log(i64 %21)
%23 = fmul double %22, 0x3FF7154764EE6C2F
br label %25
24: ; preds = %11
br label %25
25: ; preds = %24, %17
%26 = phi double [ %23, %17 ], [ -9.990000e+02, %24 ]
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = fadd double %28, %26
%30 = fptrunc double %29 to float
store float %30, float* %5
br label %31
31: ; preds = %25
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i32 1
store i8* %33, i8** %4
br label %6
34: ; preds = %6
%35 = load float, float* %5
ret float %35
}

LLVM IR (-O2):
define float @RandomScore(float* %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %24, label %5
5: ; preds = %2, %16
%6 = phi i8 [ %22, %16 ], [ %3, %2 ]
%7 = phi float [ %20, %16 ], [ 0.000000e+00, %2 ]
%8 = phi i8* [ %21, %16 ], [ %1, %2 ]
%9 = tail call i64 @ForbackSymscore(i8 signext %6, float* %0, i32 1)
%10 = icmp sgt i64 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %5
%12 = load i8, i8* %8
%13 = tail call i64 @ForbackSymscore(i8 signext %12, float* %0, i32 1)
%14 = tail call double @log(i64 %13)
%15 = fmul double %14, 0x3FF7154764EE6C2F
br label %16
16: ; preds = %5, %11
%17 = phi double [ %15, %11 ], [ -9.990000e+02, %5 ]
%18 = fpext float %7 to double
%19 = fadd double %17, %18
%20 = fptrunc double %19 to float
%21 = getelementptr inbounds i8, i8* %8, i64 1
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %5
24: ; preds = %16, %2
%25 = phi float [ 0.000000e+00, %2 ], [ %20, %16 ]
ret float %25
}