void _pwmss_eqep_clk_disable(unsigned int device_id) {
  if (0 == device_id) {
    (*((volatile unsigned int *)((0x48300000) + (0x00000008u)))) &= 0xFFFFFFEFu;
    while (!((*((volatile unsigned int *)((0x48300000) + (0x00000008u)))) &
             0xFFFFFFEFu))
      ;
  } else if (1 == device_id) {
    (*((volatile unsigned int *)((0x48302000) + (0x00000008u)))) &= 0xFFFFFFEFu;
    while (!((*((volatile unsigned int *)((0x48302000) + (0x00000008u)))) &
             0xFFFFFFEFu))
      ;
  } else if (2 == device_id) {
    (*((volatile unsigned int *)((0x48304000) + (0x00000008u)))) &= 0xFFFFFFEFu;
    while (!((*((volatile unsigned int *)((0x48304000) + (0x00000008u)))) &
             0xFFFFFFEFu))
      ;
  } else {
    ;
  }
}


x86 assembly (clang, -O0):
<_pwmss_eqep_clk_disable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    114c <_pwmss_eqep_clk_disable+0x4c>
mov    $0x48300008,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x48300008,%eax
mov    %ecx,(%rax)
mov    $0x48300008,%eax
mov    (%rax),%eax
and    $0xffffffef,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1142 <_pwmss_eqep_clk_disable+0x42>
jmp    1147 <_pwmss_eqep_clk_disable+0x47>
jmp    1123 <_pwmss_eqep_clk_disable+0x23>
jmp    11eb <_pwmss_eqep_clk_disable+0xeb>
mov    $0x1,%eax
cmp    -0x4(%rbp),%eax
jne    1194 <_pwmss_eqep_clk_disable+0x94>
mov    $0x48302008,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x48302008,%eax
mov    %ecx,(%rax)
mov    $0x48302008,%eax
mov    (%rax),%eax
and    $0xffffffef,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    118a <_pwmss_eqep_clk_disable+0x8a>
jmp    118f <_pwmss_eqep_clk_disable+0x8f>
jmp    116b <_pwmss_eqep_clk_disable+0x6b>
jmp    11e6 <_pwmss_eqep_clk_disable+0xe6>
mov    $0x2,%eax
cmp    -0x4(%rbp),%eax
jne    11dc <_pwmss_eqep_clk_disable+0xdc>
mov    $0x48304008,%eax
mov    (%rax),%ecx
and    $0xffffffef,%ecx
mov    $0x48304008,%eax
mov    %ecx,(%rax)
mov    $0x48304008,%eax
mov    (%rax),%eax
and    $0xffffffef,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    11d2 <_pwmss_eqep_clk_disable+0xd2>
jmp    11d7 <_pwmss_eqep_clk_disable+0xd7>
jmp    11b3 <_pwmss_eqep_clk_disable+0xb3>
jmp    11e1 <_pwmss_eqep_clk_disable+0xe1>
jmp    11e1 <_pwmss_eqep_clk_disable+0xe1>
jmp    11e6 <_pwmss_eqep_clk_disable+0xe6>
jmp    11eb <_pwmss_eqep_clk_disable+0xeb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_pwmss_eqep_clk_disable>:
cmp    $0x2,%edi
je     112f <_pwmss_eqep_clk_disable+0x2f>
cmp    $0x1,%edi
je     114f <_pwmss_eqep_clk_disable+0x4f>
test   %edi,%edi
jne    116d <_pwmss_eqep_clk_disable+0x6d>
andl   $0xffffffef,0x48300008
ef
cs nopw 0x0(%rax,%rax,1)
testl  $0xffffffef,0x48300008
ef ff ff ff
je     1120 <_pwmss_eqep_clk_disable+0x20>
jmp    116d <_pwmss_eqep_clk_disable+0x6d>
andl   $0xffffffef,0x48304008
ef
nopw   0x0(%rax,%rax,1)
testl  $0xffffffef,0x48304008
ef ff ff ff
je     1140 <_pwmss_eqep_clk_disable+0x40>
jmp    116d <_pwmss_eqep_clk_disable+0x6d>
andl   $0xffffffef,0x48302008
ef
nopw   0x0(%rax,%rax,1)
testl  $0xffffffef,0x48302008
ef ff ff ff
je     1160 <_pwmss_eqep_clk_disable+0x60>
ret

