#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 */
unsigned long _romread_i2c(unsigned long, unsigned long, unsigned long,
                           unsigned long);
int /*<<< orphan*/ _store_8(unsigned long, int);
unsigned long heap32_malloc(int);
int /*<<< orphan*/ print32_debug(unsigned long, int, int);
int /*<<< orphan*/ print32_debug_hexa(unsigned long, int, int, unsigned long);
long int _user_start() {
  unsigned long int memory_space = heap32_malloc(32);
  _store_8(memory_space, 0xC1);
  _store_8(memory_space + 1, 0xC2);
  _store_8(memory_space + 2, 0xC3);
  _store_8(memory_space + 3, 0xC4);
  _store_8(memory_space + 4, 0xC5);
  _store_8(memory_space + 5, 0xC6);
  _store_8(memory_space + 6, 0xC7);
  unsigned long int chip_select = 0b000;
  unsigned long int address_memory = 0x00;
  unsigned long int length = 128;
  unsigned long int error = 0;
  print32_debug(error, 200, 0);
  print32_debug_hexa(memory_space, 200, 12, length);
  error = _romread_i2c(memory_space, chip_select, address_memory, length);
  print32_debug(error, 200, 200);
  print32_debug_hexa(memory_space, 200, 212, length);
  while (((unsigned char)1)) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<_user_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x20,%edi
call   1040 <heap32_malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0xc1,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    $0xc2,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
mov    $0xc3,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
mov    $0xc4,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x4,%rdi
mov    $0xc5,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x5,%rdi
mov    $0xc6,%esi
call   1060 <_store_8@plt>
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
mov    $0xc7,%esi
call   1060 <_store_8@plt>
movq   $0x0,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x80,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0xc8,%esi
xor    %edx,%edx
call   1050 <print32_debug@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0xc8,%esi
mov    $0xc,%edx
call   1070 <print32_debug_hexa@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <_romread_i2c@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    $0xc8,%edx
mov    %edx,%esi
call   1050 <print32_debug@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rcx
mov    $0xc8,%esi
mov    $0xd4,%edx
call   1070 <print32_debug_hexa@plt>
jmp    1267 <_user_start+0x117>

x86 assembly (clang, -O2):
<_user_start>:
push   %rbx
mov    $0x20,%edi
call   1040 <heap32_malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0xc1,%esi
call   1060 <_store_8@plt>
lea    0x1(%rbx),%rdi
mov    $0xc2,%esi
call   1060 <_store_8@plt>
lea    0x2(%rbx),%rdi
mov    $0xc3,%esi
call   1060 <_store_8@plt>
lea    0x3(%rbx),%rdi
mov    $0xc4,%esi
call   1060 <_store_8@plt>
lea    0x4(%rbx),%rdi
mov    $0xc5,%esi
call   1060 <_store_8@plt>
lea    0x5(%rbx),%rdi
mov    $0xc6,%esi
call   1060 <_store_8@plt>
lea    0x6(%rbx),%rdi
mov    $0xc7,%esi
call   1060 <_store_8@plt>
xor    %edi,%edi
mov    $0xc8,%esi
xor    %edx,%edx
call   1050 <print32_debug@plt>
mov    $0x80,%ecx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0xc,%edx
call   1070 <print32_debug_hexa@plt>
mov    $0x80,%ecx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <_romread_i2c@plt>
mov    %rax,%rdi
mov    $0xc8,%esi
mov    $0xc8,%edx
call   1050 <print32_debug@plt>
mov    $0x80,%ecx
mov    %rbx,%rdi
mov    $0xc8,%esi
mov    $0xd4,%edx
call   1070 <print32_debug_hexa@plt>
xchg   %ax,%ax
jmp    1220 <_user_start+0xd0>

LLVM IR (-O0):
define i64 @_user_start() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
%6 = call i64 @heap32_malloc(i32 32)
store i64 %6, i64* %1
%7 = load i64, i64* %1
%8 = call i32 @_store_8(i64 %7, i32 193)
%9 = load i64, i64* %1
%10 = add i64 %9, 1
%11 = call i32 @_store_8(i64 %10, i32 194)
%12 = load i64, i64* %1
%13 = add i64 %12, 2
%14 = call i32 @_store_8(i64 %13, i32 195)
%15 = load i64, i64* %1
%16 = add i64 %15, 3
%17 = call i32 @_store_8(i64 %16, i32 196)
%18 = load i64, i64* %1
%19 = add i64 %18, 4
%20 = call i32 @_store_8(i64 %19, i32 197)
%21 = load i64, i64* %1
%22 = add i64 %21, 5
%23 = call i32 @_store_8(i64 %22, i32 198)
%24 = load i64, i64* %1
%25 = add i64 %24, 6
%26 = call i32 @_store_8(i64 %25, i32 199)
store i64 0, i64* %2
store i64 0, i64* %3
store i64 128, i64* %4
store i64 0, i64* %5
%27 = load i64, i64* %5
%28 = call i32 @print32_debug(i64 %27, i32 200, i32 0)
%29 = load i64, i64* %1
%30 = load i64, i64* %4
%31 = call i32 @print32_debug_hexa(i64 %29, i32 200, i32 12, i64 %30)
%32 = load i64, i64* %1
%33 = load i64, i64* %2
%34 = load i64, i64* %3
%35 = load i64, i64* %4
%36 = call i64 @_romread_i2c(i64 %32, i64 %33, i64 %34, i64 %35)
store i64 %36, i64* %5
%37 = load i64, i64* %5
%38 = call i32 @print32_debug(i64 %37, i32 200, i32 200)
%39 = load i64, i64* %1
%40 = load i64, i64* %4
%41 = call i32 @print32_debug_hexa(i64 %39, i32 200, i32 212, i64 %40)
br label %42
42: ; preds = %0, %42
br label %42
}

LLVM IR (-O2):
define i64 @_user_start() {
%1 = tail call i64 @heap32_malloc(i32 32)
%2 = tail call i32 @_store_8(i64 %1, i32 193)
%3 = add i64 %1, 1
%4 = tail call i32 @_store_8(i64 %3, i32 194)
%5 = add i64 %1, 2
%6 = tail call i32 @_store_8(i64 %5, i32 195)
%7 = add i64 %1, 3
%8 = tail call i32 @_store_8(i64 %7, i32 196)
%9 = add i64 %1, 4
%10 = tail call i32 @_store_8(i64 %9, i32 197)
%11 = add i64 %1, 5
%12 = tail call i32 @_store_8(i64 %11, i32 198)
%13 = add i64 %1, 6
%14 = tail call i32 @_store_8(i64 %13, i32 199)
%15 = tail call i32 @print32_debug(i64 0, i32 200, i32 0)
%16 = tail call i32 @print32_debug_hexa(i64 %1, i32 200, i32 12, i64 128)
%17 = tail call i64 @_romread_i2c(i64 %1, i64 0, i64 0, i64 128)
%18 = tail call i32 @print32_debug(i64 %17, i32 200, i32 200)
%19 = tail call i32 @print32_debug_hexa(i64 %1, i32 200, i32 212, i64 128)
br label %20
20: ; preds = %20, %0
br label %20
}