#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
char *lang_eval_doCall_string(int /*<<< orphan*/ *);
char *lang_eval_parse_string(int /*<<< orphan*/ *);
int lang_findToken(int /*<<< orphan*/ *);
char *lang_getString(int /*<<< orphan*/);
int /*<<< orphan*/ lang_getVarName(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int);
char *lang_eval_stmt_string(FILE *lang_in) {
  int tok;
  tok = lang_findToken(lang_in);
  if (tok == 18) {
    return lang_eval_parse_string(lang_in);
  } else if (tok == 5) {
    return lang_getString(lang_getVarName(lang_in));
  } else if (tok == 7) {
    return lang_eval_doCall_string(lang_in);
  } else {
    printf("Unexpected token: %d\n", tok);
    return NULL;
  }
  return NULL;
}


x86 assembly (clang, -O0):
<lang_eval_stmt_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1070 <lang_findToken@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x12,-0x14(%rbp)
jne    1194 <lang_eval_stmt_string+0x34>
mov    -0x10(%rbp),%rdi
call   1030 <lang_eval_parse_string@plt>
mov    %rax,-0x8(%rbp)
jmp    11ea <lang_eval_stmt_string+0x8a>
cmpl   $0x5,-0x14(%rbp)
jne    11b7 <lang_eval_stmt_string+0x57>
mov    -0x10(%rbp),%rdi
call   1080 <lang_getVarName@plt>
mov    %eax,%edi
call   1040 <lang_getString@plt>
mov    %rax,-0x8(%rbp)
jmp    11ea <lang_eval_stmt_string+0x8a>
cmpl   $0x7,-0x14(%rbp)
jne    11d3 <lang_eval_stmt_string+0x73>
mov    -0x10(%rbp),%rdi
call   1060 <lang_eval_doCall_string@plt>
mov    %rax,-0x8(%rbp)
jmp    11ea <lang_eval_stmt_string+0x8a>
mov    -0x14(%rbp),%esi
lea    0xe23(%rip),%rdi
call   1050 <printf@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lang_eval_stmt_string>:
push   %rbx
mov    %rdi,%rbx
call   1070 <lang_findToken@plt>
cmp    $0x5,%eax
je     1181 <lang_eval_stmt_string+0x21>
cmp    $0x7,%eax
je     1191 <lang_eval_stmt_string+0x31>
cmp    $0x12,%eax
jne    119a <lang_eval_stmt_string+0x3a>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <lang_eval_parse_string@plt>
mov    %rbx,%rdi
call   1080 <lang_getVarName@plt>
mov    %eax,%edi
pop    %rbx
jmp    1040 <lang_getString@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <lang_eval_doCall_string@plt>
lea    0xe5f(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Unexpected token: %d\0A\00"
define i8* @lang_eval_stmt_string(i32* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @lang_findToken(i32* %5)
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 18
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32*, i32** %3
%11 = call i8* @lang_eval_parse_string(i32* %10)
store i8* %11, i8** %2
br label %28
12: ; preds = %1
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 5
br i1 %14, label %15, label %19
15: ; preds = %12
%16 = load i32*, i32** %3
%17 = call i32 @lang_getVarName(i32* %16)
%18 = call i8* @lang_getString(i32 %17)
store i8* %18, i8** %2
br label %28
19: ; preds = %12
%20 = load i32, i32* %4
%21 = icmp eq i32 %20, 7
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = load i32*, i32** %3
%24 = call i8* @lang_eval_doCall_string(i32* %23)
store i8* %24, i8** %2
br label %28
25: ; preds = %19
%26 = load i32, i32* %4
%27 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %26)
store i8* null, i8** %2
br label %28
28: ; preds = %25, %22, %15, %9
%29 = load i8*, i8** %2
ret i8* %29
}

LLVM IR (-O2):
@.str = [22 x i8] c"Unexpected token: %d\0A\00"
define i8* @lang_eval_stmt_string(i32* %0) {
%2 = tail call i32 @lang_findToken(i32* %0)
switch i32 %2, label %10 [
i32 18, label %3
i32 5, label %5
i32 7, label %8
]
3: ; preds = %1
%4 = tail call i8* @lang_eval_parse_string(i32* %0)
br label %12
5: ; preds = %1
%6 = tail call i32 @lang_getVarName(i32* %0)
%7 = tail call i8* @lang_getString(i32 %6)
br label %12
8: ; preds = %1
%9 = tail call i8* @lang_eval_doCall_string(i32* %0)
br label %12
10: ; preds = %1
%11 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %12
12: ; preds = %10, %8, %5, %3
%13 = phi i8* [ %4, %3 ], [ %7, %5 ], [ %9, %8 ], [ null, %10 ]
ret i8* %13
}