#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*/ word_break(char *, char **, char *);
int main(int argc, char **argv) {
  char *s = "catsanddog";
  char *dict[] = {"cat", "cats", "and", "sand", "dog", NULL};
  char buf[32] = {0};
  word_break(s, dict, buf);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xec3(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x30,%edx
call   1030 <memset@plt>
lea    0xeb3(%rip),%rax
mov    %rax,-0x50(%rbp)
lea    0xeac(%rip),%rax
mov    %rax,-0x48(%rbp)
lea    0xea7(%rip),%rax
mov    %rax,-0x40(%rbp)
lea    0xe9b(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe83(%rip),%rax
mov    %rax,-0x30(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1030 <memset@plt>
mov    -0x18(%rbp),%rdi
lea    -0x50(%rbp),%rsi
lea    -0x70(%rbp),%rdx
call   1040 <word_break@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x58,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
lea    0xee8(%rip),%rax
mov    %rax,(%rsp)
lea    0xee1(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xedb(%rip),%rax
mov    %rax,0x10(%rsp)
lea    0xece(%rip),%rax
mov    %rax,0x18(%rsp)
lea    0xeb5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
lea    0xe98(%rip),%rdi
mov    %rsp,%rsi
lea    0x30(%rsp),%rdx
call   1030 <word_break@plt>
xor    %eax,%eax
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"catsanddog\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [5 x i8] c"cats\00"
@.str.3 = [4 x i8] c"and\00"
@.str.4 = [5 x i8] c"sand\00"
@.str.5 = [4 x i8] c"dog\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca [6 x i8*]
%8 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %6
%9 = bitcast [6 x i8*]* %7 to i8*
%10 = bitcast i8* %9 to [6 x i8*]*
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i32 0, i32 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i32 0, i32 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i32 0, i32 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i32 0, i32 0), i8** %12
%13 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i32 0, i32 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i32 0, i32 0), i8** %13
%14 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i32 0, i32 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i32 0, i32 0), i8** %14
%15 = getelementptr inbounds [6 x i8*], [6 x i8*]* %10, i32 0, i32 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i32 0, i32 0), i8** %15
%16 = bitcast [32 x i8]* %8 to i8*
%17 = load i8*, i8** %6
%18 = getelementptr inbounds [6 x i8*], [6 x i8*]* %7, i64 0, i64 0
%19 = getelementptr inbounds [32 x i8], [32 x i8]* %8, i64 0, i64 0
%20 = call i32 @word_break(i8* %17, i8** %18, i8* %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"catsanddog\00"
@.str.1 = [4 x i8] c"cat\00"
@.str.2 = [5 x i8] c"cats\00"
@.str.3 = [4 x i8] c"and\00"
@.str.4 = [5 x i8] c"sand\00"
@.str.5 = [4 x i8] c"dog\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [6 x i8*]
%4 = alloca [32 x i8]
%5 = bitcast [6 x i8*]* %3 to i8*
%6 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
%7 = bitcast i8** %6 to i8*
%8 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 0
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8** %8
%9 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i8** %9
%10 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 2
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8** %10
%11 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 3
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8** %11
%12 = getelementptr inbounds [6 x i8*], [6 x i8*]* %3, i64 0, i64 4
store i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8** %12
%13 = getelementptr inbounds [32 x i8], [32 x i8]* %4, i64 0, i64 0
%14 = call i32 @word_break(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8** %8, i8* %13)
ret i32 0
}