#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);
int main() {
  printf("%d\n", -1 == any("Hey Nick, how are you doing today?", "hello"));
  printf("%d\n",
         10 == any("Hey Nick, how are you doing today?", "how are you"));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xece(%rip),%rdi
lea    0xeea(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    0xec0(%rip),%rsi
call   1040 <any@plt>
mov    %eax,%ecx
mov    $0xa,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed9(%rip),%r14
lea    0xef5(%rip),%rsi
mov    %r14,%rdi
call   1040 <any@plt>
xor    %esi,%esi
cmp    $0xffffffff,%eax
sete   %sil
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rsi
mov    %r14,%rdi
call   1040 <any@plt>
xor    %esi,%esi
cmp    $0xa,%eax
sete   %sil
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [35 x i8] c"Hey Nick, how are you doing today?\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [12 x i8] c"how are you\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @any(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%3 = icmp eq i32 -1, %2
%4 = zext i1 %3 to i32
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = call i32 @any(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%7 = icmp eq i32 10, %6
%8 = zext i1 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [35 x i8] c"Hey Nick, how are you doing today?\00"
@.str.2 = [6 x i8] c"hello\00"
@.str.3 = [12 x i8] c"how are you\00"
define i32 @main() {
%1 = tail call i32 @any(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = tail call i32 @any(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%6 = icmp eq i32 %5, 10
%7 = zext i1 %6 to i32
%8 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}