void fill_punct_cs2(unsigned *pattern) {
  int i, j, k;
  for (i = 0, j = 3, k = 0; (i < 588) && (j < 147); i++) {
    if (i == (4 * j + 3)) {
      switch (++j) {
      case 9:
      case 21:
      case 33:
      case 45:
      case 57:
      case 69:
      case 81:
      case 93:
      case 105:
      case 117:
      case 129:
      case 141:
        j++;
      }
    } else {
      pattern[k++] = i;
    }
  }
}


x86 assembly (clang, -O0):
<fill_punct_cs2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x3,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x24c,-0xc(%rbp)
mov    %al,-0x15(%rbp)
jge    113c <fill_punct_cs2+0x3c>
cmpl   $0x93,-0x10(%rbp)
setl   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    114c <fill_punct_cs2+0x4c>
jmp    1272 <fill_punct_cs2+0x172>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x2,%ecx
add    $0x3,%ecx
cmp    %ecx,%eax
jne    1247 <fill_punct_cs2+0x147>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    %eax,-0x10(%rbp)
sub    $0x9,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    117a <fill_punct_cs2+0x7a>
mov    -0x1c(%rbp),%eax
sub    $0x15,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    118b <fill_punct_cs2+0x8b>
mov    -0x1c(%rbp),%eax
sub    $0x21,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    119c <fill_punct_cs2+0x9c>
mov    -0x1c(%rbp),%eax
sub    $0x2d,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    11ad <fill_punct_cs2+0xad>
mov    -0x1c(%rbp),%eax
sub    $0x39,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    11be <fill_punct_cs2+0xbe>
mov    -0x1c(%rbp),%eax
sub    $0x45,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    11cf <fill_punct_cs2+0xcf>
mov    -0x1c(%rbp),%eax
sub    $0x51,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    11e0 <fill_punct_cs2+0xe0>
mov    -0x1c(%rbp),%eax
sub    $0x5d,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    11f1 <fill_punct_cs2+0xf1>
mov    -0x1c(%rbp),%eax
sub    $0x69,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    1202 <fill_punct_cs2+0x102>
mov    -0x1c(%rbp),%eax
sub    $0x75,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    1213 <fill_punct_cs2+0x113>
mov    -0x1c(%rbp),%eax
sub    $0x81,%eax
je     1239 <fill_punct_cs2+0x139>
jmp    1226 <fill_punct_cs2+0x126>
mov    -0x1c(%rbp),%eax
sub    $0x8d,%eax
jne    1242 <fill_punct_cs2+0x142>
jmp    1239 <fill_punct_cs2+0x139>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    125f <fill_punct_cs2+0x15f>
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
mov    %ecx,%esi
add    $0x1,%esi
mov    %esi,-0x14(%rbp)
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    1264 <fill_punct_cs2+0x164>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    111d <fill_punct_cs2+0x1d>
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_punct_cs2>:
mov    $0x3,%edx
xor    %eax,%eax
movabs $0x1001001001001001,%r8
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x3(,%rdx,4),%ecx
cmp    %ecx,%esi
jne    1160 <fill_punct_cs2+0x60>
lea    -0x8(%rdx),%ecx
cmp    $0x3c,%ecx
ja     1140 <fill_punct_cs2+0x40>
bt     %rcx,%r8
jb     1152 <fill_punct_cs2+0x52>
nopl   0x0(%rax)
lea    0x1(%rdx),%r9d
lea    -0x50(%rdx),%ecx
cmp    $0x3c,%ecx
ja     117e <fill_punct_cs2+0x7e>
bt     %rcx,%r8
jae    117e <fill_punct_cs2+0x7e>
add    $0x2,%edx
cmp    $0x24a,%esi
jbe    1171 <fill_punct_cs2+0x71>
jmp    1189 <fill_punct_cs2+0x89>
nop
movslq %eax,%rcx
add    $0x1,%eax
mov    %esi,(%rdi,%rcx,4)
cmp    $0x24a,%esi
ja     1189 <fill_punct_cs2+0x89>
add    $0x1,%esi
cmp    $0x93,%edx
jl     1120 <fill_punct_cs2+0x20>
jmp    1189 <fill_punct_cs2+0x89>
mov    %r9d,%edx
cmp    $0x24a,%esi
jbe    1171 <fill_punct_cs2+0x71>
ret

LLVM IR (-O0):
define void @fill_punct_cs2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %2
store i32 0, i32* %3
store i32 3, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %35, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 588
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 147
br label %12
12: ; preds = %9, %6
%13 = phi i1 [ false, %6 ], [ %11, %9 ]
br i1 %13, label %14, label %38
14: ; preds = %12
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = mul nsw i32 4, %16
%18 = add nsw i32 %17, 3
%19 = icmp eq i32 %15, %18
br i1 %19, label %20, label %27
20: ; preds = %14
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
switch i32 %22, label %26 [
i32 9, label %23
i32 21, label %23
i32 33, label %23
i32 45, label %23
i32 57, label %23
i32 69, label %23
i32 81, label %23
i32 93, label %23
i32 105, label %23
i32 117, label %23
i32 129, label %23
i32 141, label %23
]
23: ; preds = %20, %20, %20, %20, %20, %20, %20, %20, %20, %20, %20, %20
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %26
26: ; preds = %23, %20
br label %34
27: ; preds = %14
%28 = load i32, i32* %3
%29 = load i32*, i32** %2
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
%32 = sext i32 %30 to i64
%33 = getelementptr inbounds i32, i32* %29, i64 %32
store i32 %28, i32* %33
br label %34
34: ; preds = %27, %26
br label %35
35: ; preds = %34
%36 = load i32, i32* %3
%37 = add nsw i32 %36, 1
store i32 %37, i32* %3
br label %6
38: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @fill_punct_cs2(i32* nocapture writeonly %0) {
br label %2
2: ; preds = %1, %17
%3 = phi i32 [ 0, %1 ], [ %19, %17 ]
%4 = phi i32 [ 3, %1 ], [ %18, %17 ]
%5 = phi i32 [ 0, %1 ], [ %20, %17 ]
%6 = shl nsw i32 %4, 2
%7 = or i32 %6, 3
%8 = icmp eq i32 %5, %7
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = add nsw i32 %4, 1
switch i32 %4, label %17 [
i32 8, label %11
i32 20, label %11
i32 32, label %11
i32 44, label %11
i32 56, label %11
i32 68, label %11
i32 80, label %11
i32 92, label %11
i32 104, label %11
i32 116, label %11
i32 128, label %11
i32 140, label %11
]
11: ; preds = %9, %9, %9, %9, %9, %9, %9, %9, %9, %9, %9, %9
%12 = add nuw nsw i32 %4, 2
br label %17
13: ; preds = %2
%14 = add nsw i32 %3, 1
%15 = sext i32 %3 to i64
%16 = getelementptr inbounds i32, i32* %0, i64 %15
store i32 %5, i32* %16
br label %17
17: ; preds = %13, %11, %9
%18 = phi i32 [ %10, %9 ], [ %12, %11 ], [ %4, %13 ]
%19 = phi i32 [ %3, %9 ], [ %3, %11 ], [ %14, %13 ]
%20 = add nuw nsw i32 %5, 1
%21 = icmp ult i32 %5, 587
%22 = icmp slt i32 %18, 147
%23 = select i1 %21, i1 %22, i1 false
br i1 %23, label %2, label %24
24: ; preds = %17
ret void
}