#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 /*<<< orphan*/ test_expression(char *, int);
int test_many_expressions() {
  if (!test_expression("10", 10))
    return 0;
  if (!test_expression("6 4 +", 10))
    return 0;
  if (!test_expression("6 4 + 10 *", 100))
    return 0;
  if (!test_expression("6 4 + 10 * 1 -", 99))
    return 0;
  if (!test_expression("1 1 + 1 + 1 1 1 + + +", 6))
    return 0;
  return 1;
}


x86 assembly (clang, -O0):
<test_many_expressions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0xa,%esi
call   1030 <test_expression@plt>
cmp    $0x0,%eax
jne    113e <test_many_expressions+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_many_expressions+0xcd>
lea    0xebe(%rip),%rdi
mov    $0xa,%esi
call   1030 <test_expression@plt>
cmp    $0x0,%eax
jne    1164 <test_many_expressions+0x54>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_many_expressions+0xcd>
lea    0xe9e(%rip),%rdi
mov    $0x64,%esi
call   1030 <test_expression@plt>
cmp    $0x0,%eax
jne    118a <test_many_expressions+0x7a>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_many_expressions+0xcd>
lea    0xe83(%rip),%rdi
mov    $0x63,%esi
call   1030 <test_expression@plt>
cmp    $0x0,%eax
jne    11b0 <test_many_expressions+0xa0>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_many_expressions+0xcd>
lea    0xe6c(%rip),%rdi
mov    $0x6,%esi
call   1030 <test_expression@plt>
cmp    $0x0,%eax
jne    11d6 <test_many_expressions+0xc6>
movl   $0x0,-0x4(%rbp)
jmp    11dd <test_many_expressions+0xcd>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_many_expressions>:
push   %rbx
lea    0xee8(%rip),%rdi
mov    $0xa,%esi
call   1030 <test_expression@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     117f <test_many_expressions+0x6f>
lea    0xed4(%rip),%rdi
mov    $0xa,%esi
call   1030 <test_expression@plt>
test   %eax,%eax
je     117f <test_many_expressions+0x6f>
lea    0xec5(%rip),%rdi
mov    $0x64,%esi
call   1030 <test_expression@plt>
test   %eax,%eax
je     117f <test_many_expressions+0x6f>
lea    0xebb(%rip),%rdi
mov    $0x63,%esi
call   1030 <test_expression@plt>
test   %eax,%eax
je     117f <test_many_expressions+0x6f>
lea    0xeb5(%rip),%rdi
mov    $0x6,%esi
call   1030 <test_expression@plt>
xor    %ebx,%ebx
test   %eax,%eax
setne  %bl
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"10\00"
@.str.1 = [6 x i8] c"6 4 +\00"
@.str.2 = [11 x i8] c"6 4 + 10 *\00"
@.str.3 = [15 x i8] c"6 4 + 10 * 1 -\00"
@.str.4 = [22 x i8] c"1 1 + 1 + 1 1 1 + + +\00"
define i32 @test_many_expressions() {
%1 = alloca i32
%2 = call i32 @test_expression(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
%3 = icmp ne i32 %2, 0
br i1 %3, label %5, label %4
4: ; preds = %0
store i32 0, i32* %1
br label %22
5: ; preds = %0
%6 = call i32 @test_expression(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5
store i32 0, i32* %1
br label %22
9: ; preds = %5
%10 = call i32 @test_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100)
%11 = icmp ne i32 %10, 0
br i1 %11, label %13, label %12
12: ; preds = %9
store i32 0, i32* %1
br label %22
13: ; preds = %9
%14 = call i32 @test_expression(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 99)
%15 = icmp ne i32 %14, 0
br i1 %15, label %17, label %16
16: ; preds = %13
store i32 0, i32* %1
br label %22
17: ; preds = %13
%18 = call i32 @test_expression(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 6)
%19 = icmp ne i32 %18, 0
br i1 %19, label %21, label %20
20: ; preds = %17
store i32 0, i32* %1
br label %22
21: ; preds = %17
store i32 1, i32* %1
br label %22
22: ; preds = %21, %20, %16, %12, %8, %4
%23 = load i32, i32* %1
ret i32 %23
}

LLVM IR (-O2):
@.str = [3 x i8] c"10\00"
@.str.1 = [6 x i8] c"6 4 +\00"
@.str.2 = [11 x i8] c"6 4 + 10 *\00"
@.str.3 = [15 x i8] c"6 4 + 10 * 1 -\00"
@.str.4 = [22 x i8] c"1 1 + 1 + 1 1 1 + + +\00"
define i32 @test_many_expressions() {
%1 = tail call i32 @test_expression(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 10)
%2 = icmp eq i32 %1, 0
br i1 %2, label %16, label %3
3: ; preds = %0
%4 = tail call i32 @test_expression(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 10)
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3
%7 = tail call i32 @test_expression(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 100)
%8 = icmp eq i32 %7, 0
br i1 %8, label %16, label %9
9: ; preds = %6
%10 = tail call i32 @test_expression(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i32 99)
%11 = icmp eq i32 %10, 0
br i1 %11, label %16, label %12
12: ; preds = %9
%13 = tail call i32 @test_expression(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 6)
%14 = icmp ne i32 %13, 0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %12, %9, %6, %3, %0
%17 = phi i32 [ 0, %0 ], [ 0, %3 ], [ 0, %6 ], [ 0, %9 ], [ %15, %12 ]
ret i32 %17
}