#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*/ mysql_close(int /*<<< orphan*/ *);
char **mysql_fetch_row(int /*<<< orphan*/ *);
int /*<<< orphan*/ mysql_free_result(int /*<<< orphan*/ *);
int /*<<< orphan*/ mysql_init(int /*<<< orphan*/ *);
int mysql_num_fields(int /*<<< orphan*/ *);
int mysql_num_rows(int /*<<< orphan*/ *);
int mysql_query(int /*<<< orphan*/ *, char *);
int /*<<< orphan*/ *mysql_real_connect(int /*<<< orphan*/ *, char *, char *,
                                       char *, char *, int,
                                       int /*<<< orphan*/ *,
                                       int /*<<< orphan*/);
int /*<<< orphan*/ *mysql_store_result(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ send_result(int, int, int);
int /*<<< orphan*/ send_result1(int, int /*<<< orphan*/, int, char *);
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
void sele(int fd) {
  MYSQL db;
  MYSQL *pdb;
  mysql_init(&db);
  pdb = mysql_real_connect(&db, "127.0.0.1", "root", "123", "class306", 3306,
                           NULL, 0);
  if (pdb == NULL) {
    perror("connect fail");
    send_result(fd, 1, 6);
    return;
  } else {
    printf("connect ok\n");
  }
  int ret;
  char *buffer = "set names utf8;";
  ret = mysql_query(&db, buffer);
  char *sql = "select * from account;";
  ret = mysql_query(pdb, sql);
  if (ret == 0) {
    printf("select ok\n");
  } else {
    perror("select fail");
    printf("sql = %s\n", sql);
    send_result(fd, 1, 6);
  }
  MYSQL_RES *res;
  res = mysql_store_result(&db);
  int row;
  row = mysql_num_rows(res);
  if (row == 0) {
    send_result(fd, 1, 6);
    mysql_free_result(res);
    mysql_close(pdb);
    return;
  }
  int column;
  column = mysql_num_fields(res);
  char buff[1000] = {0};
  MYSQL_ROW result;
  int i;
  int j;
  for (i = 0; i < row; i++) {
    result = mysql_fetch_row(res);
    for (j = 0; j < column; j++) {
      printf("%10.10s", result[j]);
      sprintf(buff, "%s%10.10s", buff, result[j]);
    }
    printf("\n");
    sprintf(buff, "%s%s", buff, "\n");
  }
  send_result1(fd, 0, 6, buff);
  mysql_free_result(res);
  mysql_close(pdb);
  return;
}


x86 assembly (clang, -O0):
<sele>:
push   %rbp
mov    %rsp,%rbp
sub    $0x440,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   10b0 <mysql_init@plt>
lea    -0x8(%rbp),%rdi
lea    0xdee(%rip),%rsi
lea    0xdf1(%rip),%rdx
lea    0xdef(%rip),%rcx
lea    0xdec(%rip),%r8
mov    $0xcea,%r9d
xor    %eax,%eax
xor    %eax,%eax
movq   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
call   1090 <mysql_real_connect@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1278 <sele+0x88>
lea    0xdc0(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1110 <send_result@plt>
jmp    1481 <sele+0x291>
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xda8(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <mysql_query@plt>
mov    %eax,-0x14(%rbp)
lea    0xd9d(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <mysql_query@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    12d9 <sele+0xe9>
lea    0xd8f(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1309 <sele+0x119>
lea    0xd87(%rip),%rdi
call   10d0 <perror@plt>
mov    -0x28(%rbp),%rsi
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1110 <send_result@plt>
lea    -0x8(%rbp),%rdi
call   1100 <mysql_store_result@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   10f0 <mysql_num_rows@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0x0,-0x34(%rbp)
jne    1355 <sele+0x165>
mov    -0x4(%rbp),%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1110 <send_result@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <mysql_free_result@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <mysql_close@plt>
jmp    1481 <sele+0x291>
mov    -0x30(%rbp),%rdi
call   1050 <mysql_num_fields@plt>
mov    %eax,-0x38(%rbp)
lea    -0x420(%rbp),%rdi
xor    %esi,%esi
mov    $0x3e8,%edx
call   1070 <memset@plt>
movl   $0x0,-0x42c(%rbp)
mov    -0x42c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1459 <sele+0x269>
mov    -0x30(%rbp),%rdi
call   1040 <mysql_fetch_row@plt>
mov    %rax,-0x428(%rbp)
movl   $0x0,-0x430(%rbp)
mov    -0x430(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    1416 <sele+0x226>
mov    -0x428(%rbp),%rax
movslq -0x430(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xcb0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x420(%rbp),%rdi
lea    -0x420(%rbp),%rdx
mov    -0x428(%rbp),%rax
movslq -0x430(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
lea    0xc80(%rip),%rsi
call   10e0 <sprintf@plt>
mov    -0x430(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x430(%rbp)
jmp    13a7 <sele+0x1b7>
lea    0xc48(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x420(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xc4e(%rip),%rsi
lea    0xc25(%rip),%rcx
call   10e0 <sprintf@plt>
mov    -0x42c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x42c(%rbp)
jmp    137e <sele+0x18e>
mov    -0x4(%rbp),%edi
lea    -0x420(%rbp),%rcx
xor    %esi,%esi
mov    $0x6,%edx
call   1080 <send_result1@plt>
mov    -0x30(%rbp),%rdi
call   10c0 <mysql_free_result@plt>
mov    -0x10(%rbp),%rdi
call   10a0 <mysql_close@plt>
add    $0x440,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sele>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x418,%rsp
mov    %edi,%r14d
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10d0 <mysql_init@plt>
lea    0xdc8(%rip),%rsi
lea    0xdcb(%rip),%rdx
lea    0xdc9(%rip),%rcx
lea    0xdc6(%rip),%r8
mov    %rbx,%rdi
mov    $0xcea,%r9d
push   $0x0
push   $0x0
call   10b0 <mysql_real_connect@plt>
add    $0x10,%rsp
test   %rax,%rax
je     1403 <sele+0x1f3>
mov    %rax,%rbp
lea    0xdff(%rip),%rdi
call   1040 <puts@plt>
lea    0xda7(%rip),%rsi
lea    0x10(%rsp),%rdi
call   1050 <mysql_query@plt>
lea    0xda6(%rip),%rsi
mov    %rbp,%rdi
call   1050 <mysql_query@plt>
test   %eax,%eax
jne    1423 <sele+0x213>
lea    0xdd6(%rip),%rdi
call   1040 <puts@plt>
lea    0x10(%rsp),%rdi
call   1120 <mysql_store_result@plt>
mov    %rax,%r12
mov    %rax,%rdi
call   1110 <mysql_num_rows@plt>
test   %eax,%eax
je     13cf <sele+0x1bf>
mov    %eax,%ebx
mov    %rbp,0x20(%rsp)
mov    %r14d,0x14(%rsp)
mov    %r12,%rdi
call   1070 <mysql_num_fields@plt>
mov    %eax,0xc(%rsp)
lea    0x30(%rsp),%rdi
mov    $0x3e8,%edx
xor    %esi,%esi
call   1090 <memset@plt>
test   %ebx,%ebx
jle    13ab <sele+0x19b>
mov    0xc(%rsp),%r13d
lea    0xd5f(%rip),%rbp
lea    0xd56(%rip),%r14
lea    0x30(%rsp),%r15
xor    %eax,%eax
mov    %r12,0x28(%rsp)
mov    %ebx,0x18(%rsp)
jmp    1367 <sele+0x157>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
lea    0xd2c(%rip),%rsi
mov    %r15,%rdx
lea    0xd16(%rip),%rcx
call   1100 <sprintf@plt>
mov    0x1c(%rsp),%eax
add    $0x1,%eax
mov    0x18(%rsp),%ebx
cmp    %ebx,%eax
mov    0x28(%rsp),%r12
je     13ab <sele+0x19b>
mov    %eax,0x1c(%rsp)
mov    %r12,%rdi
call   1060 <mysql_fetch_row@plt>
cmpl   $0x0,0xc(%rsp)
jle    1330 <sele+0x120>
mov    %rax,%r12
xor    %ebx,%ebx
nop
mov    (%r12,%rbx,8),%rsi
mov    %rbp,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    (%r12,%rbx,8),%rcx
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1100 <sprintf@plt>
add    $0x1,%rbx
cmp    %rbx,%r13
jne    1380 <sele+0x170>
jmp    1330 <sele+0x120>
lea    0x30(%rsp),%rcx
mov    0x14(%rsp),%edi
xor    %esi,%esi
mov    $0x6,%edx
call   10a0 <send_result1@plt>
mov    %r12,%rdi
call   10e0 <mysql_free_result@plt>
mov    0x20(%rsp),%rdi
jmp    13ec <sele+0x1dc>
mov    %r14d,%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1130 <send_result@plt>
mov    %r12,%rdi
call   10e0 <mysql_free_result@plt>
mov    %rbp,%rdi
call   10c0 <mysql_close@plt>
add    $0x418,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc12(%rip),%rdi
call   10f0 <perror@plt>
mov    %r14d,%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1130 <send_result@plt>
jmp    13f1 <sele+0x1e1>
lea    0xc26(%rip),%rdi
call   10f0 <perror@plt>
lea    0xc26(%rip),%rdi
lea    0xbfc(%rip),%rsi
xor    %eax,%eax
call   1080 <printf@plt>
mov    %r14d,%edi
mov    $0x1,%esi
mov    $0x6,%edx
call   1130 <send_result@plt>
jmp    12af <sele+0x9f>

LLVM IR (-O0):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [4 x i8] c"123\00"
@.str.3 = [9 x i8] c"class306\00"
@.str.4 = [13 x i8] c"connect fail\00"
@.str.5 = [12 x i8] c"connect ok\0A\00"
@.str.6 = [16 x i8] c"set names utf8;\00"
@.str.7 = [23 x i8] c"select * from account;\00"
@.str.8 = [11 x i8] c"select ok\0A\00"
@.str.9 = [12 x i8] c"select fail\00"
@.str.10 = [10 x i8] c"sql = %s\0A\00"
@.str.11 = [8 x i8] c"%10.10s\00"
@.str.12 = [10 x i8] c"%s%10.10s\00"
@.str.13 = [2 x i8] c"\0A\00"
@.str.14 = [5 x i8] c"%s%s\00"
define void @sele(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1000 x i8]
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %2
%15 = call i32 @mysql_init(i32* %3)
%16 = call i32* @mysql_real_connect(i32* %3, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 3306, i32* null, i32 0)
store i32* %16, i32** %4
%17 = load i32*, i32** %4
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %23
19: ; preds = %1
%20 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%21 = load i32, i32* %2
%22 = call i32 @send_result(i32 %21, i32 1, i32 6)
br label %103
23: ; preds = %1
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
br label %25
25: ; preds = %23
store i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0), i8** %6
%26 = load i8*, i8** %6
%27 = call i32 @mysql_query(i32* %3, i8* %26)
store i32 %27, i32* %5
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i8** %7
%28 = load i32*, i32** %4
%29 = load i8*, i8** %7
%30 = call i32 @mysql_query(i32* %28, i8* %29)
store i32 %30, i32* %5
%31 = load i32, i32* %5
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %25
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %41
35: ; preds = %25
%36 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%37 = load i8*, i8** %7
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* %37)
%39 = load i32, i32* %2
%40 = call i32 @send_result(i32 %39, i32 1, i32 6)
br label %41
41: ; preds = %35, %33
%42 = call i32* @mysql_store_result(i32* %3)
store i32* %42, i32** %8
%43 = load i32*, i32** %8
%44 = call i32 @mysql_num_rows(i32* %43)
store i32 %44, i32* %9
%45 = load i32, i32* %9
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %54
47: ; preds = %41
%48 = load i32, i32* %2
%49 = call i32 @send_result(i32 %48, i32 1, i32 6)
%50 = load i32*, i32** %8
%51 = call i32 @mysql_free_result(i32* %50)
%52 = load i32*, i32** %4
%53 = call i32 @mysql_close(i32* %52)
br label %103
54: ; preds = %41
%55 = load i32*, i32** %8
%56 = call i32 @mysql_num_fields(i32* %55)
store i32 %56, i32* %10
%57 = bitcast [1000 x i8]* %11 to i8*
store i32 0, i32* %13
br label %58
58: ; preds = %92, %54
%59 = load i32, i32* %13
%60 = load i32, i32* %9
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %95
62: ; preds = %58
%63 = load i32*, i32** %8
%64 = call i8** @mysql_fetch_row(i32* %63)
store i8** %64, i8*** %12
store i32 0, i32* %14
br label %65
65: ; preds = %84, %62
%66 = load i32, i32* %14
%67 = load i32, i32* %10
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %87
69: ; preds = %65
%70 = load i8**, i8*** %12
%71 = load i32, i32* %14
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8*, i8** %70, i64 %72
%74 = load i8*, i8** %73
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* %74)
%76 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%77 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%78 = load i8**, i8*** %12
%79 = load i32, i32* %14
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds i8*, i8** %78, i64 %80
%82 = load i8*, i8** %81
%83 = call i32 @sprintf(i8* %76, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %77, i8* %82)
br label %84
84: ; preds = %69
%85 = load i32, i32* %14
%86 = add nsw i32 %85, 1
store i32 %86, i32* %14
br label %65
87: ; preds = %65
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%89 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%90 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%91 = call i32 @sprintf(i8* %89, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8* %90, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
br label %92
92: ; preds = %87
%93 = load i32, i32* %13
%94 = add nsw i32 %93, 1
store i32 %94, i32* %13
br label %58
95: ; preds = %58
%96 = load i32, i32* %2
%97 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%98 = call i32 @send_result1(i32 %96, i32 0, i32 6, i8* %97)
%99 = load i32*, i32** %8
%100 = call i32 @mysql_free_result(i32* %99)
%101 = load i32*, i32** %4
%102 = call i32 @mysql_close(i32* %101)
br label %103
103: ; preds = %95, %47, %19
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [5 x i8] c"root\00"
@.str.2 = [4 x i8] c"123\00"
@.str.3 = [9 x i8] c"class306\00"
@.str.4 = [13 x i8] c"connect fail\00"
@.str.6 = [16 x i8] c"set names utf8;\00"
@.str.7 = [23 x i8] c"select * from account;\00"
@.str.9 = [12 x i8] c"select fail\00"
@.str.10 = [10 x i8] c"sql = %s\0A\00"
@.str.11 = [8 x i8] c"%10.10s\00"
@.str.12 = [10 x i8] c"%s%10.10s\00"
@.str.13 = [2 x i8] c"\0A\00"
@.str.14 = [5 x i8] c"%s%s\00"
@str = [11 x i8] c"connect ok\00"
@str.15 = [10 x i8] c"select ok\00"
define void @sele(i32 %0) {
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = bitcast i32* %2 to i8*
%5 = call i32 @mysql_init(i32* %2)
%6 = call i32* @mysql_real_connect(i32* %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 3306, i32* null, i32 0)
%7 = icmp eq i32* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = call i32 @perror(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @send_result(i32 %0, i32 1, i32 6)
br label %58
11: ; preds = %1
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%13 = call i32 @mysql_query(i32* %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 @mysql_query(i32* %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %11
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.15, i64 0, i64 0))
br label %22
18: ; preds = %11
%19 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0))
%21 = call i32 @send_result(i32 %0, i32 1, i32 6)
br label %22
22: ; preds = %18, %16
%23 = call i32* @mysql_store_result(i32* %2)
%24 = call i32 @mysql_num_rows(i32* %23)
%25 = icmp eq i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = call i32 @send_result(i32 %0, i32 1, i32 6)
%28 = call i32 @mysql_free_result(i32* %23)
%29 = call i32 @mysql_close(i32* %6)
br label %58
30: ; preds = %22
%31 = call i32 @mysql_num_fields(i32* %23)
%32 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%33 = icmp sgt i32 %24, 0
br i1 %33, label %34, label %54
34: ; preds = %30
%35 = icmp sgt i32 %31, 0
%36 = zext i32 %31 to i64
br label %37
37: ; preds = %34, %49
%38 = phi i32 [ 0, %34 ], [ %52, %49 ]
%39 = call i8** @mysql_fetch_row(i32* %23)
br i1 %35, label %40, label %49
40: ; preds = %37, %40
%41 = phi i64 [ %47, %40 ], [ 0, %37 ]
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.11, i64 0, i64 0), i8* %43)
%45 = load i8*, i8** %42
%46 = call i32 @sprintf(i8* %32, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.12, i64 0, i64 0), i8* %32, i8* %45)
%47 = add nuw nsw i64 %41, 1
%48 = icmp eq i64 %47, %36
br i1 %48, label %49, label %40
49: ; preds = %40, %37
%50 = call i32 @putchar(i32 10)
%51 = call i32 @sprintf(i8* %32, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0), i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
%52 = add nuw nsw i32 %38, 1
%53 = icmp eq i32 %52, %24
br i1 %53, label %54, label %37
54: ; preds = %49, %30
%55 = call i32 @send_result1(i32 %0, i32 0, i32 6, i8* %32)
%56 = call i32 @mysql_free_result(i32* %23)
%57 = call i32 @mysql_close(i32* %6)
br label %58
58: ; preds = %26, %54, %8
ret void
}