#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*/ isspace(char);
unsigned int strlen(char *);
unsigned int startIndex(char *value) {
  unsigned int start = 0;
  for (unsigned int i = 0; i < strlen(value); i++) {
    if (!isspace(value[i])) {
      if (value[i] != '=') {
        start = i;
        break;
      }
    }
  }
  return start;
}


x86 assembly (clang, -O0):
<startIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
cmp    %ecx,%eax
jae    11a6 <startIndex+0x86>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%edi
call   1040 <isspace@plt>
cmp    $0x0,%eax
jne    1193 <startIndex+0x73>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
je     118e <startIndex+0x6e>
mov    -0x10(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    11a6 <startIndex+0x86>
jmp    1193 <startIndex+0x73>
jmp    1198 <startIndex+0x78>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    113a <startIndex+0x1a>
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<startIndex>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
xor    %ebx,%ebx
test   %eax,%eax
jne    1153 <startIndex+0x33>
jmp    116c <startIndex+0x4c>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jae    116a <startIndex+0x4a>
movsbl (%r14,%rbx,1),%edi
call   1040 <isspace@plt>
test   %eax,%eax
jne    1140 <startIndex+0x20>
cmpb   $0x3d,(%r14,%rbx,1)
je     1140 <startIndex+0x20>
jmp    116c <startIndex+0x4c>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @startIndex(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %5
5: ; preds = %30, %1
%6 = load i32, i32* %4
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %33
10: ; preds = %5
%11 = load i8*, i8** %2
%12 = load i32, i32* %4
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i8, i8* %14
%16 = call i32 @isspace(i8 signext %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %29, label %18
18: ; preds = %10
%19 = load i8*, i8** %2
%20 = load i32, i32* %4
%21 = zext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = icmp ne i32 %24, 61
br i1 %25, label %26, label %28
26: ; preds = %18
%27 = load i32, i32* %4
store i32 %27, i32* %3
br label %33
28: ; preds = %18
br label %29
29: ; preds = %28, %10
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add i32 %31, 1
store i32 %32, i32* %4
br label %5
33: ; preds = %26, %5
%34 = load i32, i32* %3
ret i32 %34
}

LLVM IR (-O2):
define i32 @startIndex(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %20, label %4
4: ; preds = %1, %13
%5 = phi i64 [ %14, %13 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call i32 @isspace(i8 signext %7)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %4
%11 = load i8, i8* %6
%12 = icmp eq i8 %11, 61
br i1 %12, label %13, label %18
13: ; preds = %4, %10
%14 = add nuw nsw i64 %5, 1
%15 = tail call i32 @strlen(i8* %0)
%16 = zext i32 %15 to i64
%17 = icmp ult i64 %14, %16
br i1 %17, label %4, label %20
18: ; preds = %10
%19 = trunc i64 %5 to i32
br label %20
20: ; preds = %13, %18, %1
%21 = phi i32 [ 0, %1 ], [ %19, %18 ], [ 0, %13 ]
ret i32 %21
}