#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*/ fprintf(int /*<<< orphan*/ *, char *, char const *, ...);
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(char, int /*<<< orphan*/ *);
void version_etc(FILE *stream, const char *command_name, const char *package,
                 const char *version, const char *authors) {
  if (command_name)
    fprintf(stream, "%s (%s) %s\n", command_name, package, version);
  else
    fprintf(stream, "%s %s\n", package, version);
  fprintf(stream, "Written by %s.\n", authors);
  putc('\n', stream);
  fputs("This is free software; see the source for copying conditions.  There "
        "is NO\nwarranty; not even for MERCHANTABILITY or FITNESS FOR A "
        "PARTICULAR PURPOSE.\n",
        stream);
}


x86 assembly (clang, -O0):
<version_etc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     117a <version_etc+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1194 <version_etc+0x64>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xe7f(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rdx
lea    0xe70(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x8(%rbp),%rsi
mov    $0xa,%edi
call   1040 <putc@plt>
mov    -0x8(%rbp),%rsi
lea    0xe60(%rip),%rdi
call   1030 <fputs@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version_etc>:
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %rcx,%r8
mov    %rdx,%rcx
mov    %rdi,%rbx
test   %rsi,%rsi
je     115b <version_etc+0x2b>
mov    %rsi,%rdx
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1172 <version_etc+0x42>
lea    0xeaa(%rip),%rsi
mov    %rbx,%rdi
mov    %rcx,%rdx
mov    %r8,%rcx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe9a(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0xa,%edi
mov    %rbx,%rsi
call   1030 <putc@plt>
lea    0xe89(%rip),%rdi
mov    $0x97,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <fwrite@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"%s (%s) %s\0A\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [16 x i8] c"Written by %s.\0A\00"
@.str.3 = [152 x i8] c"This is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @version_etc(i32* %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i8*, i8** %7
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %5
%14 = load i32*, i32** %6
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8*, i8** %9
%18 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %15, i8* %16, i8* %17)
br label %24
19: ; preds = %5
%20 = load i32*, i32** %6
%21 = load i8*, i8** %8
%22 = load i8*, i8** %9
%23 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %20, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %21, i8* %22)
br label %24
24: ; preds = %19, %13
%25 = load i32*, i32** %6
%26 = load i8*, i8** %10
%27 = call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %25, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i32*, i32** %6
%29 = call i32 @putc(i8 signext 10, i32* %28)
%30 = load i32*, i32** %6
%31 = call i32 @fputs(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.3, i64 0, i64 0), i32* %30)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"%s (%s) %s\0A\00"
@.str.1 = [7 x i8] c"%s %s\0A\00"
@.str.2 = [16 x i8] c"Written by %s.\0A\00"
@.str.3 = [152 x i8] c"This is free software; see the source for copying conditions. There is NO\0Awarranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\0A\00"
define void @version_etc(i32* nocapture %0, i8* %1, i8* %2, i8* %3, i8* %4) {
%6 = icmp eq i8* %1, null
br i1 %6, label %9, label %7
7: ; preds = %5
%8 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %1, i8* %2, i8* %3)
br label %11
9: ; preds = %5
%10 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %2, i8* %3)
br label %11
11: ; preds = %9, %7
%12 = tail call i32 (i32*, i8*, i8*, ...) @fprintf(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), i8* %4)
%13 = tail call i32 @putc(i8 signext 10, i32* %0)
%14 = tail call i64 @fwrite(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str.3, i64 0, i64 0), i64 151, i64 1, i32* %0)
ret void
}