#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 */
scalar_t__ GetEndian();
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int show_about(void) {
  printf("bp - A binary parse tool\n");
  printf("   Version: %s\n", "0.27.2");
  printf("   Endianness: %s\n", GetEndian() == 0 ? "Big" : "Little");
  printf("   Credits:\n");
  printf("     Vera Brittain <vbrittain@vad.gov.uk>\n");
  printf("     William Favorite <wfavorite@tablespace.net>\n");
  fflush(stdout);
  return (0);
}


x86 assembly (clang, -O0):
<show_about>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0xeda(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <GetEndian@plt>
mov    %rax,%rcx
lea    0xee0(%rip),%rsi
lea    0xed5(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rsi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e2a(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_about>:
push   %rax
lea    0xeed(%rip),%rdi
call   1040 <puts@plt>
lea    0xeac(%rip),%rdi
lea    0xeb5(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1030 <GetEndian@plt>
test   %rax,%rax
lea    0xeb7(%rip),%rax
lea    0xeb4(%rip),%rsi
cmove  %rax,%rsi
lea    0xe92(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%edi
call   1060 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [26 x i8] c"bp - A binary parse tool\0A\00"
@.str.1 = [16 x i8] c" Version: %s\0A\00"
@.str.2 = [7 x i8] c"0.27.2\00"
@.str.3 = [19 x i8] c" Endianness: %s\0A\00"
@.str.4 = [4 x i8] c"Big\00"
@.str.5 = [7 x i8] c"Little\00"
@.str.6 = [13 x i8] c" Credits:\0A\00"
@.str.7 = [43 x i8] c" Vera Brittain <vbrittain@vad.gov.uk>\0A\00"
@.str.8 = [50 x i8] c" William Favorite <wfavorite@tablespace.net>\0A\00"
@stdout = global i32 0
define i32 @show_about() {
%1 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = call i64 (...) @GetEndian()
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.8, i64 0, i64 0))
%11 = load i32, i32* @stdout
%12 = call i32 @fflush(i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [16 x i8] c" Version: %s\0A\00"
@.str.2 = [7 x i8] c"0.27.2\00"
@.str.3 = [19 x i8] c" Endianness: %s\0A\00"
@.str.4 = [4 x i8] c"Big\00"
@.str.5 = [7 x i8] c"Little\00"
@stdout = global i32 0
@str = [25 x i8] c"bp - A binary parse tool\00"
@str.9 = [12 x i8] c" Credits:\00"
@str.10 = [42 x i8] c" Vera Brittain <vbrittain@vad.gov.uk>\00"
@str.11 = [49 x i8] c" William Favorite <wfavorite@tablespace.net>\00"
define i32 @show_about() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i64 (...) @GetEndian()
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i8* %5)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.9, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.10, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.11, i64 0, i64 0))
%10 = load i32, i32* @stdout
%11 = tail call i32 @fflush(i32 %10)
ret i32 0
}