#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 find(char *, char);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char str1[50000], ch;
  scanf("%s", str1);
  getchar();
  scanf("%c", &ch);
  if (find(str1, ch) != -1)
    printf("%d", find(str1, ch));
  else
    printf("Not found");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc370,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xc360(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xe90(%rip),%rdi
lea    -0xc361(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0xc360(%rbp),%rdi
movsbl -0xc361(%rbp),%esi
call   1050 <find@plt>
cmp    $0xffffffff,%eax
je     11c3 <main+0x83>
lea    -0xc360(%rbp),%rdi
movsbl -0xc361(%rbp),%esi
call   1050 <find@plt>
mov    %eax,%esi
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d1 <main+0x91>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc370,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0xc360,%rsp
lea    0xeb1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1060 <scanf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xe99(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1060 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1050 <find@plt>
cmp    $0xffffffff,%eax
je     11a7 <main+0x67>
movsbl 0xf(%rsp),%esi
lea    0x10(%rsp),%rdi
call   1050 <find@plt>
lea    0xe6a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    11b5 <main+0x75>
lea    0xe5b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc360,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Not found\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50000 x i8]
%3 = alloca i8
store i32 0, i32* %1
%4 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 (...) @getchar()
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%8 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%9 = load i8, i8* %3
%10 = call i32 @find(i8* %8, i8 signext %9)
%11 = icmp ne i32 %10, -1
br i1 %11, label %12, label %17
12: ; preds = %0
%13 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%14 = load i8, i8* %3
%15 = call i32 @find(i8* %13, i8 signext %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %15)
br label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %19
19: ; preds = %17, %12
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [10 x i8] c"Not found\00"
define i32 @main() {
%1 = alloca [50000 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [50000 x i8], [50000 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 (...) @getchar()
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%7 = load i8, i8* %2
%8 = call i32 @find(i8* %3, i8 signext %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %14, label %10
10: ; preds = %0
%11 = load i8, i8* %2
%12 = call i32 @find(i8* %3, i8 signext %11)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %12)
br label %16
14: ; preds = %0
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %10
ret i32 0
}