#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 db_callback(int n, char **p, void *closure) {
  int i;
  if (!n)
    return 0;
  for (i = 0; i < n; i++) {
    printf("%s ", p[i]);
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<db_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1139 <db_callback+0x29>
movl   $0x0,-0x4(%rbp)
jmp    1189 <db_callback+0x79>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1174 <db_callback+0x64>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1140 <db_callback+0x30>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db_callback>:
test   %edi,%edi
je     116c <db_callback+0x4c>
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
jle    1157 <db_callback+0x37>
mov    %rsi,%r15
mov    %edi,%r12d
lea    0xec5(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <db_callback+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
xor    %eax,%eax
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s \00"
@.str.1 = [2 x i8] c"\0A\00"
define i32 @db_callback(i32 %0, i8** %1, i8* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
%9 = load i32, i32* %5
%10 = icmp ne i32 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %29
12: ; preds = %3
store i32 0, i32* %8
br label %13
13: ; preds = %24, %12
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %27
17: ; preds = %13
%18 = load i8**, i8*** %6
%19 = load i32, i32* %8
%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* %8
%26 = add nsw i32 %25, 1
store i32 %26, i32* %8
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 0, i32* %4
br label %29
29: ; preds = %27, %11
%30 = load i32, i32* %4
ret i32 %30
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @db_callback(i32 %0, i8** nocapture %1, i8* nocapture readnone %2) {
%4 = icmp eq i32 %0, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = icmp sgt i32 %0, 0
br i1 %6, label %7, label %16
7: ; preds = %5
%8 = zext i32 %0 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %14, %9 ]
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = add nuw nsw i64 %10, 1
%15 = icmp eq i64 %14, %8
br i1 %15, label %16, label %9
16: ; preds = %9, %5
%17 = tail call i32 @putchar(i32 10)
br label %18
18: ; preds = %3, %16
ret i32 0
}