#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__ isdigit(char);
int /*<<< orphan*/ printf(char *, char *);
void version() {
  char ver[128] = "$Revision: 1.138 $";
  int i = 11;
  while (isdigit(ver[i]) || (ver[i] == '.'))
    i++;
  ver[i] = 0;
  printf("CAP - C Auxilary Preprocessor - version %s\n", ver + 11);
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
lea    -0x80(%rbp),%rdi
lea    0xeba(%rip),%rsi
mov    $0x80,%edx
call   1050 <memcpy@plt>
movl   $0xb,-0x84(%rbp)
movslq -0x84(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%edi
call   1030 <isdigit@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x85(%rbp)
jne    1198 <version+0x68>
movslq -0x84(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x2e,%eax
sete   %al
mov    %al,-0x85(%rbp)
mov    -0x85(%rbp),%al
test   $0x1,%al
jne    11ab <version+0x7b>
jmp    11bf <version+0x8f>
mov    -0x84(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84(%rbp)
jmp    115a <version+0x2a>
movslq -0x84(%rbp),%rax
movb   $0x0,-0x80(%rbp,%rax,1)
lea    -0x80(%rbp),%rsi
add    $0xb,%rsi
lea    0xea6(%rip),%rdi
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
push   %r14
push   %rbx
sub    $0x88,%rsp
movaps 0xf3f(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xf23(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
movaps 0xf07(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xeeb(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xecf(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xeb3(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xe97(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xe7b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x31,%edi
call   1030 <isdigit@plt>
mov    $0xb,%r14d
test   %rax,%rax
je     11bc <version+0x9c>
xchg   %ax,%ax
movzbl 0x1(%rsp,%r14,1),%ebx
add    $0x1,%r14
movsbl %bl,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
jne    11a0 <version+0x80>
cmp    $0x2e,%bl
je     11a0 <version+0x80>
movb   $0x0,(%rsp,%r14,1)
lea    0xb(%rsp),%rsi
lea    0xeb3(%rip),%rdi
call   1040 <printf@plt>
add    $0x88,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.version.ver = [128 x i8] c"$Revision: 1.138 $\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 = [44 x i8] c"CAP - C Auxilary Preprocessor - version %s\0A\00"
define void @version() {
%1 = alloca [128 x i8]
%2 = alloca i32
%3 = bitcast [128 x i8]* %1 to i8*
store i32 11, i32* %2
br label %4
4: ; preds = %20, %0
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %6
%8 = load i8, i8* %7
%9 = call i64 @isdigit(i8 signext %8)
%10 = icmp ne i64 %9, 0
br i1 %10, label %18, label %11
11: ; preds = %4
%12 = load i32, i32* %2
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %13
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 46
br label %18
18: ; preds = %11, %4
%19 = phi i1 [ true, %4 ], [ %17, %11 ]
br i1 %19, label %20, label %23
20: ; preds = %18
%21 = load i32, i32* %2
%22 = add nsw i32 %21, 1
store i32 %22, i32* %2
br label %4
23: ; preds = %18
%24 = load i32, i32* %2
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %25
store i8 0, i8* %26
%27 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%28 = getelementptr inbounds i8, i8* %27, i64 11
%29 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %28)
ret void
}

LLVM IR (-O2):
@__const.version.ver = [128 x i8] c"$Revision: 1.138 $\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\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 = [44 x i8] c"CAP - C Auxilary Preprocessor - version %s\0A\00"
define void @version() {
%1 = alloca [128 x i8]
%2 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 0
%3 = tail call i64 @isdigit(i8 signext 49)
%4 = icmp eq i64 %3, 0
br i1 %4, label %14, label %5
5: ; preds = %0, %5
%6 = phi i64 [ %7, %5 ], [ 11, %0 ]
%7 = add nuw i64 %6, 1
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %7
%9 = load i8, i8* %8
%10 = tail call i64 @isdigit(i8 signext %9)
%11 = icmp ne i64 %10, 0
%12 = icmp eq i8 %9, 46
%13 = or i1 %11, %12
br i1 %13, label %5, label %14
14: ; preds = %5, %0
%15 = phi i64 [ 11, %0 ], [ %7, %5 ]
%16 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 %15
store i8 0, i8* %16
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %1, i64 0, i64 11
%18 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i8* %17)
ret void
}