#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*/ countOfSubstring(char *, char *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main(void) {
  char array1[100] = "GodissagirlGodisagirlis";
  char array2[100] = "is";
  printf("%ld\n", countOfSubstring(array1, array2));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
lea    -0x70(%rbp),%rdi
lea    0xeaa(%rip),%rsi
mov    $0x64,%edx
call   1060 <memcpy@plt>
lea    -0xe0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1050 <memset@plt>
movb   $0x69,-0xe0(%rbp)
movb   $0x73,-0xdf(%rbp)
lea    -0x70(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1040 <countOfSubstring@plt>
mov    %eax,%esi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xd8,%rsp
movaps 0xf22(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xf03(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xee4(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xec5(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe87(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movl   $0x0,0xd0(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x60(%rsp)
movw   $0x7369,(%rsp)
lea    0x70(%rsp),%rdi
mov    %rsp,%rsi
call   1040 <countOfSubstring@plt>
lea    0xe99(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
ret

LLVM IR (-O0):
@__const.main.array1 = [100 x i8] c"GodissagirlGodisagirlis\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = bitcast [100 x i8]* %1 to i8*
%4 = bitcast [100 x i8]* %2 to i8*
%5 = bitcast i8* %4 to [100 x i8]*
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 0
store i8 105, i8* %6
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i32 0, i32 1
store i8 115, i8* %7
%8 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%10 = call i32 @countOfSubstring(i8* %8, i8* %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.array1 = [100 x i8] c"GodissagirlGodisagirlis\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [100 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
store i8 105, i8* %4
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 1
store i8 115, i8* %5
%6 = call i32 @countOfSubstring(i8* %3, i8* %4)
%7 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %6)
ret i32 0
}