#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
char *strchr(char *, char);
void print_version(void) {
  char versionStr[255] = "$Revision: 1.12 $";
  char *versionPtr1, *versionPtr2;
  printf("grid-proxy-verify v");
  versionPtr1 = strchr(versionStr, ' ');
  if (versionPtr1) {
    versionPtr1++;
    versionPtr2 = strchr(versionPtr1, ' ');
    if (versionPtr2)
      *versionPtr2 = '\0';
    printf("%s", versionPtr1);
  } else {
    printf("666");
  }
  printf("  - written by Jan Just Keijser, Nikhef, 2008,2009\n");
  exit(0);
}


x86 assembly (clang, -O0):
<print_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
lea    -0x100(%rbp),%rdi
lea    0xea7(%rip),%rsi
mov    $0xff,%edx
call   1050 <memcpy@plt>
lea    0xf95(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x100(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x108(%rbp)
cmpq   $0x0,-0x108(%rbp)
je     11f3 <print_version+0xb3>
mov    -0x108(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x108(%rbp)
mov    -0x108(%rbp),%rdi
mov    $0x20,%esi
call   1030 <strchr@plt>
mov    %rax,-0x110(%rbp)
cmpq   $0x0,-0x110(%rbp)
je     11d9 <print_version+0x99>
mov    -0x110(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x108(%rbp),%rsi
lea    0xf2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1201 <print_version+0xc1>
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf12(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<print_version>:
push   %rbx
sub    $0x100,%rsp
lea    0xea1(%rip),%rsi
mov    %rsp,%rbx
mov    $0xff,%edx
mov    %rbx,%rdi
call   1060 <memcpy@plt>
lea    0xf89(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
jne    119f <print_version+0x4f>
lea    0xf80(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11cc <print_version+0x7c>
mov    %rax,%rbx
add    $0x1,%rbx
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <strchr@plt>
test   %rax,%rax
je     11bb <print_version+0x6b>
movb   $0x0,(%rax)
lea    0xf51(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf47(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@__const.print_version.versionStr = [255 x i8] c"$Revision: 1.12 $\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [20 x i8] c"grid-proxy-verify v\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"666\00"
@.str.3 = [52 x i8] c" - written by Jan Just Keijser, Nikhef, 2008,2009\0A\00"
define void @print_version() {
%1 = alloca [255 x i8]
%2 = alloca i8*
%3 = alloca i8*
%4 = bitcast [255 x i8]* %1 to i8*
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%7 = call i8* @strchr(i8* %6, i8 signext 32)
store i8* %7, i8** %2
%8 = load i8*, i8** %2
%9 = icmp ne i8* %8, null
br i1 %9, label %10, label %22
10: ; preds = %0
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8*, i8** %2
%14 = call i8* @strchr(i8* %13, i8 signext 32)
store i8* %14, i8** %3
%15 = load i8*, i8** %3
%16 = icmp ne i8* %15, null
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = load i8*, i8** %3
store i8 0, i8* %18
br label %19
19: ; preds = %17, %10
%20 = load i8*, i8** %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %20)
br label %24
22: ; preds = %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %22, %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%26 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@__const.print_version.versionStr = [255 x i8] c"$Revision: 1.12 $\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str = [20 x i8] c"grid-proxy-verify v\00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [4 x i8] c"666\00"
@str = [51 x i8] c" - written by Jan Just Keijser, Nikhef, 2008,2009\00"
define void @print_version() {
%1 = alloca [255 x i8]
%2 = getelementptr inbounds [255 x i8], [255 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%4 = call i8* @strchr(i8* %2, i8 signext 32)
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %0
%7 = getelementptr inbounds i8, i8* %4, i64 1
%8 = call i8* @strchr(i8* %7, i8 signext 32)
%9 = icmp eq i8* %8, null
br i1 %9, label %11, label %10
10: ; preds = %6
store i8 0, i8* %8
br label %11
11: ; preds = %10, %6
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
br label %15
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %15
15: ; preds = %13, %11
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%17 = call i32 @exit(i32 0)
unreachable
}