#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*/ draw_back(int, char *);
int /*<<< orphan*/ draw_body(int, int, char *);
int /*<<< orphan*/ draw_head(int, int, char *);
int /*<<< orphan*/ draw_rainbow(int, int, char *);
int /*<<< orphan*/ save_image(int, char *);
int main(int argc, char *argv[]) {
  int i;
  char image[8][80];
  int nyan_x = 0;
  (void)argc;
  (void)argv;
  for (i = 0; i < 64; i++) {
    if (i < 30) {
      nyan_x = 2 * i;
    }
    draw_back(i, (char *)image);
    draw_rainbow(i, nyan_x, (char *)image);
    draw_body(i, nyan_x, (char *)image);
    draw_head(i, nyan_x, (char *)image);
    save_image(i, (char *)image);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2b0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x2a4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x40,-0x14(%rbp)
jge    1205 <main+0xb5>
cmpl   $0x1e,-0x14(%rbp)
jge    119a <main+0x4a>
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x2a4(%rbp)
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
call   1050 <draw_back@plt>
mov    -0x14(%rbp),%edi
mov    -0x2a4(%rbp),%esi
lea    -0x2a0(%rbp),%rdx
call   1030 <draw_rainbow@plt>
mov    -0x14(%rbp),%edi
mov    -0x2a4(%rbp),%esi
lea    -0x2a0(%rbp),%rdx
call   1070 <draw_body@plt>
mov    -0x14(%rbp),%edi
mov    -0x2a4(%rbp),%esi
lea    -0x2a0(%rbp),%rdx
call   1040 <draw_head@plt>
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
call   1060 <save_image@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    117a <main+0x2a>
xor    %eax,%eax
add    $0x2b0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x288,%rsp
xor    %r15d,%r15d
mov    %rsp,%r14
xor    %ebp,%ebp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
cmp    $0x1e,%ebx
cmovb  %r15d,%ebp
mov    %ebx,%edi
mov    %r14,%rsi
call   1050 <draw_back@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1030 <draw_rainbow@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1070 <draw_body@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <draw_head@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1060 <save_image@plt>
add    $0x1,%ebx
add    $0x2,%r15d
cmp    $0x40,%ebx
jne    1170 <main+0x20>
xor    %eax,%eax
add    $0x288,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca [8 x [80 x i8]]
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %8
%9 = load i32, i32* %4
%10 = load i8**, i8*** %5
store i32 0, i32* %6
br label %11
11: ; preds = %44, %2
%12 = load i32, i32* %6
%13 = icmp slt i32 %12, 64
br i1 %13, label %14, label %47
14: ; preds = %11
%15 = load i32, i32* %6
%16 = icmp slt i32 %15, 30
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = load i32, i32* %6
%19 = mul nsw i32 2, %18
store i32 %19, i32* %8
br label %20
20: ; preds = %17, %14
%21 = load i32, i32* %6
%22 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%23 = bitcast [80 x i8]* %22 to i8*
%24 = call i32 @draw_back(i32 %21, i8* %23)
%25 = load i32, i32* %6
%26 = load i32, i32* %8
%27 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%28 = bitcast [80 x i8]* %27 to i8*
%29 = call i32 @draw_rainbow(i32 %25, i32 %26, i8* %28)
%30 = load i32, i32* %6
%31 = load i32, i32* %8
%32 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%33 = bitcast [80 x i8]* %32 to i8*
%34 = call i32 @draw_body(i32 %30, i32 %31, i8* %33)
%35 = load i32, i32* %6
%36 = load i32, i32* %8
%37 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%38 = bitcast [80 x i8]* %37 to i8*
%39 = call i32 @draw_head(i32 %35, i32 %36, i8* %38)
%40 = load i32, i32* %6
%41 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%42 = bitcast [80 x i8]* %41 to i8*
%43 = call i32 @save_image(i32 %40, i8* %42)
br label %44
44: ; preds = %20
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %11
47: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [8 x [80 x i8]]
%4 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %3, i64 0, i64 0, i64 0
br label %5
5: ; preds = %2, %5
%6 = phi i32 [ 0, %2 ], [ %10, %5 ]
%7 = phi i32 [ 0, %2 ], [ %16, %5 ]
%8 = icmp ult i32 %7, 30
%9 = shl nuw nsw i32 %7, 1
%10 = select i1 %8, i32 %9, i32 %6
%11 = call i32 @draw_back(i32 %7, i8* %4)
%12 = call i32 @draw_rainbow(i32 %7, i32 %10, i8* %4)
%13 = call i32 @draw_body(i32 %7, i32 %10, i8* %4)
%14 = call i32 @draw_head(i32 %7, i32 %10, i8* %4)
%15 = call i32 @save_image(i32 %7, i8* %4)
%16 = add nuw nsw i32 %7, 1
%17 = icmp eq i32 %16, 64
br i1 %17, label %18, label %5
18: ; preds = %5
ret i32 0
}