#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 */
char *find(char *, char);
int pos(char *, char);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, char *);
int main() {
  char arr[400];
  char needle;
  char *needle1;
  scanf("%400[0-9a-zA-Z ]", arr);
  scanf(" %c", &needle);
  needle1 = find(arr, needle);
  int position = pos(arr, needle);
  printf("%d\n", position);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x1a0(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1050 <scanf@plt>
lea    0xea5(%rip),%rdi
lea    -0x1a1(%rbp),%rsi
call   1050 <scanf@plt>
lea    -0x1a0(%rbp),%rdi
movsbl -0x1a1(%rbp),%esi
call   1040 <find@plt>
mov    %rax,-0x1b0(%rbp)
lea    -0x1a0(%rbp),%rdi
movsbl -0x1a1(%rbp),%esi
call   1060 <pos@plt>
mov    %eax,-0x1b4(%rbp)
mov    -0x1b4(%rbp),%esi
lea    0xe5d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x1a0,%rsp
lea    0xeb1(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
call   1050 <scanf@plt>
lea    0xeae(%rip),%rdi
lea    0xf(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1040 <find@plt>
movsbl 0xf(%rsp),%esi
mov    %rbx,%rdi
call   1060 <pos@plt>
lea    0xe87(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x1a0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%400[0-9a-zA-Z ]\00"
@.str.1 = [4 x i8] c" %c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [400 x i8]
%3 = alloca i8
%4 = alloca i8*
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%7 = call i32 @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%9 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%10 = load i8, i8* %3
%11 = call i8* @find(i8* %9, i8 signext %10)
store i8* %11, i8** %4
%12 = getelementptr inbounds [400 x i8], [400 x i8]* %2, i64 0, i64 0
%13 = load i8, i8* %3
%14 = call i32 @pos(i8* %12, i8 signext %13)
store i32 %14, i32* %5
%15 = load i32, i32* %5
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"%400[0-9a-zA-Z ]\00"
@.str.1 = [4 x i8] c" %c\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [400 x i8]
%2 = alloca i8
%3 = getelementptr inbounds [400 x i8], [400 x i8]* %1, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%6 = load i8, i8* %2
%7 = call i8* @find(i8* %3, i8 signext %6)
%8 = load i8, i8* %2
%9 = call i32 @pos(i8* %3, i8 signext %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %9)
ret i32 0
}