#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 */
int issep(char *);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ tokenise(char *);
int main() {
  char *test1 = " ";
  char *test2 = ",";
  char *test3 = "*";
  printf("Result: %d \n", issep(test1));
  printf("Result: %d \n", issep(test2));
  printf("Result: %d \n", issep(test3));
  char *foo =
      "select _col1, col2, colC from test      where city = \"Auckland\" ;";
  tokenise(foo);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
lea    0xeb1(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xea8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <issep@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <issep@plt>
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <issep@plt>
mov    %eax,%esi
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
lea    0xe67(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <tokenise@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1050 <issep@plt>
lea    0xec2(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
call   1050 <issep@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1050 <issep@plt>
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
call   1040 <tokenise@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [13 x i8] c"Result: %d \0A\00"
@.str.4 = [66 x i8] c"select _col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8** %3
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8** %4
%6 = load i8*, i8** %2
%7 = call i32 @issep(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %7)
%9 = load i8*, i8** %3
%10 = call i32 @issep(i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i8*, i8** %4
%13 = call i32 @issep(i8* %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %13)
store i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0), i8** %5
%15 = load i8*, i8** %5
%16 = call i32 @tokenise(i8* %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
@.str.1 = [2 x i8] c",\00"
@.str.2 = [2 x i8] c"*\00"
@.str.3 = [13 x i8] c"Result: %d \0A\00"
@.str.4 = [66 x i8] c"select _col1, col2, colC from test where city = \22Auckland\22 ;\00"
define i32 @main() {
%1 = tail call i32 @issep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %1)
%3 = tail call i32 @issep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %3)
%5 = tail call i32 @issep(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %5)
%7 = tail call i32 @tokenise(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.4, i64 0, i64 0))
ret i32 0
}