#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);
  if (argv) {
    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>
cmpq   $0x0,-0x18(%rbp)
je     11e4 <execCallback+0xc4>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11df <execCallback+0xbf>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11be <execCallback+0x9e>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cc <execCallback+0xac>
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <execCallback+0xb1>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1166 <execCallback+0x46>
jmp    11e4 <execCallback+0xc4>
mov    0x2df5(%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   %rbx,%rbx
je     11b8 <execCallback+0x88>
test   %ebp,%ebp
jle    11b8 <execCallback+0x88>
mov    %ebp,%ebp
lea    0xe98(%rip),%r15
lea    0xe96(%rip),%r13
xor    %r12d,%r12d
jmp    1195 <execCallback+0x65>
xchg   %ax,%ax
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)
%13 = load i8**, i8*** %7
%14 = icmp ne i8** %13, null
br i1 %14, label %15, label %47
15: ; preds = %4
store i32 0, i32* %9
br label %16
16: ; preds = %43, %15
%17 = load i32, i32* %9
%18 = load i32, i32* %6
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %46
20: ; preds = %16
%21 = load i8**, i8*** %8
%22 = load i32, i32* %9
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8*, i8** %21, i64 %23
%25 = load i8*, i8** %24
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = load i8**, i8*** %7
%28 = load i32, i32* %9
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8*, i8** %27, i64 %29
%31 = load i8*, i8** %30
%32 = icmp ne i8* %31, null
br i1 %32, label %33, label %40
33: ; preds = %20
%34 = load i8**, i8*** %7
%35 = load i32, i32* %9
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i8*, i8** %34, i64 %36
%38 = load i8*, i8** %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %38)
br label %42
40: ; preds = %20
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %42
42: ; preds = %40, %33
br label %43
43: ; preds = %42
%44 = load i32, i32* %9
%45 = add nsw i32 %44, 1
store i32 %45, i32* %9
br label %16
46: ; preds = %16
br label %47
47: ; preds = %46, %4
%48 = load i32, i32* @stdout
%49 = call i32 @fflush(i32 %48)
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** %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 ne i8** %2, null
%9 = icmp sgt i32 %1, 0
%10 = and i1 %8, %9
br i1 %10, label %11, label %28
11: ; preds = %4
%12 = zext i32 %1 to i64
br label %13
13: ; preds = %11, %25
%14 = phi i64 [ 0, %11 ], [ %26, %25 ]
%15 = getelementptr inbounds i8*, i8** %3, i64 %14
%16 = load i8*, i8** %15
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds i8*, i8** %2, i64 %14
%19 = load i8*, i8** %18
%20 = icmp eq i8* %19, null
br i1 %20, label %23, label %21
21: ; preds = %13
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %19)
br label %25
23: ; preds = %13
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
br label %25
25: ; preds = %21, %23
%26 = add nuw nsw i64 %14, 1
%27 = icmp eq i64 %26, %12
br i1 %27, label %28, label %13
28: ; preds = %25, %4
%29 = load i32, i32* @stdout
%30 = tail call i32 @fflush(i32 %29)
ret i32 0
}