#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*/ kill_time(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ self_testing_mode();
void init_can(char *mode, char *self_test) {
  unsigned char r_val;
  if (mode == "Basic") {
    printf("********** Basic Can Mode **********\n");
    printf("Switch on Reset Mode\n");
    r_val = *((unsigned char *)(0xfffc0000 + 0x0000)) | 0x01;
    *((unsigned char *)(0xfffc0000 + 0x0000)) = r_val;
    r_val = *((unsigned char *)(0xfffc0000 + 0x001F)) & 0x7F | 0x07;
    *((unsigned char *)(0xfffc0000 + 0x001F)) = r_val;
    *((unsigned char *)(0xfffc0000 + 0x0006)) = 0x83;
    *((unsigned char *)(0xfffc0000 + 0x0007)) = 0x25;
    *((unsigned char *)(0xfffc0000 + 0x0004)) = 0x88;
    *((unsigned char *)(0xfffc0000 + 0x0005)) = 0xFF;
    kill_time(50);
    printf("Switch off reset mode\n");
    r_val = *((unsigned char *)(0xfffc0000 + 0x0000)) & 0xFE;
    *((unsigned char *)(0xfffc0000 + 0x0000)) = r_val;
    kill_time(50);
  } else if (mode == "Extended") {
    printf("************************************\n");
    printf("******** Extended Can Mode *********\n");
    printf("************************************\n");
    printf("Switch on Reset Mode\n");
    r_val = *((unsigned char *)(0xfffc0000 + 0x0000)) | 0x01;
    *((unsigned char *)(0xfffc0000 + 0x0000)) = r_val;
    printf("control_register: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0000)));
    kill_time(50);
    printf("Set clock divider register to extended can mode\n");
    r_val = *((unsigned char *)(0xfffc0000 + 0x001F)) | 0x80 | 0x07;
    *((unsigned char *)(0xfffc0000 + 0x001F)) = r_val;
    printf("clock_divider_register: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x001F)));
    kill_time(50);
    printf("Set bus timing register 0\n");
    printf("Sync Jump Width = 2  Baudrate Prescaler = 1\n");
    *((unsigned char *)(0xfffc0000 + 0x0006)) = 0xA8;
    printf("bus timing register 0: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0006)));
    printf("Set bus timing register 1\n");
    printf("SAM = 0 ---> Single Sampling\n");
    *((unsigned char *)(0xfffc0000 + 0x0007)) = 0x34;
    printf("bus timing register 1: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0007)));
    printf("Set acceptance code register\n");
    *((unsigned char *)(0xfffc0000 + 0x0010)) = 0xA6;
    printf("acceptance code register 0: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0010)));
    *((unsigned char *)(0xfffc0000 + 0x0011)) = 0xB0;
    printf("acceptance code register 1: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0011)));
    *((unsigned char *)(0xfffc0000 + 0x0012)) = 0x12;
    printf("acceptance code register 2: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0012)));
    *((unsigned char *)(0xfffc0000 + 0x0013)) = 0x30;
    printf("acceptance code register 3: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0013)));
    printf("Set acceptance mask register\n");
    *((unsigned char *)(0xfffc0000 + 0x0014)) = 0x00;
    printf("acceptance mask register: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0014)));
    *((unsigned char *)(0xfffc0000 + 0x0015)) = 0x00;
    printf("acceptance mask register: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0015)));
    *((unsigned char *)(0xfffc0000 + 0x0016)) = 0x00;
    printf("acceptance mask register: 0x%X \n",
           *((unsigned char *)(0xfffc0000 + 0x0016)));
    *((unsigned char *)(0xfffc0000 + 0x0017)) = 0x00;
    printf("acceptance mask register: 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0017)));
    if (self_test == "self_test") {
      self_testing_mode();
    }
    printf("Switch off reset mode\n");
    r_val = *((unsigned char *)(0xfffc0000 + 0x0000)) & 0xFE;
    *((unsigned char *)(0xfffc0000 + 0x0000)) = r_val;
    printf("control_register 0x%X \n\n",
           *((unsigned char *)(0xfffc0000 + 0x0000)));
    kill_time(50);
  }
}


x86 assembly (clang, -O0):
<init_can>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xeb9(%rip),%rax
cmp    %rax,-0x8(%rbp)
jne    1201 <init_can+0xd1>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0000,%eax
movzbl (%rax),%eax
or     $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc0000,%eax
mov    %cl,(%rax)
mov    $0xfffc001f,%eax
movzbl (%rax),%eax
and    $0x7f,%eax
or     $0x7,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc001f,%eax
mov    %cl,(%rax)
mov    $0xfffc0006,%eax
movb   $0x83,(%rax)
mov    $0xfffc0007,%eax
movb   $0x25,(%rax)
mov    $0xfffc0004,%eax
movb   $0x88,(%rax)
mov    $0xfffc0005,%eax
movb   $0xff,(%rax)
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0000,%eax
movzbl (%rax),%eax
and    $0xfe,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc0000,%eax
mov    %cl,(%rax)
mov    $0x32,%edi
call   1030 <kill_time@plt>
jmp    14b2 <init_can+0x382>
lea    0xe51(%rip),%rax
cmp    %rax,-0x8(%rbp)
jne    14ad <init_can+0x37d>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0000,%eax
movzbl (%rax),%eax
or     $0x1,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc0000,%eax
mov    %cl,(%rax)
mov    $0xfffc0000,%eax
movzbl (%rax),%esi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0xe3f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc001f,%eax
movzbl (%rax),%eax
or     $0x80,%eax
or     $0x7,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc001f,%eax
mov    %cl,(%rax)
mov    $0xfffc001f,%eax
movzbl (%rax),%esi
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0006,%eax
movb   $0xa8,(%rax)
mov    $0xfffc0006,%eax
movzbl (%rax),%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0007,%eax
movb   $0x34,(%rax)
mov    $0xfffc0007,%eax
movzbl (%rax),%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0010,%eax
movb   $0xa6,(%rax)
mov    $0xfffc0010,%eax
movzbl (%rax),%esi
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0011,%eax
movb   $0xb0,(%rax)
mov    $0xfffc0011,%eax
movzbl (%rax),%esi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0012,%eax
movb   $0x12,(%rax)
mov    $0xfffc0012,%eax
movzbl (%rax),%esi
lea    0xe9a(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0013,%eax
movb   $0x30,(%rax)
mov    $0xfffc0013,%eax
movzbl (%rax),%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0014,%eax
movb   $0x0,(%rax)
mov    $0xfffc0014,%eax
movzbl (%rax),%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0015,%eax
movb   $0x0,(%rax)
mov    $0xfffc0015,%eax
movzbl (%rax),%esi
lea    0xe97(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0016,%eax
movb   $0x0,(%rax)
mov    $0xfffc0016,%eax
movzbl (%rax),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0017,%eax
movb   $0x0,(%rax)
mov    $0xfffc0017,%eax
movzbl (%rax),%esi
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe90(%rip),%rax
cmp    %rax,-0x10(%rbp)
jne    1465 <init_can+0x335>
mov    $0x0,%al
call   1040 <self_testing_mode@plt>
lea    0xbd6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xfffc0000,%eax
movzbl (%rax),%eax
and    $0xfe,%eax
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%cl
mov    $0xfffc0000,%eax
mov    %cl,(%rax)
mov    $0xfffc0000,%eax
movzbl (%rax),%esi
lea    0xe52(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x32,%edi
call   1030 <kill_time@plt>
jmp    14b2 <init_can+0x382>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_can>:
push   %r15
push   %r14
push   %rbx
lea    0xeb4(%rip),%rax
cmp    %rax,%rdi
je     1163 <init_can+0x23>
lea    0xeae(%rip),%rax
cmp    %rax,%rdi
je     11b2 <init_can+0x72>
pop    %rbx
pop    %r14
pop    %r15
ret
lea    0x1141(%rip),%rdi
call   1040 <puts@plt>
lea    0x115a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffc0000,%ebx
orb    $0x1,(%rbx)
mov    0x1f(%rbx),%al
and    $0x78,%al
or     $0x7,%al
mov    %al,0x1f(%rbx)
movl   $0x2583ff88,0x4(%rbx)
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0x1140(%rip),%rdi
call   1040 <puts@plt>
andb   $0xfe,(%rbx)
jmp    139d <init_can+0x25d>
mov    %rsi,%r14
mov    $0xfffc0000,%r15d
lea    0xfdd(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0xfa9(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x10eb(%rip),%rdi
call   1040 <puts@plt>
movzbl (%r15),%esi
or     $0x1,%esi
mov    %sil,(%r15)
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0xfb1(%rip),%rdi
call   1040 <puts@plt>
movzbl 0x1f(%r15),%esi
or     $0x87,%esi
mov    %sil,0x1f(%r15)
lea    0xdfb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x32,%edi
call   1030 <kill_time@plt>
lea    0xfae(%rip),%rdi
call   1040 <puts@plt>
lea    0xfbc(%rip),%rdi
call   1040 <puts@plt>
movb   $0xa8,0x6(%r15)
lea    0xde6(%rip),%rdi
mov    $0xa8,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xfc4(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd2(%rip),%rdi
call   1040 <puts@plt>
movb   $0x34,0x7(%r15)
lea    0xdd5(%rip),%rdi
mov    $0x34,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xfcb(%rip),%rdi
call   1040 <puts@plt>
movb   $0xa6,0x10(%r15)
lea    0xdd0(%rip),%rdi
mov    $0xa6,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0xb0,0x11(%r15)
lea    0xddb(%rip),%rdi
mov    $0xb0,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0x12,0x12(%r15)
lea    0xde6(%rip),%rdi
mov    $0x12,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0x30,0x13(%r15)
lea    0xdf1(%rip),%rdi
mov    $0x30,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xf7c(%rip),%rdi
call   1040 <puts@plt>
movb   $0x0,0x14(%r15)
lea    0xdf1(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0x0,0x15(%r15)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0x0,0x16(%r15)
mov    %rbx,%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movb   $0x0,0x17(%r15)
lea    0xdd8(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdea(%rip),%rax
cmp    %rax,%r14
jne    1379 <init_can+0x239>
xor    %eax,%eax
call   1050 <self_testing_mode@plt>
lea    0xf65(%rip),%rdi
call   1040 <puts@plt>
movzbl (%r15),%esi
and    $0xfffffffe,%esi
mov    %sil,(%r15)
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x32,%edi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <kill_time@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"Basic\00"
@.str.1 = [38 x i8] c"********** Basic Can Mode **********\0A\00"
@.str.2 = [22 x i8] c"Switch on Reset Mode\0A\00"
@.str.3 = [23 x i8] c"Switch off reset mode\0A\00"
@.str.4 = [9 x i8] c"Extended\00"
@.str.5 = [38 x i8] c"************************************\0A\00"
@.str.6 = [38 x i8] c"******** Extended Can Mode *********\0A\00"
@.str.7 = [26 x i8] c"control_register: 0x%X \0A\0A\00"
@.str.8 = [49 x i8] c"Set clock divider register to extended can mode\0A\00"
@.str.9 = [32 x i8] c"clock_divider_register: 0x%X \0A\0A\00"
@.str.10 = [27 x i8] c"Set bus timing register 0\0A\00"
@.str.11 = [45 x i8] c"Sync Jump Width = 2 Baudrate Prescaler = 1\0A\00"
@.str.12 = [31 x i8] c"bus timing register 0: 0x%X \0A\0A\00"
@.str.13 = [27 x i8] c"Set bus timing register 1\0A\00"
@.str.14 = [30 x i8] c"SAM = 0 ---> Single Sampling\0A\00"
@.str.15 = [31 x i8] c"bus timing register 1: 0x%X \0A\0A\00"
@.str.16 = [30 x i8] c"Set acceptance code register\0A\00"
@.str.17 = [35 x i8] c"acceptance code register 0: 0x%X \0A\00"
@.str.18 = [35 x i8] c"acceptance code register 1: 0x%X \0A\00"
@.str.19 = [35 x i8] c"acceptance code register 2: 0x%X \0A\00"
@.str.20 = [36 x i8] c"acceptance code register 3: 0x%X \0A\0A\00"
@.str.21 = [30 x i8] c"Set acceptance mask register\0A\00"
@.str.22 = [33 x i8] c"acceptance mask register: 0x%X \0A\00"
@.str.23 = [34 x i8] c"acceptance mask register: 0x%X \0A\0A\00"
@.str.24 = [10 x i8] c"self_test\00"
@.str.25 = [25 x i8] c"control_register 0x%X \0A\0A\00"
define void @init_can(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
br i1 %7, label %8, label %30
8: ; preds = %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%12 = zext i8 %11 to i32
%13 = or i32 %12, 1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %5
%15 = load i8, i8* %5
store i8 %15, i8* inttoptr (i64 4294705152 to i8*)
%16 = load i8, i8* inttoptr (i64 4294705183 to i8*)
%17 = zext i8 %16 to i32
%18 = and i32 %17, 127
%19 = or i32 %18, 7
%20 = trunc i32 %19 to i8
store i8 %20, i8* %5
%21 = load i8, i8* %5
store i8 %21, i8* inttoptr (i64 4294705183 to i8*)
store i8 -125, i8* inttoptr (i64 4294705158 to i8*)
store i8 37, i8* inttoptr (i64 4294705159 to i8*)
store i8 -120, i8* inttoptr (i64 4294705156 to i8*)
store i8 -1, i8* inttoptr (i64 4294705157 to i8*)
%22 = call i32 @kill_time(i32 50)
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%24 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%25 = zext i8 %24 to i32
%26 = and i32 %25, 254
%27 = trunc i32 %26 to i8
store i8 %27, i8* %5
%28 = load i8, i8* %5
store i8 %28, i8* inttoptr (i64 4294705152 to i8*)
%29 = call i32 @kill_time(i32 50)
br label %110
30: ; preds = %2
%31 = load i8*, i8** %3
%32 = icmp eq i8* %31, getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0)
br i1 %32, label %33, label %109
33: ; preds = %30
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.5, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%38 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%39 = zext i8 %38 to i32
%40 = or i32 %39, 1
%41 = trunc i32 %40 to i8
store i8 %41, i8* %5
%42 = load i8, i8* %5
store i8 %42, i8* inttoptr (i64 4294705152 to i8*)
%43 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%44 = zext i8 %43 to i32
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %44)
%46 = call i32 @kill_time(i32 50)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.8, i64 0, i64 0))
%48 = load i8, i8* inttoptr (i64 4294705183 to i8*)
%49 = zext i8 %48 to i32
%50 = or i32 %49, 128
%51 = or i32 %50, 7
%52 = trunc i32 %51 to i8
store i8 %52, i8* %5
%53 = load i8, i8* %5
store i8 %53, i8* inttoptr (i64 4294705183 to i8*)
%54 = load i8, i8* inttoptr (i64 4294705183 to i8*)
%55 = zext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %55)
%57 = call i32 @kill_time(i32 50)
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.11, i64 0, i64 0))
store i8 -88, i8* inttoptr (i64 4294705158 to i8*)
%60 = load i8, i8* inttoptr (i64 4294705158 to i8*)
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i32 %61)
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.13, i64 0, i64 0))
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.14, i64 0, i64 0))
store i8 52, i8* inttoptr (i64 4294705159 to i8*)
%65 = load i8, i8* inttoptr (i64 4294705159 to i8*)
%66 = zext i8 %65 to i32
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), i32 %66)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0))
store i8 -90, i8* inttoptr (i64 4294705168 to i8*)
%69 = load i8, i8* inttoptr (i64 4294705168 to i8*)
%70 = zext i8 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i32 %70)
store i8 -80, i8* inttoptr (i64 4294705169 to i8*)
%72 = load i8, i8* inttoptr (i64 4294705169 to i8*)
%73 = zext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0), i32 %73)
store i8 18, i8* inttoptr (i64 4294705170 to i8*)
%75 = load i8, i8* inttoptr (i64 4294705170 to i8*)
%76 = zext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0), i32 %76)
store i8 48, i8* inttoptr (i64 4294705171 to i8*)
%78 = load i8, i8* inttoptr (i64 4294705171 to i8*)
%79 = zext i8 %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.21, i64 0, i64 0))
store i8 0, i8* inttoptr (i64 4294705172 to i8*)
%82 = load i8, i8* inttoptr (i64 4294705172 to i8*)
%83 = zext i8 %82 to i32
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 %83)
store i8 0, i8* inttoptr (i64 4294705173 to i8*)
%85 = load i8, i8* inttoptr (i64 4294705173 to i8*)
%86 = zext i8 %85 to i32
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 %86)
store i8 0, i8* inttoptr (i64 4294705174 to i8*)
%88 = load i8, i8* inttoptr (i64 4294705174 to i8*)
%89 = zext i8 %88 to i32
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 %89)
store i8 0, i8* inttoptr (i64 4294705175 to i8*)
%91 = load i8, i8* inttoptr (i64 4294705175 to i8*)
%92 = zext i8 %91 to i32
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0), i32 %92)
%94 = load i8*, i8** %4
%95 = icmp eq i8* %94, getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i64 0, i64 0)
br i1 %95, label %96, label %98
96: ; preds = %33
%97 = call i32 (...) @self_testing_mode()
br label %98
98: ; preds = %96, %33
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%100 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%101 = zext i8 %100 to i32
%102 = and i32 %101, 254
%103 = trunc i32 %102 to i8
store i8 %103, i8* %5
%104 = load i8, i8* %5
store i8 %104, i8* inttoptr (i64 4294705152 to i8*)
%105 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%106 = zext i8 %105 to i32
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i32 %106)
%108 = call i32 @kill_time(i32 50)
br label %109
109: ; preds = %98, %30
br label %110
110: ; preds = %109, %8
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"Basic\00"
@.str.4 = [9 x i8] c"Extended\00"
@.str.7 = [26 x i8] c"control_register: 0x%X \0A\0A\00"
@.str.9 = [32 x i8] c"clock_divider_register: 0x%X \0A\0A\00"
@.str.12 = [31 x i8] c"bus timing register 0: 0x%X \0A\0A\00"
@.str.15 = [31 x i8] c"bus timing register 1: 0x%X \0A\0A\00"
@.str.17 = [35 x i8] c"acceptance code register 0: 0x%X \0A\00"
@.str.18 = [35 x i8] c"acceptance code register 1: 0x%X \0A\00"
@.str.19 = [35 x i8] c"acceptance code register 2: 0x%X \0A\00"
@.str.20 = [36 x i8] c"acceptance code register 3: 0x%X \0A\0A\00"
@.str.22 = [33 x i8] c"acceptance mask register: 0x%X \0A\00"
@.str.23 = [34 x i8] c"acceptance mask register: 0x%X \0A\0A\00"
@.str.24 = [10 x i8] c"self_test\00"
@.str.25 = [25 x i8] c"control_register 0x%X \0A\0A\00"
@str.26 = [37 x i8] c"******** Extended Can Mode *********\00"
@str.27 = [37 x i8] c"************************************\00"
@str.29 = [48 x i8] c"Set clock divider register to extended can mode\00"
@str.30 = [26 x i8] c"Set bus timing register 0\00"
@str.31 = [44 x i8] c"Sync Jump Width = 2 Baudrate Prescaler = 1\00"
@str.32 = [26 x i8] c"Set bus timing register 1\00"
@str.33 = [29 x i8] c"SAM = 0 ---> Single Sampling\00"
@str.34 = [29 x i8] c"Set acceptance code register\00"
@str.35 = [29 x i8] c"Set acceptance mask register\00"
@str.37 = [37 x i8] c"********** Basic Can Mode **********\00"
@str.38 = [21 x i8] c"Switch on Reset Mode\00"
@str.39 = [22 x i8] c"Switch off reset mode\00"
define void @init_can(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
br i1 %3, label %4, label %16
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.37, i64 0, i64 0))
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.38, i64 0, i64 0))
%7 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%8 = or i8 %7, 1
store i8 %8, i8* inttoptr (i64 4294705152 to i8*)
%9 = load i8, i8* inttoptr (i64 4294705183 to i8*)
%10 = and i8 %9, 120
%11 = or i8 %10, 7
store i8 %11, i8* inttoptr (i64 4294705183 to i8*)
store i8 -125, i8* inttoptr (i64 4294705158 to i8*)
store i8 37, i8* inttoptr (i64 4294705159 to i8*)
store i8 -120, i8* inttoptr (i64 4294705156 to i8*)
store i8 -1, i8* inttoptr (i64 4294705157 to i8*)
%12 = tail call i32 @kill_time(i32 50)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.39, i64 0, i64 0))
%14 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%15 = and i8 %14, -2
store i8 %15, i8* inttoptr (i64 4294705152 to i8*)
br label %59
16: ; preds = %2
%17 = icmp eq i8* %0, getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0)
br i1 %17, label %18, label %61
18: ; preds = %16
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.27, i64 0, i64 0))
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.26, i64 0, i64 0))
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.27, i64 0, i64 0))
%22 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.38, i64 0, i64 0))
%23 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%24 = or i8 %23, 1
store i8 %24, i8* inttoptr (i64 4294705152 to i8*)
%25 = zext i8 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %25)
%27 = tail call i32 @kill_time(i32 50)
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.29, i64 0, i64 0))
%29 = load i8, i8* inttoptr (i64 4294705183 to i8*)
%30 = or i8 %29, -121
store i8 %30, i8* inttoptr (i64 4294705183 to i8*)
%31 = zext i8 %30 to i32
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), i32 %31)
%33 = tail call i32 @kill_time(i32 50)
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.30, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.31, i64 0, i64 0))
store i8 -88, i8* inttoptr (i64 4294705158 to i8*)
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0), i32 168)
%37 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.32, i64 0, i64 0))
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.33, i64 0, i64 0))
store i8 52, i8* inttoptr (i64 4294705159 to i8*)
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.15, i64 0, i64 0), i32 52)
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.34, i64 0, i64 0))
store i8 -90, i8* inttoptr (i64 4294705168 to i8*)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.17, i64 0, i64 0), i32 166)
store i8 -80, i8* inttoptr (i64 4294705169 to i8*)
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.18, i64 0, i64 0), i32 176)
store i8 18, i8* inttoptr (i64 4294705170 to i8*)
%43 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0), i32 18)
store i8 48, i8* inttoptr (i64 4294705171 to i8*)
%44 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.20, i64 0, i64 0), i32 48)
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.35, i64 0, i64 0))
store i8 0, i8* inttoptr (i64 4294705172 to i8*)
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 0)
store i8 0, i8* inttoptr (i64 4294705173 to i8*)
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 0)
store i8 0, i8* inttoptr (i64 4294705174 to i8*)
%48 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.22, i64 0, i64 0), i32 0)
store i8 0, i8* inttoptr (i64 4294705175 to i8*)
%49 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.23, i64 0, i64 0), i32 0)
%50 = icmp eq i8* %1, getelementptr inbounds ([10 x i8], [10 x i8]* @.str.24, i64 0, i64 0)
br i1 %50, label %51, label %53
51: ; preds = %18
%52 = tail call i32 (...) @self_testing_mode()
br label %53
53: ; preds = %51, %18
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.39, i64 0, i64 0))
%55 = load i8, i8* inttoptr (i64 4294705152 to i8*)
%56 = and i8 %55, -2
store i8 %56, i8* inttoptr (i64 4294705152 to i8*)
%57 = zext i8 %56 to i32
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.25, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %4, %53
%60 = tail call i32 @kill_time(i32 50)
br label %61
61: ; preds = %59, %16
ret void
}