#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 any(char *, char *);
int getline_my(char *);
int /*<<< orphan*/ printf(char *, ...);
void main() {
  char string[100];
  int c = 0;
  int i = 0;
  int j = 0;
  int sum = 0;
  int len = 0;
  char first[100];
  char second[200];
  printf("Please, input first string:");
  len = getline_my(first);
  printf("Please, input second string:");
  len = getline_my(second);
  sum = any(first, second);
  if (sum == -1)
    printf("We do not get any matches.\n");
  else
    printf("After applying function any we get returned value of position = "
           "%d; and value of array = %c;\n",
           sum, first[sum]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
movl   $0x0,-0x74(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x7c(%rbp)
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xf0(%rbp),%rdi
call   1040 <getline_my@plt>
mov    %eax,-0x84(%rbp)
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x1c0(%rbp),%rdi
call   1040 <getline_my@plt>
mov    %eax,-0x84(%rbp)
lea    -0xf0(%rbp),%rdi
lea    -0x1c0(%rbp),%rsi
call   1050 <any@plt>
mov    %eax,-0x80(%rbp)
cmpl   $0xffffffff,-0x80(%rbp)
jne    11d4 <main+0xa4>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f1 <main+0xc1>
mov    -0x80(%rbp),%esi
movslq -0x80(%rbp),%rax
movsbl -0xf0(%rbp,%rax,1),%edx
ff
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x138,%rsp
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <getline_my@plt>
lea    0xeb2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <getline_my@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1060 <any@plt>
cmp    $0xffffffff,%eax
je     11a7 <main+0x67>
movslq %eax,%rcx
movsbl (%rsp,%rcx,1),%edx
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b3 <main+0x73>
lea    0xee9(%rip),%rdi
call   1030 <puts@plt>
add    $0x138,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Please, input first string:\00"
@.str.1 = [29 x i8] c"Please, input second string:\00"
@.str.2 = [28 x i8] c"We do not get any matches.\0A\00"
@.str.3 = [94 x i8] c"After applying function any we get returned value of position = %d; and value of array = %c;\0A\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [100 x i8]
%8 = alloca [200 x i8]
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%11 = call i32 @getline_my(i8* %10)
store i32 %11, i32* %6
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%14 = call i32 @getline_my(i8* %13)
store i32 %14, i32* %6
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 0
%16 = getelementptr inbounds [200 x i8], [200 x i8]* %8, i64 0, i64 0
%17 = call i32 @any(i8* %15, i8* %16)
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
br label %30
22: ; preds = %0
%23 = load i32, i32* %5
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %7, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([94 x i8], [94 x i8]* @.str.3, i64 0, i64 0), i32 %23, i32 %28)
br label %30
30: ; preds = %22, %20
ret void
}

LLVM IR (-O2):
@.str = [28 x i8] c"Please, input first string:\00"
@.str.1 = [29 x i8] c"Please, input second string:\00"
@.str.3 = [94 x i8] c"After applying function any we get returned value of position = %d; and value of array = %c;\0A\00"
@str = [27 x i8] c"We do not get any matches.\00"
define void @main() {
%1 = alloca [100 x i8]
%2 = alloca [200 x i8]
%3 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @getline_my(i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @getline_my(i8* %4)
%9 = call i32 @any(i8* %3, i8* %4)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %19
13: ; preds = %0
%14 = sext i32 %9 to i64
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([94 x i8], [94 x i8]* @.str.3, i64 0, i64 0), i32 %9, i32 %17)
br label %19
19: ; preds = %13, %11
ret void
}