#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 */
unsigned char VIM_HIF_GetReg8(int);
int /*<<< orphan*/ VIM_HIF_SetReg8(int, unsigned char);
void VIM_JPEG_SetPixelRate(unsigned char bPixelrate) {
  unsigned char bValue, bValue1;
  bValue = VIM_HIF_GetReg8((0x0000 + 0x04A));
  bValue1 = VIM_HIF_GetReg8((0x0C00 + 0x001));
  bPixelrate &= 0x0f;
  bValue &= 0xf0;
  bValue |= bPixelrate;
  VIM_HIF_SetReg8((0x0000 + 0x04A), bValue);
  bValue1 &= 0x0f;
  bValue1 |= (bPixelrate << 4);
  VIM_HIF_SetReg8((0x0C00 + 0x001), bValue1);
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetPixelRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x4a,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %al,-0x2(%rbp)
mov    $0xc01,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x1(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf0,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
mov    $0x4a,%edi
movzbl -0x2(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl -0x3(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%ecx
shl    $0x4,%ecx
movzbl -0x3(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x3(%rbp)
mov    $0xc01,%edi
movzbl -0x3(%rbp),%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetPixelRate>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebp
mov    $0x4a,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %eax,%ebx
mov    $0xc01,%edi
call   1040 <VIM_HIF_GetReg8@plt>
mov    %eax,%r14d
mov    %ebp,%eax
and    $0xf,%al
and    $0xf0,%bl
or     %al,%bl
movzbl %bl,%esi
mov    $0x4a,%edi
call   1030 <VIM_HIF_SetReg8@plt>
and    $0xf,%r14b
shl    $0x4,%bpl
or     %r14b,%bpl
movzbl %bpl,%esi
mov    $0xc01,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetPixelRate(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = call zeroext i8 @VIM_HIF_GetReg8(i32 74)
store i8 %5, i8* %3
%6 = call zeroext i8 @VIM_HIF_GetReg8(i32 3073)
store i8 %6, i8* %4
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 15
%10 = trunc i32 %9 to i8
store i8 %10, i8* %2
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = and i32 %12, 240
%14 = trunc i32 %13 to i8
store i8 %14, i8* %3
%15 = load i8, i8* %2
%16 = zext i8 %15 to i32
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = or i32 %18, %16
%20 = trunc i32 %19 to i8
store i8 %20, i8* %3
%21 = load i8, i8* %3
%22 = call i32 @VIM_HIF_SetReg8(i32 74, i8 zeroext %21)
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = and i32 %24, 15
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = shl i32 %28, 4
%30 = load i8, i8* %4
%31 = zext i8 %30 to i32
%32 = or i32 %31, %29
%33 = trunc i32 %32 to i8
store i8 %33, i8* %4
%34 = load i8, i8* %4
%35 = call i32 @VIM_HIF_SetReg8(i32 3073, i8 zeroext %34)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetPixelRate(i8 zeroext %0) {
%2 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 74)
%3 = tail call zeroext i8 @VIM_HIF_GetReg8(i32 3073)
%4 = and i8 %0, 15
%5 = and i8 %2, -16
%6 = or i8 %5, %4
%7 = tail call i32 @VIM_HIF_SetReg8(i32 74, i8 zeroext %6)
%8 = and i8 %3, 15
%9 = shl i8 %0, 4
%10 = or i8 %8, %9
%11 = tail call i32 @VIM_HIF_SetReg8(i32 3073, i8 zeroext %10)
ret void
}