#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 */
scalar_t__ VH_MarkUpdateBlock(int, int, int, int);
int VL_GetScrollX();
scalar_t__ VL_GetScrollY();
int /*<<< orphan*/ VL_ScreenRect(int, int, int, int, int);
void VHB_Plot(int x, int y, int colour) {
  x += VL_GetScrollX() & 8;
  y += VL_GetScrollY();
  if (VH_MarkUpdateBlock(x, y, 1, 1))
    VL_ScreenRect(x, y, 1, 1, colour);
}


x86 assembly (clang, -O0):
<VHB_Plot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <VL_GetScrollX@plt>
and    $0x8,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1050 <VL_GetScrollY@plt>
mov    %rax,%rcx
movslq -0x8(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    $0x1,%ecx
mov    %ecx,%edx
call   1060 <VH_MarkUpdateBlock@plt>
cmp    $0x0,%rax
je     11a7 <VHB_Plot+0x67>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%r8d
mov    $0x1,%ecx
mov    %ecx,%edx
call   1030 <VL_ScreenRect@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VHB_Plot>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <VL_GetScrollX@plt>
and    $0x8,%eax
add    %eax,%ebx
xor    %eax,%eax
call   1050 <VL_GetScrollY@plt>
add    %eax,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
call   1060 <VH_MarkUpdateBlock@plt>
test   %rax,%rax
je     1192 <VHB_Plot+0x52>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x1,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <VL_ScreenRect@plt>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @VHB_Plot(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = call i32 (...) @VL_GetScrollX()
%8 = and i32 %7, 8
%9 = load i32, i32* %4
%10 = add nsw i32 %9, %8
store i32 %10, i32* %4
%11 = call i64 (...) @VL_GetScrollY()
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = add nsw i64 %13, %11
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = call i64 @VH_MarkUpdateBlock(i32 %16, i32 %17, i32 1, i32 1)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %3
%21 = load i32, i32* %4
%22 = load i32, i32* %5
%23 = load i32, i32* %6
%24 = call i32 @VL_ScreenRect(i32 %21, i32 %22, i32 1, i32 1, i32 %23)
br label %25
25: ; preds = %20, %3
ret void
}

LLVM IR (-O2):
define void @VHB_Plot(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @VL_GetScrollX()
%5 = and i32 %4, 8
%6 = add nsw i32 %5, %0
%7 = tail call i64 (...) @VL_GetScrollY()
%8 = trunc i64 %7 to i32
%9 = add i32 %8, %1
%10 = tail call i64 @VH_MarkUpdateBlock(i32 %6, i32 %9, i32 1, i32 1)
%11 = icmp eq i64 %10, 0
br i1 %11, label %14, label %12
12: ; preds = %3
%13 = tail call i32 @VL_ScreenRect(i32 %6, i32 %9, i32 1, i32 1, i32 %2)
br label %14
14: ; preds = %12, %3
ret void
}