#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 EXIT_SUCCESS;
int eval(char, int, int);
int /*<<< orphan*/ initialize_op();
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  initialize_op();
  printf("100+20=%d\n", eval('+', 100, 20));
  printf("100-20=%d\n", eval('-', 100, 20));
  printf("100*20=%d\n", eval('*', 100, 20));
  printf("100/20=%d\n", eval('/', 100, 20));
  printf("100/ 0=%d\n", eval('/', 100, 0));
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <initialize_op@plt>
mov    $0x2b,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
mov    %eax,%esi
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
mov    %eax,%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2a,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
mov    %eax,%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2f,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
mov    %eax,%esi
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    $0x2f,%edi
mov    $0x64,%esi
xor    %edx,%edx
call   1050 <eval@plt>
mov    %eax,%esi
lea    0xe44(%rip),%rdi
call   1030 <printf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <initialize_op@plt>
mov    $0x2b,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
lea    0xead(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2d,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
lea    0xe96(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2a,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2f,%edi
mov    $0x64,%esi
mov    $0x14,%edx
call   1050 <eval@plt>
lea    0xe68(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x2f,%edi
mov    $0x64,%esi
xor    %edx,%edx
call   1050 <eval@plt>
lea    0xe54(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    0x2dfa(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"100+20=%d\0A\00"
@.str.1 = [11 x i8] c"100-20=%d\0A\00"
@.str.2 = [11 x i8] c"100*20=%d\0A\00"
@.str.3 = [11 x i8] c"100/20=%d\0A\00"
@.str.4 = [11 x i8] c"100/ 0=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @initialize_op()
%3 = call i32 @eval(i8 signext 43, i32 100, i32 20)
%4 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @eval(i8 signext 45, i32 100, i32 20)
%6 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = call i32 @eval(i8 signext 42, i32 100, i32 20)
%8 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 @eval(i8 signext 47, i32 100, i32 20)
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = call i32 @eval(i8 signext 47, i32 100, i32 0)
%12 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"100+20=%d\0A\00"
@.str.1 = [11 x i8] c"100-20=%d\0A\00"
@.str.2 = [11 x i8] c"100*20=%d\0A\00"
@.str.3 = [11 x i8] c"100/20=%d\0A\00"
@.str.4 = [11 x i8] c"100/ 0=%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @initialize_op()
%2 = tail call i32 @eval(i8 signext 43, i32 100, i32 20)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @eval(i8 signext 45, i32 100, i32 20)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 @eval(i8 signext 42, i32 100, i32 20)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 @eval(i8 signext 47, i32 100, i32 20)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = tail call i32 @eval(i8 signext 47, i32 100, i32 0)
%11 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 %10)
%12 = load i32, i32* @EXIT_SUCCESS
ret i32 %12
}