#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 execTerm(char **, unsigned char *, float, char *);
int nextToken(char **, char **, int *);
int /*<<< orphan*/ pushBack(char **, int);
float execExpression(char **str, unsigned char *bInPtr, float floatV,
                     char *err) {
  int f = 1;
  float term1, term2;
  char *item;
  unsigned char bPtr[10];
  int n;
  for (n = 0; n <= 9; n++)
    bPtr[n] = *bInPtr++;
  switch (nextToken(str, &item, &n)) {
  case 100:
    f = 1;
    break;
  case 101:
    f = -1;
    break;
  default:
    pushBack(str, n);
    break;
  }
  term1 = execTerm(str, bPtr, floatV, err) * f;
  if (*err) {
    return (0);
  }
  int t;
  while ((t = nextToken(str, &item, &n)) != 0) {
    f = 1;
    switch (t) {
    case 100:
      f = 1;
      break;
    case 101:
      f = -1;
      break;
    default:
      pushBack(str, n);
      return (term1);
    }
    term2 = execTerm(str, bPtr, floatV, err);
    if (*err) {
      return (0);
    }
    term1 += term2 * f;
  }
  return (term1);
}


x86 assembly (clang, -O0):
<execExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
movl   $0x0,-0x50(%rbp)
cmpl   $0x9,-0x50(%rbp)
jg     1188 <execExpression+0x58>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
movslq -0x50(%rbp),%rax
mov    %cl,-0x4a(%rbp,%rax,1)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    1157 <execExpression+0x27>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <nextToken@plt>
mov    %eax,%ecx
mov    %ecx,-0x58(%rbp)
sub    $0x64,%eax
je     11bd <execExpression+0x8d>
jmp    11ac <execExpression+0x7c>
mov    -0x58(%rbp),%eax
sub    $0x65,%eax
je     11c9 <execExpression+0x99>
jmp    11d5 <execExpression+0xa5>
movl   $0x1,-0x2c(%rbp)
jmp    11e1 <execExpression+0xb1>
movl   $0xffffffff,-0x2c(%rbp)
jmp    11e1 <execExpression+0xb1>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%esi
call   1030 <pushBack@plt>
mov    -0x10(%rbp),%rdi
lea    -0x4a(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
call   1050 <execTerm@plt>
imul   -0x2c(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     121e <execExpression+0xee>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1303 <execExpression+0x1d3>
jmp    1223 <execExpression+0xf3>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x50(%rbp),%rdx
call   1040 <nextToken@plt>
mov    %eax,-0x54(%rbp)
cmp    $0x0,%eax
je     12f9 <execExpression+0x1c9>
movl   $0x1,-0x2c(%rbp)
mov    -0x54(%rbp),%eax
mov    %eax,-0x5c(%rbp)
sub    $0x64,%eax
je     126c <execExpression+0x13c>
jmp    125b <execExpression+0x12b>
mov    -0x5c(%rbp),%eax
sub    $0x65,%eax
je     1278 <execExpression+0x148>
jmp    1284 <execExpression+0x154>
movl   $0x1,-0x2c(%rbp)
jmp    129f <execExpression+0x16f>
movl   $0xffffffff,-0x2c(%rbp)
jmp    129f <execExpression+0x16f>
mov    -0x10(%rbp),%rdi
mov    -0x50(%rbp),%esi
call   1030 <pushBack@plt>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1303 <execExpression+0x1d3>
mov    -0x10(%rbp),%rdi
lea    -0x4a(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
call   1050 <execTerm@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x34(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     12d8 <execExpression+0x1a8>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1303 <execExpression+0x1d3>
movss  -0x34(%rbp),%xmm0
cvtsi2ssl -0x2c(%rbp),%xmm2
movss  -0x30(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x30(%rbp)
jmp    1223 <execExpression+0xf3>
movss  -0x30(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execExpression>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%r14
movss  %xmm0,(%rsp)
mov    %rdi,%rbx
mov    (%rsi),%rax
mov    %rax,0x10(%rsp)
movzwl 0x8(%rsi),%eax
mov    %ax,0x18(%rsp)
movl   $0xa,0x8(%rsp)
lea    0x20(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <nextToken@plt>
mov    $0x1,%ebp
cmp    $0x64,%eax
je     1193 <execExpression+0x63>
cmp    $0x65,%eax
jne    1187 <execExpression+0x57>
mov    $0xffffffff,%ebp
jmp    1193 <execExpression+0x63>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <pushBack@plt>
movss  (%rsp),%xmm0
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <execTerm@plt>
cmpb   $0x0,(%r14)
je     11c0 <execExpression+0x90>
xorps  %xmm0,%xmm0
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
imul   %ebp,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
movss  %xmm0,0x4(%rsp)
lea    0x20(%rsp),%r15
lea    0x8(%rsp),%r12
lea    0x10(%rsp),%r13
nop
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
call   1040 <nextToken@plt>
movss  0xe0a(%rip),%xmm1
cmp    $0x64,%eax
movss  (%rsp),%xmm0
je     120d <execExpression+0xdd>
cmp    $0x65,%eax
jne    1246 <execExpression+0x116>
movss  0xdf7(%rip),%xmm1
movss  %xmm1,0xc(%rsp)
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
call   1050 <execTerm@plt>
cmpb   $0x0,(%r14)
jne    11ae <execExpression+0x7e>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  0xc(%rsp),%xmm0
movss  0x4(%rsp),%xmm1
addss  %xmm0,%xmm1
movss  %xmm1,0x4(%rsp)
jmp    11e0 <execExpression+0xb0>
test   %eax,%eax
je     1256 <execExpression+0x126>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
call   1030 <pushBack@plt>
movss  0x4(%rsp),%xmm0
jmp    11b1 <execExpression+0x81>

LLVM IR (-O0):
define float @execExpression(i8** %0, i8* %1, float %2, i8* %3) {
%5 = alloca float
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca float
%9 = alloca i8*
%10 = alloca i32
%11 = alloca float
%12 = alloca float
%13 = alloca i8*
%14 = alloca [10 x i8]
%15 = alloca i32
%16 = alloca i32
store i8** %0, i8*** %6
store i8* %1, i8** %7
store float %2, float* %8
store i8* %3, i8** %9
store i32 1, i32* %10
store i32 0, i32* %15
br label %17
17: ; preds = %27, %4
%18 = load i32, i32* %15
%19 = icmp sle i32 %18, 9
br i1 %19, label %20, label %30
20: ; preds = %17
%21 = load i8*, i8** %7
%22 = getelementptr inbounds i8, i8* %21, i32 1
store i8* %22, i8** %7
%23 = load i8, i8* %21
%24 = load i32, i32* %15
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 %25
store i8 %23, i8* %26
br label %27
27: ; preds = %20
%28 = load i32, i32* %15
%29 = add nsw i32 %28, 1
store i32 %29, i32* %15
br label %17
30: ; preds = %17
%31 = load i8**, i8*** %6
%32 = call i32 @nextToken(i8** %31, i8** %13, i32* %15)
switch i32 %32, label %35 [
i32 100, label %33
i32 101, label %34
]
33: ; preds = %30
store i32 1, i32* %10
br label %39
34: ; preds = %30
store i32 -1, i32* %10
br label %39
35: ; preds = %30
%36 = load i8**, i8*** %6
%37 = load i32, i32* %15
%38 = call i32 @pushBack(i8** %36, i32 %37)
br label %39
39: ; preds = %35, %34, %33
%40 = load i8**, i8*** %6
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%42 = load float, float* %8
%43 = load i8*, i8** %9
%44 = call i32 @execTerm(i8** %40, i8* %41, float %42, i8* %43)
%45 = load i32, i32* %10
%46 = mul nsw i32 %44, %45
%47 = sitofp i32 %46 to float
store float %47, float* %11
%48 = load i8*, i8** %9
%49 = load i8, i8* %48
%50 = icmp ne i8 %49, 0
br i1 %50, label %51, label %52
51: ; preds = %39
store float 0.000000e+00, float* %5
br label %85
52: ; preds = %39
br label %53
53: ; preds = %77, %52
%54 = load i8**, i8*** %6
%55 = call i32 @nextToken(i8** %54, i8** %13, i32* %15)
store i32 %55, i32* %16
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %83
57: ; preds = %53
store i32 1, i32* %10
%58 = load i32, i32* %16
switch i32 %58, label %61 [
i32 100, label %59
i32 101, label %60
]
59: ; preds = %57
store i32 1, i32* %10
br label %66
60: ; preds = %57
store i32 -1, i32* %10
br label %66
61: ; preds = %57
%62 = load i8**, i8*** %6
%63 = load i32, i32* %15
%64 = call i32 @pushBack(i8** %62, i32 %63)
%65 = load float, float* %11
store float %65, float* %5
br label %85
66: ; preds = %60, %59
%67 = load i8**, i8*** %6
%68 = getelementptr inbounds [10 x i8], [10 x i8]* %14, i64 0, i64 0
%69 = load float, float* %8
%70 = load i8*, i8** %9
%71 = call i32 @execTerm(i8** %67, i8* %68, float %69, i8* %70)
%72 = sitofp i32 %71 to float
store float %72, float* %12
%73 = load i8*, i8** %9
%74 = load i8, i8* %73
%75 = icmp ne i8 %74, 0
br i1 %75, label %76, label %77
76: ; preds = %66
store float 0.000000e+00, float* %5
br label %85
77: ; preds = %66
%78 = load float, float* %12
%79 = load i32, i32* %10
%80 = sitofp i32 %79 to float
%81 = load float, float* %11
%82 = call float @llvm.fmuladd.f32(float %78, float %80, float %81)
store float %82, float* %11
br label %53
83: ; preds = %53
%84 = load float, float* %11
store float %84, float* %5
br label %85
85: ; preds = %83, %76, %61, %51
%86 = load float, float* %5
ret float %86
}

LLVM IR (-O2):
define float @execExpression(i8** %0, i8* nocapture %1, float %2, i8* %3) {
%5 = alloca i8*
%6 = alloca [10 x i8]
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%8 = alloca i32
%9 = bitcast i8** %5 to i8*
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%11 = bitcast i32* %8 to i8*
store i32 10, i32* %8
%12 = call i32 @nextToken(i8** %0, i8** %5, i32* %8)
switch i32 %12, label %14 [
i32 100, label %17
i32 101, label %13
]
13: ; preds = %4
br label %17
14: ; preds = %4
%15 = load i32, i32* %8
%16 = call i32 @pushBack(i8** %0, i32 %15)
br label %17
17: ; preds = %4, %14, %13
%18 = phi i32 [ 1, %14 ], [ -1, %13 ], [ 1, %4 ]
%19 = call i32 @execTerm(i8** %0, i8* %10, float %2, i8* %3)
%20 = load i8, i8* %3
%21 = icmp eq i8 %20, 0
br i1 %21, label %22, label %40
22: ; preds = %17
%23 = mul nsw i32 %19, %18
%24 = sitofp i32 %23 to float
br label %25
25: ; preds = %37, %22
%26 = phi float [ %24, %22 ], [ %39, %37 ]
%27 = call i32 @nextToken(i8** %0, i8** %5, i32* %8)
switch i32 %27, label %29 [
i32 0, label %40
i32 100, label %32
i32 101, label %28
]
28: ; preds = %25
br label %32
29: ; preds = %25
%30 = load i32, i32* %8
%31 = call i32 @pushBack(i8** %0, i32 %30)
br label %40
32: ; preds = %25, %28
%33 = phi float [ -1.000000e+00, %28 ], [ 1.000000e+00, %25 ]
%34 = call i32 @execTerm(i8** %0, i8* %10, float %2, i8* %3)
%35 = load i8, i8* %3
%36 = icmp eq i8 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %32
%38 = sitofp i32 %34 to float
%39 = call float @llvm.fmuladd.f32(float %38, float %33, float %26)
br label %25
40: ; preds = %32, %25, %29, %17
%41 = phi float [ 0.000000e+00, %17 ], [ %26, %29 ], [ %26, %25 ], [ 0.000000e+00, %32 ]
ret float %41
}