void set_usb_phy_config(int cfg) {
  int divider = 0;
  int clk_sel = 0;
  int i;
  int time_dly = 500;
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) = ((
      (*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) & (~((7 << 5)))));
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) &
        (~((0x7f << 24)))));
  if (cfg == 0) {
    clk_sel = 1;
    divider = 0;
  } else {
    clk_sel = 3;
    divider = 49;
  }
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) |
        ((divider << 24))));
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) |
        ((clk_sel << 5))));
  *(volatile unsigned *)(0xc1100000 + ((0x2104) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2104) << 2))) | ((1 << 23))));
  *(volatile unsigned *)(0xc1100000 + ((0x2104) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2104) << 2))) | ((1 << 24))));
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) | ((1 << 8))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) | ((1 << 17))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) = ((
      (*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) & (~((1 << 17)))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) | ((1 << 18))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) = ((
      (*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) & (~((1 << 18)))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) | ((1 << 19))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) = ((
      (*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) & (~((1 << 19)))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) =
      (((*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) | ((1 << 0))));
  i = 0;
  while (i++ < time_dly) {
  };
  *(volatile unsigned *)(0xc1100000 + ((0x2100) << 2)) = ((
      (*(volatile unsigned *)(0xc1100000 + ((0x2100) << 2))) & (~((1 << 0)))));
  i = 0;
  while (i++ < time_dly) {
  };
}


x86 assembly (clang, -O0):
<set_usb_phy_config>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x1f4,-0x14(%rbp)
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0xffffff1f,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0x80ffffff,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
cmpl   $0x0,-0x4(%rbp)
jne    1161 <set_usb_phy_config+0x61>
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
jmp    116f <set_usb_phy_config+0x6f>
movl   $0x3,-0xc(%rbp)
movl   $0x31,-0x8(%rbp)
mov    $0xc1108400,%eax
mov    (%rax),%ecx
mov    -0x8(%rbp),%eax
shl    $0x18,%eax
or     %eax,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
mov    $0xc1108400,%eax
mov    (%rax),%ecx
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
or     %eax,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
mov    $0xc1108410,%eax
mov    (%rax),%ecx
or     $0x800000,%ecx
mov    $0xc1108410,%eax
mov    %ecx,(%rax)
mov    $0xc1108410,%eax
mov    (%rax),%ecx
or     $0x1000000,%ecx
mov    $0xc1108410,%eax
mov    %ecx,(%rax)
mov    $0xc1108400,%eax
mov    (%rax),%ecx
or     $0x100,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    11f7 <set_usb_phy_config+0xf7>
jmp    11de <set_usb_phy_config+0xde>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
or     $0x20000,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    122b <set_usb_phy_config+0x12b>
jmp    1212 <set_usb_phy_config+0x112>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0xfffdffff,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    125f <set_usb_phy_config+0x15f>
jmp    1246 <set_usb_phy_config+0x146>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
or     $0x40000,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    1293 <set_usb_phy_config+0x193>
jmp    127a <set_usb_phy_config+0x17a>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0xfffbffff,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    12c7 <set_usb_phy_config+0x1c7>
jmp    12ae <set_usb_phy_config+0x1ae>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
or     $0x80000,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    12fb <set_usb_phy_config+0x1fb>
jmp    12e2 <set_usb_phy_config+0x1e2>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0xfff7ffff,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    132f <set_usb_phy_config+0x22f>
jmp    1316 <set_usb_phy_config+0x216>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    1360 <set_usb_phy_config+0x260>
jmp    1347 <set_usb_phy_config+0x247>
mov    $0xc1108400,%eax
mov    (%rax),%ecx
and    $0xfffffffe,%ecx
mov    $0xc1108400,%eax
mov    %ecx,(%rax)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x10(%rbp)
cmp    -0x14(%rbp),%eax
jge    1391 <set_usb_phy_config+0x291>
jmp    1378 <set_usb_phy_config+0x278>
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_usb_phy_config>:
mov    $0xc1108400,%eax
andl   $0xffffff1f,(%rax)
andl   $0x80ffffff,(%rax)
xor    %ecx,%ecx
test   %edi,%edi
mov    $0x31000000,%edx
cmove  %edi,%edx
setne  %cl
or     %edx,(%rax)
shl    $0x6,%ecx
or     (%rax),%ecx
or     $0x20,%ecx
mov    %ecx,(%rax)
orl    $0x800000,0x10(%rax)
orl    $0x1000000,0x10(%rax)
orl    $0x100,(%rax)
orl    $0x20000,(%rax)
andl   $0xfffdffff,(%rax)
orl    $0x40000,(%rax)
andl   $0xfffbffff,(%rax)
orl    $0x80000,(%rax)
andl   $0xfff7ffff,(%rax)
orl    $0x1,(%rax)
andl   $0xfffffffe,(%rax)
ret

