#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 */

/* Variables and functions */
int /*<<< orphan*/ ConfigureBridge();
int /*<<< orphan*/ ConfigureCANInterface(int);
int /*<<< orphan*/ Delay(int);
void ConfigureCAN(void) {
  (*((volatile unsigned long *)(0x400FE060))) &= ~(0x00000001);
  Delay(524288);
  (*((volatile unsigned long *)(0x400FE060))) =
      (((*((volatile unsigned long *)(0x400FE060))) &
        ~(0x000007C0 | 0x00000030)) |
       0x00000540 | 0x00000000);
  (*((volatile unsigned long *)(0x400FE140))) =
      ((16000000 + 999999) / 1000000) - 1;
  (*((volatile unsigned long *)(0x400FE100))) |= 0x01000000;
  (*((volatile unsigned long *)(0x400FE108))) |= 0x00000001;
  Delay(3);
  (*((volatile unsigned long *)(0x40004000 + 0x00000420))) |=
      (1 << 4) | (1 << 5);
  (*((volatile unsigned long *)(0x40004000 + 0x0000051C))) |=
      (1 << 4) | (1 << 5);
  ConfigureBridge();
  ConfigureCANInterface(1);
}


x86 assembly (clang, -O0):
<ConfigureCAN>:
push   %rbp
mov    %rsp,%rbp
mov    $0x400fe060,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0x400fe060,%eax
mov    %rcx,(%rax)
mov    $0x80000,%edi
call   1030 <Delay@plt>
mov    $0x400fe060,%eax
mov    (%rax),%rcx
and    $0xfffffffffffff80f,%rcx
or     $0x540,%rcx
or     $0x0,%rcx
mov    $0x400fe060,%eax
mov    %rcx,(%rax)
mov    $0x400fe140,%eax
movq   $0xf,(%rax)
mov    $0x400fe100,%eax
mov    (%rax),%rcx
or     $0x1000000,%rcx
mov    $0x400fe100,%eax
mov    %rcx,(%rax)
mov    $0x400fe108,%eax
mov    (%rax),%rcx
or     $0x1,%rcx
mov    $0x400fe108,%eax
mov    %rcx,(%rax)
mov    $0x3,%edi
call   1030 <Delay@plt>
mov    $0x40004420,%eax
mov    (%rax),%rcx
or     $0x30,%rcx
mov    $0x40004420,%eax
mov    %rcx,(%rax)
mov    $0x4000451c,%eax
mov    (%rax),%rcx
or     $0x30,%rcx
mov    $0x4000451c,%eax
mov    %rcx,(%rax)
mov    $0x0,%al
call   1040 <ConfigureBridge@plt>
mov    $0x1,%edi
call   1050 <ConfigureCANInterface@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ConfigureCAN>:
push   %rax
andq   $0xfffffffffffffffe,0x400fe060
40 fe
mov    $0x80000,%edi
call   1030 <Delay@plt>
mov    $0xfffffffffffff80f,%rax
and    0x400fe060,%rax
40
or     $0x540,%rax
mov    %rax,0x400fe060
40
movq   $0xf,0x400fe140
orq    $0x1000000,0x400fe100
orq    $0x1,0x400fe108
40 01
mov    $0x3,%edi
call   1030 <Delay@plt>
orq    $0x30,0x40004420
40 30
orq    $0x30,0x4000451c
40 30
xor    %eax,%eax
call   1040 <ConfigureBridge@plt>
mov    $0x1,%edi
pop    %rax
jmp    1050 <ConfigureCANInterface@plt>

LLVM IR (-O0):
define void @ConfigureCAN() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1074782304 to i64*)
%3 = call i32 @Delay(i32 524288)
%4 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%5 = and i64 %4, -2033
%6 = or i64 %5, 1344
%7 = or i64 %6, 0
store volatile i64 %7, i64* inttoptr (i64 1074782304 to i64*)
store volatile i64 15, i64* inttoptr (i64 1074782528 to i64*)
%8 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%9 = or i64 %8, 16777216
store volatile i64 %9, i64* inttoptr (i64 1074782464 to i64*)
%10 = load volatile i64, i64* inttoptr (i64 1074782472 to i64*)
%11 = or i64 %10, 1
store volatile i64 %11, i64* inttoptr (i64 1074782472 to i64*)
%12 = call i32 @Delay(i32 3)
%13 = load volatile i64, i64* inttoptr (i64 1073759264 to i64*)
%14 = or i64 %13, 48
store volatile i64 %14, i64* inttoptr (i64 1073759264 to i64*)
%15 = load volatile i64, i64* inttoptr (i64 1073759516 to i64*)
%16 = or i64 %15, 48
store volatile i64 %16, i64* inttoptr (i64 1073759516 to i64*)
%17 = call i32 (...) @ConfigureBridge()
%18 = call i32 @ConfigureCANInterface(i32 1)
ret void
}

LLVM IR (-O2):
define void @ConfigureCAN() {
%1 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 1074782304 to i64*)
%3 = tail call i32 @Delay(i32 524288)
%4 = load volatile i64, i64* inttoptr (i64 1074782304 to i64*)
%5 = and i64 %4, -2033
%6 = or i64 %5, 1344
store volatile i64 %6, i64* inttoptr (i64 1074782304 to i64*)
store volatile i64 15, i64* inttoptr (i64 1074782528 to i64*)
%7 = load volatile i64, i64* inttoptr (i64 1074782464 to i64*)
%8 = or i64 %7, 16777216
store volatile i64 %8, i64* inttoptr (i64 1074782464 to i64*)
%9 = load volatile i64, i64* inttoptr (i64 1074782472 to i64*)
%10 = or i64 %9, 1
store volatile i64 %10, i64* inttoptr (i64 1074782472 to i64*)
%11 = tail call i32 @Delay(i32 3)
%12 = load volatile i64, i64* inttoptr (i64 1073759264 to i64*)
%13 = or i64 %12, 48
store volatile i64 %13, i64* inttoptr (i64 1073759264 to i64*)
%14 = load volatile i64, i64* inttoptr (i64 1073759516 to i64*)
%15 = or i64 %14, 48
store volatile i64 %15, i64* inttoptr (i64 1073759516 to i64*)
%16 = tail call i32 (...) @ConfigureBridge()
%17 = tail call i32 @ConfigureCANInterface(i32 1)
ret void
}