void set_terms(type, term_type, GL, GR, G) int type;
int *term_type;
int *GL;
int *GR;
int *G;
{
  *term_type = type;
  switch (type) {
  case 1:
    *GL = 0, *GR = 1, G[0] = 1, G[1] = 3, G[2] = 3, G[3] = 3;
    break;
  case 2:
    *GL = 0, *GR = 1, G[0] = 0, G[1] = 3, G[2] = 3, G[3] = 3;
    break;
  case 3:
    *GL = 0, *GR = 3, G[0] = 0, G[1] = 2, G[2] = 3, G[3] = 5;
    break;
  case 4:
    *GL = 0, *GR = 3, G[0] = 0, G[1] = 3, G[2] = 3, G[3] = 5;
    break;
  case 5:
    *GL = 0, *GR = 4, G[0] = 0, G[1] = 3, G[2] = 3, G[3] = 3;
    break;
  }
}


x86 assembly (clang, -O0):
<set_terms>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x30(%rbp)
sub    $0x4,%eax
ja     1298 <set_terms+0x198>
mov    -0x30(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0xc(%rax)
jmp    1298 <set_terms+0x198>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0xc(%rax)
jmp    1298 <set_terms+0x198>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x2,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x5,0xc(%rax)
jmp    1298 <set_terms+0x198>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x3,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x5,0xc(%rax)
jmp    1298 <set_terms+0x198>
mov    -0x18(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x4(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0x8(%rax)
mov    -0x28(%rbp),%rax
movl   $0x3,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_terms>:
mov    %edi,(%rsi)
add    $0xffffffff,%edi
cmp    $0x4,%edi
ja     1153 <set_terms+0x53>
movslq %edi,%rax
lea    0xeec(%rip),%rsi
mov    (%rsi,%rax,4),%r9d
lea    0xef5(%rip),%rdi
mov    (%rdi,%rax,4),%r10d
lea    0xefe(%rip),%rsi
mov    (%rsi,%rax,4),%esi
lea    0xf08(%rip),%rdi
mov    (%rdi,%rax,4),%eax
movl   $0x0,(%rdx)
mov    %r9d,(%rcx)
mov    %r10d,(%r8)
mov    %esi,0x4(%r8)
movl   $0x3,0x8(%r8)
mov    %eax,0xc(%r8)
ret

LLVM IR (-O0):
define void @set_terms(i32 %0, i32* %1, i32* %2, i32* %3, i32* %4) {
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
store i32 %0, i32* %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32* %3, i32** %9
store i32* %4, i32** %10
%11 = load i32, i32* %6
%12 = load i32*, i32** %7
store i32 %11, i32* %12
%13 = load i32, i32* %6
switch i32 %13, label %69 [
i32 1, label %14
i32 2, label %25
i32 3, label %36
i32 4, label %47
i32 5, label %58
]
14: ; preds = %5
%15 = load i32*, i32** %8
store i32 0, i32* %15
%16 = load i32*, i32** %9
store i32 1, i32* %16
%17 = load i32*, i32** %10
%18 = getelementptr inbounds i32, i32* %17, i64 0
store i32 1, i32* %18
%19 = load i32*, i32** %10
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 3, i32* %20
%21 = load i32*, i32** %10
%22 = getelementptr inbounds i32, i32* %21, i64 2
store i32 3, i32* %22
%23 = load i32*, i32** %10
%24 = getelementptr inbounds i32, i32* %23, i64 3
store i32 3, i32* %24
br label %69
25: ; preds = %5
%26 = load i32*, i32** %8
store i32 0, i32* %26
%27 = load i32*, i32** %9
store i32 1, i32* %27
%28 = load i32*, i32** %10
%29 = getelementptr inbounds i32, i32* %28, i64 0
store i32 0, i32* %29
%30 = load i32*, i32** %10
%31 = getelementptr inbounds i32, i32* %30, i64 1
store i32 3, i32* %31
%32 = load i32*, i32** %10
%33 = getelementptr inbounds i32, i32* %32, i64 2
store i32 3, i32* %33
%34 = load i32*, i32** %10
%35 = getelementptr inbounds i32, i32* %34, i64 3
store i32 3, i32* %35
br label %69
36: ; preds = %5
%37 = load i32*, i32** %8
store i32 0, i32* %37
%38 = load i32*, i32** %9
store i32 3, i32* %38
%39 = load i32*, i32** %10
%40 = getelementptr inbounds i32, i32* %39, i64 0
store i32 0, i32* %40
%41 = load i32*, i32** %10
%42 = getelementptr inbounds i32, i32* %41, i64 1
store i32 2, i32* %42
%43 = load i32*, i32** %10
%44 = getelementptr inbounds i32, i32* %43, i64 2
store i32 3, i32* %44
%45 = load i32*, i32** %10
%46 = getelementptr inbounds i32, i32* %45, i64 3
store i32 5, i32* %46
br label %69
47: ; preds = %5
%48 = load i32*, i32** %8
store i32 0, i32* %48
%49 = load i32*, i32** %9
store i32 3, i32* %49
%50 = load i32*, i32** %10
%51 = getelementptr inbounds i32, i32* %50, i64 0
store i32 0, i32* %51
%52 = load i32*, i32** %10
%53 = getelementptr inbounds i32, i32* %52, i64 1
store i32 3, i32* %53
%54 = load i32*, i32** %10
%55 = getelementptr inbounds i32, i32* %54, i64 2
store i32 3, i32* %55
%56 = load i32*, i32** %10
%57 = getelementptr inbounds i32, i32* %56, i64 3
store i32 5, i32* %57
br label %69
58: ; preds = %5
%59 = load i32*, i32** %8
store i32 0, i32* %59
%60 = load i32*, i32** %9
store i32 4, i32* %60
%61 = load i32*, i32** %10
%62 = getelementptr inbounds i32, i32* %61, i64 0
store i32 0, i32* %62
%63 = load i32*, i32** %10
%64 = getelementptr inbounds i32, i32* %63, i64 1
store i32 3, i32* %64
%65 = load i32*, i32** %10
%66 = getelementptr inbounds i32, i32* %65, i64 2
store i32 3, i32* %66
%67 = load i32*, i32** %10
%68 = getelementptr inbounds i32, i32* %67, i64 3
store i32 3, i32* %68
br label %69
69: ; preds = %5, %58, %47, %36, %25, %14
ret void
}

LLVM IR (-O2):
@switch.table.set_terms = [5 x i32] [i32 1, i32 1, i32 3, i32 3, i32 4]
@switch.table.set_terms.1 = [5 x i32] [i32 1, i32 0, i32 0, i32 0, i32 0]
@switch.table.set_terms.2 = [5 x i32] [i32 3, i32 3, i32 2, i32 3, i32 3]
@switch.table.set_terms.3 = [5 x i32] [i32 3, i32 3, i32 5, i32 5, i32 3]
define void @set_terms(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
store i32 %0, i32* %1
%6 = add i32 %0, -1
%7 = icmp ult i32 %6, 5
br i1 %7, label %8, label %24
8: ; preds = %5
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.set_terms, i64 0, i64 %9
%11 = load i32, i32* %10
%12 = sext i32 %6 to i64
%13 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.set_terms.1, i64 0, i64 %12
%14 = load i32, i32* %13
%15 = sext i32 %6 to i64
%16 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.set_terms.2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = sext i32 %6 to i64
%19 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.set_terms.3, i64 0, i64 %18
%20 = load i32, i32* %19
store i32 0, i32* %2
store i32 %11, i32* %3
store i32 %14, i32* %4
%21 = getelementptr inbounds i32, i32* %4, i64 1
store i32 %17, i32* %21
%22 = getelementptr inbounds i32, i32* %4, i64 2
store i32 3, i32* %22
%23 = getelementptr inbounds i32, i32* %4, i64 3
store i32 %20, i32* %23
br label %24
24: ; preds = %5, %8
ret void
}