#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*/ gif_frame();
int /*<<< orphan*/ gif_square(int, int, int, char *);
int gif_start(char *, int, int);
int /*<<< orphan*/ gif_stop(int);
int main() {
  int handle;
  handle = gif_start("200x200", 200, 200);
  gif_frame();
  gif_square(0, 0, 50, "blue");
  gif_frame();
  gif_square(50, 50, 50, "red");
  gif_frame();
  gif_square(100, 100, 50, "yellow");
  gif_frame();
  gif_square(150, 150, 50, "green");
  gif_stop(handle);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0xc8,%edx
mov    %edx,%esi
call   1060 <gif_start@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <gif_frame@plt>
xor    %esi,%esi
mov    $0x32,%edx
lea    0xe8e(%rip),%rcx
mov    %esi,%edi
call   1040 <gif_square@plt>
mov    $0x0,%al
call   1030 <gif_frame@plt>
mov    $0x32,%edx
lea    0xe79(%rip),%rcx
mov    %edx,%edi
mov    %edx,%esi
call   1040 <gif_square@plt>
mov    $0x0,%al
call   1030 <gif_frame@plt>
mov    $0x64,%esi
mov    $0x32,%edx
lea    0xe5c(%rip),%rcx
mov    %esi,%edi
call   1040 <gif_square@plt>
mov    $0x0,%al
call   1030 <gif_frame@plt>
mov    $0x96,%esi
mov    $0x32,%edx
lea    0xe44(%rip),%rcx
mov    %esi,%edi
call   1040 <gif_square@plt>
mov    -0x8(%rbp),%edi
call   1050 <gif_stop@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xeb8(%rip),%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
call   1060 <gif_start@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <gif_frame@plt>
lea    0xea1(%rip),%rcx
xor    %edi,%edi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <gif_square@plt>
xor    %eax,%eax
call   1030 <gif_frame@plt>
lea    0xe8a(%rip),%rcx
mov    $0x32,%edi
mov    $0x32,%esi
mov    $0x32,%edx
call   1040 <gif_square@plt>
xor    %eax,%eax
call   1030 <gif_frame@plt>
lea    0xe6c(%rip),%rcx
mov    $0x64,%edi
mov    $0x64,%esi
mov    $0x32,%edx
call   1040 <gif_square@plt>
xor    %eax,%eax
call   1030 <gif_frame@plt>
lea    0xe51(%rip),%rcx
mov    $0x96,%edi
mov    $0x96,%esi
mov    $0x32,%edx
call   1040 <gif_square@plt>
mov    %ebx,%edi
call   1050 <gif_stop@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"200x200\00"
@.str.1 = [5 x i8] c"blue\00"
@.str.2 = [4 x i8] c"red\00"
@.str.3 = [7 x i8] c"yellow\00"
@.str.4 = [6 x i8] c"green\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @gif_start(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
store i32 %3, i32* %2
%4 = call i32 (...) @gif_frame()
%5 = call i32 @gif_square(i32 0, i32 0, i32 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 (...) @gif_frame()
%7 = call i32 @gif_square(i32 50, i32 50, i32 50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (...) @gif_frame()
%9 = call i32 @gif_square(i32 100, i32 100, i32 50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (...) @gif_frame()
%11 = call i32 @gif_square(i32 150, i32 150, i32 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%12 = load i32, i32* %2
%13 = call i32 @gif_stop(i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"200x200\00"
@.str.1 = [5 x i8] c"blue\00"
@.str.2 = [4 x i8] c"red\00"
@.str.3 = [7 x i8] c"yellow\00"
@.str.4 = [6 x i8] c"green\00"
define i32 @main() {
%1 = tail call i32 @gif_start(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 200, i32 200)
%2 = tail call i32 (...) @gif_frame()
%3 = tail call i32 @gif_square(i32 0, i32 0, i32 50, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (...) @gif_frame()
%5 = tail call i32 @gif_square(i32 50, i32 50, i32 50, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = tail call i32 (...) @gif_frame()
%7 = tail call i32 @gif_square(i32 100, i32 100, i32 50, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 (...) @gif_frame()
%9 = tail call i32 @gif_square(i32 150, i32 150, i32 50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%10 = tail call i32 @gif_stop(i32 %1)
ret i32 0
}