#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*/ enable_irq_sff();
int /*<<< orphan*/ init_can(char *, char *);
int /*<<< orphan*/ kill_time(int);
int /*<<< orphan*/ reset_all_irqs();
int /*<<< orphan*/ self_reception_test();
int /*<<< orphan*/ tx_request_command();
int /*<<< orphan*/ write_frame_basic(unsigned char volatile *);
main() {
  int i;
  volatile unsigned char frame_basic0[10] = {0xEA, 0x28, 0x12, 0x34, 0x56,
                                             0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  volatile unsigned char frame_basic1[10] = {0xEB, 0x28, 0x12, 0x34, 0x56,
                                             0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  volatile unsigned char frame_basic2[10] = {0xEC, 0x28, 0x12, 0x34, 0x56,
                                             0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  volatile unsigned char frame_basic3[10] = {0xED, 0x28, 0x12, 0x34, 0x56,
                                             0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  volatile unsigned char frame_extended[13] = {0x88, 0xA6, 0xB0, 0x12, 0x30,
                                               0x12, 0x34, 0x56, 0x78, 0x9A,
                                               0xBC, 0xDE, 0xF0};
  volatile unsigned char r_val;
  init_can("Basic", "normal");
  enable_irq_sff();
  write_frame_basic(frame_basic0);
  tx_request_command();
  reset_all_irqs();
  kill_time(100000);
  write_frame_basic(frame_basic1);
  tx_request_command();
  reset_all_irqs();
  kill_time(100000);
  write_frame_basic(frame_basic2);
  tx_request_command();
  reset_all_irqs();
  kill_time(100000);
  write_frame_basic(frame_basic3);
  tx_request_command();
  reset_all_irqs();
  kill_time(100000);
  self_reception_test();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    -0xe(%rbp),%rax
mov    0xe85(%rip),%cx
mov    %cx,0x8(%rax)
mov    0xe72(%rip),%rcx
mov    %rcx,(%rax)
lea    -0x18(%rbp),%rax
mov    0xe76(%rip),%cx
mov    %cx,0x8(%rax)
mov    0xe63(%rip),%rcx
mov    %rcx,(%rax)
lea    -0x22(%rbp),%rax
mov    0xe67(%rip),%cx
mov    %cx,0x8(%rax)
mov    0xe54(%rip),%rcx
mov    %rcx,(%rax)
lea    -0x2c(%rbp),%rax
mov    0xe58(%rip),%cx
mov    %cx,0x8(%rax)
mov    0xe45(%rip),%rcx
mov    %rcx,(%rax)
lea    -0x39(%rbp),%rax
mov    0xe4e(%rip),%cl
mov    %cl,0xc(%rax)
mov    0xe41(%rip),%ecx
mov    %ecx,0x8(%rax)
mov    0xe2f(%rip),%rcx
mov    %rcx,(%rax)
lea    0xe32(%rip),%rdi
lea    0xe31(%rip),%rsi
call   1080 <init_can@plt>
mov    $0x0,%al
call   1040 <enable_irq_sff@plt>
lea    -0xe(%rbp),%rdi
call   1070 <write_frame_basic@plt>
mov    $0x0,%al
call   1060 <tx_request_command@plt>
mov    $0x0,%al
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x18(%rbp),%rdi
call   1070 <write_frame_basic@plt>
mov    $0x0,%al
call   1060 <tx_request_command@plt>
mov    $0x0,%al
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x22(%rbp),%rdi
call   1070 <write_frame_basic@plt>
mov    $0x0,%al
call   1060 <tx_request_command@plt>
mov    $0x0,%al
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x2c(%rbp),%rdi
call   1070 <write_frame_basic@plt>
mov    $0x0,%al
call   1060 <tx_request_command@plt>
mov    $0x0,%al
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
mov    $0x0,%al
call   1090 <self_reception_test@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movzwl 0xe8d(%rip),%eax
mov    %ax,0x40(%rsp)
mov    0xe79(%rip),%rax
mov    %rax,0x38(%rsp)
movzwl 0xe7f(%rip),%eax
mov    %ax,0x30(%rsp)
mov    0xe6b(%rip),%rax
mov    %rax,0x28(%rsp)
movzwl 0xe71(%rip),%eax
mov    %ax,0x20(%rsp)
mov    0xe5d(%rip),%rax
mov    %rax,0x18(%rsp)
movzwl 0xe63(%rip),%eax
mov    %ax,0x10(%rsp)
mov    0xe4f(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0xe4d(%rip),%rdi
lea    0xe4c(%rip),%rsi
call   1080 <init_can@plt>
xor    %eax,%eax
call   1040 <enable_irq_sff@plt>
lea    0x38(%rsp),%rdi
call   1070 <write_frame_basic@plt>
xor    %eax,%eax
call   1060 <tx_request_command@plt>
xor    %eax,%eax
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    0x28(%rsp),%rdi
call   1070 <write_frame_basic@plt>
xor    %eax,%eax
call   1060 <tx_request_command@plt>
xor    %eax,%eax
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    0x18(%rsp),%rdi
call   1070 <write_frame_basic@plt>
xor    %eax,%eax
call   1060 <tx_request_command@plt>
xor    %eax,%eax
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    0x8(%rsp),%rdi
call   1070 <write_frame_basic@plt>
xor    %eax,%eax
call   1060 <tx_request_command@plt>
xor    %eax,%eax
call   1050 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
xor    %eax,%eax
call   1090 <self_reception_test@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@__const.main.frame_basic0 = [10 x i8] c"\EA(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic1 = [10 x i8] c"\EB(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic2 = [10 x i8] c"\EC(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic3 = [10 x i8] c"\ED(\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended = [13 x i8] c"\88\A6\B0\120\124Vx\9A\BC\DE\F0"
@.str = [6 x i8] c"Basic\00"
@.str.1 = [7 x i8] c"normal\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = alloca [10 x i8]
%6 = alloca [13 x i8]
%7 = alloca i8
%8 = bitcast [10 x i8]* %2 to i8*
%9 = bitcast [10 x i8]* %3 to i8*
%10 = bitcast [10 x i8]* %4 to i8*
%11 = bitcast [10 x i8]* %5 to i8*
%12 = bitcast [13 x i8]* %6 to i8*
%13 = call i32 @init_can(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 (...) @enable_irq_sff()
%15 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%16 = call i32 @write_frame_basic(i8* %15)
%17 = call i32 (...) @tx_request_command()
%18 = call i32 (...) @reset_all_irqs()
%19 = call i32 @kill_time(i32 100000)
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%21 = call i32 @write_frame_basic(i8* %20)
%22 = call i32 (...) @tx_request_command()
%23 = call i32 (...) @reset_all_irqs()
%24 = call i32 @kill_time(i32 100000)
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%26 = call i32 @write_frame_basic(i8* %25)
%27 = call i32 (...) @tx_request_command()
%28 = call i32 (...) @reset_all_irqs()
%29 = call i32 @kill_time(i32 100000)
%30 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%31 = call i32 @write_frame_basic(i8* %30)
%32 = call i32 (...) @tx_request_command()
%33 = call i32 (...) @reset_all_irqs()
%34 = call i32 @kill_time(i32 100000)
%35 = call i32 (...) @self_reception_test()
ret i32 0
}

LLVM IR (-O2):
@__const.main.frame_basic0 = [10 x i8] c"\EA(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic1 = [10 x i8] c"\EB(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic2 = [10 x i8] c"\EC(\124Vx\9A\BC\DE\F0"
@__const.main.frame_basic3 = [10 x i8] c"\ED(\124Vx\9A\BC\DE\F0"
@.str = [6 x i8] c"Basic\00"
@.str.1 = [7 x i8] c"normal\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca [10 x i8]
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @init_can(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%10 = tail call i32 (...) @enable_irq_sff()
%11 = call i32 @write_frame_basic(i8* %5)
%12 = call i32 (...) @tx_request_command()
%13 = call i32 (...) @reset_all_irqs()
%14 = call i32 @kill_time(i32 100000)
%15 = call i32 @write_frame_basic(i8* %6)
%16 = call i32 (...) @tx_request_command()
%17 = call i32 (...) @reset_all_irqs()
%18 = call i32 @kill_time(i32 100000)
%19 = call i32 @write_frame_basic(i8* %7)
%20 = call i32 (...) @tx_request_command()
%21 = call i32 (...) @reset_all_irqs()
%22 = call i32 @kill_time(i32 100000)
%23 = call i32 @write_frame_basic(i8* %8)
%24 = call i32 (...) @tx_request_command()
%25 = call i32 (...) @reset_all_irqs()
%26 = call i32 @kill_time(i32 100000)
%27 = call i32 (...) @self_reception_test()
ret i32 0
}