#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 uDMAChannelAttributeDisable(uint32_t ui32ChannelNum, uint32_t ui32Attr) {
  ;

  ;
  ui32ChannelNum &= 0x1f;
  if (ui32Attr & 0x00000001) {
    (*((volatile unsigned long *)(0x400FF01C))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000002) {
    (*((volatile unsigned long *)(0x400FF034))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000004) {
    (*((volatile unsigned long *)(0x400FF03C))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000008) {
    (*((volatile unsigned long *)(0x400FF024))) = 1 << ui32ChannelNum;
  }
}


x86 assembly (clang, -O0):
<uDMAChannelAttributeDisable>:
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     1137 <uDMAChannelAttributeDisable+0x37>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff01c,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     115b <uDMAChannelAttributeDisable+0x5b>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff034,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     117f <uDMAChannelAttributeDisable+0x7f>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff03c,%eax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     11a3 <uDMAChannelAttributeDisable+0xa3>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
movslq %eax,%rcx
mov    $0x400ff024,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelAttributeDisable>:
mov    %edi,%ecx
and    $0x1f,%ecx
test   $0x1,%sil
jne    111e <uDMAChannelAttributeDisable+0x1e>
test   $0x2,%sil
jne    1135 <uDMAChannelAttributeDisable+0x35>
test   $0x4,%sil
jne    114c <uDMAChannelAttributeDisable+0x4c>
test   $0x8,%sil
jne    1163 <uDMAChannelAttributeDisable+0x63>
ret
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff01c
40
test   $0x2,%sil
je     1111 <uDMAChannelAttributeDisable+0x11>
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff034
40
test   $0x4,%sil
je     1117 <uDMAChannelAttributeDisable+0x17>
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff03c
40
test   $0x8,%sil
je     111d <uDMAChannelAttributeDisable+0x1d>
mov    $0x1,%eax
shl    %cl,%eax
cltq
mov    %rax,0x400ff024
40
ret

LLVM IR (-O0):
define void @uDMAChannelAttributeDisable(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 %14
10: ; preds = %2
%11 = load i32, i32* %3
%12 = shl i32 1, %11
%13 = sext i32 %12 to i64
store volatile i64 %13, i64* inttoptr (i64 1074786332 to i64*)
br label %14
14: ; preds = %10, %2
%15 = load i32, i32* %4
%16 = and i32 %15, 2
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %14
%19 = load i32, i32* %3
%20 = shl i32 1, %19
%21 = sext i32 %20 to i64
store volatile i64 %21, i64* inttoptr (i64 1074786356 to i64*)
br label %22
22: ; preds = %18, %14
%23 = load i32, i32* %4
%24 = and i32 %23, 4
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = load i32, i32* %3
%28 = shl i32 1, %27
%29 = sext i32 %28 to i64
store volatile i64 %29, i64* inttoptr (i64 1074786364 to i64*)
br label %30
30: ; preds = %26, %22
%31 = load i32, i32* %4
%32 = and i32 %31, 8
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %38
34: ; preds = %30
%35 = load i32, i32* %3
%36 = shl i32 1, %35
%37 = sext i32 %36 to i64
store volatile i64 %37, i64* inttoptr (i64 1074786340 to i64*)
br label %38
38: ; preds = %34, %30
ret void
}

LLVM IR (-O2):
define void @uDMAChannelAttributeDisable(i32 %0, i32 %1) {
%3 = and i32 %0, 31
%4 = and i32 %1, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %9, label %6
6: ; preds = %2
%7 = shl nuw i32 1, %3
%8 = sext i32 %7 to i64
store volatile i64 %8, i64* inttoptr (i64 1074786332 to i64*)
br label %9
9: ; preds = %6, %2
%10 = and i32 %1, 2
%11 = icmp eq i32 %10, 0
br i1 %11, label %15, label %12
12: ; preds = %9
%13 = shl nuw i32 1, %3
%14 = sext i32 %13 to i64
store volatile i64 %14, i64* inttoptr (i64 1074786356 to i64*)
br label %15
15: ; preds = %12, %9
%16 = and i32 %1, 4
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = shl nuw i32 1, %3
%20 = sext i32 %19 to i64
store volatile i64 %20, i64* inttoptr (i64 1074786364 to i64*)
br label %21
21: ; preds = %18, %15
%22 = and i32 %1, 8
%23 = icmp eq i32 %22, 0
br i1 %23, label %27, label %24
24: ; preds = %21
%25 = shl nuw i32 1, %3
%26 = sext i32 %25 to i64
store volatile i64 %26, i64* inttoptr (i64 1074786340 to i64*)
br label %27
27: ; preds = %24, %21
ret void
}