#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelAttributeEnable(uint32_t ui32ChannelNum, uint32_t ui32Attr) {
  ;

  ;
  ui32ChannelNum &= 0x1f;
  if (ui32Attr & 0x00000001) {
    (*((volatile uint32_t *)(0x400FF018))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000002) {
    (*((volatile uint32_t *)(0x400FF030))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000004) {
    (*((volatile uint32_t *)(0x400FF038))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000008) {
    (*((volatile uint32_t *)(0x400FF020))) = 1 << ui32ChannelNum;
  }
}


x86 assembly (clang, -O0):
<uDMAChannelAttributeEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1135 <uDMAChannelAttributeEnable+0x35>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff018,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1157 <uDMAChannelAttributeEnable+0x57>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff030,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1179 <uDMAChannelAttributeEnable+0x79>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff038,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     119b <uDMAChannelAttributeEnable+0x9b>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff020,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelAttributeEnable>:
mov    %edi,%ecx
and    $0x1f,%ecx
test   $0x1,%sil
jne    111e <uDMAChannelAttributeEnable+0x1e>
test   $0x2,%sil
jne    1132 <uDMAChannelAttributeEnable+0x32>
test   $0x4,%sil
jne    1146 <uDMAChannelAttributeEnable+0x46>
test   $0x8,%sil
jne    115a <uDMAChannelAttributeEnable+0x5a>
ret
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff018
test   $0x2,%sil
je     1111 <uDMAChannelAttributeEnable+0x11>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff030
test   $0x4,%sil
je     1117 <uDMAChannelAttributeEnable+0x17>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff038
test   $0x8,%sil
je     111d <uDMAChannelAttributeEnable+0x1d>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff020
ret

LLVM IR (-O0):
define void @uDMAChannelAttributeEnable(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
%6 = and i32 %5, 31
store i32 %6, i32* %3
%7 = load i32, i32* %4
%8 = and i32 %7, 1
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = shl i32 1, %11
store volatile i32 %12, i32* inttoptr (i64 1074786328 to i32*)
br label %13
13: ; preds = %10, %2
%14 = load i32, i32* %4
%15 = and i32 %14, 2
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %13
%18 = load i32, i32* %3
%19 = shl i32 1, %18
store volatile i32 %19, i32* inttoptr (i64 1074786352 to i32*)
br label %20
20: ; preds = %17, %13
%21 = load i32, i32* %4
%22 = and i32 %21, 4
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %27
24: ; preds = %20
%25 = load i32, i32* %3
%26 = shl i32 1, %25
store volatile i32 %26, i32* inttoptr (i64 1074786360 to i32*)
br label %27
27: ; preds = %24, %20
%28 = load i32, i32* %4
%29 = and i32 %28, 8
%30 = icmp ne i32 %29, 0
br i1 %30, label %31, label %34
31: ; preds = %27
%32 = load i32, i32* %3
%33 = shl i32 1, %32
store volatile i32 %33, i32* inttoptr (i64 1074786336 to i32*)
br label %34
34: ; preds = %31, %27
ret void
}

LLVM IR (-O2):
define void @uDMAChannelAttributeEnable(i32 %0, i32 %1) {
%3 = and i32 %0, 31
%4 = and i32 %1, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = shl nuw i32 1, %3
store volatile i32 %7, i32* inttoptr (i64 1074786328 to i32*)
br label %8
8: ; preds = %6, %2
%9 = and i32 %1, 2
%10 = icmp eq i32 %9, 0
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = shl nuw i32 1, %3
store volatile i32 %12, i32* inttoptr (i64 1074786352 to i32*)
br label %13
13: ; preds = %11, %8
%14 = and i32 %1, 4
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = shl nuw i32 1, %3
store volatile i32 %17, i32* inttoptr (i64 1074786360 to i32*)
br label %18
18: ; preds = %16, %13
%19 = and i32 %1, 8
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = shl nuw i32 1, %3
store volatile i32 %22, i32* inttoptr (i64 1074786336 to i32*)
br label %23
23: ; preds = %21, %18
ret void
}