void set_mux_control(unsigned int ctl) {
  switch (ctl) {
  case 0:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) &= ~(1 << 7);
    break;
  case 1:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) |= (1 << 7);
    break;
  case 2:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) &= ~(1 << 7);
    break;
  case 3:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) |= (1 << 7);
    break;
  case 4:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) &= ~(1 << 7);
    break;
  case 5:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) &= ~(1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) |= (1 << 7);
    break;
  case 6:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) &= ~(1 << 7);
    break;
  default:
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 19);
    (*((volatile unsigned int *)(0x481ae000 + 0x13c))) |= (1 << 16);
    (*((volatile unsigned int *)(0x44e07000 + 0x13c))) |= (1 << 7);
    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    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfff7ffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfffeffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfff7ffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfffeffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfff7ffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfff7ffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfffeffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
and    $0xfffeffff,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
and    $0xffffff7f,%ecx
mov    $0x44e0713c,%eax
mov    %ecx,(%rax)
jmp    132f <set_mux_control+0x22f>
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x481ae13c,%eax
mov    (%rax),%ecx
or     $0x10000,%ecx
mov    $0x481ae13c,%eax
mov    %ecx,(%rax)
mov    $0x44e0713c,%eax
mov    (%rax),%ecx
or     $0x80,%ecx
mov    $0x44e0713c,%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   $0xfff7ffff,0x481ae13c
ff ff f7 ff
jmp    116e <set_mux_control+0x6e>
orl    $0x80000,0x481ae13c
jmp    1156 <set_mux_control+0x56>
andl   $0xfff7ffff,0x481ae13c
ff ff f7 ff
jmp    1186 <set_mux_control+0x86>
andl   $0xfff7ffff,0x481ae13c
ff ff f7 ff
jmp    11b0 <set_mux_control+0xb0>
andl   $0xfff7ffff,0x481ae13c
ff ff f7 ff
orl    $0x10000,0x481ae13c
jmp    1191 <set_mux_control+0x91>
orl    $0x80000,0x481ae13c
andl   $0xfffeffff,0x481ae13c
ff ff fe ff
jmp    11bb <set_mux_control+0xbb>
orl    $0x80000,0x481ae13c
andl   $0xfffeffff,0x481ae13c
ff ff fe ff
mov    $0x80,%eax
or     0x44e0713c,%eax
mov    %eax,0x44e0713c
ret
orl    $0x80000,0x481ae13c
orl    $0x10000,0x481ae13c
mov    $0xffffff7f,%eax
and    0x44e0713c,%eax
mov    %eax,0x44e0713c
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 1209721148 to i32*)
%6 = and i32 %5, -524289
store volatile i32 %6, i32* inttoptr (i64 1209721148 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%8 = and i32 %7, -65537
store volatile i32 %8, i32* inttoptr (i64 1209721148 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%10 = and i32 %9, -129
store volatile i32 %10, i32* inttoptr (i64 1155559740 to i32*)
br label %60
11: ; preds = %1
%12 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%13 = and i32 %12, -524289
store volatile i32 %13, i32* inttoptr (i64 1209721148 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%15 = and i32 %14, -65537
store volatile i32 %15, i32* inttoptr (i64 1209721148 to i32*)
%16 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%17 = or i32 %16, 128
store volatile i32 %17, i32* inttoptr (i64 1155559740 to i32*)
br label %60
18: ; preds = %1
%19 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%20 = and i32 %19, -524289
store volatile i32 %20, i32* inttoptr (i64 1209721148 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%22 = or i32 %21, 65536
store volatile i32 %22, i32* inttoptr (i64 1209721148 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%24 = and i32 %23, -129
store volatile i32 %24, i32* inttoptr (i64 1155559740 to i32*)
br label %60
25: ; preds = %1
%26 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%27 = and i32 %26, -524289
store volatile i32 %27, i32* inttoptr (i64 1209721148 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%29 = or i32 %28, 65536
store volatile i32 %29, i32* inttoptr (i64 1209721148 to i32*)
%30 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%31 = or i32 %30, 128
store volatile i32 %31, i32* inttoptr (i64 1155559740 to i32*)
br label %60
32: ; preds = %1
%33 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%34 = or i32 %33, 524288
store volatile i32 %34, i32* inttoptr (i64 1209721148 to i32*)
%35 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%36 = and i32 %35, -65537
store volatile i32 %36, i32* inttoptr (i64 1209721148 to i32*)
%37 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%38 = and i32 %37, -129
store volatile i32 %38, i32* inttoptr (i64 1155559740 to i32*)
br label %60
39: ; preds = %1
%40 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%41 = or i32 %40, 524288
store volatile i32 %41, i32* inttoptr (i64 1209721148 to i32*)
%42 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%43 = and i32 %42, -65537
store volatile i32 %43, i32* inttoptr (i64 1209721148 to i32*)
%44 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%45 = or i32 %44, 128
store volatile i32 %45, i32* inttoptr (i64 1155559740 to i32*)
br label %60
46: ; preds = %1
%47 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%48 = or i32 %47, 524288
store volatile i32 %48, i32* inttoptr (i64 1209721148 to i32*)
%49 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%50 = or i32 %49, 65536
store volatile i32 %50, i32* inttoptr (i64 1209721148 to i32*)
%51 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%52 = and i32 %51, -129
store volatile i32 %52, i32* inttoptr (i64 1155559740 to i32*)
br label %60
53: ; preds = %1
%54 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%55 = or i32 %54, 524288
store volatile i32 %55, i32* inttoptr (i64 1209721148 to i32*)
%56 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%57 = or i32 %56, 65536
store volatile i32 %57, i32* inttoptr (i64 1209721148 to i32*)
%58 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%59 = or i32 %58, 128
store volatile i32 %59, i32* inttoptr (i64 1155559740 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 1209721148 to i32*)
%4 = and i32 %3, -524289
store volatile i32 %4, i32* inttoptr (i64 1209721148 to i32*)
%5 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%6 = and i32 %5, -65537
store volatile i32 %6, i32* inttoptr (i64 1209721148 to i32*)
%7 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%8 = and i32 %7, -129
br label %58
9: ; preds = %1
%10 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%11 = and i32 %10, -524289
store volatile i32 %11, i32* inttoptr (i64 1209721148 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%13 = and i32 %12, -65537
store volatile i32 %13, i32* inttoptr (i64 1209721148 to i32*)
%14 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%15 = or i32 %14, 128
br label %58
16: ; preds = %1
%17 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%18 = and i32 %17, -524289
store volatile i32 %18, i32* inttoptr (i64 1209721148 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%20 = or i32 %19, 65536
store volatile i32 %20, i32* inttoptr (i64 1209721148 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%22 = and i32 %21, -129
br label %58
23: ; preds = %1
%24 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%25 = and i32 %24, -524289
store volatile i32 %25, i32* inttoptr (i64 1209721148 to i32*)
%26 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%27 = or i32 %26, 65536
store volatile i32 %27, i32* inttoptr (i64 1209721148 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%29 = or i32 %28, 128
br label %58
30: ; preds = %1
%31 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%32 = or i32 %31, 524288
store volatile i32 %32, i32* inttoptr (i64 1209721148 to i32*)
%33 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%34 = and i32 %33, -65537
store volatile i32 %34, i32* inttoptr (i64 1209721148 to i32*)
%35 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%36 = and i32 %35, -129
br label %58
37: ; preds = %1
%38 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%39 = or i32 %38, 524288
store volatile i32 %39, i32* inttoptr (i64 1209721148 to i32*)
%40 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%41 = and i32 %40, -65537
store volatile i32 %41, i32* inttoptr (i64 1209721148 to i32*)
%42 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%43 = or i32 %42, 128
br label %58
44: ; preds = %1
%45 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%46 = or i32 %45, 524288
store volatile i32 %46, i32* inttoptr (i64 1209721148 to i32*)
%47 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%48 = or i32 %47, 65536
store volatile i32 %48, i32* inttoptr (i64 1209721148 to i32*)
%49 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%50 = and i32 %49, -129
br label %58
51: ; preds = %1
%52 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%53 = or i32 %52, 524288
store volatile i32 %53, i32* inttoptr (i64 1209721148 to i32*)
%54 = load volatile i32, i32* inttoptr (i64 1209721148 to i32*)
%55 = or i32 %54, 65536
store volatile i32 %55, i32* inttoptr (i64 1209721148 to i32*)
%56 = load volatile i32, i32* inttoptr (i64 1155559740 to i32*)
%57 = or i32 %56, 128
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 1155559740 to i32*)
ret void
}