#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 strlen(char *);
int main() {
  char text[] = "Ich bin ein Text ohne Sinn, aber mit den Zahlen 0,8,1,5";
  int i = 0;
  char arr[] = "hallo";
  int j = 0;
  for (i = 0; i < strlen(arr); i++) {
    for (j = 0; j < i; j++) {
      printf("*");
    }
    printf("%c", arr[i]);
    for (j++; j < strlen(arr); j++) {
      printf("*");
    }
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x38,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
mov    0xed7(%rip),%eax
mov    %eax,-0x4a(%rbp)
mov    0xed1(%rip),%ax
mov    %ax,-0x46(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x54(%rbp)
lea    -0x4a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
cmp    %ecx,%eax
jge    123c <main+0x10c>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    11c8 <main+0x98>
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    11a0 <main+0x70>
movslq -0x44(%rbp),%rax
movsbl -0x4a(%rbp,%rax,1),%esi
lea    0xe68(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    -0x50(%rbp),%eax
mov    %eax,-0x58(%rbp)
lea    -0x4a(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
cmp    %ecx,%eax
jge    1220 <main+0xf0>
lea    0xe33(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    11e8 <main+0xb8>
lea    0xe1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    117d <main+0x4d>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movw   $0x6f,0x4(%rsp)
movl   $0x6c6c6168,(%rsp)
mov    %rsp,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11bb <main+0x9b>
xor    %r15d,%r15d
mov    %rsp,%r14
jmp    116d <main+0x4d>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%r15
jge    11bb <main+0x9b>
mov    $0x0,%ebp
test   %r15,%r15
je     1193 <main+0x73>
mov    %r15,%rbx
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffffffffffff,%rbx
jne    1180 <main+0x60>
mov    %r15d,%ebp
movsbl (%rsp,%r15,1),%edi
nopl   0x0(%rax,%rax,1)
call   1030 <putchar@plt>
add    $0x1,%ebp
mov    %r14,%rdi
call   1040 <strlen@plt>
cmp    %eax,%ebp
jge    1150 <main+0x30>
mov    $0x2a,%edi
jmp    11a0 <main+0x80>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.text = [56 x i8] c"Ich bin ein Text ohne Sinn, aber mit den Zahlen 0,8,1,5\00"
@__const.main.arr = [6 x i8] c"hallo\00"
@.str = [2 x i8] c"*\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [56 x i8]
%3 = alloca i32
%4 = alloca [6 x i8]
%5 = alloca i32
store i32 0, i32* %1
%6 = bitcast [56 x i8]* %2 to i8*
store i32 0, i32* %3
%7 = bitcast [6 x i8]* %4 to i8*
store i32 0, i32* %5
store i32 0, i32* %3
br label %8
8: ; preds = %44, %0
%9 = load i32, i32* %3
%10 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%11 = call i32 @strlen(i8* %10)
%12 = icmp slt i32 %9, %11
br i1 %12, label %13, label %47
13: ; preds = %8
store i32 0, i32* %5
br label %14
14: ; preds = %20, %13
%15 = load i32, i32* %5
%16 = load i32, i32* %3
%17 = icmp slt i32 %15, %16
br i1 %17, label %18, label %23
18: ; preds = %14
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %20
20: ; preds = %18
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %14
23: ; preds = %14
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %32
32: ; preds = %39, %23
%33 = load i32, i32* %5
%34 = getelementptr inbounds [6 x i8], [6 x i8]* %4, i64 0, i64 0
%35 = call i32 @strlen(i8* %34)
%36 = icmp slt i32 %33, %35
br i1 %36, label %37, label %42
37: ; preds = %32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %39
39: ; preds = %37
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
br label %32
42: ; preds = %32
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %3
%46 = add nsw i32 %45, 1
store i32 %46, i32* %3
br label %8
47: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [6 x i8] c"hallo\00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%3 = call i32 @strlen(i8* %2)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %37
5: ; preds = %0, %31
%6 = phi i64 [ %33, %31 ], [ 0, %0 ]
%7 = icmp eq i64 %6, 0
br i1 %7, label %16, label %8
8: ; preds = %5, %8
%9 = phi i32 [ %11, %8 ], [ 0, %5 ]
%10 = call i32 @putchar(i32 42)
%11 = add nuw nsw i32 %9, 1
%12 = zext i32 %11 to i64
%13 = icmp eq i64 %6, %12
br i1 %13, label %14, label %8
14: ; preds = %8
%15 = trunc i64 %6 to i32
br label %16
16: ; preds = %14, %5
%17 = phi i32 [ 0, %5 ], [ %15, %14 ]
%18 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 %6
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = call i32 @putchar(i32 %20)
%22 = add nuw nsw i32 %17, 1
%23 = call i32 @strlen(i8* %2)
%24 = icmp slt i32 %22, %23
br i1 %24, label %25, label %31
25: ; preds = %16, %25
%26 = phi i32 [ %28, %25 ], [ %22, %16 ]
%27 = call i32 @putchar(i32 42)
%28 = add nuw nsw i32 %26, 1
%29 = call i32 @strlen(i8* %2)
%30 = icmp slt i32 %28, %29
br i1 %30, label %25, label %31
31: ; preds = %25, %16
%32 = call i32 @putchar(i32 10)
%33 = add nuw nsw i64 %6, 1
%34 = call i32 @strlen(i8* %2)
%35 = sext i32 %34 to i64
%36 = icmp slt i64 %33, %35
br i1 %36, label %5, label %37
37: ; preds = %31, %0
ret i32 0
}