#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 rqlStatement {
  int dummy;
};
struct lineFile {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ cloneString(char *);
int /*<<< orphan*/ lineFileClose(struct lineFile **);
struct lineFile *lineFileOnString(char *, int, int /*<<< orphan*/);
struct rqlStatement *rqlStatementParse(struct lineFile *);
struct rqlStatement *rqlStatementParseString(char *string) {
  struct lineFile *lf = lineFileOnString("query", 1, cloneString(string));
  struct rqlStatement *rql = rqlStatementParse(lf);
  lineFileClose(&lf);
  return rql;
}


x86 assembly (clang, -O0):
<rqlStatementParseString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <cloneString@plt>
mov    %eax,%edx
lea    0xea2(%rip),%rdi
mov    $0x1,%esi
call   1050 <lineFileOnString@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <rqlStatementParse@plt>
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
call   1040 <lineFileClose@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rqlStatementParseString>:
push   %rbx
sub    $0x10,%rsp
call   1060 <cloneString@plt>
lea    0xeaf(%rip),%rdi
mov    $0x1,%esi
mov    %eax,%edx
call   1050 <lineFileOnString@plt>
mov    %rax,0x8(%rsp)
mov    %rax,%rdi
call   1030 <rqlStatementParse@plt>
mov    %rax,%rbx
lea    0x8(%rsp),%rdi
call   1040 <lineFileClose@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.rqlStatement = type { i32 }
%struct.lineFile = type { i32 }
@.str = [6 x i8] c"query\00"
define %struct.rqlStatement* @rqlStatementParseString(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.lineFile*
%4 = alloca %struct.rqlStatement*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @cloneString(i8* %5)
%7 = call %struct.lineFile* @lineFileOnString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1, i32 %6)
store %struct.lineFile* %7, %struct.lineFile** %3
%8 = load %struct.lineFile*, %struct.lineFile** %3
%9 = call %struct.rqlStatement* @rqlStatementParse(%struct.lineFile* %8)
store %struct.rqlStatement* %9, %struct.rqlStatement** %4
%10 = call i32 @lineFileClose(%struct.lineFile** %3)
%11 = load %struct.rqlStatement*, %struct.rqlStatement** %4
ret %struct.rqlStatement* %11
}

LLVM IR (-O2):
%struct.rqlStatement = type { i32 }
%struct.lineFile = type { i32 }
@.str = [6 x i8] c"query\00"
define %struct.rqlStatement* @rqlStatementParseString(i8* %0) {
%2 = alloca %struct.lineFile*
%3 = bitcast %struct.lineFile** %2 to i8*
%4 = tail call i32 @cloneString(i8* %0)
%5 = tail call %struct.lineFile* @lineFileOnString(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 1, i32 %4)
store %struct.lineFile* %5, %struct.lineFile** %2
%6 = tail call %struct.rqlStatement* @rqlStatementParse(%struct.lineFile* %5)
%7 = call i32 @lineFileClose(%struct.lineFile** %2)
ret %struct.rqlStatement* %6
}