#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 */
scalar_t__ ft_isinarray(char const, char *);
size_t ft_strtrim_count_begin(char const *s) {
  size_t i;
  i = 0;
  while (s[i] && ft_isinarray(s[i], " \t\n\r\v\f"))
    ++i;
  return (i);
}


x86 assembly (clang, -O0):
<ft_strtrim_count_begin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
je     1160 <ft_strtrim_count_begin+0x50>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
lea    0xeb3(%rip),%rsi
movsbl (%rax,%rcx,1),%edi
call   1030 <ft_isinarray@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1170 <ft_strtrim_count_begin+0x60>
jmp    1181 <ft_strtrim_count_begin+0x71>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <ft_strtrim_count_begin+0x14>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_strtrim_count_begin>:
push   %r15
push   %r14
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1150 <ft_strtrim_count_begin+0x40>
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xed9(%rip),%r15
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
mov    %r15,%rsi
call   1030 <ft_isinarray@plt>
test   %rax,%rax
je     1152 <ft_strtrim_count_begin+0x42>
movzbl 0x1(%r14,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <ft_strtrim_count_begin+0x20>
jmp    1152 <ft_strtrim_count_begin+0x42>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i64 @ft_strtrim_count_begin(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
store i64 0, i64* %3
br label %4
4: ; preds = %20, %1
%5 = load i8*, i8** %2
%6 = load i64, i64* %3
%7 = getelementptr inbounds i8, i8* %5, i64 %6
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %18
11: ; preds = %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = getelementptr inbounds i8, i8* %12, i64 %13
%15 = load i8, i8* %14
%16 = call i64 @ft_isinarray(i8 signext %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%17 = icmp ne i64 %16, 0
br label %18
18: ; preds = %11, %4
%19 = phi i1 [ false, %4 ], [ %17, %11 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i64, i64* %3
%22 = add i64 %21, 1
store i64 %22, i64* %3
br label %4
23: ; preds = %18
%24 = load i64, i64* %3
ret i64 %24
}

LLVM IR (-O2):
@.str = [7 x i8] c" \09\0A\0D\0B\0C\00"
define i64 @ft_strtrim_count_begin(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %12, %9 ], [ %2, %1 ]
%6 = phi i64 [ %10, %9 ], [ 0, %1 ]
%7 = tail call i64 @ft_isinarray(i8 signext %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = add i64 %6, 1
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %9, %1
%15 = phi i64 [ 0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i64 %15
}