#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);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char str1[50000], ch;
  int kk;
  scanf("%s", str1);
  getchar();
  scanf("%c", &ch);
  scanf("%d", &kk);
  if (find(str1, ch, kk) != -1)
    printf("%d", find(str1, ch, kk));
  else
    printf("Not found\n");
  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
mov    $0x0,%al
call   1060 <scanf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xe8e(%rip),%rdi
lea    -0xc361(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe7c(%rip),%rdi
lea    -0xc368(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    -0xc360(%rbp),%rdi
mov    -0xc361(%rbp),%al
mov    -0xc368(%rbp),%edx
movsbl %al,%esi
call   1050 <find@plt>
cmp    $0xffffffff,%eax
je     11ec <main+0xac>
lea    -0xc360(%rbp),%rdi
mov    -0xc361(%rbp),%al
mov    -0xc368(%rbp),%edx
movsbl %al,%esi
call   1050 <find@plt>
mov    %eax,%esi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11fa <main+0xba>
lea    0xe16(%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    0xea1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
lea    0xe87(%rip),%rdi
lea    0xb(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
lea    0xe77(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1070 <scanf@plt>
movsbl 0xb(%rsp),%esi
mov    0xc(%rsp),%edx
mov    %rbx,%rdi
call   1060 <find@plt>
cmp    $0xffffffff,%eax
je     11d6 <main+0x86>
movsbl 0xb(%rsp),%esi
mov    0xc(%rsp),%edx
lea    0x10(%rsp),%rdi
call   1060 <find@plt>
lea    0xe3b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e2 <main+0x92>
lea    0xe2c(%rip),%rdi
call   1030 <puts@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 = [11 x i8] c"Not found\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50000 x i8]
%3 = alloca i8
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = call i32 (...) @getchar()
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %4)
%10 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%11 = load i8, i8* %3
%12 = load i32, i32* %4
%13 = call i32 @find(i8* %10, i8 signext %11, i32 %12)
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %21
15: ; preds = %0
%16 = getelementptr inbounds [50000 x i8], [50000 x i8]* %2, i64 0, i64 0
%17 = load i8, i8* %3
%18 = load i32, i32* %4
%19 = call i32 @find(i8* %16, i8 signext %17, i32 %18)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %23
21: ; preds = %0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
br label %23
23: ; preds = %21, %15
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 = [10 x i8] c"Not found\00"
define i32 @main() {
%1 = alloca [50000 x i8]
%2 = alloca i8
%3 = alloca i32
%4 = getelementptr inbounds [50000 x i8], [50000 x i8]* %1, i64 0, i64 0
%5 = bitcast i32* %3 to i8*
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %4)
%7 = call i32 (...) @getchar()
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %3)
%10 = load i8, i8* %2
%11 = load i32, i32* %3
%12 = call i32 @find(i8* %4, i8 signext %10, i32 %11)
%13 = icmp eq i32 %12, -1
br i1 %13, label %19, label %14
14: ; preds = %0
%15 = load i8, i8* %2
%16 = load i32, i32* %3
%17 = call i32 @find(i8* %4, i8 signext %15, i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %17)
br label %21
19: ; preds = %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
br label %21
21: ; preds = %19, %14
ret i32 0
}