#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*/ char_length(char const *);
scalar_t__ is_blank_char(char const *);
size_t indent_length(const char *line) {
  const char *start = line;
  while (*line != '\0' && is_blank_char(line))
    line += char_length(line);
  return (line - start);
}


x86 assembly (clang, -O0):
<indent_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     115c <indent_length+0x3c>
mov    -0x8(%rbp),%rdi
call   1030 <is_blank_char@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    116c <indent_length+0x4c>
jmp    118a <indent_length+0x6a>
mov    -0x8(%rbp),%rdi
call   1040 <char_length@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
jmp    1134 <indent_length+0x14>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
sub    %rcx,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<indent_length>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
cmpb   $0x0,(%rdi)
mov    %rdi,%rax
je     116a <indent_length+0x4a>
mov    %r14,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <is_blank_char@plt>
test   %rax,%rax
je     1167 <indent_length+0x47>
mov    %rbx,%rdi
call   1040 <char_length@plt>
movslq %eax,%rcx
lea    (%rbx,%rcx,1),%rax
cmpb   $0x0,(%rbx,%rcx,1)
mov    %rax,%rbx
jne    1140 <indent_length+0x20>
jmp    116a <indent_length+0x4a>
mov    %rbx,%rax
sub    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @indent_length(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
br label %5
5: ; preds = %16, %1
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = call i64 @is_blank_char(i8* %11)
%13 = icmp ne i64 %12, 0
br label %14
14: ; preds = %10, %5
%15 = phi i1 [ false, %5 ], [ %13, %10 ]
br i1 %15, label %16, label %22
16: ; preds = %14
%17 = load i8*, i8** %2
%18 = call i32 @char_length(i8* %17)
%19 = load i8*, i8** %2
%20 = sext i32 %18 to i64
%21 = getelementptr inbounds i8, i8* %19, i64 %20
store i8* %21, i8** %2
br label %5
22: ; preds = %14
%23 = load i8*, i8** %2
%24 = load i8*, i8** %3
%25 = ptrtoint i8* %23 to i64
%26 = ptrtoint i8* %24 to i64
%27 = sub i64 %25, %26
ret i64 %27
}

LLVM IR (-O2):
define i64 @indent_length(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %8
%5 = phi i8* [ %11, %8 ], [ %0, %1 ]
%6 = tail call i64 @is_blank_char(i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %4
%9 = tail call i32 @char_length(i8* %5)
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %5, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %8, %1
%15 = phi i8* [ %0, %1 ], [ %11, %8 ], [ %5, %4 ]
%16 = ptrtoint i8* %15 to i64
%17 = ptrtoint i8* %0 to i64
%18 = sub i64 %16, %17
ret i64 %18
}