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


x86 assembly (clang, -O0):
<findEqualCharacter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jae    1171 <findEqualCharacter+0x61>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    115e <findEqualCharacter+0x4e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1178 <findEqualCharacter+0x68>
jmp    1163 <findEqualCharacter+0x53>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <findEqualCharacter+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<findEqualCharacter>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strlen@plt>
xor    %ebx,%ebx
test   %eax,%eax
je     114c <findEqualCharacter+0x3c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x3d,(%r14,%rbx,1)
je     114c <findEqualCharacter+0x3c>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%eax
cmp    %rax,%rbx
jb     1130 <findEqualCharacter+0x20>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @findEqualCharacter(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = load i8*, i8** %3
%8 = call i32 @strlen(i8* %7)
%9 = icmp ult i32 %6, %8
br i1 %9, label %10, label %24
10: ; preds = %5
%11 = load i8*, i8** %3
%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 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 61
br i1 %17, label %18, label %20
18: ; preds = %10
%19 = load i32, i32* %4
store i32 %19, i32* %2
br label %25
20: ; preds = %10
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %18
%26 = load i32, i32* %2
ret i32 %26
}

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