#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(char *);
int /*<<< orphan*/ printf(char *, ...);
int main() {
  char str1[50];
  char toRemove[50];
  int pos;
  printf("Input length : %d\n", getLine(str1));
  printf("Input length : %d\n", getLine(toRemove));
  if ((pos = any(str1, toRemove)) != -1)
    printf("Found matching char at position %d\n", pos);
  else
    printf("no match\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
call   1050 <getLine@plt>
mov    %eax,%esi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1050 <getLine@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x84(%rbp)
cmp    $0xffffffff,%eax
je     11a9 <main+0x79>
mov    -0x84(%rbp),%esi
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b7 <main+0x87>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0x40(%rsp),%r14
mov    %r14,%rdi
call   1060 <getLine@plt>
lea    0xea0(%rip),%r15
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1060 <getLine@plt>
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <any@plt>
cmp    $0xffffffff,%eax
je     11a5 <main+0x65>
lea    0xe79(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11b1 <main+0x71>
lea    0xe8b(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Input length : %d\0A\00"
@.str.1 = [36 x i8] c"Found matching char at position %d\0A\00"
@.str.2 = [10 x i8] c"no match\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [50 x i8]
%3 = alloca [50 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%6 = call i32 @getLine(i8* %5)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%9 = call i32 @getLine(i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%13 = call i32 @any(i8* %11, i8* %12)
store i32 %13, i32* %4
%14 = icmp ne i32 %13, -1
br i1 %14, label %15, label %18
15: ; preds = %0
%16 = load i32, i32* %4
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %20
18: ; preds = %0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %15
ret i32 1
}

LLVM IR (-O2):
@.str = [19 x i8] c"Input length : %d\0A\00"
@.str.1 = [36 x i8] c"Found matching char at position %d\0A\00"
@str = [9 x i8] c"no match\00"
define i32 @main() {
%1 = alloca [50 x i8]
%2 = alloca [50 x i8]
%3 = getelementptr inbounds [50 x i8], [50 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [50 x i8], [50 x i8]* %2, i64 0, i64 0
%5 = call i32 @getLine(i8* %3)
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = call i32 @getLine(i8* %4)
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = call i32 @any(i8* %3, i8* %4)
%10 = icmp eq i32 %9, -1
br i1 %10, label %13, label %11
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0), i32 %9)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 1
}