#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 badchars[] = "abcd";
  char source[] = "hhahhbhhchhd";
  printf("\n%s\n", source);
  printf("\n%d\n", any(source, badchars));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0xed2(%rip),%eax
mov    %eax,-0x5(%rbp)
mov    0xecd(%rip),%al
mov    %al,-0x1(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x12(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0xa(%rbp)
mov    0xebd(%rip),%al
mov    %al,-0x6(%rbp)
lea    -0x12(%rbp),%rsi
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x12(%rbp),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <any@plt>
mov    %eax,%esi
lea    0xe98(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movb   $0x0,0xc(%rsp)
movl   $0x64636261,0x8(%rsp)
64
movabs $0x64686863686862,%rax
mov    %rax,0x15(%rsp)
movabs $0x6868626868616868,%rax
62 68 68
mov    %rax,0x10(%rsp)
lea    0xebb(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <any@plt>
lea    0xe9d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.badchars = [5 x i8] c"abcd\00"
@__const.main.source = [13 x i8] c"hhahhbhhchhd\00"
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [13 x i8]
%3 = bitcast [5 x i8]* %1 to i8*
%4 = bitcast [13 x i8]* %2 to i8*
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%9 = call i32 @any(i8* %7, i8* %8)
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main.badchars = [5 x i8] c"abcd\00"
@__const.main.source = [13 x i8] c"hhahhbhhchhd\00"
@.str = [5 x i8] c"\0A%s\0A\00"
@.str.1 = [5 x i8] c"\0A%d\0A\00"
define i32 @main() {
%1 = alloca [5 x i8]
%2 = alloca [13 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @any(i8* %4, i8* %3)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret i32 0
}