#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_pea(int, int, int, char *);
int /*<<< orphan*/ draw_shooter(int, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ draw_sunflower(int, int /*<<< orphan*/, int /*<<< orphan*/,
                                  char *);
int /*<<< orphan*/ draw_zombie(int, int, int /*<<< orphan*/, char *);
int /*<<< orphan*/ save_image(int, char *);
int main(int argc, char *argv[]) {
  int frame;
  char image[8][80];
  int zombie_x, pea_x;
  (void)argc;
  (void)argv;
  for (frame = 0; frame < 100; frame++) {
    draw_back(frame, (char *)image);
    draw_sunflower(frame, 0, 0, (char *)image);
    draw_shooter(frame, 12, 0, (char *)image);
    zombie_x = 80 - (frame / 2);
    draw_zombie(frame, zombie_x, 0, (char *)image);
    pea_x = 20 + (frame % 32) * 4;
    if (pea_x <= zombie_x) {
      draw_pea(frame, pea_x, 2, (char *)image);
    }
    save_image(frame, (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,-0x14(%rbp)
cmpl   $0x64,-0x14(%rbp)
jge    1255 <main+0xf5>
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
call   1030 <draw_back@plt>
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rcx
xor    %edx,%edx
mov    %edx,%esi
call   1040 <draw_sunflower@plt>
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rcx
mov    $0xc,%esi
xor    %edx,%edx
call   1070 <draw_shooter@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    $0x50,%eax
sub    %ecx,%eax
mov    %eax,-0x2a4(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x2a4(%rbp),%esi
lea    -0x2a0(%rbp),%rcx
xor    %edx,%edx
call   1060 <draw_zombie@plt>
mov    -0x14(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
shl    $0x2,%eax
add    $0x14,%eax
mov    %eax,-0x2a8(%rbp)
mov    -0x2a8(%rbp),%eax
cmp    -0x2a4(%rbp),%eax
jg     1238 <main+0xd8>
mov    -0x14(%rbp),%edi
mov    -0x2a8(%rbp),%esi
lea    -0x2a0(%rbp),%rcx
mov    $0x2,%edx
call   1080 <draw_pea@plt>
mov    -0x14(%rbp),%edi
lea    -0x2a0(%rbp),%rsi
call   1050 <save_image@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1180 <main+0x20>
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
jmp    1196 <main+0x36>
nopw   0x0(%rax,%rax,1)
mov    %ebp,%edi
mov    %r14,%rsi
call   1050 <save_image@plt>
add    $0x1,%ebp
add    $0x4,%r15d
cmp    $0x64,%ebp
je     11f6 <main+0x96>
mov    %ebp,%edi
mov    %r14,%rsi
call   1030 <draw_back@plt>
mov    %ebp,%edi
xor    %esi,%esi
xor    %edx,%edx
mov    %r14,%rcx
call   1040 <draw_sunflower@plt>
mov    %ebp,%edi
mov    $0xc,%esi
xor    %edx,%edx
mov    %r14,%rcx
call   1070 <draw_shooter@plt>
mov    %ebp,%eax
shr    %eax
mov    $0x50,%ebx
sub    %eax,%ebx
mov    %ebp,%edi
mov    %ebx,%esi
xor    %edx,%edx
mov    %r14,%rcx
call   1060 <draw_zombie@plt>
mov    %r15d,%esi
and    $0x7c,%esi
add    $0x14,%esi
cmp    %ebx,%esi
ja     1180 <main+0x20>
mov    %ebp,%edi
mov    $0x2,%edx
mov    %r14,%rcx
call   1080 <draw_pea@plt>
jmp    1180 <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
%9 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = load i32, i32* %4
%11 = load i8**, i8*** %5
store i32 0, i32* %6
br label %12
12: ; preds = %54, %2
%13 = load i32, i32* %6
%14 = icmp slt i32 %13, 100
br i1 %14, label %15, label %57
15: ; preds = %12
%16 = load i32, i32* %6
%17 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%18 = bitcast [80 x i8]* %17 to i8*
%19 = call i32 @draw_back(i32 %16, i8* %18)
%20 = load i32, i32* %6
%21 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%22 = bitcast [80 x i8]* %21 to i8*
%23 = call i32 @draw_sunflower(i32 %20, i32 0, i32 0, i8* %22)
%24 = load i32, i32* %6
%25 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%26 = bitcast [80 x i8]* %25 to i8*
%27 = call i32 @draw_shooter(i32 %24, i32 12, i32 0, i8* %26)
%28 = load i32, i32* %6
%29 = sdiv i32 %28, 2
%30 = sub nsw i32 80, %29
store i32 %30, i32* %8
%31 = load i32, i32* %6
%32 = load i32, i32* %8
%33 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%34 = bitcast [80 x i8]* %33 to i8*
%35 = call i32 @draw_zombie(i32 %31, i32 %32, i32 0, i8* %34)
%36 = load i32, i32* %6
%37 = srem i32 %36, 32
%38 = mul nsw i32 %37, 4
%39 = add nsw i32 20, %38
store i32 %39, i32* %9
%40 = load i32, i32* %9
%41 = load i32, i32* %8
%42 = icmp sle i32 %40, %41
br i1 %42, label %43, label %49
43: ; preds = %15
%44 = load i32, i32* %6
%45 = load i32, i32* %9
%46 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%47 = bitcast [80 x i8]* %46 to i8*
%48 = call i32 @draw_pea(i32 %44, i32 %45, i32 2, i8* %47)
br label %49
49: ; preds = %43, %15
%50 = load i32, i32* %6
%51 = getelementptr inbounds [8 x [80 x i8]], [8 x [80 x i8]]* %7, i64 0, i64 0
%52 = bitcast [80 x i8]* %51 to i8*
%53 = call i32 @save_image(i32 %50, i8* %52)
br label %54
54: ; preds = %49
%55 = load i32, i32* %6
%56 = add nsw i32 %55, 1
store i32 %56, i32* %6
br label %12
57: ; preds = %12
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, %19
%6 = phi i32 [ 0, %2 ], [ %21, %19 ]
%7 = call i32 @draw_back(i32 %6, i8* %4)
%8 = call i32 @draw_sunflower(i32 %6, i32 0, i32 0, i8* %4)
%9 = call i32 @draw_shooter(i32 %6, i32 12, i32 0, i8* %4)
%10 = lshr i32 %6, 1
%11 = sub nuw nsw i32 80, %10
%12 = call i32 @draw_zombie(i32 %6, i32 %11, i32 0, i8* %4)
%13 = shl nuw nsw i32 %6, 2
%14 = and i32 %13, 124
%15 = add nuw nsw i32 %14, 20
%16 = icmp ugt i32 %15, %11
br i1 %16, label %19, label %17
17: ; preds = %5
%18 = call i32 @draw_pea(i32 %6, i32 %15, i32 2, i8* %4)
br label %19
19: ; preds = %17, %5
%20 = call i32 @save_image(i32 %6, i8* %4)
%21 = add nuw nsw i32 %6, 1
%22 = icmp eq i32 %21, 100
br i1 %22, label %23, label %5
23: ; preds = %19
ret i32 0
}