#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*/ drawPolygon(char const *, double *, double *, int);
int /*<<< orphan*/ fillPolygon(char const *, double *, double *, int);
int /*<<< orphan*/ setColor(char const *, int, int, int, int);
void paintPolygon(const char *name, double x[], double y[], int n_points,
                  int fr, int fg, int fb, int fa, int dr, int dg, int db,
                  int da) {
  setColor(name, fr, fg, fb, fa);
  fillPolygon(name, x, y, n_points);
  setColor(name, dr, dg, db, da);
  drawPolygon(name, x, y, n_points);
}


x86 assembly (clang, -O0):
<paintPolygon>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x38(%rbp),%eax
mov    0x30(%rbp),%eax
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    %r9d,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    0x10(%rbp),%ecx
mov    0x18(%rbp),%r8d
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1030 <fillPolygon@plt>
mov    -0x8(%rbp),%rdi
mov    0x20(%rbp),%esi
mov    0x28(%rbp),%edx
mov    0x30(%rbp),%ecx
mov    0x38(%rbp),%r8d
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <drawPolygon@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintPolygon>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%eax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
mov    0x50(%rsp),%r12d
mov    0x58(%rsp),%r13d
mov    0x60(%rsp),%ecx
mov    %ecx,0x4(%rsp)
mov    0x68(%rsp),%ecx
mov    %ecx,(%rsp)
mov    0x40(%rsp),%ecx
mov    0x48(%rsp),%r8d
mov    %eax,%esi
mov    %r9d,%edx
call   1050 <setColor@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1030 <fillPolygon@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r13d,%edx
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
call   1050 <setColor@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <drawPolygon@plt>

LLVM IR (-O0):
define void @paintPolygon(i8* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = alloca i8*
%14 = alloca double*
%15 = alloca double*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
store i8* %0, i8** %13
store double* %1, double** %14
store double* %2, double** %15
store i32 %3, i32* %16
store i32 %4, i32* %17
store i32 %5, i32* %18
store i32 %6, i32* %19
store i32 %7, i32* %20
store i32 %8, i32* %21
store i32 %9, i32* %22
store i32 %10, i32* %23
store i32 %11, i32* %24
%25 = load i8*, i8** %13
%26 = load i32, i32* %17
%27 = load i32, i32* %18
%28 = load i32, i32* %19
%29 = load i32, i32* %20
%30 = call i32 @setColor(i8* %25, i32 %26, i32 %27, i32 %28, i32 %29)
%31 = load i8*, i8** %13
%32 = load double*, double** %14
%33 = load double*, double** %15
%34 = load i32, i32* %16
%35 = call i32 @fillPolygon(i8* %31, double* %32, double* %33, i32 %34)
%36 = load i8*, i8** %13
%37 = load i32, i32* %21
%38 = load i32, i32* %22
%39 = load i32, i32* %23
%40 = load i32, i32* %24
%41 = call i32 @setColor(i8* %36, i32 %37, i32 %38, i32 %39, i32 %40)
%42 = load i8*, i8** %13
%43 = load double*, double** %14
%44 = load double*, double** %15
%45 = load i32, i32* %16
%46 = call i32 @drawPolygon(i8* %42, double* %43, double* %44, i32 %45)
ret void
}

LLVM IR (-O2):
define void @paintPolygon(i8* %0, double* %1, double* %2, i32 %3, i32 %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11) {
%13 = tail call i32 @setColor(i8* %0, i32 %4, i32 %5, i32 %6, i32 %7)
%14 = tail call i32 @fillPolygon(i8* %0, double* %1, double* %2, i32 %3)
%15 = tail call i32 @setColor(i8* %0, i32 %8, i32 %9, i32 %10, i32 %11)
%16 = tail call i32 @drawPolygon(i8* %0, double* %1, double* %2, i32 %3)
ret void
}