#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 /*<<< orphan*/ printf(char *, ...);
int main() {
  char s1[] = "mom";
  char s2[] = "Tomb";
  int index;
  index = any(s1, s2);
  if (index) {
    printf("Match at index=%d\n", index);
  } else {
    printf("No match found.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x8(%rbp)
mov    0xec6(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xec1(%rip),%al
mov    %al,-0x9(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0xd(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     117a <main+0x5a>
mov    -0x14(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <main+0x68>
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movl   $0x6d6f6d,0x14(%rsp)
movb   $0x0,0x10(%rsp)
movl   $0x626d6f54,0xc(%rsp)
62
lea    0x14(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1050 <any@plt>
test   %eax,%eax
je     116e <main+0x3e>
lea    0xea2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    117a <main+0x4a>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.s1 = [4 x i8] c"mom\00"
@__const.main.s2 = [5 x i8] c"Tomb\00"
@.str = [19 x i8] c"Match at index=%d\0A\00"
@.str.1 = [17 x i8] c"No match found.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i8]
%3 = alloca [5 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [4 x i8]* %2 to i8*
%6 = bitcast [5 x i8]* %3 to i8*
%7 = getelementptr inbounds [4 x i8], [4 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%9 = call i32 @any(i8* %7, i8* %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %0
%13 = load i32, i32* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %17
15: ; preds = %0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %17
17: ; preds = %15, %12
ret i32 0
}

LLVM IR (-O2):
@__const.main.s2 = [5 x i8] c"Tomb\00"
@.str = [19 x i8] c"Match at index=%d\0A\00"
@str = [16 x i8] c"No match found.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i8]
%3 = bitcast i32* %1 to i8*
store i32 7171949, i32* %1
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = call i32 @any(i8* %3, i8* %4)
%6 = icmp eq i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %5)
br label %11
9: ; preds = %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %11
11: ; preds = %9, %7
ret i32 0
}