#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_Bar(int x, int y, int w, int h, int colour) {
  x += VL_GetScrollX() & 8;
  y += VL_GetScrollY();
  if (VH_MarkUpdateBlock(x, y, w, h))
    VL_ScreenRect(x, y, w, h, colour);
}


x86 assembly (clang, -O0):
<VHB_Bar>:
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    $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    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1060 <VH_MarkUpdateBlock@plt>
cmp    $0x0,%rax
je     11ac <VHB_Bar+0x6c>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
call   1030 <VL_ScreenRect@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VHB_Bar>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %edx,%r12d
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    %r12d,%edx
mov    %r15d,%ecx
call   1060 <VH_MarkUpdateBlock@plt>
test   %rax,%rax
je     1198 <VHB_Bar+0x58>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <VL_ScreenRect@plt>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @VHB_Bar(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 = call i32 (...) @VL_GetScrollX()
%12 = and i32 %11, 8
%13 = load i32, i32* %6
%14 = add nsw i32 %13, %12
store i32 %14, i32* %6
%15 = call i64 (...) @VL_GetScrollY()
%16 = load i32, i32* %7
%17 = sext i32 %16 to i64
%18 = add nsw i64 %17, %15
%19 = trunc i64 %18 to i32
store i32 %19, i32* %7
%20 = load i32, i32* %6
%21 = load i32, i32* %7
%22 = load i32, i32* %8
%23 = load i32, i32* %9
%24 = call i64 @VH_MarkUpdateBlock(i32 %20, i32 %21, i32 %22, i32 %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %33
26: ; preds = %5
%27 = load i32, i32* %6
%28 = load i32, i32* %7
%29 = load i32, i32* %8
%30 = load i32, i32* %9
%31 = load i32, i32* %10
%32 = call i32 @VL_ScreenRect(i32 %27, i32 %28, i32 %29, i32 %30, i32 %31)
br label %33
33: ; preds = %26, %5
ret void
}

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