#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 sheet_cell_callback(size_t row, size_t col, const char *value,
                        void *callbackdata) {
  if (col > 1)
    printf("\t");
  printf("[%i,%i]", (int)row, (int)col);
  if (value)
    printf("%s", value);
  return 0;
}


x86 assembly (clang, -O0):
<sheet_cell_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x1,-0x10(%rbp)
jbe    1141 <sheet_cell_callback+0x31>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x18(%rbp)
je     1178 <sheet_cell_callback+0x68>
mov    -0x18(%rbp),%rsi
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sheet_cell_callback>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
cmp    $0x2,%rsi
jb     113e <sheet_cell_callback+0x1e>
mov    $0x9,%edi
call   1030 <putchar@plt>
lea    0xebb(%rip),%rdi
mov    %r15d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14,%r14
je     1167 <sheet_cell_callback+0x47>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
@.str.1 = [8 x i8] c"[%i,%i]\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @sheet_cell_callback(i64 %0, i64 %1, i8* %2, i8* %3) {
%5 = alloca i64
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i8*
store i64 %0, i64* %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%9 = load i64, i64* %6
%10 = icmp ugt i64 %9, 1
br i1 %10, label %11, label %13
11: ; preds = %4
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %4
%14 = load i64, i64* %5
%15 = trunc i64 %14 to i32
%16 = load i64, i64* %6
%17 = trunc i64 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %15, i32 %17)
%19 = load i8*, i8** %7
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %24
21: ; preds = %13
%22 = load i8*, i8** %7
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %22)
br label %24
24: ; preds = %21, %13
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [8 x i8] c"[%i,%i]\00"
@.str.2 = [3 x i8] c"%s\00"
define i32 @sheet_cell_callback(i64 %0, i64 %1, i8* %2, i8* nocapture readnone %3) {
%5 = icmp ugt i64 %1, 1
br i1 %5, label %6, label %8
6: ; preds = %4
%7 = tail call i32 @putchar(i32 9)
br label %8
8: ; preds = %6, %4
%9 = trunc i64 %0 to i32
%10 = trunc i64 %1 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = icmp eq i8* %2, null
br i1 %12, label %15, label %13
13: ; preds = %8
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %2)
br label %15
15: ; preds = %13, %8
ret i32 0
}