#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 *, ...);
void print_content(void **in, int depth) {
  int i, x, size;
  void **data;
  if (depth >= 4) {
    printf("...");
    return;
  }
  if (in == NULL) {
    printf("nil");
    return;
  }
  x = (int)in;
  if (x & 1) {
    printf("%i", x >> 1);
  } else {
    size = *((int *)in);
    data = in + 1;
    printf("{s:%i", size);
    for (i = 0; i < size; i++) {
      printf(", ");
      print_content(*data, depth + 1);
      data++;
    }
    printf("}");
  }
}


x86 assembly (clang, -O0):
<print_content>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jl     114c <print_content+0x2c>
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121a <print_content+0xfa>
cmpq   $0x0,-0x8(%rbp)
jne    116a <print_content+0x4a>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121a <print_content+0xfa>
mov    -0x8(%rbp),%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1199 <print_content+0x79>
mov    -0x14(%rbp),%esi
sar    $0x1,%esi
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    121a <print_content+0xfa>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%esi
lea    0xe50(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    120c <print_content+0xec>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
call   1040 <print_content@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11c6 <print_content+0xa6>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_content>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x4,%esi
jl     1146 <print_content+0x16>
lea    0xebc(%rip),%rdi
jmp    11b8 <print_content+0x88>
mov    %rdi,%r12
test   %rdi,%rdi
je     11b1 <print_content+0x81>
test   $0x1,%r12b
jne    11c7 <print_content+0x97>
mov    %esi,%ebp
mov    (%r12),%r14d
lea    0xea7(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    119f <print_content+0x6f>
add    $0x1,%ebp
lea    0xe94(%rip),%r15
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r12,%rbx,8),%rdi
mov    %ebp,%esi
call   1050 <print_content@plt>
add    $0x1,%rbx
cmp    %ebx,%r14d
jne    1180 <print_content+0x50>
mov    $0x7d,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
sar    %r12d
lea    0xe3a(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"...\00"
@.str.1 = [4 x i8] c"nil\00"
@.str.2 = [3 x i8] c"%i\00"
@.str.3 = [6 x i8] c"{s:%i\00"
@.str.4 = [3 x i8] c", \00"
@.str.5 = [2 x i8] c"}\00"
define void @print_content(i8** %0, i32 %1) {
%3 = alloca i8**
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8**
store i8** %0, i8*** %3
store i32 %1, i32* %4
%9 = load i32, i32* %4
%10 = icmp sge i32 %9, 4
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %54
13: ; preds = %2
%14 = load i8**, i8*** %3
%15 = icmp eq i8** %14, null
br i1 %15, label %16, label %18
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %54
18: ; preds = %13
%19 = load i8**, i8*** %3
%20 = ptrtoint i8** %19 to i32
store i32 %20, i32* %6
%21 = load i32, i32* %6
%22 = and i32 %21, 1
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %28
24: ; preds = %18
%25 = load i32, i32* %6
%26 = ashr i32 %25, 1
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %54
28: ; preds = %18
%29 = load i8**, i8*** %3
%30 = bitcast i8** %29 to i32*
%31 = load i32, i32* %30
store i32 %31, i32* %7
%32 = load i8**, i8*** %3
%33 = getelementptr inbounds i8*, i8** %32, i64 1
store i8** %33, i8*** %8
%34 = load i32, i32* %7
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %34)
store i32 0, i32* %5
br label %36
36: ; preds = %49, %28
%37 = load i32, i32* %5
%38 = load i32, i32* %7
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %52
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%42 = load i8**, i8*** %8
%43 = load i8*, i8** %42
%44 = bitcast i8* %43 to i8**
%45 = load i32, i32* %4
%46 = add nsw i32 %45, 1
%47 = load i8**, i8*** %8
%48 = getelementptr inbounds i8*, i8** %47, i32 1
store i8** %48, i8*** %8
br label %49
49: ; preds = %40
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %36
52: ; preds = %36
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
br label %54
54: ; preds = %11, %16, %52, %24
ret void
}

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