#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*/ bail_error(char *);
scalar_t__ strncmp(char *, char *, int);
char *ltrim_string(char *str) {
  if (strncmp(str, " * ", 3) == 0)
    str += 3;
  while (*str == ' ')
    str++;
  if (*str == '\t')
    bail_error("Indent with spaces, not TABs");
  return str;
}


x86 assembly (clang, -O0):
<ltrim_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1157 <ltrim_string+0x37>
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
jmp    115c <ltrim_string+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    117d <ltrim_string+0x5d>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    115c <ltrim_string+0x3c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x9,%eax
jne    1199 <ltrim_string+0x79>
lea    0xe70(%rip),%rdi
call   1040 <bail_error@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ltrim_string>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
lea    (%rcx,%rcx,2),%rbx
add    %r14,%rbx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
cmp    $0x20,%al
jne    115d <ltrim_string+0x3d>
add    $0x1,%rbx
jmp    1150 <ltrim_string+0x30>
cmp    $0x9,%al
jne    116d <ltrim_string+0x4d>
lea    0xe9c(%rip),%rdi
call   1040 <bail_error@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c" * \00"
@.str.1 = [29 x i8] c"Indent with spaces, not TABs\00"
define i8* @ltrim_string(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strncmp(i8* %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 3
store i8* %8, i8** %2
br label %9
9: ; preds = %6, %1
br label %10
10: ; preds = %15, %9
%11 = load i8*, i8** %2
%12 = load i8, i8* %11
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 32
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i8*, i8** %2
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %2
br label %10
18: ; preds = %10
%19 = load i8*, i8** %2
%20 = load i8, i8* %19
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 9
br i1 %22, label %23, label %25
23: ; preds = %18
%24 = call i32 @bail_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %25
25: ; preds = %23, %18
%26 = load i8*, i8** %2
ret i8* %26
}

LLVM IR (-O2):
@.str = [4 x i8] c" * \00"
@.str.1 = [29 x i8] c"Indent with spaces, not TABs\00"
define i8* @ltrim_string(i8* %0) {
%2 = tail call i64 @strncmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i64 3, i64 0
%5 = getelementptr i8, i8* %0, i64 %4
br label %6
6: ; preds = %9, %1
%7 = phi i8* [ %5, %1 ], [ %10, %9 ]
%8 = load i8, i8* %7
switch i8 %8, label %13 [
i8 32, label %9
i8 9, label %11
]
9: ; preds = %6
%10 = getelementptr inbounds i8, i8* %7, i64 1
br label %6
11: ; preds = %6
%12 = tail call i32 @bail_error(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
br label %13
13: ; preds = %6, %11
ret i8* %7
}