#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__ getline2(char *);
int /*<<< orphan*/ printf(char *, int);
int stirngindex(char *, char *);
int main() {
  int t;
  char s[1000];
  while (getline2(s) > 0) {
    if ((t = stirngindex(s, "Michael")) > 0)
      printf("%d", t);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
call   1040 <getline2@plt>
cmp    $0x0,%rax
jle    118b <main+0x5b>
lea    -0x3f0(%rbp),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <stirngindex@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1186 <main+0x56>
mov    -0x8(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1050 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x3f0,%rsp
mov    %rsp,%rdi
call   1040 <getline2@plt>
test   %rax,%rax
jle    1188 <main+0x58>
lea    0xeb0(%rip),%r14
mov    %rsp,%rbx
lea    0xeae(%rip),%r15
jmp    116d <main+0x3d>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1040 <getline2@plt>
test   %rax,%rax
jle    1188 <main+0x58>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <stirngindex@plt>
test   %eax,%eax
jle    1160 <main+0x30>
mov    %r15,%rdi
mov    %eax,%esi
call   1050 <printf@plt>
jmp    1160 <main+0x30>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Michael\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %15, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i64 @getline2(i8* %5)
%7 = icmp sgt i64 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = call i32 @stirngindex(i8* %9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
store i32 %10, i32* %2
%11 = icmp sgt i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %8
br label %4
16: ; preds = %4
%17 = load i32, i32* %1
ret i32 %17
}

LLVM IR (-O2):
@.str = [8 x i8] c"Michael\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i64 @getline2(i8* %2)
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = call i32 @stirngindex(i8* %2, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
br label %10
10: ; preds = %8, %5
%11 = call i64 @getline2(i8* %2)
%12 = icmp sgt i64 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}