#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 atkinson(int x, int y, int dr, int dg, int db) {
  diff(x + 1, y, 1.0 / 8, dr, dg, db);
  diff(x + 2, y, 1.0 / 8, dr, dg, db);
  diff(x - 1, y + 1, 1.0 / 8, dr, dg, db);
  diff(x, y + 1, 1.0 / 8, dr, dg, db);
  diff(x + 1, y + 1, 1.0 / 8, dr, dg, db);
  diff(x, y + 2, 1.0 / 8, dr, dg, db);
}


x86 assembly (clang, -O0):
<atkinson>:
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  0xebd(%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  0xe9d(%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  0xe7a(%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  0xe5a(%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  0xe37(%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  0xe17(%rip),%xmm0
call   1030 <diff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atkinson>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%r12d
lea    0x1(%r12),%edi
mov    %edi,0x4(%rsp)
movsd  0xec7(%rip),%xmm0
call   1030 <diff@plt>
lea    0x2(%r12),%edi
mov    %ebp,%esi
movsd  0xeb3(%rip),%xmm0
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
lea    -0x1(%r12),%edi
lea    0x1(%rbp),%r13d
mov    %r13d,%esi
movsd  0xe92(%rip),%xmm0
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    %r12d,%edi
mov    %r13d,%esi
movsd  0xe77(%rip),%xmm0
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
mov    0x4(%rsp),%edi
mov    %r13d,%esi
movsd  0xe5b(%rip),%xmm0
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1030 <diff@plt>
add    $0x2,%ebp
mov    %r12d,%edi
mov    %ebp,%esi
movsd  0xe3e(%rip),%xmm0
mov    %ebx,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <diff@plt>

LLVM IR (-O0):
define void @atkinson(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.250000e-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 1.250000e-01, i32 %21, i32 %22, i32 %23)
%25 = load i32, i32* %6
%26 = sub nsw i32 %25, 1
%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 1.250000e-01, i32 %29, i32 %30, i32 %31)
%33 = load i32, i32* %6
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
%36 = load i32, i32* %8
%37 = load i32, i32* %9
%38 = load i32, i32* %10
%39 = call i32 @diff(i32 %33, i32 %35, double 1.250000e-01, i32 %36, i32 %37, i32 %38)
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
%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.250000e-01, i32 %44, i32 %45, i32 %46)
%48 = load i32, i32* %6
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 2
%51 = load i32, i32* %8
%52 = load i32, i32* %9
%53 = load i32, i32* %10
%54 = call i32 @diff(i32 %48, i32 %50, double 1.250000e-01, i32 %51, i32 %52, i32 %53)
ret void
}

LLVM IR (-O2):
define void @atkinson(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.250000e-01, i32 %2, i32 %3, i32 %4)
%8 = add nsw i32 %0, 2
%9 = tail call i32 @diff(i32 %8, i32 %1, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%10 = add nsw i32 %0, -1
%11 = add nsw i32 %1, 1
%12 = tail call i32 @diff(i32 %10, i32 %11, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%13 = tail call i32 @diff(i32 %0, i32 %11, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%14 = tail call i32 @diff(i32 %6, i32 %11, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
%15 = add nsw i32 %1, 2
%16 = tail call i32 @diff(i32 %0, i32 %15, double 1.250000e-01, i32 %2, i32 %3, i32 %4)
ret void
}