#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 *, char *, char *);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int project_list_tasks_callback(void *data, int n, char **vals, char **keys) {
  int *first = data;
  if (!*first)
    puts(", {");
  else
    putchar('{');
  *first = 0;
  int i;
  for (i = 0; i < n; i++) {
    if (i > 0)
      puts(", ");
    printf("\"%s\":\"%s\"", keys[i], vals[i]);
  }
  putchar('}');
  return 0;
}


x86 assembly (clang, -O0):
<project_list_tasks_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)
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    116d <project_list_tasks_callback+0x3d>
lea    0xe9d(%rip),%rdi
call   1040 <puts@plt>
jmp    1177 <project_list_tasks_callback+0x47>
mov    $0x7b,%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11dc <project_list_tasks_callback+0xac>
cmpl   $0x0,-0x2c(%rbp)
jle    11aa <project_list_tasks_callback+0x7a>
lea    0xe5f(%rip),%rdi
call   1040 <puts@plt>
mov    -0x20(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    -0x18(%rbp),%rax
movslq -0x2c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xe3e(%rip),%rdi
call   1050 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1188 <project_list_tasks_callback+0x58>
mov    $0x7d,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<project_list_tasks_callback>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %rdx,%r13
mov    %esi,%r15d
mov    %rdi,%rbp
cmpl   $0x0,(%rdi)
je     1158 <project_list_tasks_callback+0x28>
mov    $0x7b,%edi
call   1030 <putchar@plt>
jmp    1164 <project_list_tasks_callback+0x34>
lea    0xea1(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,0x0(%rbp)
test   %r15d,%r15d
jle    11c2 <project_list_tasks_callback+0x92>
mov    (%r14),%rsi
mov    0x0(%r13),%rdx
lea    0xe89(%rip),%rdi
call   1050 <printf@plt>
cmp    $0x1,%r15d
je     11c2 <project_list_tasks_callback+0x92>
mov    %r15d,%ebp
mov    $0x1,%ebx
lea    0xe6c(%rip),%r15
lea    0xe68(%rip),%r12
nop
mov    %r15,%rdi
call   1040 <puts@plt>
mov    (%r14,%rbx,8),%rsi
mov    0x0(%r13,%rbx,8),%rdx
mov    %r12,%rdi
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11a0 <project_list_tasks_callback+0x70>
mov    $0x7d,%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):
@.str = [4 x i8] c", {\00"
@.str.1 = [3 x i8] c", \00"
@.str.2 = [10 x i8] c"\22%s\22:\22%s\22\00"
define i32 @project_list_tasks_callback(i8* %0, i32 %1, i8** %2, i8** %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i32*
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i8** %3, i8*** %8
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
store i32* %12, i32** %9
%13 = load i32*, i32** %9
%14 = load i32, i32* %13
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %4
%17 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %20
18: ; preds = %4
%19 = call i32 @putchar(i8 signext 123)
br label %20
20: ; preds = %18, %16
%21 = load i32*, i32** %9
store i32 0, i32* %21
store i32 0, i32* %10
br label %22
22: ; preds = %43, %20
%23 = load i32, i32* %10
%24 = load i32, i32* %6
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %46
26: ; preds = %22
%27 = load i32, i32* %10
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = call i32 @puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %31
31: ; preds = %29, %26
%32 = load i8**, i8*** %8
%33 = load i32, i32* %10
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8*, i8** %32, i64 %34
%36 = load i8*, i8** %35
%37 = load i8**, i8*** %7
%38 = load i32, i32* %10
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8*, i8** %37, i64 %39
%41 = load i8*, i8** %40
%42 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %36, i8* %41)
br label %43
43: ; preds = %31
%44 = load i32, i32* %10
%45 = add nsw i32 %44, 1
store i32 %45, i32* %10
br label %22
46: ; preds = %22
%47 = call i32 @putchar(i8 signext 125)
ret i32 0
}

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