#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 uint32_t *)(ui32Base + 0x00000020))) & 0x00008000) {
  }
  (*((volatile uint32_t *)(ui32Base + 0x00000024))) = 0x00000080 | 0x00000020;
  (*((volatile uint32_t *)(ui32Base + 0x00000030))) = 0;
  (*((volatile uint32_t *)(ui32Base + 0x00000034))) = 0;
  (*((volatile uint32_t *)(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),%eax
and    $0x8000,%eax
cmp    $0x0,%eax
je     1127 <CANMessageClear+0x27>
jmp    110a <CANMessageClear+0xa>
mov    -0x4(%rbp),%eax
add    $0x24,%eax
cltq
movl   $0xa0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%eax
cltq
movl   $0x0,(%rax)
mov    -0x4(%rbp),%eax
add    $0x34,%eax
cltq
movl   $0x0,(%rax)
mov    -0x8(%rbp),%ecx
and    $0x3f,%ecx
mov    -0x4(%rbp),%eax
add    $0x20,%eax
cltq
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<CANMessageClear>:
movslq %edi,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
testl  $0x8000,0x20(%rax)
jne    1110 <CANMessageClear+0x10>
movl   $0xa0,0x24(%rax)
movl   $0x0,0x30(%rax)
movl   $0x0,0x34(%rax)
and    $0x3f,%esi
mov    %esi,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 i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 32768
%12 = icmp ne i32 %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 i32*
store volatile i32 160, i32* %18
%19 = load i32, i32* %3
%20 = add nsw i32 %19, 48
%21 = sext i32 %20 to i64
%22 = inttoptr i64 %21 to i32*
store volatile i32 0, i32* %22
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 52
%25 = sext i32 %24 to i64
%26 = inttoptr i64 %25 to i32*
store volatile i32 0, i32* %26
%27 = load i32, i32* %4
%28 = and i32 %27, 63
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 32
%31 = sext i32 %30 to i64
%32 = inttoptr i64 %31 to i32*
store volatile i32 %28, i32* %32
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 i32*
br label %6
6: ; preds = %6, %2
%7 = load volatile i32, i32* %5
%8 = and i32 %7, 32768
%9 = icmp eq i32 %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 i32*
store volatile i32 160, i32* %13
%14 = add nsw i32 %0, 48
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i32*
store volatile i32 0, i32* %16
%17 = add nsw i32 %0, 52
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 0, i32* %19
%20 = and i32 %1, 63
store volatile i32 %20, i32* %5
ret void
}