#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() {
  unsigned char r_val;
  printf("************************************\n");
  printf("******** read receive buffer *******\n");
  printf("************************************\n");
  printf("identifier 0: 0x%X \n", *((unsigned char *)(0xfffc0014)));
  printf("identifier 1: 0x%X \n", *((unsigned char *)(0xfffc0015)));
  printf("data byte 1: 0x%X \n", *((unsigned char *)(0xfffc0016)));
  printf("data byte 2: 0x%X \n", *((unsigned char *)(0xfffc0017)));
  printf("data byte 3: 0x%X \n", *((unsigned char *)(0xfffc0018)));
  printf("data byte 4: 0x%X \n", *((unsigned char *)(0xfffc0019)));
  printf("data byte 5: 0x%X \n", *((unsigned char *)(0xfffc001A)));
  printf("data byte 6: 0x%X \n", *((unsigned char *)(0xfffc001B)));
  printf("data byte 7: 0x%X \n", *((unsigned char *)(0xfffc001C)));
  printf("data byte 8: 0x%X \n\n", *((unsigned char *)(0xfffc001D)));
}


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    $0xfffc0014,%eax
movzbl (%rax),%esi
lea    0xefb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0015,%eax
movzbl (%rax),%esi
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0016,%eax
movzbl (%rax),%esi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0017,%eax
movzbl (%rax),%esi
lea    0xef7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0018,%eax
movzbl (%rax),%esi
lea    0xef5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc0019,%eax
movzbl (%rax),%esi
lea    0xef3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc001a,%eax
movzbl (%rax),%esi
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc001b,%eax
movzbl (%rax),%esi
lea    0xeef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc001c,%eax
movzbl (%rax),%esi
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0xfffc001d,%eax
movzbl (%rax),%esi
lea    0xeeb(%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    $0xfffc0014,%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 i8, i8* inttoptr (i64 4294705172 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 i8, i8* inttoptr (i64 4294705173 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 i8, i8* inttoptr (i64 4294705174 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 i8, i8* inttoptr (i64 4294705175 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 i8, i8* inttoptr (i64 4294705176 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 i8, i8* inttoptr (i64 4294705177 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 i8, i8* inttoptr (i64 4294705178 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 i8, i8* inttoptr (i64 4294705179 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 i8, i8* inttoptr (i64 4294705180 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 i8, i8* inttoptr (i64 4294705181 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 i8, i8* inttoptr (i64 4294705172 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 i8, i8* inttoptr (i64 4294705173 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 i8, i8* inttoptr (i64 4294705174 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 i8, i8* inttoptr (i64 4294705175 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 i8, i8* inttoptr (i64 4294705176 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 i8, i8* inttoptr (i64 4294705177 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 i8, i8* inttoptr (i64 4294705178 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 i8, i8* inttoptr (i64 4294705179 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 i8, i8* inttoptr (i64 4294705180 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 i8, i8* inttoptr (i64 4294705181 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
}