#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*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main() {
  int i, j, pos;
  char str1[19];
  char str2[19];
  char temp[19];
  int found = -1;
  scanf("%s %s", str1, str2);
  int len1 = strlen(str1);
  int len2 = strlen(str2);
  for (i = 0; i < (1 + len1 - len2); i++) {
    for (j = i; j < i + len2; j++) {
      temp[j - i] = str1[j];
    }
    temp[len2] = '\0';
    if (strcmp(temp, str2) == 0) {
      found = i;
      break;
    }
  }
  printf("%d", found);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x74(%rbp)
lea    -0x30(%rbp),%rsi
lea    -0x50(%rbp),%rdx
lea    0xe98(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x78(%rbp)
lea    -0x50(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x7c(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x78(%rbp),%ecx
add    $0x1,%ecx
sub    -0x7c(%rbp),%ecx
cmp    %ecx,%eax
jge    1217 <main+0xd7>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%ecx
add    -0x7c(%rbp),%ecx
cmp    %ecx,%eax
jge    11d9 <main+0x99>
movslq -0xc(%rbp),%rax
mov    -0x30(%rbp,%rax,1),%cl
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
cltq
mov    %cl,-0x70(%rbp,%rax,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11a6 <main+0x66>
movslq -0x7c(%rbp),%rax
movb   $0x0,-0x70(%rbp,%rax,1)
lea    -0x70(%rbp),%rdi
lea    -0x50(%rbp),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1204 <main+0xc4>
mov    -0x8(%rbp),%eax
mov    %eax,-0x74(%rbp)
jmp    1217 <main+0xd7>
jmp    1209 <main+0xc9>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    118c <main+0x4c>
mov    -0x74(%rbp),%esi
lea    0xde5(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
lea    0xe9b(%rip),%rdi
lea    0x50(%rsp),%rbx
lea    0x30(%rsp),%rbp
mov    %rbx,%rsi
mov    %rbp,%rdx
call   1070 <scanf@plt>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %rbp,%rdi
call   1030 <strlen@plt>
sub    %eax,%ebx
add    $0x1,%ebx
test   %ebx,%ebx
jle    122b <main+0xdb>
mov    %eax,%r13d
cltq
mov    %rax,0x8(%rsp)
mov    %ebx,%eax
mov    %rax,(%rsp)
mov    $0x1,%r15d
mov    $0xffffffff,%r14d
xor    %ebx,%ebx
lea    0x10(%rsp),%rdi
mov    %r13d,%ebp
mov    %rdi,%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmp    %r15d,%ebp
mov    %r15d,%eax
cmovg  %ebp,%eax
test   %r13d,%r13d
jle    11fa <main+0xaa>
add    %r14d,%eax
mov    %eax,%edx
add    $0x1,%rdx
lea    (%rsp,%rbx,1),%rsi
add    $0x50,%rsi
mov    %r12,%rdi
call   1060 <memcpy@plt>
mov    %r12,%rdi
mov    0x8(%rsp),%rax
movb   $0x0,0x10(%rsp,%rax,1)
lea    0x30(%rsp),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     1230 <main+0xe0>
add    $0x1,%rbx
add    $0x1,%ebp
add    $0x1,%r15d
add    $0xffffffff,%r14d
cmp    %rbx,(%rsp)
mov    %r12,%rdi
jne    11d0 <main+0x80>
mov    $0xffffffff,%ebx
lea    0xdcf(%rip),%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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