#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*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_MARB_SetThumbbufMem(unsigned long StartAdd, unsigned long Size) {
  VIM_HIF_SetReg8((0x2400 + 0x00C), (unsigned char)StartAdd);
  VIM_HIF_SetReg8((0x2400 + 0x00B), (unsigned char)(StartAdd >> 8));
  VIM_HIF_SetReg8((0x2400 + 0x00A), (unsigned char)(StartAdd >> 16));
  VIM_HIF_SetReg8((0x2400 + 0x00F), (unsigned char)(StartAdd + Size));
  VIM_HIF_SetReg8((0x2400 + 0x00E), (unsigned char)((StartAdd + Size) >> 8));
  VIM_HIF_SetReg8((0x2400 + 0x00D), (unsigned char)((StartAdd + Size) >> 16));
}


x86 assembly (clang, -O0):
<VIM_MARB_SetThumbbufMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x240c,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    $0x240b,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    $0x240a,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
mov    $0x240f,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
shr    $0x8,%rax
mov    $0x240e,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
shr    $0x10,%rax
mov    $0x240d,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_MARB_SetThumbbufMem>:
push   %r15
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%rbx
movzbl %bl,%esi
mov    $0x240c,%edi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl %bh,%esi
mov    $0x240b,%edi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    $0x240a,%edi
call   1030 <VIM_HIF_SetReg8@plt>
add    %ebx,%r15d
movzbl %r15b,%esi
mov    %r15,%rbx
mov    $0x240f,%edi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl %bh,%esi
mov    $0x240e,%edi
call   1030 <VIM_HIF_SetReg8@plt>
shr    $0x10,%ebx
movzbl %bl,%esi
mov    $0x240d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r15
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_MARB_SetThumbbufMem(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = trunc i64 %5 to i8
%7 = call i32 @VIM_HIF_SetReg8(i32 9228, i8 zeroext %6)
%8 = load i64, i64* %3
%9 = lshr i64 %8, 8
%10 = trunc i64 %9 to i8
%11 = call i32 @VIM_HIF_SetReg8(i32 9227, i8 zeroext %10)
%12 = load i64, i64* %3
%13 = lshr i64 %12, 16
%14 = trunc i64 %13 to i8
%15 = call i32 @VIM_HIF_SetReg8(i32 9226, i8 zeroext %14)
%16 = load i64, i64* %3
%17 = load i64, i64* %4
%18 = add i64 %16, %17
%19 = trunc i64 %18 to i8
%20 = call i32 @VIM_HIF_SetReg8(i32 9231, i8 zeroext %19)
%21 = load i64, i64* %3
%22 = load i64, i64* %4
%23 = add i64 %21, %22
%24 = lshr i64 %23, 8
%25 = trunc i64 %24 to i8
%26 = call i32 @VIM_HIF_SetReg8(i32 9230, i8 zeroext %25)
%27 = load i64, i64* %3
%28 = load i64, i64* %4
%29 = add i64 %27, %28
%30 = lshr i64 %29, 16
%31 = trunc i64 %30 to i8
%32 = call i32 @VIM_HIF_SetReg8(i32 9229, i8 zeroext %31)
ret void
}

LLVM IR (-O2):
define void @VIM_MARB_SetThumbbufMem(i64 %0, i64 %1) {
%3 = trunc i64 %0 to i8
%4 = tail call i32 @VIM_HIF_SetReg8(i32 9228, i8 zeroext %3)
%5 = lshr i64 %0, 8
%6 = trunc i64 %5 to i8
%7 = tail call i32 @VIM_HIF_SetReg8(i32 9227, i8 zeroext %6)
%8 = lshr i64 %0, 16
%9 = trunc i64 %8 to i8
%10 = tail call i32 @VIM_HIF_SetReg8(i32 9226, i8 zeroext %9)
%11 = add i64 %1, %0
%12 = trunc i64 %11 to i8
%13 = tail call i32 @VIM_HIF_SetReg8(i32 9231, i8 zeroext %12)
%14 = lshr i64 %11, 8
%15 = trunc i64 %14 to i8
%16 = tail call i32 @VIM_HIF_SetReg8(i32 9230, i8 zeroext %15)
%17 = lshr i64 %11, 16
%18 = trunc i64 %17 to i8
%19 = tail call i32 @VIM_HIF_SetReg8(i32 9229, i8 zeroext %18)
ret void
}