LLVM IR (-O0):
define void @set_usb_phy_config(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 500, i32* %6
%7 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%8 = and i32 %7, -225
store volatile i32 %8, i32* inttoptr (i64 3239085056 to i32*)
%9 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%10 = and i32 %9, -2130706433
store volatile i32 %10, i32* inttoptr (i64 3239085056 to i32*)
%11 = load i32, i32* %2
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %1
store i32 1, i32* %4
store i32 0, i32* %3
br label %15
14: ; preds = %1
store i32 3, i32* %4
store i32 49, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%17 = load i32, i32* %3
%18 = shl i32 %17, 24
%19 = or i32 %16, %18
store volatile i32 %19, i32* inttoptr (i64 3239085056 to i32*)
%20 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%21 = load i32, i32* %4
%22 = shl i32 %21, 5
%23 = or i32 %20, %22
store volatile i32 %23, i32* inttoptr (i64 3239085056 to i32*)
%24 = load volatile i32, i32* inttoptr (i64 3239085072 to i32*)
%25 = or i32 %24, 8388608
store volatile i32 %25, i32* inttoptr (i64 3239085072 to i32*)
%26 = load volatile i32, i32* inttoptr (i64 3239085072 to i32*)
%27 = or i32 %26, 16777216
store volatile i32 %27, i32* inttoptr (i64 3239085072 to i32*)
%28 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%29 = or i32 %28, 256
store volatile i32 %29, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %30
30: ; preds = %35, %15
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
store i32 %32, i32* %5
%33 = load i32, i32* %6
%34 = icmp slt i32 %31, %33
br i1 %34, label %35, label %36
35: ; preds = %30
br label %30
36: ; preds = %30
%37 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%38 = or i32 %37, 131072
store volatile i32 %38, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %39
39: ; preds = %44, %36
%40 = load i32, i32* %5
%41 = add nsw i32 %40, 1
store i32 %41, i32* %5
%42 = load i32, i32* %6
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %45
44: ; preds = %39
br label %39
45: ; preds = %39
%46 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%47 = and i32 %46, -131073
store volatile i32 %47, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %48
48: ; preds = %53, %45
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
%51 = load i32, i32* %6
%52 = icmp slt i32 %49, %51
br i1 %52, label %53, label %54
53: ; preds = %48
br label %48
54: ; preds = %48
%55 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%56 = or i32 %55, 262144
store volatile i32 %56, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %57
57: ; preds = %62, %54
%58 = load i32, i32* %5
%59 = add nsw i32 %58, 1
store i32 %59, i32* %5
%60 = load i32, i32* %6
%61 = icmp slt i32 %58, %60
br i1 %61, label %62, label %63
62: ; preds = %57
br label %57
63: ; preds = %57
%64 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%65 = and i32 %64, -262145
store volatile i32 %65, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %66
66: ; preds = %71, %63
%67 = load i32, i32* %5
%68 = add nsw i32 %67, 1
store i32 %68, i32* %5
%69 = load i32, i32* %6
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %72
71: ; preds = %66
br label %66
72: ; preds = %66
%73 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%74 = or i32 %73, 524288
store volatile i32 %74, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %75
75: ; preds = %80, %72
%76 = load i32, i32* %5
%77 = add nsw i32 %76, 1
store i32 %77, i32* %5
%78 = load i32, i32* %6
%79 = icmp slt i32 %76, %78
br i1 %79, label %80, label %81
80: ; preds = %75
br label %75
81: ; preds = %75
%82 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%83 = and i32 %82, -524289
store volatile i32 %83, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %84
84: ; preds = %89, %81
%85 = load i32, i32* %5
%86 = add nsw i32 %85, 1
store i32 %86, i32* %5
%87 = load i32, i32* %6
%88 = icmp slt i32 %85, %87
br i1 %88, label %89, label %90
89: ; preds = %84
br label %84
90: ; preds = %84
%91 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%92 = or i32 %91, 1
store volatile i32 %92, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %93
93: ; preds = %98, %90
%94 = load i32, i32* %5
%95 = add nsw i32 %94, 1
store i32 %95, i32* %5
%96 = load i32, i32* %6
%97 = icmp slt i32 %94, %96
br i1 %97, label %98, label %99
98: ; preds = %93
br label %93
99: ; preds = %93
%100 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%101 = and i32 %100, -2
store volatile i32 %101, i32* inttoptr (i64 3239085056 to i32*)
store i32 0, i32* %5
br label %102
102: ; preds = %107, %99
%103 = load i32, i32* %5
%104 = add nsw i32 %103, 1
store i32 %104, i32* %5
%105 = load i32, i32* %6
%106 = icmp slt i32 %103, %105
br i1 %106, label %107, label %108
107: ; preds = %102
br label %102
108: ; preds = %102
ret void
}

