#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 uint32_t *)(0x400FF01C))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000002) {
    (*((volatile uint32_t *)(0x400FF034))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000004) {
    (*((volatile uint32_t *)(0x400FF03C))) = 1 << ui32ChannelNum;
  }
  if (ui32Attr & 0x00000008) {
    (*((volatile uint32_t *)(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     1135 <uDMAChannelAttributeDisable+0x35>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff01c,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     1157 <uDMAChannelAttributeDisable+0x57>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff034,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
je     1179 <uDMAChannelAttributeDisable+0x79>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff03c,%eax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     119b <uDMAChannelAttributeDisable+0x9b>
mov    -0x4(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff024,%eax
mov    %ecx,(%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    1132 <uDMAChannelAttributeDisable+0x32>
test   $0x4,%sil
jne    1146 <uDMAChannelAttributeDisable+0x46>
test   $0x8,%sil
jne    115a <uDMAChannelAttributeDisable+0x5a>
ret
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff01c
test   $0x2,%sil
je     1111 <uDMAChannelAttributeDisable+0x11>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff034
test   $0x4,%sil
je     1117 <uDMAChannelAttributeDisable+0x17>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff03c
test   $0x8,%sil
je     111d <uDMAChannelAttributeDisable+0x1d>
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff024
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 %13
10: ; preds = %2
%11 = load i32, i32* %3
%12 = shl i32 1, %11
store volatile i32 %12, i32* inttoptr (i64 1074786332 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 1074786356 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 1074786364 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 1074786340 to i32*)
br label %34
34: ; preds = %31, %27
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 %8, label %6
6: ; preds = %2
%7 = shl nuw i32 1, %3
store volatile i32 %7, i32* inttoptr (i64 1074786332 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 1074786356 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 1074786364 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 1074786340 to i32*)
br label %23
23: ; preds = %21, %18
ret void
}