void UnmaskCombineEvent(int efnum) {
  int indx;
  int num;
  unsigned long tmp;
  if (efnum < 4) {
    printf("bad efnum, you cannot combine 0-3 itself\n");
    return;
  }
  indx = efnum % 32;
  num = efnum / 32;
  tmp = ({
    unsigned long __v =
        (*(volatile unsigned long *)(((0x01800000 + 0x80) + (num * 4))));
    __v;
  });
  tmp &= ~(1 << indx);
  ({
    unsigned long __v = tmp;
    (*(volatile unsigned long *)(((0x01800000 + 0x80) + (num * 4))) = (__v));
    __v;
  });
}


x86 assembly (clang, -O0):
<UnmaskCombineEvent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x4,-0x4(%rbp)
jge    1138 <UnmaskCombineEvent+0x28>
lea    0xed4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b3 <UnmaskCombineEvent+0xa3>
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x1800080,%eax
cltq
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
cltq
and    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rcx
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    $0x1800080,%eax
cltq
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rax
mov    %rax,-0x38(%rbp)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<UnmaskCombineEvent>:
cmp    $0x3,%edi
jg     1121 <UnmaskCombineEvent+0x11>
lea    0xee4(%rip),%rdi
jmp    1030 <puts@plt>
mov    %edi,%eax
shr    $0x3,%eax
and    $0xfffffffc,%eax
mov    $0xfffffffe,%edx
mov    %edi,%ecx
rol    %cl,%edx
movslq %edx,%rcx
and    %rcx,0x1800080(%rax)
ret

LLVM IR (-O0):
@.str = [42 x i8] c"bad efnum, you cannot combine 0-3 itself\0A\00"
define void @UnmaskCombineEvent(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i32 %0, i32* %2
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, 4
br i1 %11, label %12, label %14
12: ; preds = %1
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %42
14: ; preds = %1
%15 = load i32, i32* %2
%16 = srem i32 %15, 32
store i32 %16, i32* %3
%17 = load i32, i32* %2
%18 = sdiv i32 %17, 32
store i32 %18, i32* %4
%19 = load i32, i32* %4
%20 = mul nsw i32 %19, 4
%21 = add nsw i32 25165952, %20
%22 = sext i32 %21 to i64
%23 = inttoptr i64 %22 to i64*
%24 = load volatile i64, i64* %23
store i64 %24, i64* %6
%25 = load i64, i64* %6
store i64 %25, i64* %7
%26 = load i64, i64* %7
store i64 %26, i64* %5
%27 = load i32, i32* %3
%28 = shl i32 1, %27
%29 = xor i32 %28, -1
%30 = sext i32 %29 to i64
%31 = load i64, i64* %5
%32 = and i64 %31, %30
store i64 %32, i64* %5
%33 = load i64, i64* %5
store i64 %33, i64* %8
%34 = load i64, i64* %8
%35 = load i32, i32* %4
%36 = mul nsw i32 %35, 4
%37 = add nsw i32 25165952, %36
%38 = sext i32 %37 to i64
%39 = inttoptr i64 %38 to i64*
store volatile i64 %34, i64* %39
%40 = load i64, i64* %8
store i64 %40, i64* %9
%41 = load i64, i64* %9
br label %42
42: ; preds = %14, %12
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"bad efnum, you cannot combine 0-3 itself\00"
define void @UnmaskCombineEvent(i32 %0) {
%2 = icmp slt i32 %0, 4
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %17
5: ; preds = %1
%6 = lshr i32 %0, 3
%7 = and i32 %6, 536870908
%8 = add nuw nsw i32 %7, 25165952
%9 = zext i32 %8 to i64
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = and i32 %0, 31
%13 = shl nuw i32 1, %12
%14 = xor i32 %13, -1
%15 = sext i32 %14 to i64
%16 = and i64 %11, %15
store volatile i64 %16, i64* %10
br label %17
17: ; preds = %5, %3
ret void
}