#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*/ diff(int, int, double, int, int, int);
void sierra(int x, int y, int dr, int dg, int db) {
  diff(x + 1, y, 5.0 / 32, dr, dg, db);
  diff(x + 2, y, 3.0 / 32, dr, dg, db);
  diff(x - 2, y + 1, 2.0 / 32, dr, dg, db);
  diff(x - 1, y + 1, 4.0 / 32, dr, dg, db);
  diff(x, y + 1, 5.0 / 32, dr, dg, db);
  diff(x + 1, y + 1, 4.0 / 32, dr, dg, db);
  diff(x + 2, y + 1, 2.0 / 32, dr, dg, db);
  diff(x - 1, y + 2, 2.0 / 32, dr, dg, db);
  diff(x, y + 2, 3.0 / 32, dr, dg, db);
  diff(x + 1, y + 2, 2.0 / 32, dr, dg, db);
}


x86 assembly (clang, -O0):
<sierra>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xed5(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xea5(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xe7a(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xe67(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xe4f(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xe24(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xdf1(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xdce(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xdb6(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
add    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xd8b(%rip),%xmm0
call   1030 <diff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sierra>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r14d
mov    %ecx,%ebp
mov    %edx,%ebx
mov    %esi,%r15d
mov    %edi,%r13d
lea    0x1(%r13),%edi
mov    %edi,0xc(%rsp)
movsd  0xec5(%rip),%xmm0
call   1030 <diff@plt>
lea    0x2(%r13),%edi
mov    %edi,0x14(%rsp)
movsd  0xeb8(%rip),%xmm0
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
lea    -0x2(%r13),%edi
lea    0x1(%r15),%r12d
movsd  0xea1(%rip),%xmm0
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
lea    -0x1(%r13),%edi
mov    %edi,0x10(%rsp)
movsd  0xe8a(%rip),%xmm0
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    %r13d,%edi
mov    %r12d,%esi
movsd  0xe55(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0xc(%rsp),%edi
mov    %r12d,%esi
movsd  0xe52(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0x14(%rsp),%edi
mov    %r12d,%esi
movsd  0xe2f(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
add    $0x2,%r15d
mov    0x10(%rsp),%edi
mov    %r15d,%esi
movsd  0xe10(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    %r13d,%edi
mov    %r15d,%esi
movsd  0xdee(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0xc(%rsp),%edi
mov    %r15d,%esi
movsd  0xddb(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <diff@plt>

LLVM IR (-O0):
define void @sierra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = add nsw i32 %11, 1
%13 = load i32, i32* %7
%14 = load i32, i32* %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @diff(i32 %12, i32 %13, double 1.562500e-01, i32 %14, i32 %15, i32 %16)
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 2
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = load i32, i32* %10
%24 = call i32 @diff(i32 %19, i32 %20, double 9.375000e-02, i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, 2
%27 = load i32, i32* %7
%28 = add nsw i32 %27, 1
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = call i32 @diff(i32 %26, i32 %28, double 6.250000e-02, i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %6
%34 = sub nsw i32 %33, 1
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
%37 = load i32, i32* %8
%38 = load i32, i32* %9
%39 = load i32, i32* %10
%40 = call i32 @diff(i32 %34, i32 %36, double 1.250000e-01, i32 %37, i32 %38, i32 %39)
%41 = load i32, i32* %6
%42 = load i32, i32* %7
%43 = add nsw i32 %42, 1
%44 = load i32, i32* %8
%45 = load i32, i32* %9
%46 = load i32, i32* %10
%47 = call i32 @diff(i32 %41, i32 %43, double 1.562500e-01, i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %6
%49 = add nsw i32 %48, 1
%50 = load i32, i32* %7
%51 = add nsw i32 %50, 1
%52 = load i32, i32* %8
%53 = load i32, i32* %9
%54 = load i32, i32* %10
%55 = call i32 @diff(i32 %49, i32 %51, double 1.250000e-01, i32 %52, i32 %53, i32 %54)
%56 = load i32, i32* %6
%57 = add nsw i32 %56, 2
%58 = load i32, i32* %7
%59 = add nsw i32 %58, 1
%60 = load i32, i32* %8
%61 = load i32, i32* %9
%62 = load i32, i32* %10
%63 = call i32 @diff(i32 %57, i32 %59, double 6.250000e-02, i32 %60, i32 %61, i32 %62)
%64 = load i32, i32* %6
%65 = sub nsw i32 %64, 1
%66 = load i32, i32* %7
%67 = add nsw i32 %66, 2
%68 = load i32, i32* %8
%69 = load i32, i32* %9
%70 = load i32, i32* %10
%71 = call i32 @diff(i32 %65, i32 %67, double 6.250000e-02, i32 %68, i32 %69, i32 %70)
%72 = load i32, i32* %6
%73 = load i32, i32* %7
%74 = add nsw i32 %73, 2
%75 = load i32, i32* %8
%76 = load i32, i32* %9
%77 = load i32, i32* %10
%78 = call i32 @diff(i32 %72, i32 %74, double 9.375000e-02, i32 %75, i32 %76, i32 %77)
%79 = load i32, i32* %6
%80 = add nsw i32 %79, 1
%81 = load i32, i32* %7
%82 = add nsw i32 %81, 2
%83 = load i32, i32* %8
%84 = load i32, i32* %9
%85 = load i32, i32* %10
%86 = call i32 @diff(i32 %80, i32 %82, double 6.250000e-02, i32 %83, i32 %84, i32 %85)
ret void
}

LLVM IR (-O2):
define void @sierra(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = add nsw i32 %0, 1
%7 = tail call i32 @diff(i32 %6, i32 %1, double 1.562500e-01, i32 %2, i32 %3, i32 %4)
%8 = add nsw i32 %0, 2
%9 = tail call i32 @diff(i32 %8, i32 %1, double 9.375000e-02, i32 %2, i32 %3, i32 %4)
%10 = add nsw i32 %0, -2
%11 = add nsw i32 %1, 1
%12 = tail call i32 @diff(i32 %10, i32 %11, double 6.250000e-02, i32 %2, i32 %3, i32 %4)
%13 = add nsw i32 %0, -1
%14 = tail call i32 @diff(i32 %13, i32 %11, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%15 = tail call i32 @diff(i32 %0, i32 %11, double 1.562500e-01, i32 %2, i32 %3, i32 %4)
%16 = tail call i32 @diff(i32 %6, i32 %11, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%17 = tail call i32 @diff(i32 %8, i32 %11, double 6.250000e-02, i32 %2, i32 %3, i32 %4)
%18 = add nsw i32 %1, 2
%19 = tail call i32 @diff(i32 %13, i32 %18, double 6.250000e-02, i32 %2, i32 %3, i32 %4)
%20 = tail call i32 @diff(i32 %0, i32 %18, double 9.375000e-02, i32 %2, i32 %3, i32 %4)
%21 = tail call i32 @diff(i32 %6, i32 %18, double 6.250000e-02, i32 %2, i32 %3, i32 %4)
ret void
}