#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 EOF;
int /*<<< orphan*/ printf(char *, int);
scalar_t__ strindex(int *, char *);
int main(void) {
  int c[3];
  char mstring[] = "too sexy";
  c[0] = ~EOF;
  while (c[0] != EOF)
    if (strindex(c, mstring))
      printf("%d\n", c[2]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x19(%rbp)
mov    0xec8(%rip),%al
mov    %al,-0x11(%rbp)
mov    0x2e9e(%rip),%rax
mov    (%rax),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    0x2e8c(%rip),%rcx
cmp    (%rcx),%eax
je     118f <main+0x6f>
lea    -0x10(%rbp),%rdi
lea    -0x19(%rbp),%rsi
call   1040 <strindex@plt>
cmp    $0x0,%rax
je     118a <main+0x6a>
mov    -0x8(%rbp),%esi
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
jmp    1152 <main+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
movabs $0x79786573206f6f74,%rax
65 78 79
mov    %rax,(%rsp)
movb   $0x0,0x8(%rsp)
mov    0x2ea3(%rip),%r12
mov    (%r12),%eax
not    %eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%r14
mov    %rsp,%rbx
lea    0xeab(%rip),%r15
jmp    116a <main+0x4a>
mov    0xc(%rsp),%eax
cmp    (%r12),%eax
je     1188 <main+0x68>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <strindex@plt>
test   %rax,%rax
je     1160 <main+0x40>
mov    0x14(%rsp),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.mstring = [9 x i8] c"too sexy\00"
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca [9 x i8]
store i32 0, i32* %1
%4 = bitcast [9 x i8]* %3 to i8*
%5 = load i32, i32* @EOF
%6 = xor i32 %5, -1
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
store i32 %6, i32* %7
br label %8
8: ; preds = %22, %0
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%10 = load i32, i32* %9
%11 = load i32, i32* @EOF
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %23
13: ; preds = %8
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%15 = getelementptr inbounds [9 x i8], [9 x i8]* %3, i64 0, i64 0
%16 = call i64 @strindex(i32* %14, i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 2
%20 = load i32, i32* %19
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %18, %13
br label %8
23: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@__const.main.mstring = [9 x i8] c"too sexy\00"
@EOF = global i32 0
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [3 x i32]
%2 = alloca [9 x i8]
%3 = bitcast [3 x i32]* %1 to i8*
%4 = getelementptr inbounds [9 x i8], [9 x i8]* %2, i64 0, i64 0
%5 = load i32, i32* @EOF
%6 = xor i32 %5, -1
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
store i32 %6, i32* %7
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 2
br label %9
9: ; preds = %0, %15
%10 = call i64 @strindex(i32* %7, i8* %4)
%11 = icmp eq i64 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = load i32, i32* %8
%14 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
%16 = load i32, i32* %7
%17 = load i32, i32* @EOF
%18 = icmp eq i32 %16, %17
br i1 %18, label %19, label %9
19: ; preds = %15
ret i32 0
}