#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 /*<<< orphan*/ *gets(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ *strstr(char *, char *);
int main(int argc, const char *argv[]) {
  char str[501], s[501];
  while (gets(str) != NULL) {
    gets(s);
    if (strstr(str, s) != NULL)
      printf("YES!\n");
    else
      printf("NO!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x210(%rbp),%rdi
call   1040 <gets@plt>
cmp    $0x0,%rax
je     11aa <main+0x7a>
lea    -0x410(%rbp),%rdi
call   1040 <gets@plt>
lea    -0x210(%rbp),%rdi
lea    -0x410(%rbp),%rsi
call   1050 <strstr@plt>
cmp    $0x0,%rax
je     1199 <main+0x69>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
jmp    11a5 <main+0x75>
lea    0xe66(%rip),%rdi
call   1030 <printf@plt>
jmp    1149 <main+0x19>
xor    %eax,%eax
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x3f8,%rsp
mov    %rsp,%rdi
call   1040 <gets@plt>
test   %rax,%rax
je     119f <main+0x6f>
lea    0x200(%rsp),%r14
mov    %rsp,%rbx
lea    0xea3(%rip),%r15
lea    0xea0(%rip),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <gets@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <strstr@plt>
test   %rax,%rax
mov    %r12,%rdi
cmove  %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <gets@plt>
test   %rax,%rax
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x3f8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [6 x i8] c"YES!\0A\00"
@.str.1 = [5 x i8] c"NO!\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 [501 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %8
8: ; preds = %23, %2
%9 = getelementptr inbounds [501 x i8], [501 x i8]* %6, i64 0, i64 0
%10 = call i32* @gets(i8* %9)
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = getelementptr inbounds [501 x i8], [501 x i8]* %7, i64 0, i64 0
%14 = call i32* @gets(i8* %13)
%15 = getelementptr inbounds [501 x i8], [501 x i8]* %6, i64 0, i64 0
%16 = getelementptr inbounds [501 x i8], [501 x i8]* %7, i64 0, i64 0
%17 = call i32* @strstr(i8* %15, i8* %16)
%18 = icmp ne i32* %17, null
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %23
21: ; preds = %12
%22 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %21, %19
br label %8
24: ; preds = %8
ret i32 0
}

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