#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 */
struct stack_t {
  int dummy;
};
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *appendLetStatement(struct memorycontainer *,
                                           struct memorycontainer *);
struct memorycontainer *appendNativeCallFunctionStatement(char *,
                                                          struct stack_t *,
                                                          int /*<<< orphan*/ *);
struct memorycontainer *cloneMemory(struct memorycontainer *);
struct memorycontainer *createExpression(unsigned char,
                                         struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *createIntegerExpression(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, unsigned char);
struct stack_t *getNewStack();
int /*<<< orphan*/ pushExpression(struct stack_t *, struct memorycontainer *);
int /*<<< orphan*/ stderr;
struct memorycontainer *
appendLetWithOperatorStatement(struct memorycontainer *identifier,
                               struct memorycontainer *expressionContainer,
                               unsigned char operator) {
  unsigned char token = 0;
  if (operator== 0) {
    token = 0x0A;
  } else if (operator== 1) {
    token = 0x0B;
  } else if (operator== 2) {
    token = 0x0C;
  } else if (operator== 3 || operator== 6) {
    token = 0x0D;
  } else if (operator== 4) {
    token = 0x0E;
  } else if (operator== 5) {
    token = 0x19;
  } else {
    fprintf(stderr, "Can not find operator with id of %c\n", operator);
  }
  struct memorycontainer *identifier_clone = cloneMemory(identifier);
  struct memorycontainer *rhs =
      createExpression(token, identifier, expressionContainer);
  if (operator== 6) {
    struct memorycontainer *mathCommand = createIntegerExpression(10);
    struct stack_t *argStack = getNewStack();
    pushExpression(argStack, mathCommand);
    pushExpression(argStack, rhs);
    rhs = appendNativeCallFunctionStatement("rtl_math", argStack, NULL);
  }
  return appendLetStatement(identifier_clone, rhs);
}


x86 assembly (clang, -O0):
<appendLetWithOperatorStatement>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
movb   $0x0,-0x12(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x0,%eax
jne    11af <appendLetWithOperatorStatement+0x2f>
movb   $0xa,-0x12(%rbp)
jmp    125c <appendLetWithOperatorStatement+0xdc>
movzbl -0x11(%rbp),%eax
cmp    $0x1,%eax
jne    11c5 <appendLetWithOperatorStatement+0x45>
movb   $0xb,-0x12(%rbp)
jmp    1257 <appendLetWithOperatorStatement+0xd7>
movzbl -0x11(%rbp),%eax
cmp    $0x2,%eax
jne    11db <appendLetWithOperatorStatement+0x5b>
movb   $0xc,-0x12(%rbp)
jmp    1252 <appendLetWithOperatorStatement+0xd2>
movzbl -0x11(%rbp),%eax
cmp    $0x3,%eax
je     11f5 <appendLetWithOperatorStatement+0x75>
movzbl -0x11(%rbp),%eax
cmp    $0x6,%eax
jne    11fe <appendLetWithOperatorStatement+0x7e>
movb   $0xd,-0x12(%rbp)
jmp    124d <appendLetWithOperatorStatement+0xcd>
movzbl -0x11(%rbp),%eax
cmp    $0x4,%eax
jne    1214 <appendLetWithOperatorStatement+0x94>
movb   $0xe,-0x12(%rbp)
jmp    1248 <appendLetWithOperatorStatement+0xc8>
movzbl -0x11(%rbp),%eax
cmp    $0x5,%eax
jne    122a <appendLetWithOperatorStatement+0xaa>
movb   $0x19,-0x12(%rbp)
jmp    1243 <appendLetWithOperatorStatement+0xc3>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdc6(%rip),%rsi
movzbl -0x11(%rbp),%edx
call   1040 <fprintf@plt>
jmp    1248 <appendLetWithOperatorStatement+0xc8>
jmp    124d <appendLetWithOperatorStatement+0xcd>
jmp    1252 <appendLetWithOperatorStatement+0xd2>
jmp    1257 <appendLetWithOperatorStatement+0xd7>
jmp    125c <appendLetWithOperatorStatement+0xdc>
mov    -0x8(%rbp),%rdi
call   1060 <cloneMemory@plt>
mov    %rax,-0x20(%rbp)
mov    -0x12(%rbp),%al
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movzbl %al,%edi
call   1030 <createExpression@plt>
mov    %rax,-0x28(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x6,%eax
jne    12d8 <appendLetWithOperatorStatement+0x158>
mov    $0xa,%edi
call   1050 <createIntegerExpression@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   10a0 <getNewStack@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1080 <pushExpression@plt>
mov    -0x38(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1080 <pushExpression@plt>
mov    -0x38(%rbp),%rsi
lea    0xd5a(%rip),%rdi
xor    %eax,%eax
mov    %eax,%edx
call   1090 <appendNativeCallFunctionStatement@plt>
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1070 <appendLetStatement@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<appendLetWithOperatorStatement>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%r12
cmp    $0x7,%bpl
jae    11ac <appendLetWithOperatorStatement+0x2c>
movzbl %bpl,%ecx
shl    $0x3,%ecx
movabs $0xd190e0d0c0b0a,%rbx
shr    %cl,%rbx
jmp    11c7 <appendLetWithOperatorStatement+0x47>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
movzbl %bpl,%edx
lea    0xe40(%rip),%rsi
call   1040 <fprintf@plt>
xor    %ebx,%ebx
mov    %r12,%rdi
call   1060 <cloneMemory@plt>
mov    %rax,%r14
movzbl %bl,%edi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <createExpression@plt>
mov    %rax,%rbx
cmp    $0x6,%bpl
jne    122a <appendLetWithOperatorStatement+0xaa>
mov    $0xa,%edi
call   1050 <createIntegerExpression@plt>
mov    %rax,%r15
xor    %eax,%eax
call   10a0 <getNewStack@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r15,%rsi
call   1080 <pushExpression@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <pushExpression@plt>
lea    0xe08(%rip),%rdi
mov    %rbp,%rsi
xor    %edx,%edx
call   1090 <appendNativeCallFunctionStatement@plt>
mov    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <appendLetStatement@plt>

LLVM IR (-O0):
%struct.memorycontainer = type { i32 }
%struct.stack_t = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Can not find operator with id of %c\0A\00"
@.str.1 = [9 x i8] c"rtl_math\00"
define %struct.memorycontainer* @appendLetWithOperatorStatement(%struct.memorycontainer* %0, %struct.memorycontainer* %1, i8 zeroext %2) {
%4 = alloca %struct.memorycontainer*
%5 = alloca %struct.memorycontainer*
%6 = alloca i8
%7 = alloca i8
%8 = alloca %struct.memorycontainer*
%9 = alloca %struct.memorycontainer*
%10 = alloca %struct.memorycontainer*
%11 = alloca %struct.stack_t*
store %struct.memorycontainer* %0, %struct.memorycontainer** %4
store %struct.memorycontainer* %1, %struct.memorycontainer** %5
store i8 %2, i8* %6
store i8 0, i8* %7
%12 = load i8, i8* %6
%13 = zext i8 %12 to i32
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %3
store i8 10, i8* %7
br label %54
16: ; preds = %3
%17 = load i8, i8* %6
%18 = zext i8 %17 to i32
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %16
store i8 11, i8* %7
br label %53
21: ; preds = %16
%22 = load i8, i8* %6
%23 = zext i8 %22 to i32
%24 = icmp eq i32 %23, 2
br i1 %24, label %25, label %26
25: ; preds = %21
store i8 12, i8* %7
br label %52
26: ; preds = %21
%27 = load i8, i8* %6
%28 = zext i8 %27 to i32
%29 = icmp eq i32 %28, 3
br i1 %29, label %34, label %30
30: ; preds = %26
%31 = load i8, i8* %6
%32 = zext i8 %31 to i32
%33 = icmp eq i32 %32, 6
br i1 %33, label %34, label %35
34: ; preds = %30, %26
store i8 13, i8* %7
br label %51
35: ; preds = %30
%36 = load i8, i8* %6
%37 = zext i8 %36 to i32
%38 = icmp eq i32 %37, 4
br i1 %38, label %39, label %40
39: ; preds = %35
store i8 14, i8* %7
br label %50
40: ; preds = %35
%41 = load i8, i8* %6
%42 = zext i8 %41 to i32
%43 = icmp eq i32 %42, 5
br i1 %43, label %44, label %45
44: ; preds = %40
store i8 25, i8* %7
br label %49
45: ; preds = %40
%46 = load i32, i32* @stderr
%47 = load i8, i8* %6
%48 = call i32 @fprintf(i32 %46, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 zeroext %47)
br label %49
49: ; preds = %45, %44
br label %50
50: ; preds = %49, %39
br label %51
51: ; preds = %50, %34
br label %52
52: ; preds = %51, %25
br label %53
53: ; preds = %52, %20
br label %54
54: ; preds = %53, %15
%55 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%56 = call %struct.memorycontainer* @cloneMemory(%struct.memorycontainer* %55)
store %struct.memorycontainer* %56, %struct.memorycontainer** %8
%57 = load i8, i8* %7
%58 = load %struct.memorycontainer*, %struct.memorycontainer** %4
%59 = load %struct.memorycontainer*, %struct.memorycontainer** %5
%60 = call %struct.memorycontainer* @createExpression(i8 zeroext %57, %struct.memorycontainer* %58, %struct.memorycontainer* %59)
store %struct.memorycontainer* %60, %struct.memorycontainer** %9
%61 = load i8, i8* %6
%62 = zext i8 %61 to i32
%63 = icmp eq i32 %62, 6
br i1 %63, label %64, label %75
64: ; preds = %54
%65 = call %struct.memorycontainer* @createIntegerExpression(i32 10)
store %struct.memorycontainer* %65, %struct.memorycontainer** %10
%66 = call %struct.stack_t* (...) @getNewStack()
store %struct.stack_t* %66, %struct.stack_t** %11
%67 = load %struct.stack_t*, %struct.stack_t** %11
%68 = load %struct.memorycontainer*, %struct.memorycontainer** %10
%69 = call i32 @pushExpression(%struct.stack_t* %67, %struct.memorycontainer* %68)
%70 = load %struct.stack_t*, %struct.stack_t** %11
%71 = load %struct.memorycontainer*, %struct.memorycontainer** %9
%72 = call i32 @pushExpression(%struct.stack_t* %70, %struct.memorycontainer* %71)
%73 = load %struct.stack_t*, %struct.stack_t** %11
%74 = call %struct.memorycontainer* @appendNativeCallFunctionStatement(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %struct.stack_t* %73, i32* null)
store %struct.memorycontainer* %74, %struct.memorycontainer** %9
br label %75
75: ; preds = %64, %54
%76 = load %struct.memorycontainer*, %struct.memorycontainer** %8
%77 = load %struct.memorycontainer*, %struct.memorycontainer** %9
%78 = call %struct.memorycontainer* @appendLetStatement(%struct.memorycontainer* %76, %struct.memorycontainer* %77)
ret %struct.memorycontainer* %78
}

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
%struct.stack_t = type { i32 }
@stderr = global i32 0
@.str = [37 x i8] c"Can not find operator with id of %c\0A\00"
@.str.1 = [9 x i8] c"rtl_math\00"
define %struct.memorycontainer* @appendLetWithOperatorStatement(%struct.memorycontainer* %0, %struct.memorycontainer* %1, i8 zeroext %2) {
%4 = icmp ult i8 %2, 7
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i8 zeroext %2)
br label %13
8: ; preds = %3
%9 = zext i8 %2 to i56
%10 = shl nuw nsw i56 %9, 3
%11 = lshr i56 3686722836368138, %10
%12 = trunc i56 %11 to i8
br label %13
13: ; preds = %8, %5
%14 = phi i8 [ 0, %5 ], [ %12, %8 ]
%15 = tail call %struct.memorycontainer* @cloneMemory(%struct.memorycontainer* %0)
%16 = tail call %struct.memorycontainer* @createExpression(i8 zeroext %14, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
%17 = icmp eq i8 %2, 6
br i1 %17, label %18, label %24
18: ; preds = %13
%19 = tail call %struct.memorycontainer* @createIntegerExpression(i32 10)
%20 = tail call %struct.stack_t* (...) @getNewStack()
%21 = tail call i32 @pushExpression(%struct.stack_t* %20, %struct.memorycontainer* %19)
%22 = tail call i32 @pushExpression(%struct.stack_t* %20, %struct.memorycontainer* %16)
%23 = tail call %struct.memorycontainer* @appendNativeCallFunctionStatement(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), %struct.stack_t* %20, i32* null)
br label %24
24: ; preds = %18, %13
%25 = phi %struct.memorycontainer* [ %23, %18 ], [ %16, %13 ]
%26 = tail call %struct.memorycontainer* @appendLetStatement(%struct.memorycontainer* %15, %struct.memorycontainer* %25)
ret %struct.memorycontainer* %26
}