#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 */
typedef int /*<<< orphan*/ print;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strlcat(char *, char *, int);
int /*<<< orphan*/ strlcpy(char *, char *, int);
int main(void) {
  char *groet;
  groet = "hallo, het is weer een mooie dag \n\n";
  printf(groet);
  int x = 0;
  while (groet[++x])
    ;
  printf("%d \n", x);
  char print[100];
  strlcpy(print, groet, sizeof(print));
  strlcat(print, "Hoi, hoe gaat het", sizeof(print));
  strlcat(print, " met jou?", sizeof(print));
  printf("%s\n", print);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeb7(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x14(%rbp)
movslq %ecx,%rcx
cmpb   $0x0,(%rax,%rcx,1)
je     117e <main+0x4e>
jmp    115f <main+0x2f>
mov    -0x14(%rbp),%esi
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x64,%edx
call   1050 <strlcpy@plt>
lea    -0x80(%rbp),%rdi
lea    0xe7d(%rip),%rsi
mov    $0x64,%edx
call   1030 <strlcat@plt>
lea    -0x80(%rbp),%rdi
lea    0xe7a(%rip),%rsi
mov    $0x64,%edx
call   1030 <strlcat@plt>
lea    -0x80(%rbp),%rsi
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x70,%rsp
lea    0xef9(%rip),%rdi
call   1030 <puts@plt>
lea    0xecc(%rip),%rdi
mov    $0x23,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe95(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x64,%edx
call   1060 <strlcpy@plt>
lea    0xea7(%rip),%rsi
mov    %rbx,%rdi
mov    $0x64,%edx
call   1040 <strlcat@plt>
lea    0xea5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x64,%edx
call   1040 <strlcat@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [36 x i8] c"hallo, het is weer een mooie dag \0A\0A\00"
@.str.1 = [5 x i8] c"%d \0A\00"
@.str.2 = [18 x i8] c"Hoi, hoe gaat het\00"
@.str.3 = [10 x i8] c" met jou?\00"
@.str.4 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [100 x i8]
store i32 0, i32* %1
store i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* %5)
store i32 0, i32* %3
br label %7
7: ; preds = %15, %0
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
store i32 %10, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %8, i64 %11
%13 = load i8, i8* %12
%14 = icmp ne i8 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %7
br label %7
16: ; preds = %7
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%20 = load i8*, i8** %2
%21 = call i32 @strlcpy(i8* %19, i8* %20, i32 100)
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%23 = call i32 @strlcat(i8* %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 100)
%24 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%25 = call i32 @strlcat(i8* %24, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 100)
%26 = getelementptr inbounds [100 x i8], [100 x i8]* %4, i64 0, i64 0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [36 x i8] c"hallo, het is weer een mooie dag \0A\0A\00"
@.str.1 = [5 x i8] c"%d \0A\00"
@.str.2 = [18 x i8] c"Hoi, hoe gaat het\00"
@.str.3 = [10 x i8] c" met jou?\00"
@str = [35 x i8] c"hallo, het is weer een mooie dag \0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 35)
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%5 = call i32 @strlcpy(i8* %4, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i32 100)
%6 = call i32 @strlcat(i8* %4, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 100)
%7 = call i32 @strlcat(i8* %4, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 100)
%8 = call i32 @puts(i8* %4)
ret i32 0
}