#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 indexofany(char *, char *);
int /*<<< orphan*/ printf(char *, int);
void testindexofany(void) {
  char source[113] =
      "Good Morning, Vietnam! Hey, this is not a test, THIS IS ROCK AND ROLL! "
      "Time to rock it from the delta to the DMZ!";
  char stuff[10] = "WWWWWWWWWW";
  char targets[3] = "DMZ";
  printf("Index:\t%d", indexofany(source, targets));
}


x86 assembly (clang, -O0):
<testindexofany>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x71,%edx
call   1040 <memcpy@plt>
mov    0xf1a(%rip),%rax
mov    %rax,-0x8a(%rbp)
mov    0xf14(%rip),%ax
mov    %ax,-0x82(%rbp)
mov    0xf08(%rip),%ax
mov    %ax,-0x8d(%rbp)
mov    0xefd(%rip),%al
mov    %al,-0x8b(%rbp)
lea    -0x80(%rbp),%rdi
lea    -0x8d(%rbp),%rsi
call   1050 <indexofany@plt>
mov    %eax,%esi
lea    0xedf(%rip),%rdi
call   1030 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testindexofany>:
sub    $0x88,%rsp
movaps 0xf32(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf16(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xefa(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xede(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xec2(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xea6(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe8a(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movb   $0x21,0x80(%rsp)
21
movb   $0x5a,0xe(%rsp)
movw   $0x4d44,0xc(%rsp)
lea    0x10(%rsp),%rdi
lea    0xc(%rsp),%rsi
call   1040 <indexofany@plt>
lea    0xecf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
add    $0x88,%rsp
ret

LLVM IR (-O0):
@__const.testindexofany.source = [113 x i8] c"Good Morning, Vietnam! Hey, this is not a test, THIS IS ROCK AND ROLL! Time to rock it from the delta to the DMZ!"
@__const.testindexofany.stuff = [10 x i8] c"WWWWWWWWWW"
@__const.testindexofany.targets = [3 x i8] c"DMZ"
@.str = [10 x i8] c"Index:\09%d\00"
define void @testindexofany() {
%1 = alloca [113 x i8]
%2 = alloca [10 x i8]
%3 = alloca [3 x i8]
%4 = bitcast [113 x i8]* %1 to i8*
%5 = bitcast [10 x i8]* %2 to i8*
%6 = bitcast [3 x i8]* %3 to i8*
%7 = getelementptr inbounds [113 x i8], [113 x i8]* %1, i64 0, i64 0
%8 = getelementptr inbounds [3 x i8], [3 x i8]* %3, i64 0, i64 0
%9 = call i32 @indexofany(i8* %7, i8* %8)
%10 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@__const.testindexofany.source = [113 x i8] c"Good Morning, Vietnam! Hey, this is not a test, THIS IS ROCK AND ROLL! Time to rock it from the delta to the DMZ!"
@__const.testindexofany.targets = [3 x i8] c"DMZ"
@.str = [10 x i8] c"Index:\09%d\00"
define void @testindexofany() {
%1 = alloca [113 x i8]
%2 = alloca [3 x i8]
%3 = getelementptr inbounds [113 x i8], [113 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [3 x i8], [3 x i8]* %2, i64 0, i64 0
%5 = call i32 @indexofany(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}