#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 */
typedef int length2;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int str_len(char *);
int main() {
  char str1[100], str2[100], ch;
  int n;
  scanf("%s\n", str1);
  scanf("%c\n", &ch);
  scanf("%d\n", &n);
  scanf("%s\n", str2);
  int i, j, count = 0;
  int length1 = str_len(str1);
  int length2 = str_len(str2);
  for (i = 0; i < length1; i++) {
    if (ch == str1[i])
      count++;
  }
  int res = 0;
  for (i = 0; i < length1; i++) {
    if (str2[0] == str1[i]) {
      for (j = 0; j < length2; j++) {
        if (str2[j] != str1[i + j])
          break;
      }
      if (j == (length2)-1) {
        res = 1;
        break;
      }
    }
  }
  printf("%d", res);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea9(%rip),%rdi
lea    -0xe1(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe98(%rip),%rdi
lea    -0xe8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    -0xe0(%rbp),%rsi
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <scanf@plt>
movl   $0x0,-0xf4(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <str_len@plt>
mov    %eax,-0xf8(%rbp)
lea    -0xe0(%rbp),%rdi
call   1050 <str_len@plt>
mov    %eax,-0xfc(%rbp)
movl   $0x0,-0xec(%rbp)
mov    -0xec(%rbp),%eax
cmp    -0xf8(%rbp),%eax
jge    121d <main+0xed>
movsbl -0xe1(%rbp),%eax
movslq -0xec(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    1204 <main+0xd4>
mov    -0xf4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
jmp    1209 <main+0xd9>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    11c8 <main+0x98>
movl   $0x0,-0x100(%rbp)
movl   $0x0,-0xec(%rbp)
mov    -0xec(%rbp),%eax
cmp    -0xf8(%rbp),%eax
jge    1307 <main+0x1d7>
movsbl -0xe0(%rbp),%eax
movslq -0xec(%rbp),%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
jne    12ee <main+0x1be>
movl   $0x0,-0xf0(%rbp)
mov    -0xf0(%rbp),%eax
cmp    -0xfc(%rbp),%eax
jge    12c3 <main+0x193>
movslq -0xf0(%rbp),%rax
movsbl -0xe0(%rbp,%rax,1),%eax
ff
mov    -0xec(%rbp),%ecx
add    -0xf0(%rbp),%ecx
movslq %ecx,%rcx
movsbl -0x70(%rbp,%rcx,1),%ecx
cmp    %ecx,%eax
je     12aa <main+0x17a>
jmp    12c3 <main+0x193>
jmp    12af <main+0x17f>
mov    -0xf0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf0(%rbp)
jmp    1268 <main+0x138>
mov    -0xf0(%rbp),%eax
mov    -0xfc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    12e9 <main+0x1b9>
movl   $0x1,-0x100(%rbp)
jmp    1307 <main+0x1d7>
jmp    12ee <main+0x1be>
jmp    12f3 <main+0x1c3>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    1231 <main+0x101>
mov    -0x100(%rbp),%esi
lea    0xcf8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0xe8,%rsp
lea    0xebc(%rip),%rbp
xor    %r14d,%r14d
lea    0x80(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea1(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe92(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0x10(%rsp),%r15
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
call   1050 <str_len@plt>
mov    %eax,%ebp
mov    %r15,%rdi
call   1050 <str_len@plt>
test   %ebp,%ebp
jle    1210 <main+0xe0>
mov    0x10(%rsp),%r9b
lea    -0x1(%rax),%r8d
mov    %ebp,%esi
mov    %eax,%edi
xor    %ebp,%ebp
jmp    11d2 <main+0xa2>
nopl   0x0(%rax,%rax,1)
cmp    %r8d,%edx
je     120a <main+0xda>
add    $0x1,%rbp
add    $0x1,%rbx
cmp    %rsi,%rbp
je     1205 <main+0xd5>
cmp    0x80(%rsp,%rbp,1),%r9b
jne    11c5 <main+0x95>
xor    %edx,%edx
test   %eax,%eax
jle    11c0 <main+0x90>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl 0x10(%rsp,%rdx,1),%ecx
cmp    (%rbx,%rdx,1),%cl
jne    11c0 <main+0x90>
add    $0x1,%rdx
cmp    %rdx,%rdi
jne    11f0 <main+0xc0>
jmp    11c5 <main+0x95>
xor    %r14d,%r14d
jmp    1210 <main+0xe0>
mov    $0x1,%r14d
lea    0xdf5(%rip),%rdi
mov    %r14d,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca [100 x i8]
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 0, i32* %1
%12 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %5)
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %16)
store i32 0, i32* %8
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = call i32 @str_len(i8* %18)
store i32 %19, i32* %9
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%21 = call i32 @str_len(i8* %20)
store i32 %21, i32* %10
store i32 0, i32* %6
br label %22
22: ; preds = %39, %0
%23 = load i32, i32* %6
%24 = load i32, i32* %9
%25 = icmp slt i32 %23, %24
br i1 %25, label %26, label %42
26: ; preds = %22
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = sext i8 %32 to i32
%34 = icmp eq i32 %28, %33
br i1 %34, label %35, label %38
35: ; preds = %26
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %38
38: ; preds = %35, %26
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %22
42: ; preds = %22
store i32 0, i32* %11
store i32 0, i32* %6
br label %43
43: ; preds = %89, %42
%44 = load i32, i32* %6
%45 = load i32, i32* %9
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %92
47: ; preds = %43
%48 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = load i32, i32* %6
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %50, %55
br i1 %56, label %57, label %88
57: ; preds = %47
store i32 0, i32* %7
br label %58
58: ; preds = %78, %57
%59 = load i32, i32* %7
%60 = load i32, i32* %10
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %81
62: ; preds = %58
%63 = load i32, i32* %7
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = sext i8 %66 to i32
%68 = load i32, i32* %6
%69 = load i32, i32* %7
%70 = add nsw i32 %68, %69
%71 = sext i32 %70 to i64
%72 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %71
%73 = load i8, i8* %72
%74 = sext i8 %73 to i32
%75 = icmp ne i32 %67, %74
br i1 %75, label %76, label %77
76: ; preds = %62
br label %81
77: ; preds = %62
br label %78
78: ; preds = %77
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %58
81: ; preds = %76, %58
%82 = load i32, i32* %7
%83 = load i32, i32* %10
%84 = sub nsw i32 %83, 1
%85 = icmp eq i32 %82, %84
br i1 %85, label %86, label %87
86: ; preds = %81
store i32 1, i32* %11
br label %92
87: ; preds = %81
br label %88
88: ; preds = %87, %47
br label %89
89: ; preds = %88
%90 = load i32, i32* %6
%91 = add nsw i32 %90, 1
store i32 %91, i32* %6
br label %43
92: ; preds = %86, %43
%93 = load i32, i32* %11
%94 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %93)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [4 x i8] c"%c\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = alloca i8
%4 = alloca i32
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %5)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %6)
%12 = call i32 @str_len(i8* %5)
%13 = call i32 @str_len(i8* %6)
%14 = icmp sgt i32 %12, 0
br i1 %14, label %15, label %46
15: ; preds = %0
%16 = load i8, i8* %6
%17 = icmp sgt i32 %13, 0
%18 = add nsw i32 %13, -1
%19 = zext i32 %12 to i64
%20 = zext i32 %13 to i64
br label %21
21: ; preds = %15, %43
%22 = phi i64 [ 0, %15 ], [ %44, %43 ]
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %16, %24
br i1 %25, label %26, label %43
26: ; preds = %21
br i1 %17, label %27, label %40
27: ; preds = %26, %35
%28 = phi i64 [ %36, %35 ], [ 0, %26 ]
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = add nuw nsw i64 %28, %22
%32 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %30, %33
br i1 %34, label %35, label %38
35: ; preds = %27
%36 = add nuw nsw i64 %28, 1
%37 = icmp eq i64 %36, %20
br i1 %37, label %43, label %27
38: ; preds = %27
%39 = trunc i64 %28 to i32
br label %40
40: ; preds = %38, %26
%41 = phi i32 [ 0, %26 ], [ %39, %38 ]
%42 = icmp eq i32 %41, %18
br i1 %42, label %46, label %43
43: ; preds = %35, %21, %40
%44 = add nuw nsw i64 %22, 1
%45 = icmp eq i64 %44, %19
br i1 %45, label %46, label %21
46: ; preds = %43, %40, %0
%47 = phi i32 [ 0, %0 ], [ 1, %40 ], [ 0, %43 ]
%48 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %47)
ret i32 0
}