#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_JPEG_SetTimerInterval(unsigned long dwMs, unsigned long dwMclk) {
  unsigned short Num1Ms;
  Num1Ms = dwMclk / 1000;
  dwMs *= Num1Ms;
  VIM_HIF_SetReg8((0x0000 + 0x064), (unsigned char)(dwMs >> 24));
  VIM_HIF_SetReg8((0x0000 + 0x065), (unsigned char)(dwMs >> 16));
  VIM_HIF_SetReg8((0x0000 + 0x066), (unsigned char)(dwMs >> 8));
  VIM_HIF_SetReg8((0x0000 + 0x067), (unsigned char)dwMs);
}


x86 assembly (clang, -O0):
<VIM_JPEG_SetTimerInterval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x3e8,%ecx
xor    %edx,%edx
div    %rcx
mov    %ax,-0x12(%rbp)
movzwl -0x12(%rbp),%eax
imul   -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x18,%rax
mov    $0x64,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x10,%rax
mov    $0x65,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
shr    $0x8,%rax
mov    $0x66,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    -0x8(%rbp),%rax
mov    $0x67,%edi
movzbl %al,%esi
call   1030 <VIM_HIF_SetReg8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<VIM_JPEG_SetTimerInterval>:
push   %rbx
mov    %rsi,%rax
mov    %rdi,%rbx
shr    $0x3,%rax
movabs $0x20c49ba5e353f7cf,%rcx
9b c4 20
mul    %rcx
shr    $0x4,%edx
movzwl %dx,%eax
imul   %eax,%ebx
mov    %ebx,%eax
shr    $0x18,%eax
mov    $0x64,%edi
mov    %eax,%esi
call   1030 <VIM_HIF_SetReg8@plt>
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%esi
mov    $0x65,%edi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl %bh,%esi
mov    $0x66,%edi
call   1030 <VIM_HIF_SetReg8@plt>
movzbl %bl,%esi
mov    $0x67,%edi
pop    %rbx
jmp    1030 <VIM_HIF_SetReg8@plt>

LLVM IR (-O0):
define void @VIM_JPEG_SetTimerInterval(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i16
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = udiv i64 %6, 1000
%8 = trunc i64 %7 to i16
store i16 %8, i16* %5
%9 = load i16, i16* %5
%10 = zext i16 %9 to i64
%11 = load i64, i64* %3
%12 = mul i64 %11, %10
store i64 %12, i64* %3
%13 = load i64, i64* %3
%14 = lshr i64 %13, 24
%15 = trunc i64 %14 to i8
%16 = call i32 @VIM_HIF_SetReg8(i32 100, i8 zeroext %15)
%17 = load i64, i64* %3
%18 = lshr i64 %17, 16
%19 = trunc i64 %18 to i8
%20 = call i32 @VIM_HIF_SetReg8(i32 101, i8 zeroext %19)
%21 = load i64, i64* %3
%22 = lshr i64 %21, 8
%23 = trunc i64 %22 to i8
%24 = call i32 @VIM_HIF_SetReg8(i32 102, i8 zeroext %23)
%25 = load i64, i64* %3
%26 = trunc i64 %25 to i8
%27 = call i32 @VIM_HIF_SetReg8(i32 103, i8 zeroext %26)
ret void
}

LLVM IR (-O2):
define void @VIM_JPEG_SetTimerInterval(i64 %0, i64 %1) {
%3 = udiv i64 %1, 1000
%4 = and i64 %3, 65535
%5 = mul i64 %4, %0
%6 = lshr i64 %5, 24
%7 = trunc i64 %6 to i8
%8 = tail call i32 @VIM_HIF_SetReg8(i32 100, i8 zeroext %7)
%9 = lshr i64 %5, 16
%10 = trunc i64 %9 to i8
%11 = tail call i32 @VIM_HIF_SetReg8(i32 101, i8 zeroext %10)
%12 = lshr i64 %5, 8
%13 = trunc i64 %12 to i8
%14 = tail call i32 @VIM_HIF_SetReg8(i32 102, i8 zeroext %13)
%15 = trunc i64 %5 to i8
%16 = tail call i32 @VIM_HIF_SetReg8(i32 103, i8 zeroext %15)
ret void
}