#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 strlen(char *);
int extract_ode(char *s1, int *ie, int i1) {
  int i = 0, n = strlen(s1);
  i = i1;
  while (i < n) {
    if (s1[i] == '=') {
      *ie = i + 1;
      return 1;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<extract_ode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x24(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    1183 <extract_ode+0x73>
mov    -0x10(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x3d,%eax
jne    1175 <extract_ode+0x65>
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    118a <extract_ode+0x7a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    113c <extract_ode+0x2c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_ode>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %r15d,%ecx
jle    1168 <extract_ode+0x58>
movslq %r15d,%rdx
add    $0x1,%r15d
add    %rdx,%rbx
neg    %ecx
nopl   0x0(%rax,%rax,1)
cmpb   $0x3d,(%rbx)
je     1160 <extract_ode+0x50>
add    $0x1,%rbx
lea    (%rcx,%r15,1),%edx
add    $0x1,%edx
mov    %r15d,%esi
add    $0x1,%esi
mov    %esi,%r15d
cmp    $0x1,%edx
jne    1140 <extract_ode+0x30>
jmp    1168 <extract_ode+0x58>
mov    %r15d,(%r14)
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

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