#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 */
typedef int /*<<< orphan*/ MYSQL;

/* Variables and functions */
int mysql_errno(int /*<<< orphan*/ *);
char *mysql_error(int /*<<< orphan*/ *);
scalar_t__ mysql_query(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void dropTable(MYSQL *connection, char *tableName) {
  char query[200];
  sprintf(query, "DROP TABLE benchmark.%s", tableName);
  if (mysql_query(connection, query)) {
    printf("dropTable::Error %u: %s\n", mysql_errno(connection),
           mysql_error(connection));
  }
}


x86 assembly (clang, -O0):
<dropTable>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe8b(%rip),%rsi
call   1070 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <mysql_query@plt>
cmp    $0x0,%rax
je     11c1 <dropTable+0x71>
mov    -0x8(%rbp),%rdi
call   1050 <mysql_errno@plt>
mov    %eax,-0xe4(%rbp)
mov    -0x8(%rbp),%rdi
call   1060 <mysql_error@plt>
mov    -0xe4(%rbp),%esi
mov    %rax,%rdx
lea    0xe5c(%rip),%rdi
call   1040 <printf@plt>
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dropTable>:
push   %rbp
push   %r14
push   %rbx
sub    $0xd0,%rsp
mov    %rsi,%rdx
mov    %rdi,%rbx
lea    0xe98(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1070 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <mysql_query@plt>
test   %rax,%rax
je     11a6 <dropTable+0x56>
mov    %rbx,%rdi
call   1050 <mysql_errno@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1060 <mysql_error@plt>
lea    0xe7c(%rip),%rdi
mov    %ebp,%esi
mov    %rax,%rdx
call   1040 <printf@plt>
add    $0xd0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"DROP TABLE benchmark.%s\00"
@.str.1 = [25 x i8] c"dropTable::Error %u: %s\0A\00"
define void @dropTable(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca [200 x i8]
store i32* %0, i32** %3
store i8* %1, i8** %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %4
%8 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = load i32*, i32** %3
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i64 @mysql_query(i32* %9, i8* %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %2
%14 = load i32*, i32** %3
%15 = call i32 @mysql_errno(i32* %14)
%16 = load i32*, i32** %3
%17 = call i8* @mysql_error(i32* %16)
%18 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %15, i8* %17)
br label %19
19: ; preds = %13, %2
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"DROP TABLE benchmark.%s\00"
@.str.1 = [25 x i8] c"dropTable::Error %u: %s\0A\00"
define void @dropTable(i32* %0, i8* %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %1)
%6 = call i64 @mysql_query(i32* %0, i8* %4)
%7 = icmp eq i64 %6, 0
br i1 %7, label %12, label %8
8: ; preds = %2
%9 = call i32 @mysql_errno(i32* %0)
%10 = call i8* @mysql_error(i32* %0)
%11 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %9, i8* %10)
br label %12
12: ; preds = %8, %2
ret void
}