#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*/ IP(unsigned char *);
unsigned char *malloc(int);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  printf("Hello World\n");
  unsigned char TXT[] = {
      0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x01, 0x60, 0x6E, 0x11, 0x02, 0x0F,
      0x08, 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA,
      0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA,
      0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA,
      0x55, 0x66, 0x77, 0x88, 0x99, 0xAA, 0x55, 0x66, 0x77, 0x88, 0x99, 0xAA};
  unsigned char *htp = malloc(sizeof(unsigned char) * 80);
  int i = 0;
  int j = 0;
  printf("begin \n");
  for (i = 20; i < 80; i++) {
    j = i - 20;
    htp[i] = TXT[j];
  }
  IP(htp);
  printf("begin i be a printing \n");
  for (i = 0; i < 80; i++) {
    printf("% i 0x%2X\n", i, htp[i]);
  }
  printf("end \n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x40(%rbp),%rdi
lea    0xed8(%rip),%rsi
mov    $0x3c,%edx
call   1040 <memcpy@plt>
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x14,-0x4c(%rbp)
cmpl   $0x50,-0x4c(%rbp)
jge    11d7 <main+0x97>
mov    -0x4c(%rbp),%eax
sub    $0x14,%eax
mov    %eax,-0x50(%rbp)
movslq -0x50(%rbp),%rax
mov    -0x40(%rbp,%rax,1),%dl
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11a3 <main+0x63>
mov    -0x48(%rbp),%rdi
call   1060 <IP@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4c(%rbp)
cmpl   $0x50,-0x4c(%rbp)
jge    122a <main+0xea>
mov    -0x4c(%rbp),%esi
mov    -0x48(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    11f5 <main+0xb5>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x50,%edi
call   1050 <malloc@plt>
mov    %rax,%r15
lea    0xeee(%rip),%rdi
call   1030 <puts@plt>
movaps 0xe8f(%rip),%xmm0
movups %xmm0,0x14(%r15)
movaps 0xe93(%rip),%xmm0
movups %xmm0,0x24(%r15)
movaps 0xe97(%rip),%xmm0
movups %xmm0,0x34(%r15)
movups 0xe97(%rip),%xmm0
movups %xmm0,0x40(%r15)
mov    %r15,%rdi
call   1060 <IP@plt>
lea    0xeb1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe87(%rip),%r14
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movzbl (%r15,%rbx,1),%edx
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    $0x50,%rbx
jne    11c0 <main+0x80>
lea    0xe8f(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c"Hello World\0A\00"
@__const.main.TXT = [60 x i8] c"\FF\FF\FF\FF\FF\FF\01`n\11\02\0F\08\00\11\223DUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AA"
@.str.1 = [8 x i8] c"begin \0A\00"
@.str.2 = [24 x i8] c"begin i be a printing \0A\00"
@.str.3 = [11 x i8] c"% i 0x%2X\0A\00"
@.str.4 = [6 x i8] c"end \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [60 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%7 = bitcast [60 x i8]* %2 to i8*
%8 = call i8* @malloc(i32 80)
store i8* %8, i8** %3
store i32 0, i32* %4
store i32 0, i32* %5
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0))
store i32 20, i32* %4
br label %10
10: ; preds = %24, %0
%11 = load i32, i32* %4
%12 = icmp slt i32 %11, 80
br i1 %12, label %13, label %27
13: ; preds = %10
%14 = load i32, i32* %4
%15 = sub nsw i32 %14, 20
store i32 %15, i32* %5
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [60 x i8], [60 x i8]* %2, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = load i8*, i8** %3
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i8, i8* %20, i64 %22
store i8 %19, i8* %23
br label %24
24: ; preds = %13
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %10
27: ; preds = %10
%28 = load i8*, i8** %3
%29 = call i32 @IP(i8* %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
store i32 0, i32* %4
br label %31
31: ; preds = %43, %27
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 80
br i1 %33, label %34, label %46
34: ; preds = %31
%35 = load i32, i32* %4
%36 = load i8*, i8** %3
%37 = load i32, i32* %4
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %36, i64 %38
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %35, i32 %41)
br label %43
43: ; preds = %34
%44 = load i32, i32* %4
%45 = add nsw i32 %44, 1
store i32 %45, i32* %4
br label %31
46: ; preds = %31
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%48 = load i32, i32* %1
ret i32 %48
}

LLVM IR (-O2):
@__const.main.TXT = [60 x i8] c"\FF\FF\FF\FF\FF\FF\01`n\11\02\0F\08\00\11\223DUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AAUfw\88\99\AA"
@.str.3 = [11 x i8] c"% i 0x%2X\0A\00"
@str = [12 x i8] c"Hello World\00"
@str.5 = [7 x i8] c"begin \00"
@str.6 = [23 x i8] c"begin i be a printing \00"
@str.7 = [5 x i8] c"end \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%2 = tail call dereferenceable_or_null(80) i8* @malloc(i32 80)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.5, i64 0, i64 0))
%4 = getelementptr i8, i8* %2, i64 20
%5 = tail call i32 @IP(i8* %2)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.6, i64 0, i64 0))
br label %7
7: ; preds = %0, %7
%8 = phi i64 [ 0, %0 ], [ %14, %7 ]
%9 = getelementptr inbounds i8, i8* %2, i64 %8
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = trunc i64 %8 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0), i32 %12, i32 %11)
%14 = add nuw nsw i64 %8, 1
%15 = icmp eq i64 %14, 80
br i1 %15, label %16, label %7
16: ; preds = %7
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.7, i64 0, i64 0))
ret i32 0
}