#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 foo[80] = "argle bargle";
  char bar[80] = "toobz";
  int result;
  if ((result = any(foo, bar)) != -1) {
    printf("Found a match at position %d!\n", result);
  } else {
    printf("No match found.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xea3(%rip),%rsi
mov    $0x50,%edx
call   1050 <memcpy@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x50,%edx
call   1040 <memset@plt>
movb   $0x74,-0xb0(%rbp)
movb   $0x6f,-0xaf(%rbp)
movb   $0x6f,-0xae(%rbp)
movb   $0x62,-0xad(%rbp)
movb   $0x7a,-0xac(%rbp)
lea    -0x60(%rbp),%rdi
lea    -0xb0(%rbp),%rsi
call   1060 <any@plt>
mov    %eax,-0xb4(%rbp)
cmp    $0xffffffff,%eax
je     11d5 <main+0x95>
mov    -0xb4(%rbp),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e3 <main+0xa3>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0xa8,%rsp
movaps 0xf02(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xee3(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xec4(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xea8(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xe8c(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x626f6f74,(%rsp)
movb   $0x7a,0x4(%rsp)
lea    0x50(%rsp),%rdi
mov    %rsp,%rsi
call   1050 <any@plt>
cmp    $0xffffffff,%eax
je     11c4 <main+0x94>
lea    0xe97(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11d0 <main+0xa0>
lea    0xea4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0xa8,%rsp
ret

LLVM IR (-O0):
@__const.main.foo = [80 x i8] c"argle bargle\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [31 x i8] c"Found a match at position %d!\0A\00"
@.str.1 = [17 x i8] c"No match found.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [80 x i8]
%3 = alloca [80 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [80 x i8]* %2 to i8*
%6 = bitcast [80 x i8]* %3 to i8*
%7 = bitcast i8* %6 to [80 x i8]*
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i32 0, i32 0
store i8 116, i8* %8
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i32 0, i32 1
store i8 111, i8* %9
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i32 0, i32 2
store i8 111, i8* %10
%11 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i32 0, i32 3
store i8 98, i8* %11
%12 = getelementptr inbounds [80 x i8], [80 x i8]* %7, i32 0, i32 4
store i8 122, i8* %12
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%15 = call i32 @any(i8* %13, i8* %14)
store i32 %15, i32* %4
%16 = icmp ne i32 %15, -1
br i1 %16, label %17, label %20
17: ; preds = %0
%18 = load i32, i32* %4
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %18)
br label %22
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
ret i32 0
}

LLVM IR (-O2):
@__const.main.foo = [80 x i8] c"argle bargle\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [31 x i8] c"Found a match at position %d!\0A\00"
@str = [16 x i8] c"No match found.\00"
define i32 @main() {
%1 = alloca [80 x i8]
%2 = alloca [80 x i8]
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 0
store i8 116, i8* %4
%5 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 1
store i8 111, i8* %5
%6 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 2
store i8 111, i8* %6
%7 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 3
store i8 98, i8* %7
%8 = getelementptr inbounds [80 x i8], [80 x i8]* %2, i64 0, i64 4
store i8 122, i8* %8
%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 ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %15
13: ; preds = %0
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
ret i32 0
}