#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*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ test_assignment();
int /*<<< orphan*/ test_compile();
int /*<<< orphan*/ test_compile_inner();
int /*<<< orphan*/ test_declaration();
int /*<<< orphan*/ test_div_two_factor_term();
int /*<<< orphan*/ test_expression_add();
int /*<<< orphan*/ test_expression_subtract();
int /*<<< orphan*/ test_factor();
int /*<<< orphan*/ test_mul_two_factor_term();
int /*<<< orphan*/ test_negative_expr();
int /*<<< orphan*/ test_paren_factor();
int /*<<< orphan*/ test_term_simple();
int main(int argc, char *argv[]) {
  if (argc > 1) {
    fprintf(stderr, "%s takes no arguments\n", argv[0]);
    return 1;
  }
  test_term_simple();
  test_expression_add();
  test_expression_subtract();
  test_factor();
  test_mul_two_factor_term();
  test_div_two_factor_term();
  test_paren_factor();
  test_negative_expr();
  test_declaration();
  test_assignment();
  test_compile_inner();
  test_compile();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jle    1218 <main+0x48>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xdf9(%rip),%rsi
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1273 <main+0xa3>
mov    $0x0,%al
call   1030 <test_term_simple@plt>
mov    $0x0,%al
call   1050 <test_expression_add@plt>
mov    $0x0,%al
call   10b0 <test_expression_subtract@plt>
mov    $0x0,%al
call   10f0 <test_factor@plt>
mov    $0x0,%al
call   1040 <test_mul_two_factor_term@plt>
mov    $0x0,%al
call   10a0 <test_div_two_factor_term@plt>
mov    $0x0,%al
call   1060 <test_paren_factor@plt>
mov    $0x0,%al
call   1080 <test_negative_expr@plt>
mov    $0x0,%al
call   10d0 <test_declaration@plt>
mov    $0x0,%al
call   10c0 <test_assignment@plt>
mov    $0x0,%al
call   1070 <test_compile_inner@plt>
mov    $0x0,%al
call   10e0 <test_compile@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x2,%edi
jl     11f5 <main+0x25>
mov    0x2e03(%rip),%rax
mov    (%rax),%edi
mov    (%rsi),%rdx
lea    0xe17(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%ebx
jmp    124b <main+0x7b>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <test_term_simple@plt>
xor    %eax,%eax
call   1050 <test_expression_add@plt>
xor    %eax,%eax
call   10b0 <test_expression_subtract@plt>
xor    %eax,%eax
call   10f0 <test_factor@plt>
xor    %eax,%eax
call   1040 <test_mul_two_factor_term@plt>
xor    %eax,%eax
call   10a0 <test_div_two_factor_term@plt>
xor    %eax,%eax
call   1060 <test_paren_factor@plt>
xor    %eax,%eax
call   1080 <test_negative_expr@plt>
xor    %eax,%eax
call   10d0 <test_declaration@plt>
xor    %eax,%eax
call   10c0 <test_assignment@plt>
xor    %eax,%eax
call   1070 <test_compile_inner@plt>
xor    %eax,%eax
call   10e0 <test_compile@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [23 x i8] c"%s takes no arguments\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i32, i32* %4
%7 = icmp sgt i32 %6, 1
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i32, i32* @stderr
%10 = load i8**, i8*** %5
%11 = getelementptr inbounds i8*, i8** %10, i64 0
%12 = load i8*, i8** %11
%13 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %12)
store i32 1, i32* %3
br label %27
14: ; preds = %2
%15 = call i32 (...) @test_term_simple()
%16 = call i32 (...) @test_expression_add()
%17 = call i32 (...) @test_expression_subtract()
%18 = call i32 (...) @test_factor()
%19 = call i32 (...) @test_mul_two_factor_term()
%20 = call i32 (...) @test_div_two_factor_term()
%21 = call i32 (...) @test_paren_factor()
%22 = call i32 (...) @test_negative_expr()
%23 = call i32 (...) @test_declaration()
%24 = call i32 (...) @test_assignment()
%25 = call i32 (...) @test_compile_inner()
%26 = call i32 (...) @test_compile()
store i32 0, i32* %3
br label %27
27: ; preds = %14, %8
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [23 x i8] c"%s takes no arguments\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %6)
br label %21
8: ; preds = %2
%9 = tail call i32 (...) @test_term_simple()
%10 = tail call i32 (...) @test_expression_add()
%11 = tail call i32 (...) @test_expression_subtract()
%12 = tail call i32 (...) @test_factor()
%13 = tail call i32 (...) @test_mul_two_factor_term()
%14 = tail call i32 (...) @test_div_two_factor_term()
%15 = tail call i32 (...) @test_paren_factor()
%16 = tail call i32 (...) @test_negative_expr()
%17 = tail call i32 (...) @test_declaration()
%18 = tail call i32 (...) @test_assignment()
%19 = tail call i32 (...) @test_compile_inner()
%20 = tail call i32 (...) @test_compile()
br label %21
21: ; preds = %8, %4
%22 = phi i32 [ 1, %4 ], [ 0, %8 ]
ret i32 %22
}