#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*/ putc(char, int /*<<< orphan*/ *);
void indent(int amount, FILE *fp) {
  while (amount >= 8) {
    putc('\t', fp);
    amount -= 8;
  }
  while (--amount >= 0) {
    putc(' ', fp);
  }
}


x86 assembly (clang, -O0):
<indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x8,-0x4(%rbp)
jl     1145 <indent+0x35>
mov    -0x10(%rbp),%rsi
mov    $0x9,%edi
call   1030 <putc@plt>
mov    -0x4(%rbp),%eax
sub    $0x8,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <indent+0xf>
jmp    114a <indent+0x3a>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
cmp    $0x0,%eax
jl     116f <indent+0x5f>
mov    -0x10(%rbp),%rsi
mov    $0x20,%edi
call   1030 <putc@plt>
jmp    114a <indent+0x3a>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
cmp    $0x8,%edi
jl     113d <indent+0x2d>
xchg   %ax,%ax
mov    $0x9,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
lea    -0x8(%rbx),%ebp
cmp    $0xf,%ebx
mov    %ebp,%ebx
ja     1120 <indent+0x10>
test   %ebp,%ebp
jg     1143 <indent+0x33>
jmp    1165 <indent+0x55>
mov    %ebx,%ebp
test   %ebp,%ebp
jle    1165 <indent+0x55>
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    $0x20,%edi
mov    %r14,%rsi
call   1030 <putc@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1150 <indent+0x40>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @indent(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
br label %5
5: ; preds = %8, %2
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 8
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32*, i32** %4
%10 = call i32 @putc(i8 signext 9, i32* %9)
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 8
store i32 %12, i32* %3
br label %5
13: ; preds = %5
br label %14
14: ; preds = %18, %13
%15 = load i32, i32* %3
%16 = add nsw i32 %15, -1
store i32 %16, i32* %3
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %14
%19 = load i32*, i32** %4
%20 = call i32 @putc(i8 signext 32, i32* %19)
br label %14
21: ; preds = %14
ret void
}

LLVM IR (-O2):
define void @indent(i32 %0, i32* nocapture %1) {
%3 = icmp sgt i32 %0, 7
br i1 %3, label %7, label %4
4: ; preds = %7, %2
%5 = phi i32 [ %0, %2 ], [ %10, %7 ]
%6 = icmp sgt i32 %5, 0
br i1 %6, label %12, label %17
7: ; preds = %2, %7
%8 = phi i32 [ %10, %7 ], [ %0, %2 ]
%9 = tail call i32 @putc(i8 signext 9, i32* %1)
%10 = add nsw i32 %8, -8
%11 = icmp ugt i32 %8, 15
br i1 %11, label %7, label %4
12: ; preds = %4, %12
%13 = phi i32 [ %14, %12 ], [ %5, %4 ]
%14 = add nsw i32 %13, -1
%15 = tail call i32 @putc(i8 signext 32, i32* %1)
%16 = icmp ugt i32 %13, 1
br i1 %16, label %12, label %17
17: ; preds = %12, %4
ret void
}