#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void indent(FILE *fp, unsigned depth, const char *trailer) {
  unsigned i;
  for (i = 0; i < depth; i++) {
    (void)fprintf(fp, "    ");
  }
  if (trailer) {
    (void)fprintf(fp, "%s", trailer);
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1156 <indent+0x46>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112a <indent+0x1a>
cmpq   $0x0,-0x18(%rbp)
je     1177 <indent+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe95(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
test   %esi,%esi
je     115a <indent+0x3a>
mov    %esi,%ebp
lea    0xec6(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    $0x4,%esi
mov    $0x1,%edx
mov    %r15,%rdi
mov    %rbx,%rcx
call   1040 <fwrite@plt>
add    $0xffffffff,%ebp
jne    1140 <indent+0x20>
test   %r14,%r14
je     1174 <indent+0x54>
mov    %r14,%rdi
mov    %rbx,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fputs@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [5 x i8] c" \00"
define void @indent(i32* nocapture %0, i32 %1, i8* %2) {
%4 = icmp eq i32 %1, 0
br i1 %4, label %10, label %5
5: ; preds = %3, %5
%6 = phi i32 [ %8, %5 ], [ 0, %3 ]
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64 4, i64 1, i32* %0)
%8 = add nuw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %10, label %5
10: ; preds = %5, %3
%11 = icmp eq i8* %2, null
br i1 %11, label %14, label %12
12: ; preds = %10
%13 = tail call i32 @fputs(i8* %2, i32* %0)
br label %14
14: ; preds = %12, %10
ret void
}