#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 /*<<< orphan*/ putchar(char);
int main(void) {
  char string1[] = "This string contains a bunch of 's' characters";
  int pos;
  int i;
  pos = any(string1, "aeiou");
  printf("Locating the first lowercase vowel in the string:\n\n\"This string "
         "contains a bunch of 's' characters\"\n");
  if (pos != -1) {
    (void)putchar(' ');
    for (i = 0; i < pos; i++)
      (void)putchar(' ');
    (void)putchar('^');
    printf("\n\nFound at position: %d (where '0' is the first character)\n\n",
           pos);
  } else
    printf("\n\nNot found!\n\n");
  pos = any(string1, "x");
  printf("Locating the character 'x' in the string:\n\n\"This string contains "
         "a bunch of 's' characters\"\n");
  if (pos != -1) {
    (void)putchar(' ');
    for (i = 0; i < pos; i++)
      (void)putchar(' ');
    (void)putchar('^');
    printf("\n\nFound at position: %d (where '0' is the first character)\n\n",
           pos);
  } else
    printf("\n\nNot found!\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x2f,%edx
call   1050 <memcpy@plt>
lea    -0x40(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1060 <any@plt>
mov    %eax,-0x44(%rbp)
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xffffffff,-0x44(%rbp)
je     11e4 <main+0xa4>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11c4 <main+0x84>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11a0 <main+0x60>
mov    $0x5e,%edi
call   1030 <putchar@plt>
mov    -0x44(%rbp),%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11f2 <main+0xb2>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xee9(%rip),%rsi
call   1060 <any@plt>
mov    %eax,-0x44(%rbp)
lea    0xedc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0xffffffff,-0x44(%rbp)
je     1272 <main+0x132>
mov    $0x20,%edi
call   1030 <putchar@plt>
movl   $0x0,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    1252 <main+0x112>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    122e <main+0xee>
mov    $0x5e,%edi
call   1030 <putchar@plt>
mov    -0x44(%rbp),%esi
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1280 <main+0x140>
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x38,%rsp
movups 0xed2(%rip),%xmm0
movups %xmm0,0x1f(%rsp)
movaps 0xeb7(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe9b(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xebf(%rip),%rsi
mov    %rsp,%rdi
call   1060 <any@plt>
mov    %eax,%ebx
lea    0xef3(%rip),%rdi
call   1040 <puts@plt>
cmp    $0xffffffff,%ebx
je     11cb <main+0x8b>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    11af <main+0x6f>
mov    %ebx,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    11a0 <main+0x60>
mov    $0x5e,%edi
call   1030 <putchar@plt>
lea    0xe75(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11d7 <main+0x97>
lea    0xf62(%rip),%rdi
call   1040 <puts@plt>
lea    0xe94(%rip),%rsi
mov    %rsp,%rdi
call   1060 <any@plt>
mov    %eax,%ebx
lea    0xee9(%rip),%rdi
call   1040 <puts@plt>
cmp    $0xffffffff,%ebx
je     123b <main+0xfb>
mov    $0x20,%edi
call   1030 <putchar@plt>
test   %ebx,%ebx
jle    121f <main+0xdf>
mov    %ebx,%ebp
nopl   0x0(%rax)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1210 <main+0xd0>
mov    $0x5e,%edi
call   1030 <putchar@plt>
lea    0xe05(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1247 <main+0x107>
lea    0xef2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.string1 = [47 x i8] c"This string contains a bunch of 's' characters\00"
@.str = [6 x i8] c"aeiou\00"
@.str.1 = [101 x i8] c"Locating the first lowercase vowel in the string:\0A\0A\22This string contains a bunch of 's' characters\22\0A\00"
@.str.2 = [61 x i8] c"\0A\0AFound at position: %d (where '0' is the first character)\0A\0A\00"
@.str.3 = [15 x i8] c"\0A\0ANot found!\0A\0A\00"
@.str.4 = [2 x i8] c"x\00"
@.str.5 = [93 x i8] c"Locating the character 'x' in the string:\0A\0A\22This string contains a bunch of 's' characters\22\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [47 x i8]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [47 x i8]* %2 to i8*
%6 = getelementptr inbounds [47 x i8], [47 x i8]* %2, i64 0, i64 0
%7 = call i32 @any(i8* %6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 %7, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([101 x i8], [101 x i8]* @.str.1, i64 0, i64 0))
%9 = load i32, i32* %3
%10 = icmp ne i32 %9, -1
br i1 %10, label %11, label %26
11: ; preds = %0
%12 = call i32 @putchar(i8 signext 32)
store i32 0, i32* %4
br label %13
13: ; preds = %19, %11
%14 = load i32, i32* %4
%15 = load i32, i32* %3
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %13
%18 = call i32 @putchar(i8 signext 32)
br label %19
19: ; preds = %17
%20 = load i32, i32* %4
%21 = add nsw i32 %20, 1
store i32 %21, i32* %4
br label %13
22: ; preds = %13
%23 = call i32 @putchar(i8 signext 94)
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %24)
br label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = getelementptr inbounds [47 x i8], [47 x i8]* %2, i64 0, i64 0
%30 = call i32 @any(i8* %29, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 %30, i32* %3
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([93 x i8], [93 x i8]* @.str.5, i64 0, i64 0))
%32 = load i32, i32* %3
%33 = icmp ne i32 %32, -1
br i1 %33, label %34, label %49
34: ; preds = %28
%35 = call i32 @putchar(i8 signext 32)
store i32 0, i32* %4
br label %36
36: ; preds = %42, %34
%37 = load i32, i32* %4
%38 = load i32, i32* %3
%39 = icmp slt i32 %37, %38
br i1 %39, label %40, label %45
40: ; preds = %36
%41 = call i32 @putchar(i8 signext 32)
br label %42
42: ; preds = %40
%43 = load i32, i32* %4
%44 = add nsw i32 %43, 1
store i32 %44, i32* %4
br label %36
45: ; preds = %36
%46 = call i32 @putchar(i8 signext 94)
%47 = load i32, i32* %3
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %47)
br label %51
49: ; preds = %28
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %49, %45
ret i32 0
}

LLVM IR (-O2):
@__const.main.string1 = [47 x i8] c"This string contains a bunch of 's' characters\00"
@.str = [6 x i8] c"aeiou\00"
@.str.2 = [61 x i8] c"\0A\0AFound at position: %d (where '0' is the first character)\0A\0A\00"
@.str.4 = [2 x i8] c"x\00"
@str = [100 x i8] c"Locating the first lowercase vowel in the string:\0A\0A\22This string contains a bunch of 's' characters\22\00"
@str.7 = [92 x i8] c"Locating the character 'x' in the string:\0A\0A\22This string contains a bunch of 's' characters\22\00"
@str.8 = [14 x i8] c"\0A\0ANot found!\0A\00"
define i32 @main() {
%1 = alloca [47 x i8]
%2 = getelementptr inbounds [47 x i8], [47 x i8]* %1, i64 0, i64 0
%3 = call i32 @any(i8* %2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([100 x i8], [100 x i8]* @str, i64 0, i64 0))
%5 = icmp eq i32 %3, -1
br i1 %5, label %17, label %6
6: ; preds = %0
%7 = call i32 @putchar(i8 signext 32)
%8 = icmp sgt i32 %3, 0
br i1 %8, label %9, label %14
9: ; preds = %6, %9
%10 = phi i32 [ %12, %9 ], [ 0, %6 ]
%11 = call i32 @putchar(i8 signext 32)
%12 = add nuw nsw i32 %10, 1
%13 = icmp eq i32 %12, %3
br i1 %13, label %14, label %9
14: ; preds = %9, %6
%15 = call i32 @putchar(i8 signext 94)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %3)
br label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
br label %19
19: ; preds = %17, %14
%20 = call i32 @any(i8* %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @str.7, i64 0, i64 0))
%22 = icmp eq i32 %20, -1
br i1 %22, label %34, label %23
23: ; preds = %19
%24 = call i32 @putchar(i8 signext 32)
%25 = icmp sgt i32 %20, 0
br i1 %25, label %26, label %31
26: ; preds = %23, %26
%27 = phi i32 [ %29, %26 ], [ 0, %23 ]
%28 = call i32 @putchar(i8 signext 32)
%29 = add nuw nsw i32 %27, 1
%30 = icmp eq i32 %29, %20
br i1 %30, label %31, label %26
31: ; preds = %26, %23
%32 = call i32 @putchar(i8 signext 94)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.2, i64 0, i64 0), i32 %20)
br label %36
34: ; preds = %19
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.8, i64 0, i64 0))
br label %36
36: ; preds = %34, %31
ret i32 0
}