#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) {
  if (depth >= 4) {
    printf("...");
    return;
  }
  int x = (long)in;
  if (x & 1) {
    printf("%i", x >> 1);
  } else {
    int size = *((int *)in);
    void **data = in + 1;
    int i;
    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    $0x30,%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    11fc <print_content+0xdc>
mov    -0x8(%rbp),%rax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     117b <print_content+0x5b>
mov    -0x10(%rbp),%esi
sar    $0x1,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fc <print_content+0xdc>
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11ee <print_content+0xce>
lea    0xe4f(%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    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11a8 <print_content+0x88>
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_content>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
cmp    $0x4,%esi
jl     1153 <print_content+0x23>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>
mov    %rdi,%r12
test   $0x1,%r12b
jne    11c1 <print_content+0x91>
mov    %esi,%ebp
mov    (%r12),%r14d
lea    0xe9b(%rip),%rdi
mov    %r14d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    11af <print_content+0x7f>
add    $0x1,%ebp
lea    0xe88(%rip),%r15
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
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    1190 <print_content+0x60>
mov    $0x7d,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>
sar    %r12d
lea    0xe3c(%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 = [3 x i8] c"%i\00"
@.str.2 = [6 x i8] c"{s:%i\00"
@.str.3 = [3 x i8] c", \00"
@.str.4 = [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 i8**
%8 = alloca i32
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 %50
13: ; preds = %2
%14 = load i8**, i8*** %3
%15 = ptrtoint i8** %14 to i64
%16 = trunc i64 %15 to i32
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = and i32 %17, 1
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %24
20: ; preds = %13
%21 = load i32, i32* %5
%22 = ashr i32 %21, 1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %22)
br label %50
24: ; preds = %13
%25 = load i8**, i8*** %3
%26 = bitcast i8** %25 to i32*
%27 = load i32, i32* %26
store i32 %27, i32* %6
%28 = load i8**, i8*** %3
%29 = getelementptr inbounds i8*, i8** %28, i64 1
store i8** %29, i8*** %7
%30 = load i32, i32* %6
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %30)
store i32 0, i32* %8
br label %32
32: ; preds = %45, %24
%33 = load i32, i32* %8
%34 = load i32, i32* %6
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %48
36: ; preds = %32
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
%38 = load i8**, i8*** %7
%39 = load i8*, i8** %38
%40 = bitcast i8* %39 to i8**
%41 = load i32, i32* %4
%42 = add nsw i32 %41, 1
%43 = load i8**, i8*** %7
%44 = getelementptr inbounds i8*, i8** %43, i32 1
store i8** %44, i8*** %7
br label %45
45: ; preds = %36
%46 = load i32, i32* %8
%47 = add nsw i32 %46, 1
store i32 %47, i32* %8
br label %32
48: ; preds = %32
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %50
50: ; preds = %11, %48, %20
ret void
}

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