void set_mux_control(unsigned int ctl) {
  switch (ctl) {
  case 0:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 22);
    break;
  case 1:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 22);
    break;
  case 2:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 22);
    break;
  case 3:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 22);
    break;
  case 4:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 22);
    break;
  case 5:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 22);
    break;
  case 6:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) &= ~(1 << 22);
    break;
  default:
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 23);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 24);
    (*((volatile unsigned int *)(0x481ac000 + 0x13c))) |= (1 << 22);
    break;
  }
}


x86 assembly (clang, -O0):
<set_mux_control>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rax,-0x10(%rbp)
sub    $0x6,%rax
ja     12f3 <set_mux_control+0x1f3>
mov    -0x10(%rbp),%rax
lea    0xedd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xff7fffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xfeffffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xffbfffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xff7fffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xfeffffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xff7fffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xffbfffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xff7fffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x800000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xfeffffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xffbfffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x800000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xfeffffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x800000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
and    $0xffbfffff,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x800000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
mov    $0x481ac13c,%eax
mov    (%rax),%ecx
or     $0x400000,%ecx
mov    $0x481ac13c,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_mux_control>:
cmp    $0x6,%edi
ja     1124 <set_mux_control+0x24>
mov    %edi,%eax
lea    0xef2(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
andl   $0xff7fffff,0x481ac13c
ff ff 7f ff
jmp    116e <set_mux_control+0x6e>
orl    $0x800000,0x481ac13c
jmp    1156 <set_mux_control+0x56>
andl   $0xff7fffff,0x481ac13c
ff ff 7f ff
jmp    1186 <set_mux_control+0x86>
andl   $0xff7fffff,0x481ac13c
ff ff 7f ff
jmp    11b0 <set_mux_control+0xb0>
andl   $0xff7fffff,0x481ac13c
ff ff 7f ff
orl    $0x1000000,0x481ac13c
jmp    1191 <set_mux_control+0x91>
orl    $0x800000,0x481ac13c
andl   $0xfeffffff,0x481ac13c
ff ff ff fe
jmp    11bb <set_mux_control+0xbb>
orl    $0x800000,0x481ac13c
andl   $0xfeffffff,0x481ac13c
ff ff ff fe
mov    $0x400000,%eax
or     0x481ac13c,%eax
mov    %eax,0x481ac13c
ret
orl    $0x800000,0x481ac13c
orl    $0x1000000,0x481ac13c
mov    $0xffbfffff,%eax
and    0x481ac13c,%eax
mov    %eax,0x481ac13c
ret

LLVM IR (-O0):
define void @set_mux_control(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
switch i32 %3, label %53 [
i32 0, label %4
i32 1, label %11
i32 2, label %18
i32 3, label %25
i32 4, label %32
i32 5, label %39
i32 6, label %46
]
4: ; preds = %1
%5 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%6 = and i32 %5, -8388609
store volatile i32 %6, i32* inttoptr (i64 1209712956 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%8 = and i32 %7, -16777217
store volatile i32 %8, i32* inttoptr (i64 1209712956 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%10 = and i32 %9, -4194305
store volatile i32 %10, i32* inttoptr (i64 1209712956 to i32*)
br label %60
11: ; preds = %1
%12 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%13 = and i32 %12, -8388609
store volatile i32 %13, i32* inttoptr (i64 1209712956 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%15 = and i32 %14, -16777217
store volatile i32 %15, i32* inttoptr (i64 1209712956 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%17 = or i32 %16, 4194304
store volatile i32 %17, i32* inttoptr (i64 1209712956 to i32*)
br label %60
18: ; preds = %1
%19 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%20 = and i32 %19, -8388609
store volatile i32 %20, i32* inttoptr (i64 1209712956 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%22 = or i32 %21, 16777216
store volatile i32 %22, i32* inttoptr (i64 1209712956 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%24 = and i32 %23, -4194305
store volatile i32 %24, i32* inttoptr (i64 1209712956 to i32*)
br label %60
25: ; preds = %1
%26 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%27 = and i32 %26, -8388609
store volatile i32 %27, i32* inttoptr (i64 1209712956 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%29 = or i32 %28, 16777216
store volatile i32 %29, i32* inttoptr (i64 1209712956 to i32*)
%30 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%31 = or i32 %30, 4194304
store volatile i32 %31, i32* inttoptr (i64 1209712956 to i32*)
br label %60
32: ; preds = %1
%33 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%34 = or i32 %33, 8388608
store volatile i32 %34, i32* inttoptr (i64 1209712956 to i32*)
%35 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%36 = and i32 %35, -16777217
store volatile i32 %36, i32* inttoptr (i64 1209712956 to i32*)
%37 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%38 = and i32 %37, -4194305
store volatile i32 %38, i32* inttoptr (i64 1209712956 to i32*)
br label %60
39: ; preds = %1
%40 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%41 = or i32 %40, 8388608
store volatile i32 %41, i32* inttoptr (i64 1209712956 to i32*)
%42 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%43 = and i32 %42, -16777217
store volatile i32 %43, i32* inttoptr (i64 1209712956 to i32*)
%44 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%45 = or i32 %44, 4194304
store volatile i32 %45, i32* inttoptr (i64 1209712956 to i32*)
br label %60
46: ; preds = %1
%47 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%48 = or i32 %47, 8388608
store volatile i32 %48, i32* inttoptr (i64 1209712956 to i32*)
%49 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%50 = or i32 %49, 16777216
store volatile i32 %50, i32* inttoptr (i64 1209712956 to i32*)
%51 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%52 = and i32 %51, -4194305
store volatile i32 %52, i32* inttoptr (i64 1209712956 to i32*)
br label %60
53: ; preds = %1
%54 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%55 = or i32 %54, 8388608
store volatile i32 %55, i32* inttoptr (i64 1209712956 to i32*)
%56 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%57 = or i32 %56, 16777216
store volatile i32 %57, i32* inttoptr (i64 1209712956 to i32*)
%58 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%59 = or i32 %58, 4194304
store volatile i32 %59, i32* inttoptr (i64 1209712956 to i32*)
br label %60
60: ; preds = %53, %46, %39, %32, %25, %18, %11, %4
ret void
}

LLVM IR (-O2):
define void @set_mux_control(i32 %0) {
switch i32 %0, label %51 [
i32 0, label %2
i32 1, label %9
i32 2, label %16
i32 3, label %23
i32 4, label %30
i32 5, label %37
i32 6, label %44
]
2: ; preds = %1
%3 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%4 = and i32 %3, -8388609
store volatile i32 %4, i32* inttoptr (i64 1209712956 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%6 = and i32 %5, -16777217
store volatile i32 %6, i32* inttoptr (i64 1209712956 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%8 = and i32 %7, -4194305
br label %58
9: ; preds = %1
%10 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%11 = and i32 %10, -8388609
store volatile i32 %11, i32* inttoptr (i64 1209712956 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%13 = and i32 %12, -16777217
store volatile i32 %13, i32* inttoptr (i64 1209712956 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%15 = or i32 %14, 4194304
br label %58
16: ; preds = %1
%17 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%18 = and i32 %17, -8388609
store volatile i32 %18, i32* inttoptr (i64 1209712956 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%20 = or i32 %19, 16777216
store volatile i32 %20, i32* inttoptr (i64 1209712956 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%22 = and i32 %21, -4194305
br label %58
23: ; preds = %1
%24 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%25 = and i32 %24, -8388609
store volatile i32 %25, i32* inttoptr (i64 1209712956 to i32*)
%26 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%27 = or i32 %26, 16777216
store volatile i32 %27, i32* inttoptr (i64 1209712956 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%29 = or i32 %28, 4194304
br label %58
30: ; preds = %1
%31 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%32 = or i32 %31, 8388608
store volatile i32 %32, i32* inttoptr (i64 1209712956 to i32*)
%33 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%34 = and i32 %33, -16777217
store volatile i32 %34, i32* inttoptr (i64 1209712956 to i32*)
%35 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%36 = and i32 %35, -4194305
br label %58
37: ; preds = %1
%38 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%39 = or i32 %38, 8388608
store volatile i32 %39, i32* inttoptr (i64 1209712956 to i32*)
%40 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%41 = and i32 %40, -16777217
store volatile i32 %41, i32* inttoptr (i64 1209712956 to i32*)
%42 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%43 = or i32 %42, 4194304
br label %58
44: ; preds = %1
%45 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%46 = or i32 %45, 8388608
store volatile i32 %46, i32* inttoptr (i64 1209712956 to i32*)
%47 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%48 = or i32 %47, 16777216
store volatile i32 %48, i32* inttoptr (i64 1209712956 to i32*)
%49 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%50 = and i32 %49, -4194305
br label %58
51: ; preds = %1
%52 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%53 = or i32 %52, 8388608
store volatile i32 %53, i32* inttoptr (i64 1209712956 to i32*)
%54 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%55 = or i32 %54, 16777216
store volatile i32 %55, i32* inttoptr (i64 1209712956 to i32*)
%56 = load volatile i32, i32* inttoptr (i64 1209712956 to i32*)
%57 = or i32 %56, 4194304
br label %58
58: ; preds = %51, %44, %37, %30, %23, %16, %9, %2
%59 = phi i32 [ %57, %51 ], [ %50, %44 ], [ %43, %37 ], [ %36, %30 ], [ %29, %23 ], [ %22, %16 ], [ %15, %9 ], [ %8, %2 ]
store volatile i32 %59, i32* inttoptr (i64 1209712956 to i32*)
ret void
}