void s_get_nrc_block_values(char *sudoku, char b, char *restrict block) {
  char blocks[4][9] = {{10, 11, 12, 19, 20, 21, 28, 29, 30},
                       {14, 15, 16, 23, 24, 25, 32, 33, 34},
                       {46, 47, 48, 55, 56, 57, 64, 65, 66},
                       {50, 51, 52, 59, 60, 61, 68, 69, 70}};
  for (char i = 0; i < 9; i++) {
    block[i] = sudoku[blocks[b][i]];
  }
}


x86 assembly (clang, -O0):
<s_get_nrc_block_values>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xecf(%rip),%rsi
mov    $0x24,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x41(%rbp)
movsbl -0x41(%rbp),%eax
cmp    $0x9,%eax
jge    1186 <s_get_nrc_block_values+0x76>
mov    -0x8(%rbp),%rax
movsbq -0x9(%rbp),%rdx
lea    -0x40(%rbp),%rcx
imul   $0x9,%rdx,%rdx
add    %rdx,%rcx
movsbq -0x41(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x18(%rbp),%rax
movsbq -0x41(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x41(%rbp),%al
add    $0x1,%al
mov    %al,-0x41(%rbp)
jmp    113f <s_get_nrc_block_values+0x2f>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_get_nrc_block_values>:
movslq %esi,%rax
lea    (%rax,%rax,8),%rax
lea    0xef2(%rip),%r8
movsbq (%r8,%rax,1),%rsi
mov    (%rdi,%rsi,1),%cl
mov    %cl,(%rdx)
movsbq 0x1(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x1(%rdx)
movsbq 0x2(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x2(%rdx)
movsbq 0x3(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x3(%rdx)
movsbq 0x4(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x4(%rdx)
movsbq 0x5(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x5(%rdx)
movsbq 0x6(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x6(%rdx)
movsbq 0x7(%r8,%rax,1),%rcx
mov    (%rdi,%rcx,1),%cl
mov    %cl,0x7(%rdx)
movsbq 0x8(%r8,%rax,1),%rax
mov    (%rdi,%rax,1),%al
mov    %al,0x8(%rdx)
ret

LLVM IR (-O0):
@__const.s_get_nrc_block_values.blocks = [4 x [9 x i8]] [[9 x i8] c"\0A\0B\0C\13\14\15\1C\1D\1E", [9 x i8] c"\0E\0F\10\17\18\19 !\22", [9 x i8] c"./0789@AB", [9 x i8] c"234;<=DEF"]
define void @s_get_nrc_block_values(i8* %0, i8 signext %1, i8* noalias %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8*
%7 = alloca [4 x [9 x i8]]
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8* %2, i8** %6
%9 = bitcast [4 x [9 x i8]]* %7 to i8*
store i8 0, i8* %8
br label %10
10: ; preds = %30, %3
%11 = load i8, i8* %8
%12 = sext i8 %11 to i32
%13 = icmp slt i32 %12, 9
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i8, i8* %5
%17 = sext i8 %16 to i64
%18 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* %7, i64 0, i64 %17
%19 = load i8, i8* %8
%20 = sext i8 %19 to i64
%21 = getelementptr inbounds [9 x i8], [9 x i8]* %18, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i64
%24 = getelementptr inbounds i8, i8* %15, i64 %23
%25 = load i8, i8* %24
%26 = load i8*, i8** %6
%27 = load i8, i8* %8
%28 = sext i8 %27 to i64
%29 = getelementptr inbounds i8, i8* %26, i64 %28
store i8 %25, i8* %29
br label %30
30: ; preds = %14
%31 = load i8, i8* %8
%32 = add i8 %31, 1
store i8 %32, i8* %8
br label %10
33: ; preds = %10
ret void
}

LLVM IR (-O2):
@__const.s_get_nrc_block_values.blocks = [4 x [9 x i8]] [[9 x i8] c"\0A\0B\0C\13\14\15\1C\1D\1E", [9 x i8] c"\0E\0F\10\17\18\19 !\22", [9 x i8] c"./0789@AB", [9 x i8] c"234;<=DEF"]
define void @s_get_nrc_block_values(i8* nocapture %0, i8 signext %1, i8* noalias nocapture writeonly %2) {
%4 = sext i8 %1 to i64
%5 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i64
%8 = getelementptr inbounds i8, i8* %0, i64 %7
%9 = load i8, i8* %8
store i8 %9, i8* %2
%10 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 1
%11 = load i8, i8* %10
%12 = sext i8 %11 to i64
%13 = getelementptr inbounds i8, i8* %0, i64 %12
%14 = load i8, i8* %13
%15 = getelementptr inbounds i8, i8* %2, i64 1
store i8 %14, i8* %15
%16 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 2
%17 = load i8, i8* %16
%18 = sext i8 %17 to i64
%19 = getelementptr inbounds i8, i8* %0, i64 %18
%20 = load i8, i8* %19
%21 = getelementptr inbounds i8, i8* %2, i64 2
store i8 %20, i8* %21
%22 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 3
%23 = load i8, i8* %22
%24 = sext i8 %23 to i64
%25 = getelementptr inbounds i8, i8* %0, i64 %24
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %2, i64 3
store i8 %26, i8* %27
%28 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 4
%29 = load i8, i8* %28
%30 = sext i8 %29 to i64
%31 = getelementptr inbounds i8, i8* %0, i64 %30
%32 = load i8, i8* %31
%33 = getelementptr inbounds i8, i8* %2, i64 4
store i8 %32, i8* %33
%34 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 5
%35 = load i8, i8* %34
%36 = sext i8 %35 to i64
%37 = getelementptr inbounds i8, i8* %0, i64 %36
%38 = load i8, i8* %37
%39 = getelementptr inbounds i8, i8* %2, i64 5
store i8 %38, i8* %39
%40 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 6
%41 = load i8, i8* %40
%42 = sext i8 %41 to i64
%43 = getelementptr inbounds i8, i8* %0, i64 %42
%44 = load i8, i8* %43
%45 = getelementptr inbounds i8, i8* %2, i64 6
store i8 %44, i8* %45
%46 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 7
%47 = load i8, i8* %46
%48 = sext i8 %47 to i64
%49 = getelementptr inbounds i8, i8* %0, i64 %48
%50 = load i8, i8* %49
%51 = getelementptr inbounds i8, i8* %2, i64 7
store i8 %50, i8* %51
%52 = getelementptr inbounds [4 x [9 x i8]], [4 x [9 x i8]]* @__const.s_get_nrc_block_values.blocks, i64 0, i64 %4, i64 8
%53 = load i8, i8* %52
%54 = sext i8 %53 to i64
%55 = getelementptr inbounds i8, i8* %0, i64 %54
%56 = load i8, i8* %55
%57 = getelementptr inbounds i8, i8* %2, i64 8
store i8 %56, i8* %57
ret void
}