#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*/ delay(int);
int /*<<< orphan*/ printf(char *, ...);
void payload(void) {
  const char *hacked =
      "\n"
      "##     ##    ###     ######  ##    ## ######## ########  \n"
      "##     ##   ## ##   ##    ## ##   ##  ##       ##     ## \n"
      "##     ##  ##   ##  ##       ##  ##   ##       ##     ## \n"
      "######### ##     ## ##       #####    ######   ##     ## \n"
      "##     ## ######### ##       ##  ##   ##       ##     ## \n"
      "##     ## ##     ## ##    ## ##   ##  ##       ##     ## \n"
      "##     ## ##     ##  ######  ##    ## ######## ########  \n";
  for (;;) {
    for (int a = 0; a < 10; a++) {
      printf("\f");
      for (int i = 0; i < a; i++) {
        printf("\n");
      }
      printf("%s", hacked);
      delay(100);
    }
    for (int a = 10; a > 0; a--) {
      printf("\f");
      for (int i = 0; i < a; i++) {
        printf("\n");
      }
      printf("%s", hacked);
      delay(100);
    }
  }
}


x86 assembly (clang, -O0):
<payload>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    11ab <payload+0x8b>
lea    0x104d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1181 <payload+0x61>
lea    0x102a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1159 <payload+0x39>
mov    -0x8(%rbp),%rsi
lea    0x100e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <delay@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    113a <payload+0x1a>
movl   $0xa,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jle    1223 <payload+0x103>
lea    0xfd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11f9 <payload+0xd9>
lea    0xfb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11d1 <payload+0xb1>
mov    -0x8(%rbp),%rsi
lea    0xf96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x64,%edi
call   1040 <delay@plt>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    11b2 <payload+0x92>
jmp    1133 <payload+0x13>

x86 assembly (clang, -O2):
<payload>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xec3(%rip),%r14
nopl   (%rax)
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    %ebx,%ebp
test   %ebx,%ebx
je     115f <payload+0x2f>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1150 <payload+0x20>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
add    $0x1,%ebx
cmp    $0xa,%ebx
jne    1140 <payload+0x10>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0xa,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1190 <payload+0x60>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x9,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11c0 <payload+0x90>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x8,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11f0 <payload+0xc0>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x7,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1220 <payload+0xf0>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x6,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1250 <payload+0x120>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x5,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1280 <payload+0x150>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x4,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12b0 <payload+0x180>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x3,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    12e0 <payload+0x1b0>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x2,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1310 <payload+0x1e0>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
mov    $0xc,%edi
call   1030 <putchar@plt>
mov    $0x1,%ebx
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1340 <payload+0x210>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x64,%edi
call   1050 <delay@plt>
xor    %ebx,%ebx
jmp    1140 <payload+0x10>

LLVM IR (-O0):
@.str = [408 x i8] c"\0A## ## ### ###### ## ## ######## ######## \0A## ## ## ## ## ## ## ## ## ## ## \0A## ## ## ## ## ## ## ## ## ## \0A######### ## ## ## ##### ###### ## ## \0A## ## ######### ## ## ## ## ## ## \0A## ## ## ## ## ## ## ## ## ## ## \0A## ## ## ## ###### ## ## ######## ######## \0A\00"
@.str.1 = [2 x i8] c"\0C\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [3 x i8] c"%s\00"
define void @payload() {
%1 = alloca i8*
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i8* getelementptr inbounds ([408 x i8], [408 x i8]* @.str, i64 0, i64 0), i8** %1
br label %6
6: ; preds = %50, %0
store i32 0, i32* %2
br label %7
7: ; preds = %25, %6
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 10
br i1 %9, label %10, label %28
10: ; preds = %7
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %3
br label %12
12: ; preds = %18, %10
%13 = load i32, i32* %3
%14 = load i32, i32* %2
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %21
16: ; preds = %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %16
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %12
21: ; preds = %12
%22 = load i8*, i8** %1
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = call i32 @delay(i32 100)
br label %25
25: ; preds = %21
%26 = load i32, i32* %2
%27 = add nsw i32 %26, 1
store i32 %27, i32* %2
br label %7
28: ; preds = %7
store i32 10, i32* %4
br label %29
29: ; preds = %47, %28
%30 = load i32, i32* %4
%31 = icmp sgt i32 %30, 0
br i1 %31, label %32, label %50
32: ; preds = %29
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %5
br label %34
34: ; preds = %40, %32
%35 = load i32, i32* %5
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %43
38: ; preds = %34
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %40
40: ; preds = %38
%41 = load i32, i32* %5
%42 = add nsw i32 %41, 1
store i32 %42, i32* %5
br label %34
43: ; preds = %34
%44 = load i8*, i8** %1
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %44)
%46 = call i32 @delay(i32 100)
br label %47
47: ; preds = %43
%48 = load i32, i32* %4
%49 = add nsw i32 %48, -1
store i32 %49, i32* %4
br label %29
50: ; preds = %29
br label %6
}

