#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 */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ set_row(int /*<<< orphan*/, int, int, int,
                           int /*<<< orphan*/);
int /*<<< orphan*/ weber_fechner(int /*<<< orphan*/);
void heart_layer(uint8_t x, uint8_t raw_i) {
  uint16_t intensity = weber_fechner(raw_i);
  set_row(x, 0, 1, 2, intensity);
  set_row(x, 0, 5, 6, intensity);
  set_row(x, 1, 0, 7, intensity);
  set_row(x, 2, 0, 7, intensity);
  set_row(x, 3, 0, 7, intensity);
  set_row(x, 4, 1, 6, intensity);
  set_row(x, 5, 2, 5, intensity);
  set_row(x, 6, 3, 4, intensity);
}


x86 assembly (clang, -O0):
<heart_layer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <weber_fechner@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x7,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x7,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x7,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x6,%ecx
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x5,%ecx
mov    $0x2,%edx
mov    %ecx,%esi
call   1030 <set_row@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%r8d
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
call   1030 <set_row@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<heart_layer>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
mov    %esi,%edi
call   1040 <weber_fechner@plt>
mov    %eax,%ebp
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    %eax,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x2,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x3,%esi
xor    %edx,%edx
mov    $0x7,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x4,%esi
mov    $0x1,%edx
mov    $0x6,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x5,%esi
mov    $0x2,%edx
mov    $0x5,%ecx
mov    %ebp,%r8d
call   1030 <set_row@plt>
mov    %ebx,%edi
mov    $0x6,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    %ebp,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <set_row@plt>

LLVM IR (-O0):
define void @heart_layer(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = call i32 @weber_fechner(i32 %6)
store i32 %7, i32* %5
%8 = load i32, i32* %3
%9 = load i32, i32* %5
%10 = call i32 @set_row(i32 %8, i32 0, i32 1, i32 2, i32 %9)
%11 = load i32, i32* %3
%12 = load i32, i32* %5
%13 = call i32 @set_row(i32 %11, i32 0, i32 5, i32 6, i32 %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %5
%16 = call i32 @set_row(i32 %14, i32 1, i32 0, i32 7, i32 %15)
%17 = load i32, i32* %3
%18 = load i32, i32* %5
%19 = call i32 @set_row(i32 %17, i32 2, i32 0, i32 7, i32 %18)
%20 = load i32, i32* %3
%21 = load i32, i32* %5
%22 = call i32 @set_row(i32 %20, i32 3, i32 0, i32 7, i32 %21)
%23 = load i32, i32* %3
%24 = load i32, i32* %5
%25 = call i32 @set_row(i32 %23, i32 4, i32 1, i32 6, i32 %24)
%26 = load i32, i32* %3
%27 = load i32, i32* %5
%28 = call i32 @set_row(i32 %26, i32 5, i32 2, i32 5, i32 %27)
%29 = load i32, i32* %3
%30 = load i32, i32* %5
%31 = call i32 @set_row(i32 %29, i32 6, i32 3, i32 4, i32 %30)
ret void
}

LLVM IR (-O2):
define void @heart_layer(i32 %0, i32 %1) {
%3 = tail call i32 @weber_fechner(i32 %1)
%4 = tail call i32 @set_row(i32 %0, i32 0, i32 1, i32 2, i32 %3)
%5 = tail call i32 @set_row(i32 %0, i32 0, i32 5, i32 6, i32 %3)
%6 = tail call i32 @set_row(i32 %0, i32 1, i32 0, i32 7, i32 %3)
%7 = tail call i32 @set_row(i32 %0, i32 2, i32 0, i32 7, i32 %3)
%8 = tail call i32 @set_row(i32 %0, i32 3, i32 0, i32 7, i32 %3)
%9 = tail call i32 @set_row(i32 %0, i32 4, i32 1, i32 6, i32 %3)
%10 = tail call i32 @set_row(i32 %0, i32 5, i32 2, i32 5, i32 %3)
%11 = tail call i32 @set_row(i32 %0, i32 6, i32 3, i32 4, i32 %3)
ret void
}