#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*/ printf(char *, char *);
int /*<<< orphan*/ split(char **, char *);
int main(void) {
  char *woerter[100];
  int i;
  split(woerter, "Das ist ein (ganz) kleines, feines Beispiel!");
  for (i = 0; woerter[i] != NULL; i++) {
    printf("%s\n", woerter[i]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x340,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x330(%rbp),%rdi
lea    0xec0(%rip),%rsi
call   1040 <split@plt>
movl   $0x0,-0x334(%rbp)
movslq -0x334(%rbp),%rax
cmpq   $0x0,-0x330(%rbp,%rax,8)
je     1194 <main+0x74>
movslq -0x334(%rbp),%rax
mov    -0x330(%rbp,%rax,8),%rsi
ff
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x334(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x334(%rbp)
jmp    114f <main+0x2f>
xor    %eax,%eax
add    $0x340,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x328,%rsp
lea    0xecf(%rip),%rsi
mov    %rsp,%rdi
call   1040 <split@plt>
mov    (%rsp),%rsi
test   %rsi,%rsi
je     1164 <main+0x44>
lea    0x8(%rsp),%rbx
lea    0xedf(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
call   1030 <printf@plt>
mov    (%rbx),%rsi
add    $0x8,%rbx
test   %rsi,%rsi
jne    1150 <main+0x30>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [45 x i8] c"Das ist ein (ganz) kleines, feines Beispiel!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8*]
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds [100 x i8*], [100 x i8*]* %2, i64 0, i64 0
%5 = call i32 @split(i8** %4, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %6
6: ; preds = %18, %0
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i8*], [100 x i8*]* %2, i64 0, i64 %8
%10 = load i8*, i8** %9
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %21
12: ; preds = %6
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i8*], [100 x i8*]* %2, i64 0, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %6
21: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [45 x i8] c"Das ist ein (ganz) kleines, feines Beispiel!\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8*]
%2 = bitcast [100 x i8*]* %1 to i8*
%3 = getelementptr inbounds [100 x i8*], [100 x i8*]* %1, i64 0, i64 0
%4 = call i32 @split(i8** %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
%5 = load i8*, i8** %3
%6 = icmp eq i8* %5, null
br i1 %6, label %15, label %7
7: ; preds = %0, %7
%8 = phi i64 [ %11, %7 ], [ 0, %0 ]
%9 = phi i8* [ %13, %7 ], [ %5, %0 ]
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = add nuw i64 %8, 1
%12 = getelementptr inbounds [100 x i8*], [100 x i8*]* %1, i64 0, i64 %11
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %7
15: ; preds = %7, %0
ret i32 0
}