#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 CANMessageClear(uint32_t ui32Base, uint32_t ui32ObjID) {
  ;
  ;
  while ((*((volatile unsigned long *)(ui32Base + 0x00000020))) & 0x00008000) {
  }
  (*((volatile unsigned long *)(ui32Base + 0x00000024))) =
      0x00000080 | 0x00000020;
  (*((volatile unsigned long *)(ui32Base + 0x00000030))) = 0;
  (*((volatile unsigned long *)(ui32Base + 0x00000034))) = 0;
  (*((volatile unsigned long *)(ui32Base + 0x00000020))) =
      ui32ObjID & 0x0000003F;
}


x86 assembly (clang, -O0):
<CANMessageClear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    (%rax),%rax
and    $0x8000,%rax
cmp    $0x0,%rax
je     112a <CANMessageClear+0x2a>
jmp    110a <CANMessageClear+0xa>
mov    -0x4(%rbp),%eax
add    $0x24,%eax
cltq
movq   $0xa0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
movq   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
movq   $0x0,(%rax)
mov    -0x8(%rbp),%eax
and    $0x3f,%eax
movslq %eax,%rcx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANMessageClear>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testq  $0x8000,0x20(%rax)
jne    1110 <CANMessageClear+0x10>
movq   $0xa0,0x24(%rax)
movq   $0x0,0x30(%rax)
movq   $0x0,0x34(%rax)
and    $0x3f,%esi
mov    %rsi,0x20(%rax)
ret

LLVM IR (-O0):
define void @CANMessageClear(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
br label %5
5: ; preds = %13, %2
%6 = load i32, i32* %3
%7 = add nsw i32 %6, 32
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i64*
%10 = load volatile i64, i64* %9
%11 = and i64 %10, 32768
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %14
13: ; preds = %5
br label %5
14: ; preds = %5
%15 = load i32, i32* %3
%16 = add nsw i32 %15, 36
%17 = sext i32 %16 to i64
%18 = inttoptr i64 %17 to i64*
store volatile i64 160, i64* %18
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 48
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i64*
store volatile i64 0, i64* %22
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 52
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i64*
store volatile i64 0, i64* %26
%27 = load i32, i32* %4
%28 = and i32 %27, 63
%29 = sext i32 %28 to i64
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 32
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i64*
store volatile i64 %29, i64* %33
ret void
}

LLVM IR (-O2):
define void @CANMessageClear(i32 %0, i32 %1) {
%3 = add nsw i32 %0, 32
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i64*
br label %6
6: ; preds = %6, %2
%7 = load volatile i64, i64* %5
%8 = and i64 %7, 32768
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %6
10: ; preds = %6
%11 = add nsw i32 %0, 36
%12 = sext i32 %11 to i64
%13 = inttoptr i64 %12 to i64*
store volatile i64 160, i64* %13
%14 = add nsw i32 %0, 48
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i64*
store volatile i64 0, i64* %16
%17 = add nsw i32 %0, 52
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i64*
store volatile i64 0, i64* %19
%20 = and i32 %1, 63
%21 = zext i32 %20 to i64
store volatile i64 %21, i64* %5
ret void
}