#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*/ fflush(int /*<<< orphan*/);
char *isbigendian();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ system(char *);
int main() {
  printf("arch_sizeof_short=%d\n", sizeof(short));
  printf("arch_sizeof_int=%d\n", sizeof(int));
  printf("arch_sizeof_long=%d\n", sizeof(long));
  printf("arch_sizeof_long_long=%d\n", sizeof(long long));
  printf("arch_sizeof_char_p=%d\n", sizeof(char *));
  printf("arch_bigendian=%s\n", isbigendian());
  printf("arch_machine=");
  fflush(stdout);
  system("uname -m");
  system("echo arch_target=`uname -m -p | tr ' ' -`-linux");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xead(%rip),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeae(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb7(%rip),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1030 <isbigendian@plt>
mov    %rax,%rsi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    0x2e05(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xea8(%rip),%rdi
call   1040 <system@plt>
lea    0xea5(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeb8(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebc(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec5(%rip),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <isbigendian@plt>
lea    0xec2(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
lea    0xeb6(%rip),%rdi
call   1040 <system@plt>
lea    0xeb3(%rip),%rdi
call   1040 <system@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"arch_sizeof_short=%d\0A\00"
@.str.1 = [20 x i8] c"arch_sizeof_int=%d\0A\00"
@.str.2 = [21 x i8] c"arch_sizeof_long=%d\0A\00"
@.str.3 = [26 x i8] c"arch_sizeof_long_long=%d\0A\00"
@.str.4 = [23 x i8] c"arch_sizeof_char_p=%d\0A\00"
@.str.5 = [19 x i8] c"arch_bigendian=%s\0A\00"
@.str.6 = [14 x i8] c"arch_machine=\00"
@stdout = global i32 0
@.str.7 = [9 x i8] c"uname -m\00"
@.str.8 = [48 x i8] c"echo arch_target=`uname -m -p | tr ' ' -`-linux\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 2)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 4)
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i64 8)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i64 8)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 8)
%7 = call i8* (...) @isbigendian()
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = call i32 @fflush(i32 %10)
%12 = call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"arch_sizeof_short=%d\0A\00"
@.str.1 = [20 x i8] c"arch_sizeof_int=%d\0A\00"
@.str.2 = [21 x i8] c"arch_sizeof_long=%d\0A\00"
@.str.3 = [26 x i8] c"arch_sizeof_long_long=%d\0A\00"
@.str.4 = [23 x i8] c"arch_sizeof_char_p=%d\0A\00"
@.str.5 = [19 x i8] c"arch_bigendian=%s\0A\00"
@.str.6 = [14 x i8] c"arch_machine=\00"
@stdout = global i32 0
@.str.7 = [9 x i8] c"uname -m\00"
@.str.8 = [48 x i8] c"echo arch_target=`uname -m -p | tr ' ' -`-linux\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 2)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i64 4)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i64 8)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.3, i64 0, i64 0), i64 8)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i64 8)
%6 = tail call i8* (...) @isbigendian()
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i8* %6)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0))
%9 = load i32, i32* @stdout
%10 = tail call i32 @fflush(i32 %9)
%11 = tail call i32 @system(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 @system(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}