#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strcat(char *, char *);
const char *indent(int depth, int header) {
  static char buf[64];
  int i = 0;
  memset(buf, 0, sizeof buf);
  for (i = 0; i < depth; i++) {
    strcat(buf, "|  ");
  }
  if (header)
    strcat(buf, "+");
  else
    strcat(buf, "");
  return buf;
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
lea    0x2f04(%rip),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    117c <indent+0x5c>
lea    0x2ede(%rip),%rdi
lea    0xe97(%rip),%rsi
call   1040 <strcat@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    114f <indent+0x2f>
cmpl   $0x0,-0x8(%rbp)
je     119e <indent+0x7e>
lea    0x2eb3(%rip),%rdi
lea    0xe70(%rip),%rsi
call   1040 <strcat@plt>
jmp    11b1 <indent+0x91>
lea    0x2e9b(%rip),%rdi
lea    0xe57(%rip),%rsi
call   1040 <strcat@plt>
lea    0x2e88(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %edi,%ebp
lea    0x2f0d(%rip),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
test   %ebp,%ebp
jle    1170 <indent+0x50>
lea    0x2ef6(%rip),%r15
lea    0xeaf(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <strcat@plt>
add    $0xffffffff,%ebp
jne    1160 <indent+0x40>
test   %r14d,%r14d
lea    0xe89(%rip),%rax
lea    0xe83(%rip),%rsi
cmove  %rax,%rsi
lea    0x2eb4(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@indent.buf = internal global [64 x i8] zeroinitializer
@.str = [4 x i8] c"| \00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @indent(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
%6 = call i32 @memset(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i32 0, i32 64)
store i32 0, i32* %5
br label %7
7: ; preds = %13, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = call i32 @strcat(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 1
store i32 %15, i32* %5
br label %7
16: ; preds = %7
%17 = load i32, i32* %4
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = call i32 @strcat(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
21: ; preds = %16
%22 = call i32 @strcat(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0)
}

LLVM IR (-O2):
@indent.buf = internal global [64 x i8] zeroinitializer
@.str = [4 x i8] c"| \00"
@.str.1 = [2 x i8] c"+\00"
@.str.2 = [1 x i8] zeroinitializer
define i8* @indent(i32 %0, i32 %1) {
%3 = tail call i32 @memset(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i32 0, i32 64)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %10
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @strcat(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = icmp eq i32 %1, 0
%12 = select i1 %11, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%13 = tail call i32 @strcat(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0), i8* %12)
ret i8* getelementptr inbounds ([64 x i8], [64 x i8]* @indent.buf, i64 0, i64 0)
}