#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
void report_systeminfo(FILE *fileout) {
  int IsLittleEndian(void);
  if (IsLittleEndian()) {
    fprintf(fileout, "System is Little Endian\n");
  } else
    fprintf(fileout, "System is Big Endian\n");
  fprintf(fileout, "Size of char: %lld\n", (long long int)sizeof(char));
  fprintf(fileout, "Size of short: %lld\n", (long long int)sizeof(short));
  fprintf(fileout, "Size of int: %lld\n", (long long int)sizeof(int));
  fprintf(fileout, "Size of size_t: %lld\n", (long long int)sizeof(size_t));
  fprintf(fileout, "Size of long int: %lld\n", (long long int)sizeof(long int));
  fprintf(fileout, "Size of long long int: %lld\n",
          (long long int)sizeof(long long int));
  fprintf(fileout, "Size of float: %lld\n", (long long int)sizeof(float));
  fprintf(fileout, "Size of double: %lld\n", (long long int)sizeof(double));
  fprintf(fileout, "Size of long double: %lld\n",
          (long long int)sizeof(long double));
  if ((long long int)sizeof(int) <= 4) {
    fprintf(fileout,
            "WARNING: Since size of integer is only 4 bytes, some routines "
            "that input and output integer arguments will be limited to 2GB.  "
            "For example, ROMIO will fail to work if try to write >2GB file, "
            "since buffer sizes must then be <2GB\n");
  }
  if (sizeof(char) != 1) {
    fprintf(fileout, "sizeof(char) was not 1 byte, void pointer use not going "
                     "to be correct\n");
    exit(1);
  }
}


x86 assembly (clang, -O0):
<report_systeminfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
call   1030 <IsLittleEndian@plt>
cmp    $0x0,%eax
je     1151 <report_systeminfo+0x31>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1163 <report_systeminfo+0x43>
mov    -0x8(%rbp),%rdi
lea    0xebd(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xec1(%rip),%rsi
mov    $0x1,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x2,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb7(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xeb8(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebe(%rip),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebc(%rip),%rsi
mov    $0x8,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebb(%rip),%rsi
mov    $0x10,%edx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x8(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report_systeminfo>:
push   %rbx
mov    %rdi,%rbx
call   1030 <IsLittleEndian@plt>
test   %eax,%eax
je     114b <report_systeminfo+0x1b>
lea    0xebc(%rip),%rdi
mov    $0x18,%esi
jmp    1157 <report_systeminfo+0x27>
lea    0xec7(%rip),%rdi
mov    $0x15,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1050 <fwrite@plt>
lea    0xec4(%rip),%rsi
mov    $0x1,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec2(%rip),%rsi
mov    $0x2,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec1(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebe(%rip),%rsi
mov    $0x8,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xebe(%rip),%rsi
mov    $0x8,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec0(%rip),%rsi
mov    $0x8,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec7(%rip),%rsi
mov    $0x4,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec6(%rip),%rsi
mov    $0x8,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xec6(%rip),%rsi
mov    $0x10,%edx
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xecb(%rip),%rdi
mov    $0xe4,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
pop    %rbx
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"System is Little Endian\0A\00"
@.str.1 = [22 x i8] c"System is Big Endian\0A\00"
@.str.2 = [20 x i8] c"Size of char: %lld\0A\00"
@.str.3 = [21 x i8] c"Size of short: %lld\0A\00"
@.str.4 = [19 x i8] c"Size of int: %lld\0A\00"
@.str.5 = [22 x i8] c"Size of size_t: %lld\0A\00"
@.str.6 = [24 x i8] c"Size of long int: %lld\0A\00"
@.str.7 = [29 x i8] c"Size of long long int: %lld\0A\00"
@.str.8 = [21 x i8] c"Size of float: %lld\0A\00"
@.str.9 = [22 x i8] c"Size of double: %lld\0A\00"
@.str.10 = [27 x i8] c"Size of long double: %lld\0A\00"
@.str.11 = [229 x i8] c"WARNING: Since size of integer is only 4 bytes, some routines that input and output integer arguments will be limited to 2GB. For example, ROMIO will fail to work if try to write >2GB file, since buffer sizes must then be <2GB\0A\00"
define void @report_systeminfo(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = call i32 @IsLittleEndian()
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32*, i32** %2
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %6, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %11
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = call i32 (i32*, i8*, ...) @fprintf(i32* %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %11
11: ; preds = %8, %5
%12 = load i32*, i32** %2
%13 = call i32 (i32*, i8*, ...) @fprintf(i32* %12, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 1)
%14 = load i32*, i32** %2
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i64 2)
%16 = load i32*, i32** %2
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %16, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i64 4)
%18 = load i32*, i32** %2
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i64 8)
%20 = load i32*, i32** %2
%21 = call i32 (i32*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 8)
%22 = load i32*, i32** %2
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %22, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 8)
%24 = load i32*, i32** %2
%25 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i64 4)
%26 = load i32*, i32** %2
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %26, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i64 8)
%28 = load i32*, i32** %2
%29 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i64 16)
%30 = load i32*, i32** %2
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %30, i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str.11, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [25 x i8] c"System is Little Endian\0A\00"
@.str.1 = [22 x i8] c"System is Big Endian\0A\00"
@.str.2 = [20 x i8] c"Size of char: %lld\0A\00"
@.str.3 = [21 x i8] c"Size of short: %lld\0A\00"
@.str.4 = [19 x i8] c"Size of int: %lld\0A\00"
@.str.5 = [22 x i8] c"Size of size_t: %lld\0A\00"
@.str.6 = [24 x i8] c"Size of long int: %lld\0A\00"
@.str.7 = [29 x i8] c"Size of long long int: %lld\0A\00"
@.str.8 = [21 x i8] c"Size of float: %lld\0A\00"
@.str.9 = [22 x i8] c"Size of double: %lld\0A\00"
@.str.10 = [27 x i8] c"Size of long double: %lld\0A\00"
@.str.11 = [229 x i8] c"WARNING: Since size of integer is only 4 bytes, some routines that input and output integer arguments will be limited to 2GB. For example, ROMIO will fail to work if try to write >2GB file, since buffer sizes must then be <2GB\0A\00"
define void @report_systeminfo(i32* nocapture %0) {
%2 = tail call i32 @IsLittleEndian()
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i64 24, i64 1, i32* %0)
br label %8
6: ; preds = %1
%7 = tail call i64 @fwrite(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 21, i64 1, i32* %0)
br label %8
8: ; preds = %6, %4
%9 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i64 1)
%10 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i64 2)
%11 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0), i64 4)
%12 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i64 8)
%13 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 8)
%14 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.7, i64 0, i64 0), i64 8)
%15 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.8, i64 0, i64 0), i64 4)
%16 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0), i64 8)
%17 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.10, i64 0, i64 0), i64 16)
%18 = tail call i64 @fwrite(i8* getelementptr inbounds ([229 x i8], [229 x i8]* @.str.11, i64 0, i64 0), i64 228, i64 1, i32* %0)
ret void
}