int stb_box_face_vertex_axis_side(int face_number, int vertex_number,
                                  int axis) {
  static box_vertices[6][4][3] = {
      {{1, 1, 1}, {1, 0, 1}, {1, 0, 0}, {1, 1, 0}},
      {{0, 0, 0}, {0, 0, 1}, {0, 1, 1}, {0, 1, 0}},
      {{0, 0, 0}, {0, 1, 0}, {1, 1, 0}, {1, 0, 0}},
      {{0, 0, 0}, {1, 0, 0}, {1, 0, 1}, {0, 0, 1}},
      {{1, 1, 1}, {0, 1, 1}, {0, 0, 1}, {1, 0, 1}},
      {{1, 1, 1}, {1, 1, 0}, {0, 1, 0}, {0, 1, 1}},
  };
  assert(face_number >= 0 && face_number < 6);
  assert(vertex_number >= 0 && vertex_number < 4);
  assert(axis >= 0 && axis < 3);
  return box_vertices[face_number][vertex_number][axis];
}


x86 assembly (clang, -O0):
<stb_box_face_vertex_axis_side>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0xd(%rbp)
jl     113a <stb_box_face_vertex_axis_side+0x2a>
cmpl   $0x6,-0x4(%rbp)
setl   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x0,-0x8(%rbp)
mov    %al,-0xe(%rbp)
jl     1162 <stb_box_face_vertex_axis_side+0x52>
cmpl   $0x4,-0x8(%rbp)
setl   %al
mov    %al,-0xe(%rbp)
mov    -0xe(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
xor    %eax,%eax
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xf(%rbp)
jl     118a <stb_box_face_vertex_axis_side+0x7a>
cmpl   $0x3,-0xc(%rbp)
setl   %al
mov    %al,-0xf(%rbp)
mov    -0xf(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1030 <assert@plt>
movslq -0x4(%rbp),%rcx
lea    0x2e8c(%rip),%rax
imul   $0x30,%rcx,%rcx
add    %rcx,%rax
movslq -0x8(%rbp),%rcx
imul   $0xc,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stb_box_face_vertex_axis_side>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %edi,%edi
cmp    $0x6,%ebx
setb   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x4,%ebp
setb   %dil
xor    %eax,%eax
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x3,%r14d
setb   %dil
xor    %eax,%eax
call   1030 <assert@plt>
movslq %ebx,%rax
movslq %ebp,%rcx
movslq %r14d,%rdx
lea    (%rax,%rax,2),%rax
shl    $0x4,%rax
lea    0xe9c(%rip),%rsi
add    %rax,%rsi
lea    (%rcx,%rcx,2),%rax
lea    (%rsi,%rax,4),%rax
mov    (%rax,%rdx,4),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stb_box_face_vertex_axis_side.box_vertices = internal global [6 x [4 x [3 x i32]]] [[4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 0, i32 1], [3 x i32] [i32 1, i32 0, i32 0], [3 x i32] [i32 1, i32 1, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 0, i32 0, i32 1], [3 x i32] [i32 0, i32 1, i32 1], [3 x i32] [i32 0, i32 1, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 0, i32 1, i32 0], [3 x i32] [i32 1, i32 1, i32 0], [3 x i32] [i32 1, i32 0, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 1, i32 0, i32 0], [3 x i32] [i32 1, i32 0, i32 1], [3 x i32] [i32 0, i32 0, i32 1]], [4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 0, i32 1, i32 1], [3 x i32] [i32 0, i32 0, i32 1], [3 x i32] [i32 1, i32 0, i32 1]], [4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 0], [3 x i32] [i32 0, i32 1, i32 0], [3 x i32] [i32 0, i32 1, i32 1]]]
define i32 @stb_box_face_vertex_axis_side(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp sge i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 6
br label %12
12: ; preds = %9, %3
%13 = phi i1 [ false, %3 ], [ %11, %9 ]
%14 = zext i1 %13 to i32
%15 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %14)
%16 = load i32, i32* %5
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %21
18: ; preds = %12
%19 = load i32, i32* %5
%20 = icmp slt i32 %19, 4
br label %21
21: ; preds = %18, %12
%22 = phi i1 [ false, %12 ], [ %20, %18 ]
%23 = zext i1 %22 to i32
%24 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %23)
%25 = load i32, i32* %6
%26 = icmp sge i32 %25, 0
br i1 %26, label %27, label %30
27: ; preds = %21
%28 = load i32, i32* %6
%29 = icmp slt i32 %28, 3
br label %30
30: ; preds = %27, %21
%31 = phi i1 [ false, %21 ], [ %29, %27 ]
%32 = zext i1 %31 to i32
%33 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %32)
%34 = load i32, i32* %4
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [6 x [4 x [3 x i32]]], [6 x [4 x [3 x i32]]]* @stb_box_face_vertex_axis_side.box_vertices, i64 0, i64 %35
%37 = load i32, i32* %5
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [4 x [3 x i32]], [4 x [3 x i32]]* %36, i64 0, i64 %38
%40 = load i32, i32* %6
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [3 x i32], [3 x i32]* %39, i64 0, i64 %41
%43 = load i32, i32* %42
ret i32 %43
}

LLVM IR (-O2):
@stb_box_face_vertex_axis_side.box_vertices = internal unnamed_addr constant [6 x [4 x [3 x i32]]] [[4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 0, i32 1], [3 x i32] [i32 1, i32 0, i32 0], [3 x i32] [i32 1, i32 1, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 0, i32 0, i32 1], [3 x i32] [i32 0, i32 1, i32 1], [3 x i32] [i32 0, i32 1, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 0, i32 1, i32 0], [3 x i32] [i32 1, i32 1, i32 0], [3 x i32] [i32 1, i32 0, i32 0]], [4 x [3 x i32]] [[3 x i32] zeroinitializer, [3 x i32] [i32 1, i32 0, i32 0], [3 x i32] [i32 1, i32 0, i32 1], [3 x i32] [i32 0, i32 0, i32 1]], [4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 0, i32 1, i32 1], [3 x i32] [i32 0, i32 0, i32 1], [3 x i32] [i32 1, i32 0, i32 1]], [4 x [3 x i32]] [[3 x i32] [i32 1, i32 1, i32 1], [3 x i32] [i32 1, i32 1, i32 0], [3 x i32] [i32 0, i32 1, i32 0], [3 x i32] [i32 0, i32 1, i32 1]]]
define i32 @stb_box_face_vertex_axis_side(i32 %0, i32 %1, i32 %2) {
%4 = icmp ult i32 %0, 6
%5 = zext i1 %4 to i32
%6 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %5)
%7 = icmp ult i32 %1, 4
%8 = zext i1 %7 to i32
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %8)
%10 = icmp ult i32 %2, 3
%11 = zext i1 %10 to i32
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %11)
%13 = sext i32 %0 to i64
%14 = sext i32 %1 to i64
%15 = sext i32 %2 to i64
%16 = getelementptr inbounds [6 x [4 x [3 x i32]]], [6 x [4 x [3 x i32]]]* @stb_box_face_vertex_axis_side.box_vertices, i64 0, i64 %13, i64 %14, i64 %15
%17 = load i32, i32* %16
ret i32 %17
}