#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 /*<<< orphan*/ buffer;

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, int);
int sscanf(char *, char *, char *);
int /*<<< orphan*/ stdin;
int main() {
  char buffer[110];
  char str[101], pattern[101];
  char stat;
  int cnt = 0;
  if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
    exit(EXIT_FAILURE);
  }
  if (sscanf(buffer, "%s", str) != 1) {
    exit(EXIT_FAILURE);
  }
  if (fgets(buffer, sizeof(buffer), stdin) == NULL) {
    exit(EXIT_FAILURE);
  }
  if (sscanf(buffer, "%s", pattern) != 1) {
    exit(EXIT_FAILURE);
  }
  for (int i = 0; str[i] != '\0'; i++) {
    stat = 1;
    for (int j = 0; pattern[j] != '\0'; j++) {
      if (str[i + j] != pattern[j]) {
        stat = 0;
        break;
      }
    }
    if (stat == 1) {
      cnt++;
    }
  }
  printf("%d", cnt);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x170,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x168(%rbp)
lea    -0x80(%rbp),%rdi
mov    0x2e81(%rip),%rax
mov    (%rax),%edx
mov    $0x6e,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    118b <main+0x4b>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    -0x80(%rbp),%rdi
lea    -0xf0(%rbp),%rdx
lea    0xe63(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     11b9 <main+0x79>
mov    0x2e26(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    -0x80(%rbp),%rdi
mov    0x2e24(%rip),%rax
mov    (%rax),%edx
mov    $0x6e,%esi
call   1040 <fgets@plt>
cmp    $0x0,%rax
jne    11e8 <main+0xa8>
mov    0x2df7(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
lea    -0x80(%rbp),%rdi
lea    -0x160(%rbp),%rdx
lea    0xe06(%rip),%rsi
call   1050 <sscanf@plt>
cmp    $0x1,%eax
je     1216 <main+0xd6>
mov    0x2dc9(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>
movl   $0x0,-0x16c(%rbp)
movslq -0x16c(%rbp),%rax
movsbl -0xf0(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     12eb <main+0x1ab>
movb   $0x1,-0x161(%rbp)
movl   $0x0,-0x170(%rbp)
movslq -0x170(%rbp),%rax
movsbl -0x160(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     12b3 <main+0x173>
mov    -0x16c(%rbp),%eax
add    -0x170(%rbp),%eax
cltq
movsbl -0xf0(%rbp,%rax,1),%eax
ff
movslq -0x170(%rbp),%rcx
movsbl -0x160(%rbp,%rcx,1),%ecx
ff
cmp    %ecx,%eax
je     129a <main+0x15a>
movb   $0x0,-0x161(%rbp)
jmp    12b3 <main+0x173>
jmp    129f <main+0x15f>
mov    -0x170(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x170(%rbp)
jmp    1249 <main+0x109>
movsbl -0x161(%rbp),%eax
cmp    $0x1,%eax
jne    12d2 <main+0x192>
mov    -0x168(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x168(%rbp)
jmp    12d7 <main+0x197>
mov    -0x16c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x16c(%rbp)
jmp    1220 <main+0xe0>
mov    -0x168(%rbp),%esi
lea    0xd0b(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ccc(%rip),%rax
mov    (%rax),%eax
add    $0x170,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x148,%rsp
mov    0x2e97(%rip),%r14
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x6e,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1246 <main+0x106>
lea    0xe8f(%rip),%rsi
mov    %rsp,%rdi
lea    0xe0(%rsp),%rbx
mov    %rbx,%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1246 <main+0x106>
mov    (%r14),%edx
mov    %rsp,%rdi
mov    $0x6e,%esi
call   1040 <fgets@plt>
test   %rax,%rax
je     1246 <main+0x106>
lea    0xe53(%rip),%rsi
mov    %rsp,%rdi
lea    0x70(%rsp),%rdx
call   1050 <sscanf@plt>
cmp    $0x1,%eax
jne    1246 <main+0x106>
cmpb   $0x0,0xe0(%rsp)
je     1224 <main+0xe4>
xor    %ecx,%ecx
mov    0x70(%rsp),%r8b
xor    %esi,%esi
jmp    11f6 <main+0xb6>
nopl   0x0(%rax,%rax,1)
xor    %edx,%edx
add    %edx,%esi
add    $0x1,%rbx
cmpb   $0x0,0xe1(%rsp,%rcx,1)
lea    0x1(%rcx),%rcx
je     1226 <main+0xe6>
mov    $0x1,%edx
test   %r8b,%r8b
je     11e2 <main+0xa2>
xor    %edi,%edi
mov    %r8d,%eax
cs nopw 0x0(%rax,%rax,1)
nop
cmp    %al,(%rbx,%rdi,1)
jne    11e0 <main+0xa0>
movzbl 0x71(%rsp,%rdi,1),%eax
add    $0x1,%rdi
test   %al,%al
jne    1210 <main+0xd0>
jmp    11e2 <main+0xa2>
xor    %esi,%esi
lea    0xdd6(%rip),%rdi
call   1030 <printf@plt>
mov    0x2d97(%rip),%rax
mov    (%rax),%eax
add    $0x148,%rsp
pop    %rbx
pop    %r14
ret
mov    0x2d8b(%rip),%rax
mov    (%rax),%edi
call   1060 <exit@plt>

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

LLVM IR (-O2):
@stdin = global i32 0
@EXIT_FAILURE = global i32 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [110 x i8]
%2 = alloca [101 x i8]
%3 = alloca [101 x i8]
%4 = getelementptr inbounds [110 x i8], [110 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 0
%7 = load i32, i32* @stdin
%8 = call i32* @fgets(i8* %4, i32 110, i32 %7)
%9 = icmp eq i32* %8, null
br i1 %9, label %10, label %13
10: ; preds = %0
%11 = load i32, i32* @EXIT_FAILURE
%12 = call i32 @exit(i32 %11)
unreachable
13: ; preds = %0
%14 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%15 = icmp eq i32 %14, 1
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* @EXIT_FAILURE
%18 = call i32 @exit(i32 %17)
unreachable
19: ; preds = %13
%20 = load i32, i32* @stdin
%21 = call i32* @fgets(i8* %4, i32 110, i32 %20)
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %26
23: ; preds = %19
%24 = load i32, i32* @EXIT_FAILURE
%25 = call i32 @exit(i32 %24)
unreachable
26: ; preds = %19
%27 = call i32 @sscanf(i8* %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %6)
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %35
29: ; preds = %26
%30 = load i8, i8* %5
%31 = icmp eq i8 %30, 0
br i1 %31, label %41, label %32
32: ; preds = %29
%33 = load i8, i8* %6
%34 = icmp eq i8 %33, 0
br label %38
35: ; preds = %26
%36 = load i32, i32* @EXIT_FAILURE
%37 = call i32 @exit(i32 %36)
unreachable
38: ; preds = %32, %57
%39 = phi i64 [ 0, %32 ], [ %60, %57 ]
%40 = phi i32 [ 0, %32 ], [ %59, %57 ]
br i1 %34, label %57, label %49
41: ; preds = %57, %29
%42 = phi i32 [ 0, %29 ], [ %59, %57 ]
%43 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %42)
%44 = load i32, i32* @EXIT_SUCCESS
ret i32 %44
45: ; preds = %49
%46 = getelementptr inbounds [101 x i8], [101 x i8]* %3, i64 0, i64 %56
%47 = load i8, i8* %46
%48 = icmp eq i8 %47, 0
br i1 %48, label %57, label %49
49: ; preds = %38, %45
%50 = phi i64 [ %56, %45 ], [ 0, %38 ]
%51 = phi i8 [ %47, %45 ], [ %33, %38 ]
%52 = add nuw nsw i64 %50, %39
%53 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = icmp eq i8 %54, %51
%56 = add nuw i64 %50, 1
br i1 %55, label %45, label %57
57: ; preds = %45, %49, %38
%58 = phi i32 [ 1, %38 ], [ 1, %45 ], [ 0, %49 ]
%59 = add nuw nsw i32 %40, %58
%60 = add nuw i64 %39, 1
%61 = getelementptr inbounds [101 x i8], [101 x i8]* %2, i64 0, i64 %60
%62 = load i8, i8* %61
%63 = icmp eq i8 %62, 0
br i1 %63, label %41, label %38
}