#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_eff();
int /*<<< orphan*/ init_can(char *, char *);
int /*<<< orphan*/ kill_time(int);
int /*<<< orphan*/ reset_all_irqs();
int /*<<< orphan*/ tx_request_command();
int /*<<< orphan*/ write_frame_extended(unsigned char *);
main() {
  int i;
  unsigned char frame_extended0[13] = {0x88, 0x16, 0xB0, 0x12, 0x30, 0x12, 0x34,
                                       0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  unsigned char frame_extended1[13] = {0x88, 0x17, 0xB0, 0x12, 0x30, 0x12, 0x34,
                                       0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  unsigned char frame_extended2[13] = {0x88, 0x18, 0xB0, 0x12, 0x30, 0x12, 0x34,
                                       0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  unsigned char frame_extended3[13] = {0x88, 0x19, 0xB0, 0x12, 0x30, 0x12, 0x34,
                                       0x56, 0x78, 0x9A, 0xBC, 0xDE, 0xF0};
  unsigned char r_val;
  init_can("Extended", "normal");
  enable_irq_eff();
  while (1) {
    write_frame_extended(frame_extended0);
    tx_request_command();
    reset_all_irqs();
    kill_time(100000);
    write_frame_extended(frame_extended1);
    tx_request_command();
    reset_all_irqs();
    kill_time(100000);
    write_frame_extended(frame_extended2);
    tx_request_command();
    reset_all_irqs();
    kill_time(100000);
    write_frame_extended(frame_extended3);
    tx_request_command();
    reset_all_irqs();
    kill_time(100000);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe8a(%rip),%rax
mov    %rax,-0x15(%rbp)
mov    0xe88(%rip),%eax
mov    %eax,-0xd(%rbp)
mov    0xe83(%rip),%al
mov    %al,-0x9(%rbp)
mov    0xe7a(%rip),%rax
mov    %rax,-0x22(%rbp)
mov    0xe78(%rip),%eax
mov    %eax,-0x1a(%rbp)
mov    0xe73(%rip),%al
mov    %al,-0x16(%rbp)
mov    0xe6a(%rip),%rax
mov    %rax,-0x2f(%rbp)
mov    0xe68(%rip),%eax
mov    %eax,-0x27(%rbp)
mov    0xe63(%rip),%al
mov    %al,-0x23(%rbp)
mov    0xe5a(%rip),%rax
mov    %rax,-0x3c(%rbp)
mov    0xe58(%rip),%eax
mov    %eax,-0x34(%rbp)
mov    0xe53(%rip),%al
mov    %al,-0x30(%rbp)
lea    0xe4a(%rip),%rdi
lea    0xe4c(%rip),%rsi
call   1080 <init_can@plt>
mov    $0x0,%al
call   1060 <enable_irq_eff@plt>
lea    -0x15(%rbp),%rdi
call   1070 <write_frame_extended@plt>
mov    $0x0,%al
call   1050 <tx_request_command@plt>
mov    $0x0,%al
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x22(%rbp),%rdi
call   1070 <write_frame_extended@plt>
mov    $0x0,%al
call   1050 <tx_request_command@plt>
mov    $0x0,%al
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x2f(%rbp),%rdi
call   1070 <write_frame_extended@plt>
mov    $0x0,%al
call   1050 <tx_request_command@plt>
mov    $0x0,%al
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
lea    -0x3c(%rbp),%rdi
call   1070 <write_frame_extended@plt>
mov    $0x0,%al
call   1050 <tx_request_command@plt>
mov    $0x0,%al
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
jmp    11fd <main+0x9d>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x48,%rsp
movabs $0xf0debc9a78563412,%rax
bc de f0
mov    %rax,0x3d(%rsp)
movabs $0x5634123012b01688,%rcx
12 34 56
mov    %rcx,0x38(%rsp)
mov    %rax,0x2d(%rsp)
movabs $0x5634123012b01788,%rcx
12 34 56
mov    %rcx,0x28(%rsp)
mov    %rax,0x1d(%rsp)
movabs $0x5634123012b01888,%rcx
12 34 56
mov    %rcx,0x18(%rsp)
mov    %rax,0xd(%rsp)
movabs $0x5634123012b01988,%rax
12 34 56
mov    %rax,0x8(%rsp)
lea    0xe68(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1080 <init_can@plt>
xor    %eax,%eax
call   1060 <enable_irq_eff@plt>
lea    0x38(%rsp),%r14
lea    0x28(%rsp),%r15
lea    0x18(%rsp),%r12
lea    0x8(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r14,%rdi
call   1070 <write_frame_extended@plt>
xor    %eax,%eax
call   1050 <tx_request_command@plt>
xor    %eax,%eax
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
mov    %r15,%rdi
call   1070 <write_frame_extended@plt>
xor    %eax,%eax
call   1050 <tx_request_command@plt>
xor    %eax,%eax
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
mov    %r12,%rdi
call   1070 <write_frame_extended@plt>
xor    %eax,%eax
call   1050 <tx_request_command@plt>
xor    %eax,%eax
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
mov    %rbx,%rdi
call   1070 <write_frame_extended@plt>
xor    %eax,%eax
call   1050 <tx_request_command@plt>
xor    %eax,%eax
call   1040 <reset_all_irqs@plt>
mov    $0x186a0,%edi
call   1030 <kill_time@plt>
jmp    1200 <main+0xa0>

LLVM IR (-O0):
@__const.main.frame_extended0 = [13 x i8] c"\88\16\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended1 = [13 x i8] c"\88\17\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended2 = [13 x i8] c"\88\18\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended3 = [13 x i8] c"\88\19\B0\120\124Vx\9A\BC\DE\F0"
@.str = [9 x i8] c"Extended\00"
@.str.1 = [7 x i8] c"normal\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [13 x i8]
%4 = alloca [13 x i8]
%5 = alloca [13 x i8]
%6 = alloca [13 x i8]
%7 = alloca i8
store i32 0, i32* %1
%8 = bitcast [13 x i8]* %3 to i8*
%9 = bitcast [13 x i8]* %4 to i8*
%10 = bitcast [13 x i8]* %5 to i8*
%11 = bitcast [13 x i8]* %6 to i8*
%12 = call i32 @init_can(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (...) @enable_irq_eff()
br label %14
14: ; preds = %0, %14
%15 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%16 = call i32 @write_frame_extended(i8* %15)
%17 = call i32 (...) @tx_request_command()
%18 = call i32 (...) @reset_all_irqs()
%19 = call i32 @kill_time(i32 100000)
%20 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%21 = call i32 @write_frame_extended(i8* %20)
%22 = call i32 (...) @tx_request_command()
%23 = call i32 (...) @reset_all_irqs()
%24 = call i32 @kill_time(i32 100000)
%25 = getelementptr inbounds [13 x i8], [13 x i8]* %5, i64 0, i64 0
%26 = call i32 @write_frame_extended(i8* %25)
%27 = call i32 (...) @tx_request_command()
%28 = call i32 (...) @reset_all_irqs()
%29 = call i32 @kill_time(i32 100000)
%30 = getelementptr inbounds [13 x i8], [13 x i8]* %6, i64 0, i64 0
%31 = call i32 @write_frame_extended(i8* %30)
%32 = call i32 (...) @tx_request_command()
%33 = call i32 (...) @reset_all_irqs()
%34 = call i32 @kill_time(i32 100000)
br label %14
}

LLVM IR (-O2):
@__const.main.frame_extended0 = [13 x i8] c"\88\16\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended1 = [13 x i8] c"\88\17\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended2 = [13 x i8] c"\88\18\B0\120\124Vx\9A\BC\DE\F0"
@__const.main.frame_extended3 = [13 x i8] c"\88\19\B0\120\124Vx\9A\BC\DE\F0"
@.str = [9 x i8] c"Extended\00"
@.str.1 = [7 x i8] c"normal\00"
define i32 @main() {
%1 = alloca [13 x i8]
%2 = alloca [13 x i8]
%3 = alloca [13 x i8]
%4 = alloca [13 x i8]
%5 = getelementptr inbounds [13 x i8], [13 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [13 x i8], [13 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [13 x i8], [13 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [13 x i8], [13 x i8]* %4, i64 0, i64 0
%9 = tail call i32 @init_can(i8* getelementptr inbounds ([9 x i8], [9 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_eff()
br label %11
11: ; preds = %11, %0
%12 = call i32 @write_frame_extended(i8* %5)
%13 = call i32 (...) @tx_request_command()
%14 = call i32 (...) @reset_all_irqs()
%15 = call i32 @kill_time(i32 100000)
%16 = call i32 @write_frame_extended(i8* %6)
%17 = call i32 (...) @tx_request_command()
%18 = call i32 (...) @reset_all_irqs()
%19 = call i32 @kill_time(i32 100000)
%20 = call i32 @write_frame_extended(i8* %7)
%21 = call i32 (...) @tx_request_command()
%22 = call i32 (...) @reset_all_irqs()
%23 = call i32 @kill_time(i32 100000)
%24 = call i32 @write_frame_extended(i8* %8)
%25 = call i32 (...) @tx_request_command()
%26 = call i32 (...) @reset_all_irqs()
%27 = call i32 @kill_time(i32 100000)
br label %11
}