#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*/ printf(char *, ...);
scalar_t__ strcmp(char *, char *);
int svnrev_to_int(char *);
void print_version(const char *progname) {
  printf("%s: onion ", progname);
  if (strcmp("1.2", "svn") == 0)
    printf("rev%i", svnrev_to_int("$Rev$"));
  else
    printf("v%s", "1.2");
  printf("\n\n");
  printf("Copyright (c) 2011-2015 Jan Pomikalek <jan.pomikalek@gmail.com>\n");
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0xeb3(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    118c <print_version+0x5c>
lea    0xea7(%rip),%rdi
call   1040 <svnrev_to_int@plt>
mov    %eax,%esi
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a1 <print_version+0x71>
lea    0xe8c(%rip),%rdi
lea    0xe71(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_version>:
push   %rax
mov    %rdi,%rsi
lea    0xeb5(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb2(%rip),%rdi
lea    0xeaf(%rip),%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     1181 <print_version+0x41>
lea    0xeae(%rip),%rdi
lea    0xe93(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    119d <print_version+0x5d>
lea    0xe91(%rip),%rdi
call   1050 <svnrev_to_int@plt>
lea    0xe7f(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
call   1030 <puts@plt>
lea    0xe75(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"%s: onion \00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [4 x i8] c"svn\00"
@.str.3 = [6 x i8] c"rev%i\00"
@.str.4 = [6 x i8] c"$Rev$\00"
@.str.5 = [4 x i8] c"v%s\00"
@.str.6 = [3 x i8] c"\0A\0A\00"
@.str.7 = [65 x i8] c"Copyright (c) 2011-2015 Jan Pomikalek <jan.pomikalek@gmail.com>\0A\00"
define void @print_version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %1
%8 = call i32 @svnrev_to_int(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %8)
br label %12
10: ; preds = %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %12
12: ; preds = %10, %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"%s: onion \00"
@.str.1 = [4 x i8] c"1.2\00"
@.str.2 = [4 x i8] c"svn\00"
@.str.3 = [6 x i8] c"rev%i\00"
@.str.4 = [6 x i8] c"$Rev$\00"
@.str.5 = [4 x i8] c"v%s\00"
@str = [2 x i8] c"\0A\00"
@str.8 = [64 x i8] c"Copyright (c) 2011-2015 Jan Pomikalek <jan.pomikalek@gmail.com>\00"
define void @print_version(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i64 @strcmp(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = tail call i32 @svnrev_to_int(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br label %10
8: ; preds = %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str.8, i64 0, i64 0))
ret void
}