LLVM IR (-O2):
@str.4 = [407 x i8] c"\0A## ## ### ###### ## ## ######## ######## \0A## ## ## ## ## ## ## ## ## ## ## \0A## ## ## ## ## ## ## ## ## ## \0A######### ## ## ## ##### ###### ## ## \0A## ## ######### ## ## ## ## ## ## \0A## ## ## ## ## ## ## ## ## ## ## \0A## ## ## ## ###### ## ## ######## ######## \00"
define void @payload() {
br label %1
1: ; preds = %10, %0
%2 = phi i32 [ 0, %0 ], [ %11, %10 ]
%3 = tail call i32 @putchar(i32 12)
%4 = icmp eq i32 %2, 0
br i1 %4, label %5, label %12
5: ; preds = %12, %1
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%7 = tail call i32 @delay(i32 100)
%8 = add nuw nsw i32 %2, 1
%9 = icmp eq i32 %8, 10
br i1 %9, label %17, label %10
10: ; preds = %5, %100
%11 = phi i32 [ %8, %5 ], [ 0, %100 ]
br label %1
12: ; preds = %1, %12
%13 = phi i32 [ %15, %12 ], [ 0, %1 ]
%14 = tail call i32 @putchar(i32 10)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %2
br i1 %16, label %5, label %12
17: ; preds = %5
%18 = tail call i32 @putchar(i32 12)
br label %103
19: ; preds = %103
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%21 = tail call i32 @delay(i32 100)
%22 = tail call i32 @putchar(i32 12)
br label %23
23: ; preds = %23, %19
%24 = phi i32 [ %26, %23 ], [ 0, %19 ]
%25 = tail call i32 @putchar(i32 10)
%26 = add nuw nsw i32 %24, 1
%27 = icmp eq i32 %26, 9
br i1 %27, label %28, label %23
28: ; preds = %23
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%30 = tail call i32 @delay(i32 100)
%31 = tail call i32 @putchar(i32 12)
br label %32
32: ; preds = %32, %28
%33 = phi i32 [ %35, %32 ], [ 0, %28 ]
%34 = tail call i32 @putchar(i32 10)
%35 = add nuw nsw i32 %33, 1
%36 = icmp eq i32 %35, 8
br i1 %36, label %37, label %32
37: ; preds = %32
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%39 = tail call i32 @delay(i32 100)
%40 = tail call i32 @putchar(i32 12)
br label %41
41: ; preds = %41, %37
%42 = phi i32 [ %44, %41 ], [ 0, %37 ]
%43 = tail call i32 @putchar(i32 10)
%44 = add nuw nsw i32 %42, 1
%45 = icmp eq i32 %44, 7
br i1 %45, label %46, label %41
46: ; preds = %41
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%48 = tail call i32 @delay(i32 100)
%49 = tail call i32 @putchar(i32 12)
br label %50
50: ; preds = %50, %46
%51 = phi i32 [ %53, %50 ], [ 0, %46 ]
%52 = tail call i32 @putchar(i32 10)
%53 = add nuw nsw i32 %51, 1
%54 = icmp eq i32 %53, 6
br i1 %54, label %55, label %50
55: ; preds = %50
%56 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%57 = tail call i32 @delay(i32 100)
%58 = tail call i32 @putchar(i32 12)
br label %59
59: ; preds = %59, %55
%60 = phi i32 [ %62, %59 ], [ 0, %55 ]
%61 = tail call i32 @putchar(i32 10)
%62 = add nuw nsw i32 %60, 1
%63 = icmp eq i32 %62, 5
br i1 %63, label %64, label %59
64: ; preds = %59
%65 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%66 = tail call i32 @delay(i32 100)
%67 = tail call i32 @putchar(i32 12)
br label %68
68: ; preds = %68, %64
%69 = phi i32 [ %71, %68 ], [ 0, %64 ]
%70 = tail call i32 @putchar(i32 10)
%71 = add nuw nsw i32 %69, 1
%72 = icmp eq i32 %71, 4
br i1 %72, label %73, label %68
73: ; preds = %68
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%75 = tail call i32 @delay(i32 100)
%76 = tail call i32 @putchar(i32 12)
br label %77
77: ; preds = %77, %73
%78 = phi i32 [ %80, %77 ], [ 0, %73 ]
%79 = tail call i32 @putchar(i32 10)
%80 = add nuw nsw i32 %78, 1
%81 = icmp eq i32 %80, 3
br i1 %81, label %82, label %77
82: ; preds = %77
%83 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%84 = tail call i32 @delay(i32 100)
%85 = tail call i32 @putchar(i32 12)
br label %86
86: ; preds = %86, %82
%87 = phi i32 [ %89, %86 ], [ 0, %82 ]
%88 = tail call i32 @putchar(i32 10)
%89 = add nuw nsw i32 %87, 1
%90 = icmp eq i32 %89, 2
br i1 %90, label %91, label %86
91: ; preds = %86
%92 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%93 = tail call i32 @delay(i32 100)
%94 = tail call i32 @putchar(i32 12)
br label %95
95: ; preds = %95, %91
%96 = phi i32 [ %98, %95 ], [ 0, %91 ]
%97 = tail call i32 @putchar(i32 10)
%98 = add nuw nsw i32 %96, 1
%99 = icmp eq i32 %96, 0
br i1 %99, label %100, label %95
100: ; preds = %95
%101 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([407 x i8], [407 x i8]* @str.4, i64 0, i64 0))
%102 = tail call i32 @delay(i32 100)
br label %10
103: ; preds = %17, %103
%104 = phi i32 [ %106, %103 ], [ 0, %17 ]
%105 = tail call i32 @putchar(i32 10)
%106 = add nuw nsw i32 %104, 1
%107 = icmp eq i32 %106, 10
br i1 %107, label %19, label %103
}