LLVM IR (-O0):
define void @_pwmss_eqep_clk_disable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 0, %3
br i1 %4, label %5, label %15
5: ; preds = %1
%6 = load volatile i32, i32* inttoptr (i64 1211105288 to i32*)
%7 = and i32 %6, -17
store volatile i32 %7, i32* inttoptr (i64 1211105288 to i32*)
br label %8
8: ; preds = %13, %5
%9 = load volatile i32, i32* inttoptr (i64 1211105288 to i32*)
%10 = and i32 %9, -17
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
br i1 %12, label %13, label %14
13: ; preds = %8
br label %8
14: ; preds = %8
br label %44
15: ; preds = %1
%16 = load i32, i32* %2
%17 = icmp eq i32 1, %16
br i1 %17, label %18, label %28
18: ; preds = %15
%19 = load volatile i32, i32* inttoptr (i64 1211113480 to i32*)
%20 = and i32 %19, -17
store volatile i32 %20, i32* inttoptr (i64 1211113480 to i32*)
br label %21
21: ; preds = %26, %18
%22 = load volatile i32, i32* inttoptr (i64 1211113480 to i32*)
%23 = and i32 %22, -17
%24 = icmp ne i32 %23, 0
%25 = xor i1 %24, true
br i1 %25, label %26, label %27
26: ; preds = %21
br label %21
27: ; preds = %21
br label %43
28: ; preds = %15
%29 = load i32, i32* %2
%30 = icmp eq i32 2, %29
br i1 %30, label %31, label %41
31: ; preds = %28
%32 = load volatile i32, i32* inttoptr (i64 1211121672 to i32*)
%33 = and i32 %32, -17
store volatile i32 %33, i32* inttoptr (i64 1211121672 to i32*)
br label %34
34: ; preds = %39, %31
%35 = load volatile i32, i32* inttoptr (i64 1211121672 to i32*)
%36 = and i32 %35, -17
%37 = icmp ne i32 %36, 0
%38 = xor i1 %37, true
br i1 %38, label %39, label %40
39: ; preds = %34
br label %34
40: ; preds = %34
br label %42
41: ; preds = %28
br label %42
42: ; preds = %41, %40
br label %43
43: ; preds = %42, %27
br label %44
44: ; preds = %43, %14
ret void
}

LLVM IR (-O2):
define void @_pwmss_eqep_clk_disable(i32 %0) {
switch i32 %0, label %23 [
i32 0, label %2
i32 1, label %9
i32 2, label %16
]
2: ; preds = %1
%3 = load volatile i32, i32* inttoptr (i64 1211105288 to i32*)
%4 = and i32 %3, -17
store volatile i32 %4, i32* inttoptr (i64 1211105288 to i32*)
br label %5
5: ; preds = %5, %2
%6 = load volatile i32, i32* inttoptr (i64 1211105288 to i32*)
%7 = and i32 %6, -17
%8 = icmp eq i32 %7, 0
br i1 %8, label %5, label %23
9: ; preds = %1
%10 = load volatile i32, i32* inttoptr (i64 1211113480 to i32*)
%11 = and i32 %10, -17
store volatile i32 %11, i32* inttoptr (i64 1211113480 to i32*)
br label %12
12: ; preds = %12, %9
%13 = load volatile i32, i32* inttoptr (i64 1211113480 to i32*)
%14 = and i32 %13, -17
%15 = icmp eq i32 %14, 0
br i1 %15, label %12, label %23
16: ; preds = %1
%17 = load volatile i32, i32* inttoptr (i64 1211121672 to i32*)
%18 = and i32 %17, -17
store volatile i32 %18, i32* inttoptr (i64 1211121672 to i32*)
br label %19
19: ; preds = %19, %16
%20 = load volatile i32, i32* inttoptr (i64 1211121672 to i32*)
%21 = and i32 %20, -17
%22 = icmp eq i32 %21, 0
br i1 %22, label %19, label %23
23: ; preds = %19, %12, %5, %1
ret void
}