void DOSMEM_FillIsrTable(int *isr) {
  int i;
  for (i = 0; i < 256; i++)
    isr[i] = (((short)((i * 4) & 0xFFFF)) | (0xf000 & 0xFFFF) << 16);
}


x86 assembly (clang, -O0):
<DOSMEM_FillIsrTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    1149 <DOSMEM_FillIsrTable+0x49>
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
and    $0xffff,%eax
movswl %ax,%edx
or     $0xf0000000,%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <DOSMEM_FillIsrTable+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<DOSMEM_FillIsrTable>:
movdqa 0xef8(%rip),%xmm0
xor    %eax,%eax
movdqa 0xefe(%rip),%xmm1
movdqa 0xf06(%rip),%xmm2
movdqa 0xf0e(%rip),%xmm3
movdqa 0xf16(%rip),%xmm4
nopw   0x0(%rax,%rax,1)
movdqa %xmm0,%xmm5
pslld  $0x2,%xmm5
movdqa %xmm5,%xmm6
paddd  %xmm1,%xmm6
movdqa %xmm5,%xmm7
por    %xmm2,%xmm7
por    %xmm2,%xmm6
movdqu %xmm7,(%rdi,%rax,4)
movdqu %xmm6,0x10(%rdi,%rax,4)
movdqa %xmm5,%xmm6
paddd  %xmm3,%xmm6
paddd  %xmm4,%xmm5
por    %xmm2,%xmm6
por    %xmm2,%xmm5
movdqu %xmm6,0x20(%rdi,%rax,4)
movdqu %xmm5,0x30(%rdi,%rax,4)
add    $0x10,%rax
paddd  %xmm1,%xmm0
cmp    $0x100,%rax
jne    1130 <DOSMEM_FillIsrTable+0x30>
ret

LLVM IR (-O0):
define void @DOSMEM_FillIsrTable(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 256
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i32, i32* %3
%9 = mul nsw i32 %8, 4
%10 = and i32 %9, 65535
%11 = trunc i32 %10 to i16
%12 = sext i16 %11 to i32
%13 = or i32 %12, -268435456
%14 = load i32*, i32** %2
%15 = load i32, i32* %3
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %14, i64 %16
store i32 %13, i32* %17
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
define void @DOSMEM_FillIsrTable(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %25, %2 ]
%4 = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %1 ], [ %26, %2 ]
%5 = shl <4 x i32> %4, <i32 2, i32 2, i32 2, i32 2>
%6 = shl <4 x i32> %4, <i32 2, i32 2, i32 2, i32 2>
%7 = add <4 x i32> %6, <i32 16, i32 16, i32 16, i32 16>
%8 = or <4 x i32> %5, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
%9 = or <4 x i32> %7, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
%10 = getelementptr inbounds i32, i32* %0, i64 %3
%11 = bitcast i32* %10 to <4 x i32>*
store <4 x i32> %8, <4 x i32>* %11
%12 = getelementptr inbounds i32, i32* %10, i64 4
%13 = bitcast i32* %12 to <4 x i32>*
store <4 x i32> %9, <4 x i32>* %13
%14 = or i64 %3, 8
%15 = add <4 x i32> %4, <i32 8, i32 8, i32 8, i32 8>
%16 = shl <4 x i32> %15, <i32 2, i32 2, i32 2, i32 2>
%17 = shl <4 x i32> %15, <i32 2, i32 2, i32 2, i32 2>
%18 = add <4 x i32> %17, <i32 16, i32 16, i32 16, i32 16>
%19 = or <4 x i32> %16, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
%20 = or <4 x i32> %18, <i32 -268435456, i32 -268435456, i32 -268435456, i32 -268435456>
%21 = getelementptr inbounds i32, i32* %0, i64 %14
%22 = bitcast i32* %21 to <4 x i32>*
store <4 x i32> %19, <4 x i32>* %22
%23 = getelementptr inbounds i32, i32* %21, i64 4
%24 = bitcast i32* %23 to <4 x i32>*
store <4 x i32> %20, <4 x i32>* %24
%25 = add nuw nsw i64 %3, 16
%26 = add <4 x i32> %4, <i32 16, i32 16, i32 16, i32 16>
%27 = icmp eq i64 %25, 256
br i1 %27, label %28, label %2
28: ; preds = %2
ret void
}