#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__ compareStr(char *, char *, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main(int argc, char const *argv[]) {
  char str1[200];
  char str2[200];
  int occurrency = 0, sz1, sz2, i, diff;
  scanf(" %[^\n]", str1);
  scanf(" %[^\n]", str2);
  sz1 = strlen(str1);
  sz2 = strlen(str2);
  diff = sz1 - sz2;
  for (i = 0; i <= diff; ++i) {
    if (compareStr(str1, str2, i, sz2)) {
      occurrency++;
    }
  }
  printf("%d\n", occurrency);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1d0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x1b4(%rbp)
lea    -0xe0(%rbp),%rsi
lea    0xe8f(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x1b0(%rbp),%rsi
lea    0xe7c(%rip),%rdi
call   1060 <scanf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1b8(%rbp)
lea    -0x1b0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1bc(%rbp)
mov    -0x1b8(%rbp),%eax
sub    -0x1bc(%rbp),%eax
mov    %eax,-0x1c4(%rbp)
movl   $0x0,-0x1c0(%rbp)
mov    -0x1c0(%rbp),%eax
cmp    -0x1c4(%rbp),%eax
jg     122c <main+0xec>
lea    -0xe0(%rbp),%rdi
lea    -0x1b0(%rbp),%rsi
mov    -0x1c0(%rbp),%edx
mov    -0x1bc(%rbp),%ecx
call   1050 <compareStr@plt>
cmp    $0x0,%rax
je     1213 <main+0xd3>
mov    -0x1b4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1b4(%rbp)
jmp    1218 <main+0xd8>
mov    -0x1c0(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c0(%rbp)
jmp    11c9 <main+0x89>
mov    -0x1b4(%rbp),%esi
lea    0xdce(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x1d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x198,%rsp
lea    0xea8(%rip),%rbx
lea    0xd0(%rsp),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    %rsp,%rbp
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <scanf@plt>
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%r13d
mov    %rbp,%rdi
call   1030 <strlen@plt>
xor    %ebp,%ebp
sub    %eax,%r13d
jl     11cf <main+0x8f>
mov    %eax,%r14d
add    $0x1,%r13d
xor    %ebp,%ebp
lea    0xd0(%rsp),%r15
mov    %rsp,%r12
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %r12,%rsi
mov    %ebx,%edx
mov    %r14d,%ecx
call   1050 <compareStr@plt>
cmp    $0x1,%rax
sbb    $0xffffffff,%ebp
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    11b0 <main+0x70>
lea    0xe31(%rip),%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x198,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [200 x i8]
%7 = alloca [200 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%14 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%16 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%18 = call i32 @strlen(i8* %17)
store i32 %18, i32* %9
%19 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%20 = call i32 @strlen(i8* %19)
store i32 %20, i32* %10
%21 = load i32, i32* %9
%22 = load i32, i32* %10
%23 = sub nsw i32 %21, %22
store i32 %23, i32* %12
store i32 0, i32* %11
br label %24
24: ; preds = %39, %2
%25 = load i32, i32* %11
%26 = load i32, i32* %12
%27 = icmp sle i32 %25, %26
br i1 %27, label %28, label %42
28: ; preds = %24
%29 = getelementptr inbounds [200 x i8], [200 x i8]* %6, i64 0, i64 0
%30 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%31 = load i32, i32* %11
%32 = load i32, i32* %10
%33 = call i64 @compareStr(i8* %29, i8* %30, i32 %31, i32 %32)
%34 = icmp ne i64 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %28
%36 = load i32, i32* %8
%37 = add nsw i32 %36, 1
store i32 %37, i32* %8
br label %38
38: ; preds = %35, %28
br label %39
39: ; preds = %38
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %24
42: ; preds = %24
%43 = load i32, i32* %8
%44 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %43)
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c" %[^\0A]\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [200 x i8]
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %5)
%8 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %6)
%9 = call i32 @strlen(i8* %5)
%10 = call i32 @strlen(i8* %6)
%11 = icmp slt i32 %9, %10
br i1 %11, label %24, label %12
12: ; preds = %2
%13 = add i32 %9, 1
%14 = sub i32 %13, %10
br label %15
15: ; preds = %12, %15
%16 = phi i32 [ %21, %15 ], [ 0, %12 ]
%17 = phi i32 [ %22, %15 ], [ 0, %12 ]
%18 = call i64 @compareStr(i8* %5, i8* %6, i32 %17, i32 %10)
%19 = icmp ne i64 %18, 0
%20 = zext i1 %19 to i32
%21 = add nuw nsw i32 %16, %20
%22 = add nuw i32 %17, 1
%23 = icmp eq i32 %22, %14
br i1 %23, label %24, label %15
24: ; preds = %15, %2
%25 = phi i32 [ 0, %2 ], [ %21, %15 ]
%26 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %25)
ret i32 0
}