#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 /*<<< orphan*/ assert(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ word_in_list(char *, char *);
void test_word_in_list() {
  char word1[(4096 * 4)];
  char word2[(4096 * 4)];
  char comma_separated_list[(4096 * 4)];
  printf("test_word_in_list...");
  sprintf(comma_separated_list, "%s", "This, is, an, example, string");
  sprintf(word1, "%s", "example");
  sprintf(word2, "%s", "cake");
  assert(word_in_list(word1, comma_separated_list) != 0);
  assert(word_in_list(word2, comma_separated_list) == 0);
  printf("Ok\n");
}


x86 assembly (clang, -O0):
<test_word_in_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc000,%rsp
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
lea    -0xc000(%rbp),%rdi
lea    0xeb0(%rip),%rsi
lea    0xeac(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x4000(%rbp),%rdi
lea    0xe96(%rip),%rsi
lea    0xeb0(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x8000(%rbp),%rdi
lea    0xe7c(%rip),%rsi
lea    0xe9e(%rip),%rdx
call   1060 <sprintf@plt>
lea    -0x4000(%rbp),%rdi
lea    -0xc000(%rbp),%rsi
call   1050 <word_in_list@plt>
cmp    $0x0,%rax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    -0x8000(%rbp),%rdi
lea    -0xc000(%rbp),%rsi
call   1050 <word_in_list@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
add    $0xc000,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_word_in_list>:
push   %rbx
sub    $0xc000,%rsp
lea    0xeb1(%rip),%rdi
call   1040 <printf@plt>
movups 0xeba(%rip),%xmm0
movaps %xmm0,(%rsp)
movups 0xebd(%rip),%xmm0
movups %xmm0,0xe(%rsp)
movabs $0x656c706d617865,%rax
mov    %rax,0x8000(%rsp)
movl   $0x656b6163,0x4000(%rsp)
63 61 6b 65
movb   $0x0,0x4004(%rsp)
lea    0x8000(%rsp),%rdi
mov    %rsp,%rbx
mov    %rbx,%rsi
call   1060 <word_in_list@plt>
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1050 <assert@plt>
lea    0x4000(%rsp),%rdi
mov    %rbx,%rsi
call   1060 <word_in_list@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
lea    0xe62(%rip),%rdi
call   1030 <puts@plt>
add    $0xc000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"test_word_in_list...\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [30 x i8] c"This, is, an, example, string\00"
@.str.3 = [8 x i8] c"example\00"
@.str.4 = [5 x i8] c"cake\00"
@.str.5 = [4 x i8] c"Ok\0A\00"
define void @test_word_in_list() {
%1 = alloca [16384 x i8]
%2 = alloca [16384 x i8]
%3 = alloca [16384 x i8]
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%5 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0))
%7 = getelementptr inbounds [16384 x i8], [16384 x i8]* %1, i64 0, i64 0
%8 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
%9 = getelementptr inbounds [16384 x i8], [16384 x i8]* %2, i64 0, i64 0
%10 = call i32 @sprintf(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
%11 = getelementptr inbounds [16384 x i8], [16384 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%13 = call i64 @word_in_list(i8* %11, i8* %12)
%14 = icmp ne i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = getelementptr inbounds [16384 x i8], [16384 x i8]* %2, i64 0, i64 0
%18 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%19 = call i64 @word_in_list(i8* %17, i8* %18)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"test_word_in_list...\00"
@.str.2 = [30 x i8] c"This, is, an, example, string\00"
@.str.4 = [5 x i8] c"cake\00"
@str = [3 x i8] c"Ok\00"
define void @test_word_in_list() {
%1 = alloca [16384 x i8]
%2 = alloca [16384 x i8]
%3 = alloca [16384 x i8]
%4 = getelementptr inbounds [16384 x i8], [16384 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [16384 x i8], [16384 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [16384 x i8], [16384 x i8]* %3, i64 0, i64 0
%7 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0))
%8 = bitcast [16384 x i8]* %1 to i64*
store i64 28548202775017573, i64* %8
%9 = call i64 @word_in_list(i8* %4, i8* %6)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = call i64 @word_in_list(i8* %5, i8* %6)
%14 = icmp eq i64 %13, 0
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}