#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*/ drawRect(char const *, double, double, int, int);
int /*<<< orphan*/ fillRect(char const *, double, double, int, int);
int /*<<< orphan*/ setColor(char const *, int, int, int, int);
void paintRect(const char *name, double x, double y, double rx, double ry,
               int fr, int fg, int fb, int fa, int dr, int dg, int db, int da) {
  setColor(name, fr, fg, fb, fa);
  fillRect(name, x - rx, y - ry, 2 * rx, 2 * ry);
  setColor(name, dr, dg, db, da);
  drawRect(name, x - rx, y - ry, 2 * rx, 2 * ry);
}


x86 assembly (clang, -O0):
<paintRect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  %xmm3,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    %edx,-0x30(%rbp)
mov    %ecx,-0x34(%rbp)
mov    %r8d,-0x38(%rbp)
mov    %r9d,-0x3c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xe60(%rip),%xmm2
mulsd  -0x20(%rbp),%xmm2
cvttsd2si %xmm2,%esi
movsd  0xe4f(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
cvttsd2si %xmm2,%edx
call   1040 <fillRect@plt>
mov    -0x8(%rbp),%rdi
mov    -0x3c(%rbp),%esi
mov    0x10(%rbp),%edx
mov    0x18(%rbp),%ecx
mov    0x20(%rbp),%r8d
call   1050 <setColor@plt>
mov    -0x8(%rbp),%rdi
movsd  -0x10(%rbp),%xmm0
subsd  -0x20(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
subsd  -0x28(%rbp),%xmm1
movsd  0xe0b(%rip),%xmm2
mulsd  -0x20(%rbp),%xmm2
cvttsd2si %xmm2,%esi
movsd  0xdfa(%rip),%xmm2
mulsd  -0x28(%rbp),%xmm2
cvttsd2si %xmm2,%edx
call   1030 <drawRect@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<paintRect>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9d,0x14(%rsp)
movsd  %xmm3,0x20(%rsp)
movsd  %xmm2,0x18(%rsp)
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %rdi,%rbx
mov    0x60(%rsp),%r13d
mov    0x68(%rsp),%r15d
mov    0x70(%rsp),%r12d
call   1050 <setColor@plt>
movsd  (%rsp),%xmm0
movsd  0x18(%rsp),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp)
addsd  %xmm1,%xmm1
cvttsd2si %xmm1,%ebp
movsd  0x8(%rsp),%xmm1
movsd  0x20(%rsp),%xmm2
subsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%rsp)
addsd  %xmm2,%xmm2
cvttsd2si %xmm2,%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <fillRect@plt>
mov    %rbx,%rdi
mov    0x14(%rsp),%esi
mov    %r13d,%edx
mov    %r15d,%ecx
mov    %r12d,%r8d
call   1050 <setColor@plt>
mov    %rbx,%rdi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %ebp,%esi
mov    %r14d,%edx
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <drawRect@plt>

LLVM IR (-O0):
define void @paintRect(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12) {
%14 = alloca i8*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
store i8* %0, i8** %14
store double %1, double* %15
store double %2, double* %16
store double %3, double* %17
store double %4, double* %18
store i32 %5, i32* %19
store i32 %6, i32* %20
store i32 %7, i32* %21
store i32 %8, i32* %22
store i32 %9, i32* %23
store i32 %10, i32* %24
store i32 %11, i32* %25
store i32 %12, i32* %26
%27 = load i8*, i8** %14
%28 = load i32, i32* %19
%29 = load i32, i32* %20
%30 = load i32, i32* %21
%31 = load i32, i32* %22
%32 = call i32 @setColor(i8* %27, i32 %28, i32 %29, i32 %30, i32 %31)
%33 = load i8*, i8** %14
%34 = load double, double* %15
%35 = load double, double* %17
%36 = fsub double %34, %35
%37 = load double, double* %16
%38 = load double, double* %18
%39 = fsub double %37, %38
%40 = load double, double* %17
%41 = fmul double 2.000000e+00, %40
%42 = fptosi double %41 to i32
%43 = load double, double* %18
%44 = fmul double 2.000000e+00, %43
%45 = fptosi double %44 to i32
%46 = call i32 @fillRect(i8* %33, double %36, double %39, i32 %42, i32 %45)
%47 = load i8*, i8** %14
%48 = load i32, i32* %23
%49 = load i32, i32* %24
%50 = load i32, i32* %25
%51 = load i32, i32* %26
%52 = call i32 @setColor(i8* %47, i32 %48, i32 %49, i32 %50, i32 %51)
%53 = load i8*, i8** %14
%54 = load double, double* %15
%55 = load double, double* %17
%56 = fsub double %54, %55
%57 = load double, double* %16
%58 = load double, double* %18
%59 = fsub double %57, %58
%60 = load double, double* %17
%61 = fmul double 2.000000e+00, %60
%62 = fptosi double %61 to i32
%63 = load double, double* %18
%64 = fmul double 2.000000e+00, %63
%65 = fptosi double %64 to i32
%66 = call i32 @drawRect(i8* %53, double %56, double %59, i32 %62, i32 %65)
ret void
}

LLVM IR (-O2):
define void @paintRect(i8* %0, double %1, double %2, double %3, double %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9, i32 %10, i32 %11, i32 %12) {
%14 = tail call i32 @setColor(i8* %0, i32 %5, i32 %6, i32 %7, i32 %8)
%15 = fsub double %1, %3
%16 = fsub double %2, %4
%17 = fmul double %3, 2.000000e+00
%18 = fptosi double %17 to i32
%19 = fmul double %4, 2.000000e+00
%20 = fptosi double %19 to i32
%21 = tail call i32 @fillRect(i8* %0, double %15, double %16, i32 %18, i32 %20)
%22 = tail call i32 @setColor(i8* %0, i32 %9, i32 %10, i32 %11, i32 %12)
%23 = tail call i32 @drawRect(i8* %0, double %15, double %16, i32 %18, i32 %20)
ret void
}