#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 *makeversion(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
void showversion(void) {
  char versionbuf[80];
  char *v;
  extern char doitlib_revision[];
  v = makeversion(versionbuf, "$Revision: 8420 $");
  if (v)
    printf("doitclient revision %s", v);
  else
    printf("doitclient unknown version");
  v = makeversion(versionbuf, doitlib_revision);
  if (v)
    printf(" (doitlib revision %s)\n", v);
  else
    printf("\n");
}


x86 assembly (clang, -O0):
<showversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
lea    -0x50(%rbp),%rdi
lea    0xecd(%rip),%rsi
call   1040 <makeversion@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     115e <showversion+0x3e>
mov    -0x58(%rbp),%rsi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116c <showversion+0x4c>
lea    0xec4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    0x2e71(%rip),%rsi
call   1040 <makeversion@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
je     11a2 <showversion+0x82>
mov    -0x58(%rbp),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b0 <showversion+0x90>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<showversion>:
sub    $0x58,%rsp
lea    0xec5(%rip),%rsi
mov    %rsp,%rdi
call   1050 <makeversion@plt>
test   %rax,%rax
je     115b <showversion+0x2b>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1169 <showversion+0x39>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e78(%rip),%rsi
mov    %rsp,%rdi
call   1050 <makeversion@plt>
test   %rax,%rax
je     1193 <showversion+0x63>
lea    0xec0(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x58,%rsp
ret
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x58,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"$Revision: 8420 $\00"
@.str.1 = [23 x i8] c"doitclient revision %s\00"
@.str.2 = [27 x i8] c"doitclient unknown version\00"
@doitlib_revision = external global [0 x i8]
@.str.3 = [24 x i8] c" (doitlib revision %s)\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
define void @showversion() {
%1 = alloca [80 x i8]
%2 = alloca i8*
%3 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%4 = call i8* @makeversion(i8* %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i8* %4, i8** %2
%5 = load i8*, i8** %2
%6 = icmp ne i8* %5, null
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %8)
br label %12
10: ; preds = %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%14 = call i8* @makeversion(i8* %13, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @doitlib_revision, i64 0, i64 0))
store i8* %14, i8** %2
%15 = load i8*, i8** %2
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %20
17: ; preds = %12
%18 = load i8*, i8** %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %18)
br label %22
20: ; preds = %12
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %22
22: ; preds = %20, %17
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"$Revision: 8420 $\00"
@.str.1 = [23 x i8] c"doitclient revision %s\00"
@.str.2 = [27 x i8] c"doitclient unknown version\00"
@doitlib_revision = external global [0 x i8]
@.str.3 = [24 x i8] c" (doitlib revision %s)\0A\00"
define void @showversion() {
%1 = alloca [80 x i8]
%2 = getelementptr inbounds [80 x i8], [80 x i8]* %1, i64 0, i64 0
%3 = call i8* @makeversion(i8* %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i8* %3, null
br i1 %4, label %7, label %5
5: ; preds = %0
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %3)
br label %9
7: ; preds = %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
br label %9
9: ; preds = %7, %5
%10 = call i8* @makeversion(i8* %2, i8* getelementptr inbounds ([0 x i8], [0 x i8]* @doitlib_revision, i64 0, i64 0))
%11 = icmp eq i8* %10, null
br i1 %11, label %14, label %12
12: ; preds = %9
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0), i8* %10)
br label %16
14: ; preds = %9
%15 = call i32 @putchar(i32 10)
br label %16
16: ; preds = %14, %12
ret void
}