#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*/ printf(char *, ...);
void read_receive_buffer_basic() {
  volatile unsigned char r_val;
  printf("************************************\n");
  printf("******** read receive buffer *******\n");
  printf("************************************\n");
  printf("identifier 0: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0014)));
  printf("identifier 1: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0015)));
  printf("data byte 1: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0016)));
  printf("data byte 2: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0017)));
  printf("data byte 3: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0018)));
  printf("data byte 4: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x0019)));
  printf("data byte 5: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x001A)));
  printf("data byte 6: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x001B)));
  printf("data byte 7: 0x%X \n",
         *((volatile unsigned char *)(0xfff20000 + 0x001C)));
  printf("data byte 8: 0x%X \n\n",
         *((volatile unsigned char *)(0xfff20000 + 0x001D)));
}


x86 assembly (clang, -O0):
<read_receive_buffer_basic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20014,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20015,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20016,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20017,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20018,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff20019,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff2001a,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff2001b,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff2001c,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xedb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfff2001d,%eax
mov    (%rax),%al
movzbl %al,%esi
lea    0xed7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_receive_buffer_basic>:
push   %rbx
lea    0xfc8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0xf94(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
mov    $0xfff20014,%ebx
movzbl (%rbx),%esi
lea    0xead(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x1(%rbx),%esi
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x2(%rbx),%esi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x3(%rbx),%esi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
lea    0xeb7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x5(%rbx),%esi
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x6(%rbx),%esi
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x7(%rbx),%esi
lea    0xebd(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x9(%rbx),%esi
lea    0xec1(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [38 x i8] c"************************************\0A\00"
@.str.1 = [38 x i8] c"******** read receive buffer *******\0A\00"
@.str.2 = [21 x i8] c"identifier 0: 0x%X \0A\00"
@.str.3 = [21 x i8] c"identifier 1: 0x%X \0A\00"
@.str.4 = [20 x i8] c"data byte 1: 0x%X \0A\00"
@.str.5 = [20 x i8] c"data byte 2: 0x%X \0A\00"
@.str.6 = [20 x i8] c"data byte 3: 0x%X \0A\00"
@.str.7 = [20 x i8] c"data byte 4: 0x%X \0A\00"
@.str.8 = [20 x i8] c"data byte 5: 0x%X \0A\00"
@.str.9 = [20 x i8] c"data byte 6: 0x%X \0A\00"
@.str.10 = [20 x i8] c"data byte 7: 0x%X \0A\00"
@.str.11 = [21 x i8] c"data byte 8: 0x%X \0A\0A\00"
define void @read_receive_buffer_basic() {
%1 = alloca i8
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0))
%5 = load volatile i8, i8* inttoptr (i64 4294049812 to i8*)
%6 = zext i8 %5 to i32
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = load volatile i8, i8* inttoptr (i64 4294049813 to i8*)
%9 = zext i8 %8 to i32
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %9)
%11 = load volatile i8, i8* inttoptr (i64 4294049814 to i8*)
%12 = zext i8 %11 to i32
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %12)
%14 = load volatile i8, i8* inttoptr (i64 4294049815 to i8*)
%15 = zext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %15)
%17 = load volatile i8, i8* inttoptr (i64 4294049816 to i8*)
%18 = zext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %18)
%20 = load volatile i8, i8* inttoptr (i64 4294049817 to i8*)
%21 = zext i8 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %21)
%23 = load volatile i8, i8* inttoptr (i64 4294049818 to i8*)
%24 = zext i8 %23 to i32
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %24)
%26 = load volatile i8, i8* inttoptr (i64 4294049819 to i8*)
%27 = zext i8 %26 to i32
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %27)
%29 = load volatile i8, i8* inttoptr (i64 4294049820 to i8*)
%30 = zext i8 %29 to i32
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %30)
%32 = load volatile i8, i8* inttoptr (i64 4294049821 to i8*)
%33 = zext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %33)
ret void
}

LLVM IR (-O2):
@.str.2 = [21 x i8] c"identifier 0: 0x%X \0A\00"
@.str.3 = [21 x i8] c"identifier 1: 0x%X \0A\00"
@.str.4 = [20 x i8] c"data byte 1: 0x%X \0A\00"
@.str.5 = [20 x i8] c"data byte 2: 0x%X \0A\00"
@.str.6 = [20 x i8] c"data byte 3: 0x%X \0A\00"
@.str.7 = [20 x i8] c"data byte 4: 0x%X \0A\00"
@.str.8 = [20 x i8] c"data byte 5: 0x%X \0A\00"
@.str.9 = [20 x i8] c"data byte 6: 0x%X \0A\00"
@.str.10 = [20 x i8] c"data byte 7: 0x%X \0A\00"
@.str.11 = [21 x i8] c"data byte 8: 0x%X \0A\0A\00"
@str.12 = [37 x i8] c"******** read receive buffer *******\00"
@str.13 = [37 x i8] c"************************************\00"
define void @read_receive_buffer_basic() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.13, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.12, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.13, i64 0, i64 0))
%4 = load volatile i8, i8* inttoptr (i64 4294049812 to i8*)
%5 = zext i8 %4 to i32
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = load volatile i8, i8* inttoptr (i64 4294049813 to i8*)
%8 = zext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i32 %8)
%10 = load volatile i8, i8* inttoptr (i64 4294049814 to i8*)
%11 = zext i8 %10 to i32
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0), i32 %11)
%13 = load volatile i8, i8* inttoptr (i64 4294049815 to i8*)
%14 = zext i8 %13 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.5, i64 0, i64 0), i32 %14)
%16 = load volatile i8, i8* inttoptr (i64 4294049816 to i8*)
%17 = zext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0), i32 %17)
%19 = load volatile i8, i8* inttoptr (i64 4294049817 to i8*)
%20 = zext i8 %19 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %20)
%22 = load volatile i8, i8* inttoptr (i64 4294049818 to i8*)
%23 = zext i8 %22 to i32
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.8, i64 0, i64 0), i32 %23)
%25 = load volatile i8, i8* inttoptr (i64 4294049819 to i8*)
%26 = zext i8 %25 to i32
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.9, i64 0, i64 0), i32 %26)
%28 = load volatile i8, i8* inttoptr (i64 4294049820 to i8*)
%29 = zext i8 %28 to i32
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %29)
%31 = load volatile i8, i8* inttoptr (i64 4294049821 to i8*)
%32 = zext i8 %31 to i32
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %32)
ret void
}