#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 callback(void *data, int col, char **col_value, char **col_name) {
  static int flag = 0;
  int i = 0;
  if (flag == 0) {
    for (i = 0; i < col; i++) {
      printf("%s\t", col_name[i]);
    }
    printf("\n");
    flag = 1;
  }
  for (i = 0; i < col; i++) {
    printf("%s\t", col_value[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x0,0x2ef7(%rip)
jne    118e <callback+0x7e>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <callback+0x66>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1142 <callback+0x32>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,0x2e9e(%rip)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c9 <callback+0xb9>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <callback+0x85>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<callback>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r13
mov    %esi,%r14d
cmpb   $0x0,0x2efc(%rip)
jne    1178 <callback+0x58>
test   %r14d,%r14d
jle    1167 <callback+0x47>
mov    %rcx,%r12
mov    %r14d,%ebp
lea    0xeb4(%rip),%r15
xor    %ebx,%ebx
xchg   %ax,%ax
mov    (%r12,%rbx,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1150 <callback+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
movb   $0x1,0x2ebc(%rip)
test   %r14d,%r14d
jle    11a8 <callback+0x88>
mov    %r14d,%ebx
lea    0xe79(%rip),%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
mov    0x0(%r13,%rbp,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%rbx
jne    1190 <callback+0x70>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@callback.flag = internal global i32 0
@.str = [4 x i8] c"%s\09\00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @callback(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
store i32 0, i32* %9
%10 = load i32, i32* @callback.flag
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %29
12: ; preds = %4
store i32 0, i32* %9
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i8**, i8*** %8
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %17
%25 = load i32, i32* %9
%26 = add nsw i32 %25, 1
store i32 %26, i32* %9
br label %13
27: ; preds = %13
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* @callback.flag
br label %29
29: ; preds = %27, %4
store i32 0, i32* %9
br label %30
30: ; preds = %41, %29
%31 = load i32, i32* %9
%32 = load i32, i32* %6
%33 = icmp slt i32 %31, %32
br i1 %33, label %34, label %44
34: ; preds = %30
%35 = load i8**, i8*** %7
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i8*, i8** %35, i64 %37
%39 = load i8*, i8** %38
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %39)
br label %41
41: ; preds = %34
%42 = load i32, i32* %9
%43 = add nsw i32 %42, 1
store i32 %43, i32* %9
br label %30
44: ; preds = %30
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@callback.flag = internal unnamed_addr global i1 false
@.str = [4 x i8] c"%s\09\00"
define i32 @callback(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture %3) {
%5 = load i1, i1* @callback.flag
br i1 %5, label %19, label %6
6: ; preds = %4
%7 = icmp sgt i32 %1, 0
br i1 %7, label %8, label %17
8: ; preds = %6
%9 = zext i32 %1 to i64
br label %10
10: ; preds = %8, %10
%11 = phi i64 [ 0, %8 ], [ %15, %10 ]
%12 = getelementptr inbounds i8*, i8** %3, i64 %11
%13 = load i8*, i8** %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = add nuw nsw i64 %11, 1
%16 = icmp eq i64 %15, %9
br i1 %16, label %17, label %10
17: ; preds = %10, %6
%18 = tail call i32 @putchar(i32 10)
store i1 true, i1* @callback.flag
br label %19
19: ; preds = %17, %4
%20 = icmp sgt i32 %1, 0
br i1 %20, label %21, label %30
21: ; preds = %19
%22 = zext i32 %1 to i64
br label %23
23: ; preds = %21, %23
%24 = phi i64 [ 0, %21 ], [ %28, %23 ]
%25 = getelementptr inbounds i8*, i8** %2, i64 %24
%26 = load i8*, i8** %25
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = add nuw nsw i64 %24, 1
%29 = icmp eq i64 %28, %22
br i1 %29, label %30, label %23
30: ; preds = %23, %19
%31 = tail call i32 @putchar(i32 10)
ret i32 0
}