#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*/ clear_screen(int /*<<< orphan*/);
int /*<<< orphan*/ fill_rect(int, int, int, int, int /*<<< orphan*/);
int /*<<< orphan*/ make_color(int, int, int);
void draw_something(void) {
  clear_screen(make_color(0, 0, 0));
  fill_rect(50, 50, 100, 100, make_color(255, 0, 0));
  fill_rect(50 + 100, 50, 100, 100, make_color(0, 255, 0));
  fill_rect(50 + 200, 50, 100, 100, make_color(0, 0, 255));
}


x86 assembly (clang, -O0):
<draw_something>:
push   %rbp
mov    %rsp,%rbp
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <make_color@plt>
mov    %eax,%edi
call   1030 <clear_screen@plt>
mov    $0xff,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1050 <make_color@plt>
mov    %eax,%r8d
mov    $0x32,%esi
mov    $0x64,%ecx
mov    %esi,%edi
mov    %ecx,%edx
call   1040 <fill_rect@plt>
xor    %edx,%edx
mov    $0xff,%esi
mov    %edx,%edi
call   1050 <make_color@plt>
mov    %eax,%r8d
mov    $0x96,%edi
mov    $0x32,%esi
mov    $0x64,%ecx
mov    %ecx,%edx
call   1040 <fill_rect@plt>
xor    %esi,%esi
mov    $0xff,%edx
mov    %esi,%edi
call   1050 <make_color@plt>
mov    %eax,%r8d
mov    $0xfa,%edi
mov    $0x32,%esi
mov    $0x64,%ecx
mov    %ecx,%edx
call   1040 <fill_rect@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_something>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <make_color@plt>
mov    %eax,%edi
call   1030 <clear_screen@plt>
mov    $0xff,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <make_color@plt>
mov    $0x32,%edi
mov    $0x32,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    %eax,%r8d
call   1040 <fill_rect@plt>
xor    %edi,%edi
mov    $0xff,%esi
xor    %edx,%edx
call   1050 <make_color@plt>
mov    $0x96,%edi
mov    $0x32,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    %eax,%r8d
call   1040 <fill_rect@plt>
xor    %edi,%edi
xor    %esi,%esi
mov    $0xff,%edx
call   1050 <make_color@plt>
mov    $0xfa,%edi
mov    $0x32,%esi
mov    $0x64,%edx
mov    $0x64,%ecx
mov    %eax,%r8d
pop    %rax
jmp    1040 <fill_rect@plt>

LLVM IR (-O0):
define void @draw_something() {
%1 = call i32 @make_color(i32 0, i32 0, i32 0)
%2 = call i32 @clear_screen(i32 %1)
%3 = call i32 @make_color(i32 255, i32 0, i32 0)
%4 = call i32 @fill_rect(i32 50, i32 50, i32 100, i32 100, i32 %3)
%5 = call i32 @make_color(i32 0, i32 255, i32 0)
%6 = call i32 @fill_rect(i32 150, i32 50, i32 100, i32 100, i32 %5)
%7 = call i32 @make_color(i32 0, i32 0, i32 255)
%8 = call i32 @fill_rect(i32 250, i32 50, i32 100, i32 100, i32 %7)
ret void
}

LLVM IR (-O2):
define void @draw_something() {
%1 = tail call i32 @make_color(i32 0, i32 0, i32 0)
%2 = tail call i32 @clear_screen(i32 %1)
%3 = tail call i32 @make_color(i32 255, i32 0, i32 0)
%4 = tail call i32 @fill_rect(i32 50, i32 50, i32 100, i32 100, i32 %3)
%5 = tail call i32 @make_color(i32 0, i32 255, i32 0)
%6 = tail call i32 @fill_rect(i32 150, i32 50, i32 100, i32 100, i32 %5)
%7 = tail call i32 @make_color(i32 0, i32 0, i32 255)
%8 = tail call i32 @fill_rect(i32 250, i32 50, i32 100, i32 100, i32 %7)
ret void
}