#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 */
int expectedCorrectBases(int *, int);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ getStructureFromParens(char *, int *, int);
scalar_t__ malloc(int);
long double pfuncFull(int *, int, int, int, long double, int, long double,
                      long double, int);
long double nsStarPairsOrParensFull(int seqlength, int seq[], int *pairs,
                                    char *parens, int complexity, int naType,
                                    int dangles, long double temperature,
                                    long double sodiumconc,
                                    long double magnesiumconc,
                                    int uselongsalt) {
  long double explIncorrect;
  long double pf;
  int *thepairs;
  pf = pfuncFull(seq, complexity, naType, dangles, temperature, 1, sodiumconc,
                 magnesiumconc, uselongsalt);
  if (pairs == NULL) {
    thepairs = (int *)malloc((seqlength + 1) * sizeof(int));
    getStructureFromParens(parens, thepairs, seqlength);
  } else
    thepairs = pairs;
  explIncorrect = seqlength - expectedCorrectBases(thepairs, seqlength);
  if (pairs == NULL)
    free(thepairs);
  return explIncorrect;
}


x86 assembly (clang, -O0):
<nsStarPairsOrParensFull>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    0x50(%rbp),%eax
fldt   0x40(%rbp)
fldt   0x30(%rbp)
fldt   0x20(%rbp)
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9d,-0x28(%rbp)
fstpt  -0x40(%rbp)
fstpt  -0x50(%rbp)
fstpt  -0x60(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    -0x28(%rbp),%edx
mov    0x10(%rbp),%ecx
fldt   -0x40(%rbp)
fldt   -0x50(%rbp)
fldt   -0x60(%rbp)
mov    0x50(%rbp),%r9d
mov    %rsp,%rax
fstpt  0x20(%rax)
fstpt  0x10(%rax)
fstpt  (%rax)
mov    $0x1,%r8d
call   1040 <pfuncFull@plt>
fstpt  -0x80(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    11fa <nsStarPairsOrParensFull+0xaa>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x88(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x88(%rbp),%rsi
mov    -0x4(%rbp),%edx
call   1060 <getStructureFromParens@plt>
jmp    1205 <nsStarPairsOrParensFull+0xb5>
mov    -0x18(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x4(%rbp),%esi
mov    %esi,-0x90(%rbp)
mov    -0x88(%rbp),%rdi
call   1070 <expectedCorrectBases@plt>
mov    %eax,%ecx
mov    -0x90(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8c(%rbp)
fildl  -0x8c(%rbp)
fstpt  -0x70(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    124a <nsStarPairsOrParensFull+0xfa>
mov    -0x88(%rbp),%rdi
call   1030 <free@plt>
fldt   -0x70(%rbp)
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nsStarPairsOrParensFull>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%eax
mov    %rcx,%r14
mov    %rdx,%r15
mov    %edi,%ebx
mov    0x60(%rsp),%ecx
mov    0xa0(%rsp),%r9d
fldt   0x70(%rsp)
fldt   0x80(%rsp)
fldt   0x90(%rsp)
fstpt  0x20(%rsp)
fstpt  0x10(%rsp)
fstpt  (%rsp)
mov    %rsi,%rdi
mov    %r8d,%esi
mov    %eax,%edx
mov    $0x1,%r8d
call   1040 <pfuncFull@plt>
fstp   %st(0)
test   %r15,%r15
je     11b6 <nsStarPairsOrParensFull+0x66>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <expectedCorrectBases@plt>
mov    %eax,%ebp
jmp    11e6 <nsStarPairsOrParensFull+0x96>
lea    0x4(,%rbx,4),%edi
call   1050 <malloc@plt>
mov    %rax,%r15
mov    %r14,%rdi
mov    %rax,%rsi
mov    %ebx,%edx
call   1060 <getStructureFromParens@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1070 <expectedCorrectBases@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1030 <free@plt>
sub    %ebp,%ebx
mov    %ebx,0x34(%rsp)
fildl  0x34(%rsp)
add    $0x38,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define x86_fp80 @nsStarPairsOrParensFull(i32 %0, i32* %1, i32* %2, i8* %3, i32 %4, i32 %5, i32 %6, x86_fp80 %7, x86_fp80 %8, x86_fp80 %9, i32 %10) {
%12 = alloca i32
%13 = alloca i32*
%14 = alloca i32*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca x86_fp80
%20 = alloca x86_fp80
%21 = alloca x86_fp80
%22 = alloca i32
%23 = alloca x86_fp80
%24 = alloca x86_fp80
%25 = alloca i32*
store i32 %0, i32* %12
store i32* %1, i32** %13
store i32* %2, i32** %14
store i8* %3, i8** %15
store i32 %4, i32* %16
store i32 %5, i32* %17
store i32 %6, i32* %18
store x86_fp80 %7, x86_fp80* %19
store x86_fp80 %8, x86_fp80* %20
store x86_fp80 %9, x86_fp80* %21
store i32 %10, i32* %22
%26 = load i32*, i32** %13
%27 = load i32, i32* %16
%28 = load i32, i32* %17
%29 = load i32, i32* %18
%30 = load x86_fp80, x86_fp80* %19
%31 = load x86_fp80, x86_fp80* %20
%32 = load x86_fp80, x86_fp80* %21
%33 = load i32, i32* %22
%34 = call x86_fp80 @pfuncFull(i32* %26, i32 %27, i32 %28, i32 %29, x86_fp80 %30, i32 1, x86_fp80 %31, x86_fp80 %32, i32 %33)
store x86_fp80 %34, x86_fp80* %24
%35 = load i32*, i32** %14
%36 = icmp eq i32* %35, null
br i1 %36, label %37, label %49
37: ; preds = %11
%38 = load i32, i32* %12
%39 = add nsw i32 %38, 1
%40 = sext i32 %39 to i64
%41 = mul i64 %40, 4
%42 = trunc i64 %41 to i32
%43 = call i64 @malloc(i32 %42)
%44 = inttoptr i64 %43 to i32*
store i32* %44, i32** %25
%45 = load i8*, i8** %15
%46 = load i32*, i32** %25
%47 = load i32, i32* %12
%48 = call i32 @getStructureFromParens(i8* %45, i32* %46, i32 %47)
br label %51
49: ; preds = %11
%50 = load i32*, i32** %14
store i32* %50, i32** %25
br label %51
51: ; preds = %49, %37
%52 = load i32, i32* %12
%53 = load i32*, i32** %25
%54 = load i32, i32* %12
%55 = call i32 @expectedCorrectBases(i32* %53, i32 %54)
%56 = sub nsw i32 %52, %55
%57 = sitofp i32 %56 to x86_fp80
store x86_fp80 %57, x86_fp80* %23
%58 = load i32*, i32** %14
%59 = icmp eq i32* %58, null
br i1 %59, label %60, label %63
60: ; preds = %51
%61 = load i32*, i32** %25
%62 = call i32 @free(i32* %61)
br label %63
63: ; preds = %60, %51
%64 = load x86_fp80, x86_fp80* %23
ret x86_fp80 %64
}

LLVM IR (-O2):
define x86_fp80 @nsStarPairsOrParensFull(i32 %0, i32* %1, i32* %2, i8* %3, i32 %4, i32 %5, i32 %6, x86_fp80 %7, x86_fp80 %8, x86_fp80 %9, i32 %10) {
%12 = tail call x86_fp80 @pfuncFull(i32* %1, i32 %4, i32 %5, i32 %6, x86_fp80 %7, i32 1, x86_fp80 %8, x86_fp80 %9, i32 %10)
%13 = icmp eq i32* %2, null
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = tail call i32 @expectedCorrectBases(i32* %2, i32 %0)
br label %24
16: ; preds = %11
%17 = shl i32 %0, 2
%18 = add i32 %17, 4
%19 = tail call i64 @malloc(i32 %18)
%20 = inttoptr i64 %19 to i32*
%21 = tail call i32 @getStructureFromParens(i8* %3, i32* %20, i32 %0)
%22 = tail call i32 @expectedCorrectBases(i32* %20, i32 %0)
%23 = tail call i32 @free(i32* %20)
br label %24
24: ; preds = %14, %16
%25 = phi i32 [ %22, %16 ], [ %15, %14 ]
%26 = sub nsw i32 %0, %25
%27 = sitofp i32 %26 to x86_fp80
ret x86_fp80 %27
}