#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 *, ...);
int /*<<< orphan*/ sort3(int *, int *, int *);
int strlen(char *);
int main() {
  char *input = "Diederich is een goede docent!";
  int size = strlen(input) - 1;
  char output[size];
  printf("Input: %s\n", input);
  printf("%d\n", size);
  int x = 0;
  while (size >= x) {
    output[x] = input[size - x];
    ++x;
  }
  printf("Output: %s\n", output);
  printf("---------\n");
  int a = 52;
  int b = 95;
  int c = 2;
  printf("Int a = %d\n", a);
  printf("Int b = %d\n", b);
  printf("Int c = %d\n", c);
  sort3(&a, &b, &c);
  printf("---------\n");
  printf("Int a = %d\n", a);
  printf("Int b = %d\n", b);
  printf("Int c = %d\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x20(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x40(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jl     11de <main+0xae>
mov    -0x40(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%edx
sub    -0x2c(%rbp),%edx
movslq %edx,%rdx
mov    (%rcx,%rdx,1),%dl
movslq -0x2c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11a9 <main+0x79>
mov    -0x40(%rbp),%rsi
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x34,-0x30(%rbp)
movl   $0x5f,-0x34(%rbp)
movl   $0x2,-0x38(%rbp)
mov    -0x30(%rbp),%esi
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x30(%rbp),%rdi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
call   1050 <sort3@plt>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%esi
lea    0xdd2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x34(%rbp),%esi
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%esi
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xeaa(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
lea    -0x1(%r15),%r12d
mov    %rsp,%r14
lea    0xf(%r12),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
lea    0xea1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeaf(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
jle    12e4 <main+0x1a4>
mov    %r12d,%edx
mov    %r15d,%eax
cmp    $0x8,%r15d
jae    11b5 <main+0x75>
xor    %ecx,%ecx
jmp    12c3 <main+0x183>
cmp    $0x20,%r15d
jae    11c2 <main+0x82>
xor    %ecx,%ecx
jmp    126c <main+0x12c>
mov    %eax,%ecx
and    $0xffffffe0,%ecx
lea    (%rdx,%rbx,1),%rsi
add    $0xfffffffffffffff1,%rsi
xor    %edi,%edi
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movdqu -0x10(%rsi),%xmm1
movdqu (%rsi),%xmm2
movdqa %xmm2,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm2
pshufd $0x4e,%xmm2,%xmm2
pshuflw $0x1b,%xmm2,%xmm2
pshufhw $0x1b,%xmm2,%xmm2
packuswb %xmm3,%xmm2
movdqa %xmm1,%xmm3
punpcklbw %xmm0,%xmm3
pshufd $0x4e,%xmm3,%xmm3
pshuflw $0x1b,%xmm3,%xmm3
pshufhw $0x1b,%xmm3,%xmm3
punpckhbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm3,%xmm1
movdqa %xmm2,(%r14,%rdi,1)
movdqa %xmm1,0x10(%r14,%rdi,1)
add    $0x20,%rdi
add    $0xffffffffffffffe0,%rsi
cmp    %rdi,%rcx
jne    11e0 <main+0xa0>
cmp    %rax,%rcx
je     12e4 <main+0x1a4>
test   $0x18,%al
je     12c3 <main+0x183>
mov    %rcx,%rsi
mov    %eax,%ecx
and    $0xfffffff8,%ecx
mov    %rdx,%rdi
sub    %rsi,%rdi
add    %rbx,%rdi
add    $0xfffffffffffffff9,%rdi
pxor   %xmm0,%xmm0
cs nopw 0x0(%rax,%rax,1)
nop
movq   (%rdi),%xmm1
punpcklbw %xmm0,%xmm1
pshufd $0x4e,%xmm1,%xmm1
pshuflw $0x1b,%xmm1,%xmm1
pshufhw $0x1b,%xmm1,%xmm1
packuswb %xmm1,%xmm1
movq   %xmm1,(%r14,%rsi,1)
add    $0x8,%rsi
add    $0xfffffffffffffff8,%rdi
cmp    %rsi,%rcx
jne    1290 <main+0x150>
cmp    %rax,%rcx
je     12e4 <main+0x1a4>
sub    %rcx,%rdx
add    %rdx,%rbx
nopl   0x0(%rax)
movzbl (%rbx),%edx
mov    %dl,(%r14,%rcx,1)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rbx
cmp    %rcx,%rax
jne    12d0 <main+0x190>
lea    0xd3f(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd5e(%rip),%r14
mov    %r14,%rdi
call   1030 <puts@plt>
movl   $0x34,-0x2c(%rbp)
movl   $0x5f,-0x28(%rbp)
movl   $0x2,-0x24(%rbp)
lea    0xd16(%rip),%r15
mov    %r15,%rdi
mov    $0x34,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd0c(%rip),%r12
mov    %r12,%rdi
mov    $0x5f,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd02(%rip),%rbx
mov    %rbx,%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x2c(%rbp),%rdi
lea    -0x28(%rbp),%rsi
lea    -0x24(%rbp),%rdx
call   1060 <sort3@plt>
mov    %r14,%rdi
call   1030 <puts@plt>
mov    -0x2c(%rbp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x28(%rbp),%esi
mov    %r12,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    -0x24(%rbp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
lea    -0x20(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [31 x i8] c"Diederich is een goede docent!\00"
@.str.1 = [11 x i8] c"Input: %s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [12 x i8] c"Output: %s\0A\00"
@.str.4 = [11 x i8] c"---------\0A\00"
@.str.5 = [12 x i8] c"Int a = %d\0A\00"
@.str.6 = [12 x i8] c"Int b = %d\0A\00"
@.str.7 = [12 x i8] c"Int c = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8** %2
%10 = load i8*, i8** %2
%11 = call i32 @strlen(i8* %10)
%12 = sub nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i32, i32* %3
%14 = zext i32 %13 to i64
%15 = call i8* @llvm.stacksave()
store i8* %15, i8** %4
%16 = alloca i8, i64 %14
store i64 %14, i64* %5
%17 = load i8*, i8** %2
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %19)
store i32 0, i32* %6
br label %21
21: ; preds = %25, %0
%22 = load i32, i32* %3
%23 = load i32, i32* %6
%24 = icmp sge i32 %22, %23
br i1 %24, label %25, label %38
25: ; preds = %21
%26 = load i8*, i8** %2
%27 = load i32, i32* %3
%28 = load i32, i32* %6
%29 = sub nsw i32 %27, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %26, i64 %30
%32 = load i8, i8* %31
%33 = load i32, i32* %6
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %16, i64 %34
store i8 %32, i8* %35
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %21
38: ; preds = %21
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %16)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
store i32 52, i32* %7
store i32 95, i32* %8
store i32 2, i32* %9
%41 = load i32, i32* %7
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %41)
%43 = load i32, i32* %8
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %43)
%45 = load i32, i32* %9
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %45)
%47 = call i32 @sort3(i32* %7, i32* %8, i32* %9)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0))
%49 = load i32, i32* %7
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %49)
%51 = load i32, i32* %8
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %9
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %53)
store i32 0, i32* %1
%55 = load i8*, i8** %4
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str = [31 x i8] c"Diederich is een goede docent!\00"
@.str.1 = [11 x i8] c"Input: %s\0A\00"
@.str.2 = [4 x i8] c"%d\0A\00"
@.str.3 = [12 x i8] c"Output: %s\0A\00"
@.str.5 = [12 x i8] c"Int a = %d\0A\00"
@.str.6 = [12 x i8] c"Int b = %d\0A\00"
@.str.7 = [12 x i8] c"Int c = %d\0A\00"
@str.8 = [10 x i8] c"---------\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = tail call i32 @strlen(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%5 = add nsw i32 %4, -1
%6 = zext i32 %5 to i64
%7 = alloca i8, i64 %6
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%10 = icmp sgt i32 %4, 0
br i1 %10, label %11, label %69
11: ; preds = %0
%12 = zext i32 %5 to i64
%13 = zext i32 %4 to i64
%14 = icmp ult i32 %4, 8
br i1 %14, label %59, label %15
15: ; preds = %11
%16 = icmp ult i32 %4, 32
br i1 %16, label %42, label %17
17: ; preds = %15
%18 = and i64 %13, 4294967264
br label %19
19: ; preds = %19, %17
%20 = phi i64 [ 0, %17 ], [ %35, %19 ]
%21 = sub nsw i64 %12, %20
%22 = getelementptr inbounds [31 x i8], [31 x i8]* @.str, i64 0, i64 %21
%23 = getelementptr inbounds i8, i8* %22, i64 -15
%24 = bitcast i8* %23 to <16 x i8>*
%25 = load <16 x i8>, <16 x i8>* %24
%26 = shufflevector <16 x i8> %25, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%27 = getelementptr inbounds i8, i8* %22, i64 -31
%28 = bitcast i8* %27 to <16 x i8>*
%29 = load <16 x i8>, <16 x i8>* %28
%30 = shufflevector <16 x i8> %29, <16 x i8> poison, <16 x i32> <i32 15, i32 14, i32 13, i32 12, i32 11, i32 10, i32 9, i32 8, i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%31 = getelementptr inbounds i8, i8* %7, i64 %20
%32 = bitcast i8* %31 to <16 x i8>*
store <16 x i8> %26, <16 x i8>* %32
%33 = getelementptr inbounds i8, i8* %31, i64 16
%34 = bitcast i8* %33 to <16 x i8>*
store <16 x i8> %30, <16 x i8>* %34
%35 = add nuw i64 %20, 32
%36 = icmp eq i64 %35, %18
br i1 %36, label %37, label %19
37: ; preds = %19
%38 = icmp eq i64 %18, %13
br i1 %38, label %69, label %39
39: ; preds = %37
%40 = and i64 %13, 24
%41 = icmp eq i64 %40, 0
br i1 %41, label %59, label %42
42: ; preds = %15, %39
%43 = phi i64 [ %18, %39 ], [ 0, %15 ]
%44 = and i64 %13, 4294967288
br label %45
45: ; preds = %45, %42
%46 = phi i64 [ %43, %42 ], [ %55, %45 ]
%47 = sub nsw i64 %12, %46
%48 = getelementptr inbounds [31 x i8], [31 x i8]* @.str, i64 0, i64 %47
%49 = getelementptr inbounds i8, i8* %48, i64 -7
%50 = bitcast i8* %49 to <8 x i8>*
%51 = load <8 x i8>, <8 x i8>* %50
%52 = shufflevector <8 x i8> %51, <8 x i8> poison, <8 x i32> <i32 7, i32 6, i32 5, i32 4, i32 3, i32 2, i32 1, i32 0>
%53 = getelementptr inbounds i8, i8* %7, i64 %46
%54 = bitcast i8* %53 to <8 x i8>*
store <8 x i8> %52, <8 x i8>* %54
%55 = add nuw i64 %46, 8
%56 = icmp eq i64 %55, %44
br i1 %56, label %57, label %45
57: ; preds = %45
%58 = icmp eq i64 %44, %13
br i1 %58, label %69, label %59
59: ; preds = %11, %39, %57
%60 = phi i64 [ 0, %11 ], [ %18, %39 ], [ %44, %57 ]
br label %61
61: ; preds = %59, %61
%62 = phi i64 [ %67, %61 ], [ %60, %59 ]
%63 = sub nsw i64 %12, %62
%64 = getelementptr inbounds [31 x i8], [31 x i8]* @.str, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = getelementptr inbounds i8, i8* %7, i64 %62
store i8 %65, i8* %66
%67 = add nuw nsw i64 %62, 1
%68 = icmp eq i64 %67, %13
br i1 %68, label %69, label %61
69: ; preds = %61, %37, %57, %0
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i8* %7)
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
%72 = bitcast i32* %1 to i8*
store i32 52, i32* %1
%73 = bitcast i32* %2 to i8*
store i32 95, i32* %2
%74 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 52)
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 95)
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 2)
%78 = call i32 @sort3(i32* %1, i32* %2, i32* %3)
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.8, i64 0, i64 0))
%80 = load i32, i32* %1
%81 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0), i32 %80)
%82 = load i32, i32* %2
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i32 %82)
%84 = load i32, i32* %3
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.7, i64 0, i64 0), i32 %84)
ret i32 0
}