#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__ EOF;
int /*<<< orphan*/ printf(char *);
scalar_t__ scanf(char *, char *);
int /*<<< orphan*/ *strstr(char *, char *);
int main(int argc, const char *argv[]) {
  char str[501], s[10];
  while (scanf("%s", str) != EOF) {
    scanf("%s", s);
    if (strstr(str, s) != NULL)
      printf("Found!\n");
    else
      printf("Not found!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1040 <scanf@plt>
mov    0x2e85(%rip),%rcx
cmp    (%rcx),%rax
je     11be <main+0x8e>
lea    -0x21a(%rbp),%rsi
lea    0xe86(%rip),%rdi
call   1040 <scanf@plt>
lea    -0x210(%rbp),%rdi
lea    -0x21a(%rbp),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     11ad <main+0x7d>
lea    0xe60(%rip),%rdi
call   1030 <printf@plt>
jmp    11b9 <main+0x89>
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x208,%rsp
lea    0xeb8(%rip),%rdi
lea    0x10(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x2e8f(%rip),%r12
cmp    (%r12),%rax
je     11b6 <main+0x86>
lea    0xe9a(%rip),%r14
lea    0x6(%rsp),%r15
lea    0x10(%rsp),%rbx
lea    0xe8c(%rip),%r13
lea    0xe90(%rip),%rbp
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <strstr@plt>
test   %rax,%rax
mov    %rbp,%rdi
cmove  %r13,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <scanf@plt>
cmp    (%r12),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x208,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [8 x i8] c"Found!\0A\00"
@.str.2 = [12 x i8] c"Not found!\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [501 x i8]
%7 = alloca [10 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %24, %2
%9 = getelementptr inbounds [501 x i8], [501 x i8]* %6, i64 0, i64 0
%10 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i64, i64* @EOF
%12 = icmp ne i64 %10, %11
br i1 %12, label %13, label %25
13: ; preds = %8
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%15 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [501 x i8], [501 x i8]* %6, i64 0, i64 0
%17 = getelementptr inbounds [10 x i8], [10 x i8]* %7, i64 0, i64 0
%18 = call i32* @strstr(i8* %16, i8* %17)
%19 = icmp ne i32* %18, null
br i1 %19, label %20, label %22
20: ; preds = %13
%21 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
br label %24
22: ; preds = %13
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %20
br label %8
25: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@str = [11 x i8] c"Not found!\00"
@str.3 = [7 x i8] c"Found!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [501 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [501 x i8], [501 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%7 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = load i64, i64* @EOF
%9 = icmp eq i64 %7, %8
br i1 %9, label %19, label %10
10: ; preds = %2, %10
%11 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%12 = call i32* @strstr(i8* %5, i8* %6)
%13 = icmp eq i32* %12, null
%14 = select i1 %13, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @str.3, i64 0, i64 0)
%15 = call i32 @puts(i8* dereferenceable(1) %14)
%16 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%17 = load i64, i64* @EOF
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %10
19: ; preds = %10, %2
ret i32 0
}