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

/* Variables and functions */
int /*<<< orphan*/ database_init_and_connect(int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ free(int /*<<< orphan*/ *);
scalar_t__ malloc(int);
int /*<<< orphan*/ mysql_close(int /*<<< orphan*/ *);
int mysql_errno(int /*<<< orphan*/ *);
char *mysql_error(int /*<<< orphan*/ *);
char **mysql_fetch_row(int /*<<< orphan*/ *);
int /*<<< orphan*/ mysql_free_result(int /*<<< orphan*/ *);
scalar_t__ mysql_real_query(int /*<<< orphan*/ *, char *, int);
int /*<<< orphan*/ *mysql_store_result(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ strlen(char *);
int main() {
  MYSQL *mysql = (MYSQL *)malloc(sizeof(MYSQL));
  database_init_and_connect(mysql);
  MYSQL_RES *rs;
  MYSQL_ROW row;
  char *sql = "SELECT * FROM `student`";
  printf("-------------------------------\n");
  if (mysql_real_query(mysql, sql, (int)strlen(sql))) {
    printf("%d: %s\n", mysql_errno(mysql), mysql_error(mysql));
    exit(-1);
  }
  rs = mysql_store_result(mysql);
  printf("%-7s\t%7s\t%7s\t%7s\n", "id", "name", "age", "address");
  while ((row = mysql_fetch_row(rs))) {
    printf("%-7s\t %7s\t %7s\t %7s\n", row[0], row[1], row[2], row[3]);
  }
  sql = "DELETE FROM `stu` WHERE (`id` > '50')";
  if (mysql_real_query(mysql, sql, (int)strlen(sql))) {
    printf("%d: %s\n", mysql_errno(mysql), mysql_error(mysql));
  }
  printf("delete......\n");
  sql = "SELECT `name` FROM `stu` WHERE `id` = 1";
  if (mysql_real_query(mysql, sql, (int)strlen(sql))) {
    printf("%d: %s\n", mysql_errno(mysql), mysql_error(mysql));
  }
  rs = mysql_store_result(mysql);
  printf("%-7s\t\n", "name");
  while ((row = mysql_fetch_row(rs))) {
    printf("%-7s\t\n", row[0]);
  }
  mysql_free_result(rs);
  mysql_close(mysql);
  free(mysql);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1090 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1080 <database_init_and_connect@plt>
lea    0xe03(%rip),%rax
mov    %rax,-0x28(%rbp)
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x38(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    %eax,%edx
call   10c0 <mysql_real_query@plt>
cmp    $0x0,%rax
je     1274 <main+0xa4>
mov    -0x10(%rbp),%rdi
call   1070 <mysql_errno@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <mysql_error@plt>
mov    -0x3c(%rbp),%esi
mov    %rax,%rdx
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0x10(%rbp),%rdi
call   10f0 <mysql_store_result@plt>
mov    %rax,-0x18(%rbp)
lea    0xdb9(%rip),%rdi
lea    0xdc4(%rip),%rsi
lea    0xdc0(%rip),%rdx
lea    0xdbe(%rip),%rcx
lea    0xdbb(%rip),%r8
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <mysql_fetch_row@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     12f4 <main+0x124>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x20(%rbp),%rax
mov    0x10(%rax),%rcx
mov    -0x20(%rbp),%rax
mov    0x18(%rax),%r8
lea    0xd7f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    12ab <main+0xdb>
lea    0xd81(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %eax,%edx
call   10c0 <mysql_real_query@plt>
cmp    $0x0,%rax
je     135a <main+0x18a>
mov    -0x10(%rbp),%rdi
call   1070 <mysql_errno@plt>
mov    %eax,-0x54(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <mysql_error@plt>
mov    -0x54(%rbp),%esi
mov    %rax,%rdx
lea    0xce6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd41(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd41(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x28(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x68(%rbp),%rdi
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
call   10c0 <mysql_real_query@plt>
cmp    $0x0,%rax
je     13ce <main+0x1fe>
mov    -0x10(%rbp),%rdi
call   1070 <mysql_errno@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x10(%rbp),%rdi
call   10d0 <mysql_error@plt>
mov    -0x6c(%rbp),%esi
mov    %rax,%rdx
lea    0xc72(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10f0 <mysql_store_result@plt>
mov    %rax,-0x18(%rbp)
lea    0xcf6(%rip),%rdi
lea    0xc6d(%rip),%rsi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1040 <mysql_fetch_row@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1421 <main+0x251>
mov    -0x20(%rbp),%rax
mov    (%rax),%rsi
lea    0xcc3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    13f0 <main+0x220>
mov    -0x18(%rbp),%rdi
call   10b0 <mysql_free_result@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <mysql_close@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
mov    $0x4,%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1080 <database_init_and_connect@plt>
lea    0xebf(%rip),%rdi
call   1040 <puts@plt>
lea    0xe03(%rip),%rsi
mov    %r14,%rdi
mov    $0x17,%edx
call   10c0 <mysql_real_query@plt>
mov    %r14,%rdi
test   %rax,%rax
jne    138a <main+0x1ba>
call   10f0 <mysql_store_result@plt>
mov    %rax,%rbx
lea    0xdfb(%rip),%rdi
lea    0xe06(%rip),%rsi
lea    0xe02(%rip),%rdx
lea    0xe00(%rip),%rcx
lea    0xdfd(%rip),%r8
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <mysql_fetch_row@plt>
test   %rax,%rax
je     1286 <main+0xb6>
lea    0xdea(%rip),%r15
nopl   0x0(%rax)
mov    (%rax),%rsi
mov    0x8(%rax),%rdx
mov    0x10(%rax),%rcx
mov    0x18(%rax),%r8
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <mysql_fetch_row@plt>
test   %rax,%rax
jne    1260 <main+0x90>
lea    0xdce(%rip),%rsi
mov    %r14,%rdi
mov    $0x25,%edx
call   10c0 <mysql_real_query@plt>
test   %rax,%rax
je     12c4 <main+0xf4>
mov    %r14,%rdi
call   1070 <mysql_errno@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   10d0 <mysql_error@plt>
lea    0xd60(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe05(%rip),%rdi
call   1040 <puts@plt>
lea    0xdaa(%rip),%rsi
mov    %r14,%rdi
mov    $0x27,%edx
call   10c0 <mysql_real_query@plt>
test   %rax,%rax
je     130e <main+0x13e>
mov    %r14,%rdi
call   1070 <mysql_errno@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   10d0 <mysql_error@plt>
lea    0xd16(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14,%rdi
call   10f0 <mysql_store_result@plt>
mov    %rax,%rbx
lea    0xd89(%rip),%rdi
lea    0xd0e(%rip),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <mysql_fetch_row@plt>
test   %rax,%rax
je     136a <main+0x19a>
lea    0xd67(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rax),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1050 <mysql_fetch_row@plt>
test   %rax,%rax
jne    1350 <main+0x180>
mov    %rbx,%rdi
call   10b0 <mysql_free_result@plt>
mov    %r14,%rdi
call   10a0 <mysql_close@plt>
mov    %r14,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret
call   1070 <mysql_errno@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   10d0 <mysql_error@plt>
lea    0xc78(%rip),%rdi
mov    %ebx,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
@.str = [24 x i8] c"SELECT * FROM `student`\00"
@.str.1 = [33 x i8] c"-------------------------------\0A\00"
@.str.2 = [8 x i8] c"%d: %s\0A\00"
@.str.3 = [18 x i8] c"%-7s\09%7s\09%7s\09%7s\0A\00"
@.str.4 = [3 x i8] c"id\00"
@.str.5 = [5 x i8] c"name\00"
@.str.6 = [4 x i8] c"age\00"
@.str.7 = [8 x i8] c"address\00"
@.str.8 = [21 x i8] c"%-7s\09 %7s\09 %7s\09 %7s\0A\00"
@.str.9 = [38 x i8] c"DELETE FROM `stu` WHERE (`id` > '50')\00"
@.str.10 = [14 x i8] c"delete......\0A\00"
@.str.11 = [40 x i8] c"SELECT `name` FROM `stu` WHERE `id` = 1\00"
@.str.12 = [7 x i8] c"%-7s\09\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i8**
%5 = alloca i8*
store i32 0, i32* %1
%6 = call i64 @malloc(i32 4)
%7 = inttoptr i64 %6 to i32*
store i32* %7, i32** %2
%8 = load i32*, i32** %2
%9 = call i32 @database_init_and_connect(i32* %8)
store i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%11 = load i32*, i32** %2
%12 = load i8*, i8** %5
%13 = load i8*, i8** %5
%14 = call i64 @strlen(i8* %13)
%15 = trunc i64 %14 to i32
%16 = call i64 @mysql_real_query(i32* %11, i8* %12, i32 %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %25
18: ; preds = %0
%19 = load i32*, i32** %2
%20 = call i32 @mysql_errno(i32* %19)
%21 = load i32*, i32** %2
%22 = call i8* @mysql_error(i32* %21)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %20, i8* %22)
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %0
%26 = load i32*, i32** %2
%27 = call i32* @mysql_store_result(i32* %26)
store i32* %27, i32** %3
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %29
29: ; preds = %33, %25
%30 = load i32*, i32** %3
%31 = call i8** @mysql_fetch_row(i32* %30)
store i8** %31, i8*** %4
%32 = icmp ne i8** %31, null
br i1 %32, label %33, label %47
33: ; preds = %29
%34 = load i8**, i8*** %4
%35 = getelementptr inbounds i8*, i8** %34, i64 0
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %4
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %4
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = load i8**, i8*** %4
%44 = getelementptr inbounds i8*, i8** %43, i64 3
%45 = load i8*, i8** %44
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %36, i8* %39, i8* %42, i8* %45)
br label %29
47: ; preds = %29
store i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i8** %5
%48 = load i32*, i32** %2
%49 = load i8*, i8** %5
%50 = load i8*, i8** %5
%51 = call i64 @strlen(i8* %50)
%52 = trunc i64 %51 to i32
%53 = call i64 @mysql_real_query(i32* %48, i8* %49, i32 %52)
%54 = icmp ne i64 %53, 0
br i1 %54, label %55, label %61
55: ; preds = %47
%56 = load i32*, i32** %2
%57 = call i32 @mysql_errno(i32* %56)
%58 = load i32*, i32** %2
%59 = call i8* @mysql_error(i32* %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %57, i8* %59)
br label %61
61: ; preds = %55, %47
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0))
store i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i8** %5
%63 = load i32*, i32** %2
%64 = load i8*, i8** %5
%65 = load i8*, i8** %5
%66 = call i64 @strlen(i8* %65)
%67 = trunc i64 %66 to i32
%68 = call i64 @mysql_real_query(i32* %63, i8* %64, i32 %67)
%69 = icmp ne i64 %68, 0
br i1 %69, label %70, label %76
70: ; preds = %61
%71 = load i32*, i32** %2
%72 = call i32 @mysql_errno(i32* %71)
%73 = load i32*, i32** %2
%74 = call i8* @mysql_error(i32* %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %72, i8* %74)
br label %76
76: ; preds = %70, %61
%77 = load i32*, i32** %2
%78 = call i32* @mysql_store_result(i32* %77)
store i32* %78, i32** %3
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %80
80: ; preds = %84, %76
%81 = load i32*, i32** %3
%82 = call i8** @mysql_fetch_row(i32* %81)
store i8** %82, i8*** %4
%83 = icmp ne i8** %82, null
br i1 %83, label %84, label %89
84: ; preds = %80
%85 = load i8**, i8*** %4
%86 = getelementptr inbounds i8*, i8** %85, i64 0
%87 = load i8*, i8** %86
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %87)
br label %80
89: ; preds = %80
%90 = load i32*, i32** %3
%91 = call i32 @mysql_free_result(i32* %90)
%92 = load i32*, i32** %2
%93 = call i32 @mysql_close(i32* %92)
%94 = load i32*, i32** %2
%95 = call i32 @free(i32* %94)
%96 = load i32, i32* %1
ret i32 %96
}

LLVM IR (-O2):
@.str = [24 x i8] c"SELECT * FROM `student`\00"
@.str.2 = [8 x i8] c"%d: %s\0A\00"
@.str.3 = [18 x i8] c"%-7s\09%7s\09%7s\09%7s\0A\00"
@.str.4 = [3 x i8] c"id\00"
@.str.5 = [5 x i8] c"name\00"
@.str.6 = [4 x i8] c"age\00"
@.str.7 = [8 x i8] c"address\00"
@.str.8 = [21 x i8] c"%-7s\09 %7s\09 %7s\09 %7s\0A\00"
@.str.9 = [38 x i8] c"DELETE FROM `stu` WHERE (`id` > '50')\00"
@.str.11 = [40 x i8] c"SELECT `name` FROM `stu` WHERE `id` = 1\00"
@.str.12 = [7 x i8] c"%-7s\09\0A\00"
@str = [32 x i8] c"-------------------------------\00"
@str.13 = [13 x i8] c"delete......\00"
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @database_init_and_connect(i32* %2)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%5 = tail call i64 @mysql_real_query(i32* %2, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 23)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %0
%8 = tail call i32 @mysql_errno(i32* %2)
%9 = tail call i8* @mysql_error(i32* %2)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %8, i8* %9)
%11 = tail call i32 @exit(i32 -1)
unreachable
12: ; preds = %0
%13 = tail call i32* @mysql_store_result(i32* %2)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i8** @mysql_fetch_row(i32* %13)
%16 = icmp eq i8** %15, null
br i1 %16, label %29, label %17
17: ; preds = %12, %17
%18 = phi i8** [ %27, %17 ], [ %15, %12 ]
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8*, i8** %18, i64 1
%21 = load i8*, i8** %20
%22 = getelementptr inbounds i8*, i8** %18, i64 2
%23 = load i8*, i8** %22
%24 = getelementptr inbounds i8*, i8** %18, i64 3
%25 = load i8*, i8** %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i8* %19, i8* %21, i8* %23, i8* %25)
%27 = tail call i8** @mysql_fetch_row(i32* %13)
%28 = icmp eq i8** %27, null
br i1 %28, label %29, label %17
29: ; preds = %17, %12
%30 = tail call i64 @mysql_real_query(i32* %2, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.9, i64 0, i64 0), i32 37)
%31 = icmp eq i64 %30, 0
br i1 %31, label %36, label %32
32: ; preds = %29
%33 = tail call i32 @mysql_errno(i32* %2)
%34 = tail call i8* @mysql_error(i32* %2)
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %33, i8* %34)
br label %36
36: ; preds = %32, %29
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.13, i64 0, i64 0))
%38 = tail call i64 @mysql_real_query(i32* %2, i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.11, i64 0, i64 0), i32 39)
%39 = icmp eq i64 %38, 0
br i1 %39, label %44, label %40
40: ; preds = %36
%41 = tail call i32 @mysql_errno(i32* %2)
%42 = tail call i8* @mysql_error(i32* %2)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %41, i8* %42)
br label %44
44: ; preds = %40, %36
%45 = tail call i32* @mysql_store_result(i32* %2)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%47 = tail call i8** @mysql_fetch_row(i32* %45)
%48 = icmp eq i8** %47, null
br i1 %48, label %55, label %49
49: ; preds = %44, %49
%50 = phi i8** [ %53, %49 ], [ %47, %44 ]
%51 = load i8*, i8** %50
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i8* %51)
%53 = tail call i8** @mysql_fetch_row(i32* %45)
%54 = icmp eq i8** %53, null
br i1 %54, label %55, label %49
55: ; preds = %49, %44
%56 = tail call i32 @mysql_free_result(i32* %45)
%57 = tail call i32 @mysql_close(i32* %2)
%58 = tail call i32 @free(i32* %2)
ret i32 0
}