#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 */
char *s_testEndianess();
char *s_testFloatingPoint();
char *s_testSerialization();
const char *POSH_GetArchString(void) {
  const char *err;
  const char *s = "OS:.............."
                  "Linux"
                  "\n"
                  "CPU:............."
                  "AMD x86-64"
                  "\n"
                  "endian:.........."
                  "little"
                  "\n"
                  "ptr size:........"
                  "64-bits"
                  "\n"
                  "64-bit ints......"
                  "yes"
                  "\n"
                  "floating point..."
                  "enabled"
                  "\n"
                  "compiler........."
                  "Gnu GCC"
                  "\n";
  err = s_testEndianess();
  if (err != 0) {
    return err;
  }
  err = s_testSerialization();
  if (err != 0) {
    return err;
  }
  err = s_testFloatingPoint();
  if (err != 0) {
    return err;
  }
  return s;
}


x86 assembly (clang, -O0):
<POSH_GetArchString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1050 <s_testEndianess@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1166 <POSH_GetArchString+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b4 <POSH_GetArchString+0x84>
mov    $0x0,%al
call   1030 <s_testSerialization@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1189 <POSH_GetArchString+0x59>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b4 <POSH_GetArchString+0x84>
mov    $0x0,%al
call   1040 <s_testFloatingPoint@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     11ac <POSH_GetArchString+0x7c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b4 <POSH_GetArchString+0x84>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<POSH_GetArchString>:
push   %rax
xor    %eax,%eax
call   1050 <s_testEndianess@plt>
test   %rax,%rax
je     113f <POSH_GetArchString+0xf>
pop    %rcx
ret
xor    %eax,%eax
call   1030 <s_testSerialization@plt>
test   %rax,%rax
jne    113d <POSH_GetArchString+0xd>
xor    %eax,%eax
call   1040 <s_testFloatingPoint@plt>
mov    %rax,%rcx
test   %rax,%rax
lea    0xea1(%rip),%rax
cmovne %rcx,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [172 x i8] c"OS:..............Linux\0ACPU:.............AMD x86-64\0Aendian:..........little\0Aptr size:........64-bits\0A64-bit ints......yes\0Afloating point...enabled\0Acompiler.........Gnu GCC\0A\00"
define i8* @POSH_GetArchString() {
%1 = alloca i8*
%2 = alloca i8*
%3 = alloca i8*
store i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8** %3
%4 = call i8* (...) @s_testEndianess()
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %9
7: ; preds = %0
%8 = load i8*, i8** %2
store i8* %8, i8** %1
br label %23
9: ; preds = %0
%10 = call i8* (...) @s_testSerialization()
store i8* %10, i8** %2
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i8*, i8** %2
store i8* %14, i8** %1
br label %23
15: ; preds = %9
%16 = call i8* (...) @s_testFloatingPoint()
store i8* %16, i8** %2
%17 = load i8*, i8** %2
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %15
%20 = load i8*, i8** %2
store i8* %20, i8** %1
br label %23
21: ; preds = %15
%22 = load i8*, i8** %3
store i8* %22, i8** %1
br label %23
23: ; preds = %21, %19, %13, %7
%24 = load i8*, i8** %1
ret i8* %24
}

LLVM IR (-O2):
@.str = [172 x i8] c"OS:..............Linux\0ACPU:.............AMD x86-64\0Aendian:..........little\0Aptr size:........64-bits\0A64-bit ints......yes\0Afloating point...enabled\0Acompiler.........Gnu GCC\0A\00"
define i8* @POSH_GetArchString() {
%1 = tail call i8* (...) @s_testEndianess()
%2 = icmp eq i8* %1, null
br i1 %2, label %3, label %10
3: ; preds = %0
%4 = tail call i8* (...) @s_testSerialization()
%5 = icmp eq i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %3
%7 = tail call i8* (...) @s_testFloatingPoint()
%8 = icmp eq i8* %7, null
%9 = select i1 %8, i8* getelementptr inbounds ([172 x i8], [172 x i8]* @.str, i64 0, i64 0), i8* %7
br label %10
10: ; preds = %6, %3, %0
%11 = phi i8* [ %1, %0 ], [ %4, %3 ], [ %9, %6 ]
ret i8* %11
}