#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 /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int main() {
  printf("zing");
  printf("%s\n", "zing");
  printf("-------------------------------------------------------------\n");
  char string[100];
  sprintf(string, "--- %s ---\n", "test");
  printf("%s\n", string);
  char sql[200];
  sprintf(sql,
          "CREATE TABLE IF NOT EXISTS %s("
          "ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,"
          "CONTENT           TEXT    NOT NULL,"
          "LEVEL            INT     NOT NULL,"
          "RESULT            INT     NOT NULL,"
          "CREATE_TIME      INTEGER NOT NULL);",
          "zing");
  printf(sql);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    0xeb2(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    0xeda(%rip),%rsi
lea    0xedf(%rip),%rdx
call   1040 <sprintf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x140(%rbp),%rdi
lea    0xebf(%rip),%rsi
lea    0xe5f(%rip),%rdx
call   1040 <sprintf@plt>
lea    -0x140(%rbp),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x138,%rsp
lea    0xebf(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
lea    0xf94(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rsi
lea    0xea4(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xe8f(%rip),%rsi
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14,%rdx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [5 x i8] c"zing\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [63 x i8] c"-------------------------------------------------------------\0A\00"
@.str.3 = [12 x i8] c"--- %s ---\0A\00"
@.str.4 = [5 x i8] c"test\00"
@.str.5 = [216 x i8] c"CREATE TABLE IF NOT EXISTS %s(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,CONTENT TEXT NOT NULL,LEVEL INT NOT NULL,RESULT INT NOT NULL,CREATE_TIME INTEGER NOT NULL);\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%12 = call i32 @sprintf(i8* %11, i8* getelementptr inbounds ([216 x i8], [216 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* %13)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"zing\00"
@.str.3 = [12 x i8] c"--- %s ---\0A\00"
@.str.4 = [5 x i8] c"test\00"
@.str.5 = [216 x i8] c"CREATE TABLE IF NOT EXISTS %s(ID INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,CONTENT TEXT NOT NULL,LEVEL INT NOT NULL,RESULT INT NOT NULL,CREATE_TIME INTEGER NOT NULL);\00"
@str = [62 x i8] c"-------------------------------------------------------------\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @str, i64 0, i64 0))
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%7 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%8 = call i32 @puts(i8* %6)
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%10 = call i32 @sprintf(i8* %9, i8* dereferenceable(1) getelementptr inbounds ([216 x i8], [216 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* %9)
ret i32 0
}