#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, int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ lua_dobuffer(char *, long, int /*<<< orphan*/);
int /*<<< orphan*/ lua_error(char *);
int /*<<< orphan*/ lua_pushusertag(int /*<<< orphan*/, int /*<<< orphan*/);
void internaldostring(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), (0), 0))) == 0)
    if (luaA_passresults() == 0)
      lua_pushusertag(0, 0);
}


x86 assembly (clang, -O0):
<internaldostring>:
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 <internaldostring+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    $0x2,%edi
xor    %edx,%edx
mov    %edx,%esi
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    11ec <internaldostring+0x8c>
mov    $0x0,%al
call   1070 <luaA_passresults@plt>
cmp    $0x0,%rax
jne    11e7 <internaldostring+0x87>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <lua_pushusertag@plt>
jmp    11ec <internaldostring+0x8c>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<internaldostring>:
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 <internaldostring+0x25>
lea    0xe80(%rip),%rdi
call   1060 <lua_error@plt>
mov    (%rsp),%r14
mov    $0x2,%edi
xor    %esi,%esi
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    11be <internaldostring+0x5e>
xor    %eax,%eax
call   1070 <luaA_passresults@plt>
test   %rax,%rax
jne    11be <internaldostring+0x5e>
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 @internaldostring() {
%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 = call i32 @luaL_opt_lstr(i32 2, i32 0, i32 0)
%14 = call i64 @lua_dobuffer(i8* %11, i64 %12, i32 %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %22
16: ; preds = %10
%17 = call i64 (...) @luaA_passresults()
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @lua_pushusertag(i32 0, i32 0)
br label %21
21: ; preds = %19, %16
br label %22
22: ; preds = %21, %10
ret void
}

LLVM IR (-O2):
@.str = [40 x i8] c"`dostring' cannot run pre-compiled code\00"
define void @internaldostring() {
%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, i32 0, i32 0)
%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 0, i32 0)
br label %18
18: ; preds = %13, %16, %8
ret void
}