void LED(int which, int on_off) {
  switch (which) {
  case 2:
    switch (on_off) {
    case 1:
      *((unsigned long *)0xBF7FC008) |= 0x80000000;
      break;
    case 0:
      *((unsigned long *)0xBF7FC008) &= 0x7FFFFFFF;
      break;
    };
    break;
  case 1:
    switch (on_off) {
    case 1:
      *((unsigned long *)0xBF7FC008) |= 0x00200000;
      break;
    case 0:
      *((unsigned long *)0xBF7FC008) &= 0xFFDFFFFF;
      break;
    };
    break;
  }
}


x86 assembly (clang, -O0):
<LED>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
sub    $0x1,%eax
je     118e <LED+0x8e>
jmp    111e <LED+0x1e>
mov    -0xc(%rbp),%eax
sub    $0x2,%eax
jne    11ed <LED+0xed>
jmp    112f <LED+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     1172 <LED+0x72>
jmp    1142 <LED+0x42>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
jne    1189 <LED+0x89>
jmp    1153 <LED+0x53>
mov    $0xbf7fc008,%eax
movabs $0x80000000,%rcx
or     (%rax),%rcx
mov    $0xbf7fc008,%eax
mov    %rcx,(%rax)
jmp    1189 <LED+0x89>
mov    $0xbf7fc008,%eax
mov    (%rax),%rcx
and    $0x7fffffff,%rcx
mov    $0xbf7fc008,%eax
mov    %rcx,(%rax)
jmp    11ed <LED+0xed>
mov    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
test   %eax,%eax
je     11ce <LED+0xce>
jmp    11a1 <LED+0xa1>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
jne    11e8 <LED+0xe8>
jmp    11b2 <LED+0xb2>
mov    $0xbf7fc008,%eax
mov    (%rax),%rcx
or     $0x200000,%rcx
mov    $0xbf7fc008,%eax
mov    %rcx,(%rax)
jmp    11e8 <LED+0xe8>
mov    $0xbf7fc008,%eax
movabs $0xffdfffff,%rcx
and    (%rax),%rcx
mov    $0xbf7fc008,%eax
mov    %rcx,(%rax)
jmp    11ed <LED+0xed>
pop    %rbp
ret

x86 assembly (clang, -O2):
<LED>:
cmp    $0x1,%edi
je     1124 <LED+0x24>
cmp    $0x2,%edi
jne    1160 <LED+0x60>
test   %esi,%esi
je     113c <LED+0x3c>
cmp    $0x1,%esi
jne    1160 <LED+0x60>
mov    $0xbf7fc008,%ecx
lea    -0x3f7fc008(%rcx),%rax
or     (%rcx),%rax
jmp    1158 <LED+0x58>
test   %esi,%esi
je     114b <LED+0x4b>
cmp    $0x1,%esi
jne    1160 <LED+0x60>
mov    $0xbf7fc008,%ecx
mov    $0x200000,%eax
or     (%rcx),%rax
jmp    1158 <LED+0x58>
mov    $0xbf7fc008,%eax
mov    (%rax),%rax
and    $0x7fffffff,%eax
jmp    1158 <LED+0x58>
mov    $0xbf7fc008,%eax
mov    (%rax),%rax
and    $0xffdfffff,%eax
mov    $0xbf7fc008,%ecx
mov    %rax,(%rcx)
ret

LLVM IR (-O0):
define void @LED(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
switch i32 %5, label %24 [
i32 2, label %6
i32 1, label %15
]
6: ; preds = %2
%7 = load i32, i32* %4
switch i32 %7, label %14 [
i32 1, label %8
i32 0, label %11
]
8: ; preds = %6
%9 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%10 = or i64 %9, 2147483648
store i64 %10, i64* inttoptr (i64 3212820488 to i64*)
br label %14
11: ; preds = %6
%12 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%13 = and i64 %12, 2147483647
store i64 %13, i64* inttoptr (i64 3212820488 to i64*)
br label %14
14: ; preds = %6, %11, %8
br label %24
15: ; preds = %2
%16 = load i32, i32* %4
switch i32 %16, label %23 [
i32 1, label %17
i32 0, label %20
]
17: ; preds = %15
%18 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%19 = or i64 %18, 2097152
store i64 %19, i64* inttoptr (i64 3212820488 to i64*)
br label %23
20: ; preds = %15
%21 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%22 = and i64 %21, 4292870143
store i64 %22, i64* inttoptr (i64 3212820488 to i64*)
br label %23
23: ; preds = %15, %20, %17
br label %24
24: ; preds = %2, %23, %14
ret void
}

LLVM IR (-O2):
define void @LED(i32 %0, i32 %1) {
switch i32 %0, label %19 [
i32 2, label %3
i32 1, label %10
]
3: ; preds = %2
switch i32 %1, label %19 [
i32 1, label %4
i32 0, label %7
]
4: ; preds = %3
%5 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%6 = or i64 %5, 2147483648
br label %17
7: ; preds = %3
%8 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%9 = and i64 %8, 2147483647
br label %17
10: ; preds = %2
switch i32 %1, label %19 [
i32 1, label %11
i32 0, label %14
]
11: ; preds = %10
%12 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%13 = or i64 %12, 2097152
br label %17
14: ; preds = %10
%15 = load i64, i64* inttoptr (i64 3212820488 to i64*)
%16 = and i64 %15, 4292870143
br label %17
17: ; preds = %7, %4, %14, %11
%18 = phi i64 [ %13, %11 ], [ %16, %14 ], [ %6, %4 ], [ %9, %7 ]
store i64 %18, i64* inttoptr (i64 3212820488 to i64*)
br label %19
19: ; preds = %17, %10, %3, %2
ret void
}