LLVM IR (-O2):
define void @set_usb_phy_config(i32 %0) {
%2 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%3 = and i32 %2, -225
store volatile i32 %3, i32* inttoptr (i64 3239085056 to i32*)
%4 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%5 = and i32 %4, -2130706433
store volatile i32 %5, i32* inttoptr (i64 3239085056 to i32*)
%6 = icmp eq i32 %0, 0
%7 = select i1 %6, i32 32, i32 96
%8 = select i1 %6, i32 0, i32 822083584
%9 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%10 = or i32 %9, %8
store volatile i32 %10, i32* inttoptr (i64 3239085056 to i32*)
%11 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%12 = or i32 %11, %7
store volatile i32 %12, i32* inttoptr (i64 3239085056 to i32*)
%13 = load volatile i32, i32* inttoptr (i64 3239085072 to i32*)
%14 = or i32 %13, 8388608
store volatile i32 %14, i32* inttoptr (i64 3239085072 to i32*)
%15 = load volatile i32, i32* inttoptr (i64 3239085072 to i32*)
%16 = or i32 %15, 16777216
store volatile i32 %16, i32* inttoptr (i64 3239085072 to i32*)
%17 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%18 = or i32 %17, 256
store volatile i32 %18, i32* inttoptr (i64 3239085056 to i32*)
%19 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%20 = or i32 %19, 131072
store volatile i32 %20, i32* inttoptr (i64 3239085056 to i32*)
%21 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%22 = and i32 %21, -131073
store volatile i32 %22, i32* inttoptr (i64 3239085056 to i32*)
%23 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%24 = or i32 %23, 262144
store volatile i32 %24, i32* inttoptr (i64 3239085056 to i32*)
%25 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%26 = and i32 %25, -262145
store volatile i32 %26, i32* inttoptr (i64 3239085056 to i32*)
%27 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%28 = or i32 %27, 524288
store volatile i32 %28, i32* inttoptr (i64 3239085056 to i32*)
%29 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%30 = and i32 %29, -524289
store volatile i32 %30, i32* inttoptr (i64 3239085056 to i32*)
%31 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%32 = or i32 %31, 1
store volatile i32 %32, i32* inttoptr (i64 3239085056 to i32*)
%33 = load volatile i32, i32* inttoptr (i64 3239085056 to i32*)
%34 = and i32 %33, -2
store volatile i32 %34, i32* inttoptr (i64 3239085056 to i32*)
ret void
}