#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int execCallback(void *NotUsed, int argc, char **argv, char **colv) {
  int i;
  static unsigned cnt = 0;
  printf("ROW #%u:\n", ++cnt);
  for (i = 0; i < argc; i++) {
    printf(" %s=", colv[i]);
    if (argv[i]) {
      printf("[%s]\n", argv[i]);
    } else {
      printf("NULL\n");
    }
  }
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<execCallback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    0x2ef7(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2eee(%rip)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11d4 <execCallback+0xb4>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11b3 <execCallback+0x93>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c1 <execCallback+0xa1>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c6 <execCallback+0xa6>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    115b <execCallback+0x3b>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<execCallback>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%ebp
mov    0x2ef3(%rip),%esi
add    $0x1,%esi
mov    %esi,0x2eea(%rip)
lea    0xea7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    11b8 <execCallback+0x88>
mov    %ebp,%ebp
lea    0xe9d(%rip),%r15
lea    0xe9b(%rip),%r13
xor    %r12d,%r12d
jmp    1195 <execCallback+0x65>
nopl   0x0(%rax)
lea    0xe8e(%rip),%rdi
call   1030 <puts@plt>
add    $0x1,%r12
cmp    %r12,%rbp
je     11b8 <execCallback+0x88>
mov    (%r14,%r12,8),%rsi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx,%r12,8),%rsi
test   %rsi,%rsi
je     1180 <execCallback+0x50>
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    118c <execCallback+0x5c>
mov    0x2e21(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@execCallback.cnt = internal global i32 0
@.str = [10 x i8] c"ROW #%u:\0A\00"
@.str.1 = [5 x i8] c" %s=\00"
@.str.2 = [6 x i8] c"[%s]\0A\00"
@.str.3 = [6 x i8] c"NULL\0A\00"
@stdout = global i32 0
define i32 @execCallback(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
%10 = load i32, i32* @execCallback.cnt
%11 = add i32 %10, 1
store i32 %11, i32* @execCallback.cnt
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %11)
store i32 0, i32* %9
br label %13
13: ; preds = %40, %4
%14 = load i32, i32* %9
%15 = load i32, i32* %6
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %43
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 ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %22)
%24 = load i8**, i8*** %7
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8*, i8** %24, i64 %26
%28 = load i8*, i8** %27
%29 = icmp ne i8* %28, null
br i1 %29, label %30, label %37
30: ; preds = %17
%31 = load i8**, i8*** %7
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i8*, i8** %31, i64 %33
%35 = load i8*, i8** %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %35)
br label %39
37: ; preds = %17
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %30
br label %40
40: ; preds = %39
%41 = load i32, i32* %9
%42 = add nsw i32 %41, 1
store i32 %42, i32* %9
br label %13
43: ; preds = %13
%44 = load i32, i32* @stdout
%45 = call i32 @fflush(i32 %44)
ret i32 0
}

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