#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*/ strcat(char *, char *);
void setIndents(char *pIndentsBuf, unsigned char indentNum) {
  unsigned char i = 0;
  const unsigned char MAX_NUM_OF_INDENT = 16 - sizeof('\0');
  if (indentNum > MAX_NUM_OF_INDENT) {
    indentNum = MAX_NUM_OF_INDENT;
  }
  *pIndentsBuf = '\0';
  for (i = 0; i < indentNum; i++) {
    strcat(pIndentsBuf, "\t");
  }
  *(pIndentsBuf + indentNum) = '\0';
}


x86 assembly (clang, -O0):
<setIndents>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movb   $0x0,-0xa(%rbp)
movb   $0xc,-0xb(%rbp)
movzbl -0x9(%rbp),%eax
cmp    $0xc,%eax
jle    113b <setIndents+0x2b>
movb   $0xc,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
movb   $0x0,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jge    1173 <setIndents+0x63>
mov    -0x8(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1030 <strcat@plt>
mov    -0xa(%rbp),%al
add    $0x1,%al
mov    %al,-0xa(%rbp)
jmp    1146 <setIndents+0x36>
mov    -0x8(%rbp),%rax
movzbl -0x9(%rbp),%ecx
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setIndents>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbp
cmp    $0xc,%sil
mov    $0xc,%r15d
cmovb  %esi,%r15d
movb   $0x0,(%rdi)
test   %r15d,%r15d
je     1150 <setIndents+0x40>
lea    0xec9(%rip),%r14
mov    %r15d,%ebx
nopw   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
add    $0xff,%bl
jne    1140 <setIndents+0x30>
movzbl %r15b,%eax
movb   $0x0,0x0(%rbp,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"\09\00"
define void @setIndents(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
store i8 0, i8* %5
store i8 12, i8* %6
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 12
br i1 %9, label %10, label %11
10: ; preds = %2
store i8 12, i8* %4
br label %11
11: ; preds = %10, %2
%12 = load i8*, i8** %3
store i8 0, i8* %12
store i8 0, i8* %5
br label %13
13: ; preds = %22, %11
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i8, i8* %4
%17 = zext i8 %16 to i32
%18 = icmp slt i32 %15, %17
br i1 %18, label %19, label %25
19: ; preds = %13
%20 = load i8*, i8** %3
%21 = call i32 @strcat(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %22
22: ; preds = %19
%23 = load i8, i8* %5
%24 = add i8 %23, 1
store i8 %24, i8* %5
br label %13
25: ; preds = %13
%26 = load i8*, i8** %3
%27 = load i8, i8* %4
%28 = zext i8 %27 to i32
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %26, i64 %29
store i8 0, i8* %30
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"\09\00"
define void @setIndents(i8* %0, i8 zeroext %1) {
%3 = icmp ult i8 %1, 12
%4 = select i1 %3, i8 %1, i8 12
store i8 0, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %2, %6
%7 = phi i8 [ %9, %6 ], [ 0, %2 ]
%8 = tail call i32 @strcat(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = add nuw nsw i8 %7, 1
%10 = icmp eq i8 %9, %4
br i1 %10, label %11, label %6
11: ; preds = %6, %2
%12 = zext i8 %4 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
store i8 0, i8* %13
ret void
}