#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 stucki(int x, int y, int dr, int dg, int db) {
  diff(x + 1, y, 8.0 / 42, dr, dg, db);
  diff(x + 2, y, 4.0 / 42, dr, dg, db);
  diff(x - 2, y + 1, 2.0 / 42, dr, dg, db);
  diff(x - 1, y + 1, 4.0 / 42, dr, dg, db);
  diff(x, y + 1, 8.0 / 42, dr, dg, db);
  diff(x + 1, y + 1, 4.0 / 42, dr, dg, db);
  diff(x + 2, y + 1, 2.0 / 42, dr, dg, db);
  diff(x - 2, y + 2, 1.0 / 42, dr, dg, db);
  diff(x - 1, y + 2, 2.0 / 42, dr, dg, db);
  diff(x, y + 2, 4.0 / 42, dr, dg, db);
  diff(x + 1, y + 2, 2.0 / 42, dr, dg, db);
  diff(x + 2, y + 2, 1.0 / 42, dr, dg, db);
}


x86 assembly (clang, -O0):
<stucki>:
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  0xead(%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  0xe82(%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  0xdf9(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
sub    $0x2,%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
sub    $0x1,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xdb3(%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  0xd9b(%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  0xd70(%rip),%xmm0
call   1030 <diff@plt>
mov    -0x4(%rbp),%edi
add    $0x2,%edi
mov    -0x8(%rbp),%esi
add    $0x2,%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
movsd  0xd45(%rip),%xmm0
call   1030 <diff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stucki>:
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,%r12d
lea    0x1(%r12),%edi
mov    %edi,0xc(%rsp)
movsd  0xec4(%rip),%xmm0
call   1030 <diff@plt>
lea    0x2(%r12),%edi
mov    %edi,0x8(%rsp)
movsd  0xeb6(%rip),%xmm0
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
lea    -0x2(%r12),%edi
mov    %edi,0x14(%rsp)
lea    0x1(%r15),%r13d
movsd  0xe9a(%rip),%xmm0
mov    %r13d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
lea    -0x1(%r12),%edi
mov    %edi,0x10(%rsp)
mov    %r13d,%esi
movsd  0xe6f(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    %r12d,%edi
mov    %r13d,%esi
movsd  0xe4d(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0xc(%rsp),%edi
mov    %r13d,%esi
movsd  0xe3a(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0x8(%rsp),%edi
mov    %r13d,%esi
movsd  0xe27(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
add    $0x2,%r15d
movsd  0xe17(%rip),%xmm0
mov    0x14(%rsp),%edi
mov    %r15d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0x10(%rsp),%edi
mov    %r15d,%esi
movsd  0xded(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    %r12d,%edi
mov    %r15d,%esi
movsd  0xdcb(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0xc(%rsp),%edi
mov    %r15d,%esi
movsd  0xdb8(%rip),%xmm0
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0x8(%rsp),%edi
mov    %r15d,%esi
movsd  0xda5(%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 @stucki(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 0x3FC8618618618618, 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 0x3FB8618618618618, 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 0x3FA8618618618618, 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 0x3FB8618618618618, 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 0x3FC8618618618618, 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 0x3FB8618618618618, 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 0x3FA8618618618618, i32 %60, i32 %61, i32 %62)
%64 = load i32, i32* %6
%65 = sub nsw i32 %64, 2
%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 0x3F98618618618618, i32 %68, i32 %69, i32 %70)
%72 = load i32, i32* %6
%73 = sub nsw i32 %72, 1
%74 = load i32, i32* %7
%75 = add nsw i32 %74, 2
%76 = load i32, i32* %8
%77 = load i32, i32* %9
%78 = load i32, i32* %10
%79 = call i32 @diff(i32 %73, i32 %75, double 0x3FA8618618618618, i32 %76, i32 %77, i32 %78)
%80 = load i32, i32* %6
%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 0x3FB8618618618618, i32 %83, i32 %84, i32 %85)
%87 = load i32, i32* %6
%88 = add nsw i32 %87, 1
%89 = load i32, i32* %7
%90 = add nsw i32 %89, 2
%91 = load i32, i32* %8
%92 = load i32, i32* %9
%93 = load i32, i32* %10
%94 = call i32 @diff(i32 %88, i32 %90, double 0x3FA8618618618618, i32 %91, i32 %92, i32 %93)
%95 = load i32, i32* %6
%96 = add nsw i32 %95, 2
%97 = load i32, i32* %7
%98 = add nsw i32 %97, 2
%99 = load i32, i32* %8
%100 = load i32, i32* %9
%101 = load i32, i32* %10
%102 = call i32 @diff(i32 %96, i32 %98, double 0x3F98618618618618, i32 %99, i32 %100, i32 %101)
ret void
}

LLVM IR (-O2):
define void @stucki(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 0x3FC8618618618618, i32 %2, i32 %3, i32 %4)
%8 = add nsw i32 %0, 2
%9 = tail call i32 @diff(i32 %8, i32 %1, double 0x3FB8618618618618, 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 0x3FA8618618618618, i32 %2, i32 %3, i32 %4)
%13 = add nsw i32 %0, -1
%14 = tail call i32 @diff(i32 %13, i32 %11, double 0x3FB8618618618618, i32 %2, i32 %3, i32 %4)
%15 = tail call i32 @diff(i32 %0, i32 %11, double 0x3FC8618618618618, i32 %2, i32 %3, i32 %4)
%16 = tail call i32 @diff(i32 %6, i32 %11, double 0x3FB8618618618618, i32 %2, i32 %3, i32 %4)
%17 = tail call i32 @diff(i32 %8, i32 %11, double 0x3FA8618618618618, i32 %2, i32 %3, i32 %4)
%18 = add nsw i32 %1, 2
%19 = tail call i32 @diff(i32 %10, i32 %18, double 0x3F98618618618618, i32 %2, i32 %3, i32 %4)
%20 = tail call i32 @diff(i32 %13, i32 %18, double 0x3FA8618618618618, i32 %2, i32 %3, i32 %4)
%21 = tail call i32 @diff(i32 %0, i32 %18, double 0x3FB8618618618618, i32 %2, i32 %3, i32 %4)
%22 = tail call i32 @diff(i32 %6, i32 %18, double 0x3FA8618618618618, i32 %2, i32 %3, i32 %4)
%23 = tail call i32 @diff(i32 %8, i32 %18, double 0x3F98618618618618, i32 %2, i32 %3, i32 %4)
ret void
}