#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 */
float execFactor(char **, unsigned char *, float, char *);
int nextToken(char **, char **, int *);
int /*<<< orphan*/ pushBack(char **, int);
float execTerm(char **str, unsigned char *bPtr, float floatV, char *err) {
  float factor1, factor2;
  int op;
  char *item;
  int n;
  factor1 = execFactor(str, bPtr, floatV, err);
  if (*err) {
    return (0);
  }
  while (1) {
    switch (nextToken(str, &item, &n)) {
    case 102:
      op = 102;
      break;
    case 103:
      op = 103;
      break;
    default:
      pushBack(str, n);
      return (factor1);
    }
    factor2 = execFactor(str, bPtr, floatV, err);
    if (*err) {
      return (0);
    }
    if (op == 102)
      factor1 *= factor2;
    else
      factor1 /= factor2;
  }
}


x86 assembly (clang, -O0):
<execTerm>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movss  %xmm0,-0x1c(%rbp)
mov    %rdx,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
call   1050 <execFactor@plt>
movss  %xmm0,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     117e <execTerm+0x4e>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1256 <execTerm+0x126>
jmp    1183 <execTerm+0x53>
mov    -0x10(%rbp),%rdi
lea    -0x40(%rbp),%rsi
lea    -0x44(%rbp),%rdx
call   1040 <nextToken@plt>
mov    %eax,%ecx
mov    %ecx,-0x48(%rbp)
sub    $0x66,%eax
je     11b8 <execTerm+0x88>
jmp    11a7 <execTerm+0x77>
mov    -0x48(%rbp),%eax
sub    $0x67,%eax
je     11c4 <execTerm+0x94>
jmp    11d0 <execTerm+0xa0>
movl   $0x66,-0x34(%rbp)
jmp    11eb <execTerm+0xbb>
movl   $0x67,-0x34(%rbp)
jmp    11eb <execTerm+0xbb>
mov    -0x10(%rbp),%rdi
mov    -0x44(%rbp),%esi
call   1030 <pushBack@plt>
movss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1256 <execTerm+0x126>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
movss  -0x1c(%rbp),%xmm0
mov    -0x28(%rbp),%rdx
call   1050 <execFactor@plt>
movss  %xmm0,-0x30(%rbp)
mov    -0x28(%rbp),%rax
cmpb   $0x0,(%rax)
je     1220 <execTerm+0xf0>
xorps  %xmm0,%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1256 <execTerm+0x126>
cmpl   $0x66,-0x34(%rbp)
jne    123e <execTerm+0x10e>
movss  -0x30(%rbp),%xmm0
mulss  -0x2c(%rbp),%xmm0
movss  %xmm0,-0x2c(%rbp)
jmp    1251 <execTerm+0x121>
movss  -0x30(%rbp),%xmm1
movss  -0x2c(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x2c(%rbp)
jmp    1183 <execTerm+0x53>
movss  -0x4(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execTerm>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x20,%rsp
mov    %rdx,%rbx
mov    %rsi,%r15
mov    %rdi,%r14
movss  %xmm0,0x10(%rsp)
call   1050 <execFactor@plt>
cmpb   $0x0,(%rbx)
je     1167 <execTerm+0x37>
xorps  %xmm0,%xmm0
add    $0x20,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
movss  %xmm0,0xc(%rsp)
lea    0x18(%rsp),%r12
lea    0x14(%rsp),%r13
nopw   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1040 <nextToken@plt>
cmp    $0x66,%eax
je     11d0 <execTerm+0xa0>
cmp    $0x67,%eax
movss  0x10(%rsp),%xmm0
jne    11ff <execTerm+0xcf>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <execFactor@plt>
cmpb   $0x0,(%rbx)
jne    1156 <execTerm+0x26>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
jmp    1180 <execTerm+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
mov    %r15,%rsi
movss  0x10(%rsp),%xmm0
mov    %rbx,%rdx
call   1050 <execFactor@plt>
cmpb   $0x0,(%rbx)
jne    1156 <execTerm+0x26>
movss  0xc(%rsp),%xmm1
mulss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
jmp    1180 <execTerm+0x50>
mov    0x14(%rsp),%esi
mov    %r14,%rdi
call   1030 <pushBack@plt>
movss  0xc(%rsp),%xmm0
jmp    1159 <execTerm+0x29>

LLVM IR (-O0):
define float @execTerm(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 float
%11 = alloca float
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i8** %0, i8*** %6
store i8* %1, i8** %7
store float %2, float* %8
store i8* %3, i8** %9
%15 = load i8**, i8*** %6
%16 = load i8*, i8** %7
%17 = load float, float* %8
%18 = load i8*, i8** %9
%19 = call float @execFactor(i8** %15, i8* %16, float %17, i8* %18)
store float %19, float* %10
%20 = load i8*, i8** %9
%21 = load i8, i8* %20
%22 = icmp ne i8 %21, 0
br i1 %22, label %23, label %24
23: ; preds = %4
store float 0.000000e+00, float* %5
br label %57
24: ; preds = %4
br label %25
25: ; preds = %24, %56
%26 = load i8**, i8*** %6
%27 = call i32 @nextToken(i8** %26, i8** %13, i32* %14)
switch i32 %27, label %30 [
i32 102, label %28
i32 103, label %29
]
28: ; preds = %25
store i32 102, i32* %12
br label %35
29: ; preds = %25
store i32 103, i32* %12
br label %35
30: ; preds = %25
%31 = load i8**, i8*** %6
%32 = load i32, i32* %14
%33 = call i32 @pushBack(i8** %31, i32 %32)
%34 = load float, float* %10
store float %34, float* %5
br label %57
35: ; preds = %29, %28
%36 = load i8**, i8*** %6
%37 = load i8*, i8** %7
%38 = load float, float* %8
%39 = load i8*, i8** %9
%40 = call float @execFactor(i8** %36, i8* %37, float %38, i8* %39)
store float %40, float* %11
%41 = load i8*, i8** %9
%42 = load i8, i8* %41
%43 = icmp ne i8 %42, 0
br i1 %43, label %44, label %45
44: ; preds = %35
store float 0.000000e+00, float* %5
br label %57
45: ; preds = %35
%46 = load i32, i32* %12
%47 = icmp eq i32 %46, 102
br i1 %47, label %48, label %52
48: ; preds = %45
%49 = load float, float* %11
%50 = load float, float* %10
%51 = fmul float %50, %49
store float %51, float* %10
br label %56
52: ; preds = %45
%53 = load float, float* %11
%54 = load float, float* %10
%55 = fdiv float %54, %53
store float %55, float* %10
br label %56
56: ; preds = %52, %48
br label %25
57: ; preds = %44, %30, %23
%58 = load float, float* %5
ret float %58
}

LLVM IR (-O2):
define float @execTerm(i8** %0, i8* %1, float %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = bitcast i8** %5 to i8*
%8 = bitcast i32* %6 to i8*
%9 = tail call float @execFactor(i8** %0, i8* %1, float %2, i8* %3)
%10 = load i8, i8* %3
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %32
12: ; preds = %4, %30
%13 = phi float [ %31, %30 ], [ %9, %4 ]
%14 = call i32 @nextToken(i8** %0, i8** %5, i32* %6)
switch i32 %14, label %15 [
i32 102, label %18
i32 103, label %22
]
15: ; preds = %12
%16 = load i32, i32* %6
%17 = call i32 @pushBack(i8** %0, i32 %16)
br label %32
18: ; preds = %12
%19 = call float @execFactor(i8** %0, i8* %1, float %2, i8* %3)
%20 = load i8, i8* %3
%21 = icmp eq i8 %20, 0
br i1 %21, label %26, label %32
22: ; preds = %12
%23 = call float @execFactor(i8** %0, i8* %1, float %2, i8* %3)
%24 = load i8, i8* %3
%25 = icmp eq i8 %24, 0
br i1 %25, label %28, label %32
26: ; preds = %18
%27 = fmul float %13, %19
br label %30
28: ; preds = %22
%29 = fdiv float %13, %23
br label %30
30: ; preds = %28, %26
%31 = phi float [ %27, %26 ], [ %29, %28 ]
br label %12
32: ; preds = %22, %18, %4, %15
%33 = phi float [ %13, %15 ], [ 0.000000e+00, %4 ], [ 0.000000e+00, %18 ], [ 0.000000e+00, %22 ]
ret float %33
}