#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__ getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
int strindex(char *, char *);
int main(void) {
  char line[200];
  char pattern[200] = "is";
  while (getline(line, 200) != 0) {
    if (strindex(line, pattern) != -1) {
      printf("%s", line);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rdi
xor    %esi,%esi
mov    $0xc8,%edx
call   1040 <memset@plt>
movb   $0x69,-0x1a0(%rbp)
movb   $0x73,-0x19f(%rbp)
lea    -0xd0(%rbp),%rdi
mov    $0xc8,%esi
call   1060 <getline@plt>
cmp    $0x0,%rax
je     11c2 <main+0x82>
lea    -0xd0(%rbp),%rdi
lea    -0x1a0(%rbp),%rsi
call   1050 <strindex@plt>
cmp    $0xffffffff,%eax
je     11bd <main+0x7d>
lea    -0xd0(%rbp),%rsi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
jmp    1173 <main+0x33>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x1a0,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0xb0(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0xc0(%rsp)
movw   $0x7369,(%rsp)
lea    0xd0(%rsp),%rdi
mov    $0xc8,%esi
call   1050 <getline@plt>
test   %rax,%rax
je     11ff <main+0xcf>
lea    0xd0(%rsp),%rbx
mov    %rsp,%r14
lea    0xe3f(%rip),%r15
jmp    11e2 <main+0xb2>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    $0xc8,%esi
call   1050 <getline@plt>
test   %rax,%rax
je     11ff <main+0xcf>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strindex@plt>
cmp    $0xffffffff,%eax
je     11d0 <main+0xa0>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    11d0 <main+0xa0>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [200 x i8]
%3 = alloca [200 x i8]
store i32 0, i32* %1
%4 = bitcast [200 x i8]* %3 to i8*
%5 = bitcast i8* %4 to [200 x i8]*
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i32 0, i32 0
store i8 105, i8* %6
%7 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i32 0, i32 1
store i8 115, i8* %7
br label %8
8: ; preds = %20, %0
%9 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%10 = call i64 @getline(i8* %9, i32 200)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %8
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%15 = call i32 @strindex(i8* %13, i8* %14)
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%19 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %17, %12
br label %8
21: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [200 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [200 x i8], [200 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
store i8 105, i8* %4
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 1
store i8 115, i8* %5
%6 = call i64 @getline(i8* %3, i32 200)
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %0, %13
%9 = call i32 @strindex(i8* %3, i8* %4)
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
br label %13
13: ; preds = %11, %8
%14 = call i64 @getline(i8* %3, i32 200)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %8
16: ; preds = %13, %0
ret i32 0
}