#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 ADCSequenceConfigure(uint32_t ui32Base, uint32_t ui32SequenceNum,
                          uint32_t ui32Trigger, uint32_t ui32Priority) {
  ;
  ;

  ;
  ;
  ui32SequenceNum *= 4;
  (*((volatile uint32_t *)(ui32Base + 0x00000014))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000014))) &
        ~(0xf << ui32SequenceNum)) |
       ((ui32Trigger & 0xf) << ui32SequenceNum));
  (*((volatile uint32_t *)(ui32Base + 0x00000020))) =
      (((*((volatile uint32_t *)(ui32Base + 0x00000020))) &
        ~(0xf << ui32SequenceNum)) |
       ((ui32Priority & 0x3) << ui32SequenceNum));
}


x86 assembly (clang, -O0):
<ADCSequenceConfigure>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
mov    $0xf,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
and    $0xf,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x18(%rbp),%ecx
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x14,%eax
cltq
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%eax
mov    -0x8(%rbp),%ecx
mov    $0xf,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
and    $0x3,%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    -0x14(%rbp),%ecx
or     %eax,%ecx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ADCSequenceConfigure>:
mov    %ecx,%eax
lea    0x0(,%rsi,4),%ecx
movslq %edi,%r8
mov    $0xf,%edi
shl    %cl,%edi
not    %edi
and    $0xf,%edx
shl    %cl,%edx
mov    0x14(%r8),%esi
and    %edi,%esi
or     %esi,%edx
mov    %edx,0x14(%r8)
and    $0x3,%eax
shl    %cl,%eax
and    0x20(%r8),%edi
or     %edi,%eax
mov    %eax,0x20(%r8)
ret

LLVM IR (-O0):
define void @ADCSequenceConfigure(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %6
%10 = mul nsw i32 %9, 4
store i32 %10, i32* %6
%11 = load i32, i32* %5
%12 = add nsw i32 %11, 20
%13 = sext i32 %12 to i64
%14 = inttoptr i64 %13 to i32*
%15 = load volatile i32, i32* %14
%16 = load i32, i32* %6
%17 = shl i32 15, %16
%18 = xor i32 %17, -1
%19 = and i32 %15, %18
%20 = load i32, i32* %7
%21 = and i32 %20, 15
%22 = load i32, i32* %6
%23 = shl i32 %21, %22
%24 = or i32 %19, %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 20
%27 = sext i32 %26 to i64
%28 = inttoptr i64 %27 to i32*
store volatile i32 %24, i32* %28
%29 = load i32, i32* %5
%30 = add nsw i32 %29, 32
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
%33 = load volatile i32, i32* %32
%34 = load i32, i32* %6
%35 = shl i32 15, %34
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = load i32, i32* %8
%39 = and i32 %38, 3
%40 = load i32, i32* %6
%41 = shl i32 %39, %40
%42 = or i32 %37, %41
%43 = load i32, i32* %5
%44 = add nsw i32 %43, 32
%45 = sext i32 %44 to i64
%46 = inttoptr i64 %45 to i32*
store volatile i32 %42, i32* %46
ret void
}

LLVM IR (-O2):
define void @ADCSequenceConfigure(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = shl nsw i32 %1, 2
%6 = add nsw i32 %0, 20
%7 = sext i32 %6 to i64
%8 = inttoptr i64 %7 to i32*
%9 = load volatile i32, i32* %8
%10 = shl i32 15, %5
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = and i32 %2, 15
%14 = shl i32 %13, %5
%15 = or i32 %12, %14
store volatile i32 %15, i32* %8
%16 = add nsw i32 %0, 32
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i32*
%19 = load volatile i32, i32* %18
%20 = and i32 %19, %11
%21 = and i32 %3, 3
%22 = shl i32 %21, %5
%23 = or i32 %20, %22
store volatile i32 %23, i32* %18
ret void
}