#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 */
scalar_t__ luaA_passresults();
char *luaL_check_lstr(int, long *);
int /*<<< orphan*/ luaL_opt_lstr(int, char *, int /*<<< orphan*/ *);
scalar_t__ lua_dobuffer(char *, long, int /*<<< orphan*/);
int /*<<< orphan*/ lua_error(char *);
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/ *, int /*<<< orphan*/);
void luaB_dostring(void) {
  long l;
  char *s = luaL_check_lstr(1, &l);
  if (*s == 27)
    lua_error("`dostring' cannot run pre-compiled code");
  if (lua_dobuffer(s, l, (luaL_opt_lstr((2), (s), NULL))) == 0)
    if (luaA_passresults() == 0)
      lua_pushusertag(NULL, 0);
}


x86 assembly (clang, -O0):
<luaB_dostring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
call   1080 <luaL_check_lstr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x1b,%eax
jne    1196 <luaB_dostring+0x36>
lea    0xe6f(%rip),%rdi
call   1060 <lua_error@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    $0x2,%edi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <luaL_opt_lstr@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1050 <lua_dobuffer@plt>
cmp    $0x0,%rax
jne    11f2 <luaB_dostring+0x92>
mov    $0x0,%al
call   1070 <luaA_passresults@plt>
cmp    $0x0,%rax
jne    11ed <luaB_dostring+0x8d>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <lua_pushusertag@plt>
jmp    11f2 <luaB_dostring+0x92>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<luaB_dostring>:
push   %r14
push   %rbx
push   %rax
mov    %rsp,%rsi
mov    $0x1,%edi
call   1080 <luaL_check_lstr@plt>
mov    %rax,%rbx
cmpb   $0x1b,(%rax)
jne    1185 <luaB_dostring+0x25>
lea    0xe80(%rip),%rdi
call   1060 <lua_error@plt>
mov    (%rsp),%r14
mov    $0x2,%edi
mov    %rbx,%rsi
xor    %edx,%edx
call   1040 <luaL_opt_lstr@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %eax,%edx
call   1050 <lua_dobuffer@plt>
test   %rax,%rax
jne    11bf <luaB_dostring+0x5f>
xor    %eax,%eax
call   1070 <luaA_passresults@plt>
test   %rax,%rax
jne    11bf <luaB_dostring+0x5f>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <lua_pushusertag@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [40 x i8] c"`dostring' cannot run pre-compiled code\00"
define void @luaB_dostring() {
%1 = alloca i64
%2 = alloca i8*
%3 = call i8* @luaL_check_lstr(i32 1, i64* %1)
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = icmp eq i32 %6, 27
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %0
%11 = load i8*, i8** %2
%12 = load i64, i64* %1
%13 = load i8*, i8** %2
%14 = call i32 @luaL_opt_lstr(i32 2, i8* %13, i32* null)
%15 = call i64 @lua_dobuffer(i8* %11, i64 %12, i32 %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %23
17: ; preds = %10
%18 = call i64 (...) @luaA_passresults()
%19 = icmp eq i64 %18, 0
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 @lua_pushusertag(i32* null, i32 0)
br label %22
22: ; preds = %20, %17
br label %23
23: ; preds = %22, %10
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"`dostring' cannot run pre-compiled code\00"
define void @luaB_dostring() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i8* @luaL_check_lstr(i32 1, i64* %1)
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 27
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @lua_error(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %0
%9 = load i64, i64* %1
%10 = call i32 @luaL_opt_lstr(i32 2, i8* %3, i32* null)
%11 = call i64 @lua_dobuffer(i8* %3, i64 %9, i32 %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %8
%14 = call i64 (...) @luaA_passresults()
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 @lua_pushusertag(i32* null, i32 0)
br label %18
18: ; preds = %13, %16, %8
ret void
}