#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 atoi(char *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
scalar_t__ isdigit(char);
int /*<<< orphan*/ strncmp(char *, char *, int);
int /*<<< orphan*/ strstr(char *, char *);
int main() {
  FILE *fd = fopen("Changes", "r");
  FILE *fd2;
  char buf[1024];
  int i = 0, space = 0, j = 0;
  char releaseid[512];
  int generation = 0;
  *releaseid = '\0';
  i = 0;
  fd = fopen("src/version.c", "r");
  if (!fd)
    generation = 1;
  else {
    while (fgets(buf, 1023, fd)) {
      if (!strstr(buf, "char *generation"))
        continue;
      while (!isdigit(buf[i]))
        i++;
      j = i;
      while (isdigit(buf[j]))
        j++;
      buf[j] = 0;
      generation = (atoi(&buf[i]) + 1);
    }
  }
  fd = fopen("src/version.c.sh", "r");
  if (!fd)
    return 0;
  fd2 = fopen("src/version.c", "w");
  if (!fd2)
    return 0;
  while (fgets(buf, 1023, fd)) {
    if (!strncmp("cat >version.c <<!SUB!THIS!", buf, 27)) {
      while (fgets(buf, 1023, fd)) {
        if (!strncmp("!SUB!THIS!", buf, 10))
          break;
        if (!strncmp("char *creation = \"$creation\";", buf, 29))
          fprintf(fd2, "char *creation = __TIMESTAMP__;\n");
        else if (!strncmp("char *generation = \"$generation\";", buf, 33))
          fprintf(fd2, "char *generation = \"%d\";\n", generation);
        else if (!strncmp("char *buildid = \"$id\";", buf, 22))
          fprintf(fd2, "char *buildid = \"%s\";\n", releaseid);
        else
          fprintf(fd2, "%s", buf);
      }
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x640,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe77(%rip),%rdi
lea    0xe78(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x424(%rbp)
movl   $0x0,-0x428(%rbp)
movl   $0x0,-0x42c(%rbp)
movl   $0x0,-0x634(%rbp)
movb   $0x0,-0x630(%rbp)
movl   $0x0,-0x424(%rbp)
lea    0xe31(%rip),%rdi
lea    0xe28(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1203 <main+0x93>
movl   $0x1,-0x634(%rbp)
jmp    1301 <main+0x191>
jmp    1208 <main+0x98>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     12fc <main+0x18c>
lea    -0x420(%rbp),%rdi
lea    0xde3(%rip),%rsi
call   1090 <strstr@plt>
cmp    $0x0,%eax
jne    1248 <main+0xd8>
jmp    1208 <main+0x98>
jmp    124d <main+0xdd>
movslq -0x424(%rbp),%rax
movsbl -0x420(%rbp,%rax,1),%edi
ff
call   1040 <isdigit@plt>
cmp    $0x0,%rax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1277 <main+0x107>
jmp    128b <main+0x11b>
mov    -0x424(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x424(%rbp)
jmp    124d <main+0xdd>
mov    -0x424(%rbp),%eax
mov    %eax,-0x42c(%rbp)
movslq -0x42c(%rbp),%rax
movsbl -0x420(%rbp,%rax,1),%edi
ff
call   1040 <isdigit@plt>
cmp    $0x0,%rax
je     12c9 <main+0x159>
mov    -0x42c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x42c(%rbp)
jmp    1297 <main+0x127>
movslq -0x42c(%rbp),%rax
movb   $0x0,-0x420(%rbp,%rax,1)
movslq -0x424(%rbp),%rax
lea    -0x420(%rbp),%rdi
add    %rax,%rdi
call   1080 <atoi@plt>
add    $0x1,%eax
mov    %eax,-0x634(%rbp)
jmp    1208 <main+0x98>
jmp    1301 <main+0x191>
lea    0xd21(%rip),%rdi
lea    0xcf9(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    132f <main+0x1bf>
movl   $0x0,-0x4(%rbp)
jmp    14d3 <main+0x363>
lea    0xcd4(%rip),%rdi
lea    0xcfd(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    135d <main+0x1ed>
movl   $0x0,-0x4(%rbp)
jmp    14d3 <main+0x363>
jmp    1362 <main+0x1f2>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     14d3 <main+0x363>
lea    -0x420(%rbp),%rsi
lea    0xcad(%rip),%rdi
mov    $0x1b,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14ce <main+0x35e>
jmp    13a7 <main+0x237>
lea    -0x420(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    $0x3ff,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     14c9 <main+0x359>
lea    -0x420(%rbp),%rsi
lea    0xc79(%rip),%rdi
mov    $0xa,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    13ec <main+0x27c>
jmp    14c9 <main+0x359>
lea    -0x420(%rbp),%rsi
lea    0xc5e(%rip),%rdi
mov    $0x1d,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1424 <main+0x2b4>
mov    -0x18(%rbp),%rdi
lea    0xc5e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14c4 <main+0x354>
lea    -0x420(%rbp),%rsi
lea    0xc65(%rip),%rdi
mov    $0x21,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    1462 <main+0x2f2>
mov    -0x18(%rbp),%rdi
mov    -0x634(%rbp),%edx
lea    0xc63(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14bf <main+0x34f>
lea    -0x420(%rbp),%rsi
lea    0xc63(%rip),%rdi
mov    $0x16,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%eax
jne    14a1 <main+0x331>
mov    -0x18(%rbp),%rdi
lea    -0x630(%rbp),%rdx
lea    0xc55(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14ba <main+0x34a>
mov    -0x18(%rbp),%rdi
lea    -0x420(%rbp),%rdx
lea    0xc4e(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    14bf <main+0x34f>
jmp    14c4 <main+0x354>
jmp    13a7 <main+0x237>
jmp    14ce <main+0x35e>
jmp    1362 <main+0x1f2>
mov    -0x4(%rbp),%eax
add    $0x640,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x618,%rsp
lea    0xe58(%rip),%rdi
lea    0xe59(%rip),%rbx
mov    %rbx,%rsi
call   1080 <fopen@plt>
movb   $0x0,0x410(%rsp)
lea    0xe44(%rip),%rdi
mov    %rbx,%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     12c4 <main+0x134>
mov    %rax,%r13
xor    %r14d,%r14d
lea    0xf(%rsp),%r12
lea    0x10(%rsp),%rbp
lea    0xe2a(%rip),%rbx
movabs $0xffffffff00000000,%r15
ff ff ff
movl   $0x0,0xc(%rsp)
mov    %rbp,%rdi
mov    $0x3ff,%esi
mov    %r13,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     12cc <main+0x13c>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   10b0 <strstr@plt>
test   %eax,%eax
je     1200 <main+0x70>
mov    %r14,%rbx
shl    $0x20,%rbx
add    %r15,%rbx
mov    %r14d,%ecx
movslq %r14d,%r14
lea    (%r12,%r14,1),%rbp
add    $0xffffffffffffffff,%r14
movabs $0x100000000,%r15
nopw   0x0(%rax,%rax,1)
mov    %ecx,%r12d
add    %r15,%rbx
movsbl 0x1(%rbp),%edi
add    $0x1,%rbp
call   1040 <isdigit@plt>
add    $0x1,%r14
lea    0x1(%r12),%ecx
test   %rax,%rax
je     1250 <main+0xc0>
movslq %r12d,%rax
lea    (%rsp,%rax,1),%rbx
add    $0x10,%rbx
nopl   0x0(%rax)
movsbl (%rbx),%edi
call   1040 <isdigit@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    1280 <main+0xf0>
movb   $0x0,-0x1(%rbx)
mov    %rbp,%rdi
call   1090 <atoi@plt>
add    $0x1,%eax
mov    %eax,0xc(%rsp)
lea    0xf(%rsp),%r12
lea    0xd68(%rip),%rbx
movabs $0xffffffff00000000,%r15
ff ff ff
lea    0x10(%rsp),%rbp
jmp    1200 <main+0x70>
movl   $0x1,0xc(%rsp)
lea    0xd56(%rip),%rdi
lea    0xd2e(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1468 <main+0x2d8>
mov    %rax,%rbx
lea    0xd18(%rip),%rdi
lea    0xd41(%rip),%rsi
call   1080 <fopen@plt>
test   %rax,%rax
je     1468 <main+0x2d8>
mov    %rax,%r12
lea    0x10(%rsp),%rdi
mov    $0x3ff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1468 <main+0x2d8>
lea    0x10(%rsp),%rbp
lea    0xd1c(%rip),%r13
lea    0xd20(%rip),%r15
lea    0xd58(%rip),%r14
jmp    1369 <main+0x1d9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    $0x3ff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1468 <main+0x2d8>
lea    0xccc(%rip),%rdi
mov    %rbp,%rsi
mov    $0x1b,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
jne    1350 <main+0x1c0>
jmp    13a9 <main+0x219>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    $0x20,%esi
mov    $0x1,%edx
lea    0xcd5(%rip),%rdi
mov    %r12,%rcx
call   10a0 <fwrite@plt>
mov    %rbp,%rdi
mov    $0x3ff,%esi
mov    %rbx,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1350 <main+0x1c0>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    $0xa,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1350 <main+0x1c0>
mov    %r15,%rdi
mov    %rbp,%rsi
mov    $0x1d,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1390 <main+0x200>
mov    %r14,%rdi
mov    %rbp,%rsi
mov    $0x21,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     1430 <main+0x2a0>
lea    0xcce(%rip),%rdi
mov    %rbp,%rsi
mov    $0x16,%edx
call   1030 <strncmp@plt>
test   %eax,%eax
je     144a <main+0x2ba>
mov    %rbp,%rdi
mov    %r12,%rsi
call   1050 <fputs@plt>
jmp    13a9 <main+0x219>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r12,%rdi
lea    0xc7f(%rip),%rsi
mov    0xc(%rsp),%edx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13a9 <main+0x219>
mov    %r12,%rdi
lea    0xc96(%rip),%rsi
lea    0x410(%rsp),%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
jmp    13a9 <main+0x219>
xor    %eax,%eax
add    $0x618,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"Changes\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"src/version.c\00"
@.str.3 = [17 x i8] c"char *generation\00"
@.str.4 = [17 x i8] c"src/version.c.sh\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [28 x i8] c"cat >version.c <<!SUB!THIS!\00"
@.str.7 = [11 x i8] c"!SUB!THIS!\00"
@.str.8 = [30 x i8] c"char *creation = \22$creation\22;\00"
@.str.9 = [33 x i8] c"char *creation = __TIMESTAMP__;\0A\00"
@.str.10 = [34 x i8] c"char *generation = \22$generation\22;\00"
@.str.11 = [26 x i8] c"char *generation = \22%d\22;\0A\00"
@.str.12 = [23 x i8] c"char *buildid = \22$id\22;\00"
@.str.13 = [23 x i8] c"char *buildid = \22%s\22;\0A\00"
@.str.14 = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca [1024 x i8]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [512 x i8]
%9 = alloca i32
store i32 0, i32* %1
%10 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %10, i32** %2
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %9
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
store i8 0, i8* %11
store i32 0, i32* %5
%12 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %12, i32** %2
%13 = load i32*, i32** %2
%14 = icmp ne i32* %13, null
br i1 %14, label %16, label %15
15: ; preds = %0
store i32 1, i32* %9
br label %61
16: ; preds = %0
br label %17
17: ; preds = %51, %26, %16
%18 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%19 = load i32*, i32** %2
%20 = call i64 @fgets(i8* %18, i32 1023, i32* %19)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %60
22: ; preds = %17
%23 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%24 = call i32 @strstr(i8* %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%25 = icmp ne i32 %24, 0
br i1 %25, label %27, label %26
26: ; preds = %22
br label %17
27: ; preds = %22
br label %28
28: ; preds = %36, %27
%29 = load i32, i32* %5
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = call i64 @isdigit(i8 signext %32)
%34 = icmp ne i64 %33, 0
%35 = xor i1 %34, true
br i1 %35, label %36, label %39
36: ; preds = %28
%37 = load i32, i32* %5
%38 = add nsw i32 %37, 1
store i32 %38, i32* %5
br label %28
39: ; preds = %28
%40 = load i32, i32* %5
store i32 %40, i32* %7
br label %41
41: ; preds = %48, %39
%42 = load i32, i32* %7
%43 = sext i32 %42 to i64
%44 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %43
%45 = load i8, i8* %44
%46 = call i64 @isdigit(i8 signext %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %41
%49 = load i32, i32* %7
%50 = add nsw i32 %49, 1
store i32 %50, i32* %7
br label %41
51: ; preds = %41
%52 = load i32, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %53
store i8 0, i8* %54
%55 = load i32, i32* %5
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 %56
%58 = call i32 @atoi(i8* %57)
%59 = add nsw i32 %58, 1
store i32 %59, i32* %9
br label %17
60: ; preds = %17
br label %61
61: ; preds = %60, %15
%62 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %62, i32** %2
%63 = load i32*, i32** %2
%64 = icmp ne i32* %63, null
br i1 %64, label %66, label %65
65: ; preds = %61
store i32 0, i32* %1
br label %124
66: ; preds = %61
%67 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
store i32* %67, i32** %3
%68 = load i32*, i32** %3
%69 = icmp ne i32* %68, null
br i1 %69, label %71, label %70
70: ; preds = %66
store i32 0, i32* %1
br label %124
71: ; preds = %66
br label %72
72: ; preds = %123, %71
%73 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%74 = load i32*, i32** %2
%75 = call i64 @fgets(i8* %73, i32 1023, i32* %74)
%76 = icmp ne i64 %75, 0
br i1 %76, label %77, label %124
77: ; preds = %72
%78 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%79 = call i32 @strncmp(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* %78, i32 27)
%80 = icmp ne i32 %79, 0
br i1 %80, label %123, label %81
81: ; preds = %77
br label %82
82: ; preds = %121, %81
%83 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%84 = load i32*, i32** %2
%85 = call i64 @fgets(i8* %83, i32 1023, i32* %84)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %122
87: ; preds = %82
%88 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%89 = call i32 @strncmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %88, i32 10)
%90 = icmp ne i32 %89, 0
br i1 %90, label %92, label %91
91: ; preds = %87
br label %122
92: ; preds = %87
%93 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%94 = call i32 @strncmp(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %93, i32 29)
%95 = icmp ne i32 %94, 0
br i1 %95, label %99, label %96
96: ; preds = %92
%97 = load i32*, i32** %3
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %97, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0))
br label %121
99: ; preds = %92
%100 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%101 = call i32 @strncmp(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %100, i32 33)
%102 = icmp ne i32 %101, 0
br i1 %102, label %107, label %103
103: ; preds = %99
%104 = load i32*, i32** %3
%105 = load i32, i32* %9
%106 = call i32 (i32*, i8*, ...) @fprintf(i32* %104, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 %105)
br label %120
107: ; preds = %99
%108 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%109 = call i32 @strncmp(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %108, i32 22)
%110 = icmp ne i32 %109, 0
br i1 %110, label %115, label %111
111: ; preds = %107
%112 = load i32*, i32** %3
%113 = getelementptr inbounds [512 x i8], [512 x i8]* %8, i64 0, i64 0
%114 = call i32 (i32*, i8*, ...) @fprintf(i32* %112, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %113)
br label %119
115: ; preds = %107
%116 = load i32*, i32** %3
%117 = getelementptr inbounds [1024 x i8], [1024 x i8]* %4, i64 0, i64 0
%118 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i64 0, i64 0), i8* %117)
br label %119
119: ; preds = %115, %111
br label %120
120: ; preds = %119, %103
br label %121
121: ; preds = %120, %96
br label %82
122: ; preds = %91, %82
br label %123
123: ; preds = %122, %77
br label %72
124: ; preds = %65, %70, %72
%125 = load i32, i32* %1
ret i32 %125
}

LLVM IR (-O2):
@.str = [8 x i8] c"Changes\00"
@.str.1 = [2 x i8] c"r\00"
@.str.2 = [14 x i8] c"src/version.c\00"
@.str.3 = [17 x i8] c"char *generation\00"
@.str.4 = [17 x i8] c"src/version.c.sh\00"
@.str.5 = [2 x i8] c"w\00"
@.str.6 = [28 x i8] c"cat >version.c <<!SUB!THIS!\00"
@.str.7 = [11 x i8] c"!SUB!THIS!\00"
@.str.8 = [30 x i8] c"char *creation = \22$creation\22;\00"
@.str.9 = [33 x i8] c"char *creation = __TIMESTAMP__;\0A\00"
@.str.10 = [34 x i8] c"char *generation = \22$generation\22;\00"
@.str.11 = [26 x i8] c"char *generation = \22%d\22;\0A\00"
@.str.12 = [23 x i8] c"char *buildid = \22$id\22;\00"
@.str.13 = [23 x i8] c"char *buildid = \22%s\22;\0A\00"
define i32 @main() {
%1 = alloca [1024 x i8]
%2 = alloca [512 x i8]
%3 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 0
%5 = getelementptr inbounds [512 x i8], [512 x i8]* %2, i64 0, i64 0
store i8 0, i8* %5
%6 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32* %6, null
br i1 %7, label %42, label %8
8: ; preds = %0, %38
%9 = phi i64 [ %21, %38 ], [ 0, %0 ]
%10 = phi i32 [ %41, %38 ], [ 0, %0 ]
br label %11
11: ; preds = %8, %14
%12 = call i64 @fgets(i8* %4, i32 1023, i32* %6)
%13 = icmp eq i64 %12, 0
br i1 %13, label %42, label %14
14: ; preds = %11
%15 = call i32 @strstr(i8* %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%16 = icmp eq i32 %15, 0
br i1 %16, label %11, label %17
17: ; preds = %14
%18 = shl i64 %9, 32
%19 = ashr exact i64 %18, 32
br label %20
20: ; preds = %17, %20
%21 = phi i64 [ %19, %17 ], [ %26, %20 ]
%22 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %21
%23 = load i8, i8* %22
%24 = call i64 @isdigit(i8 signext %23)
%25 = icmp eq i64 %24, 0
%26 = add i64 %21, 1
br i1 %25, label %20, label %27
27: ; preds = %20
%28 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %21
%29 = shl i64 %21, 32
%30 = ashr exact i64 %29, 32
br label %31
31: ; preds = %31, %27
%32 = phi i64 [ %37, %31 ], [ %30, %27 ]
%33 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = call i64 @isdigit(i8 signext %34)
%36 = icmp eq i64 %35, 0
%37 = add i64 %32, 1
br i1 %36, label %38, label %31
38: ; preds = %31
%39 = getelementptr inbounds [1024 x i8], [1024 x i8]* %1, i64 0, i64 %32
store i8 0, i8* %39
%40 = call i32 @atoi(i8* %28)
%41 = add nsw i32 %40, 1
br label %8
42: ; preds = %11, %0
%43 = phi i32 [ 1, %0 ], [ %10, %11 ]
%44 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%45 = icmp eq i32* %44, null
br i1 %45, label %84, label %46
46: ; preds = %42
%47 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%48 = icmp eq i32* %47, null
br i1 %48, label %84, label %49
49: ; preds = %46
%50 = call i64 @fgets(i8* %4, i32 1023, i32* %44)
%51 = icmp eq i64 %50, 0
br i1 %51, label %84, label %52
52: ; preds = %49, %81
%53 = call i32 @strncmp(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i8* %4, i32 27)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %81
55: ; preds = %52
%56 = call i64 @fgets(i8* %4, i32 1023, i32* %44)
%57 = icmp eq i64 %56, 0
br i1 %57, label %81, label %58
58: ; preds = %55, %78
%59 = call i32 @strncmp(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8* %4, i32 10)
%60 = icmp eq i32 %59, 0
br i1 %60, label %81, label %61
61: ; preds = %58
%62 = call i32 @strncmp(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0), i8* %4, i32 29)
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %61
%65 = call i64 @fwrite(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.9, i64 0, i64 0), i64 32, i64 1, i32* %47)
br label %78
66: ; preds = %61
%67 = call i32 @strncmp(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.10, i64 0, i64 0), i8* %4, i32 33)
%68 = icmp eq i32 %67, 0
br i1 %68, label %69, label %71
69: ; preds = %66
%70 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0), i32 %43)
br label %78
71: ; preds = %66
%72 = call i32 @strncmp(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.12, i64 0, i64 0), i8* %4, i32 22)
%73 = icmp eq i32 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %71
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), i8* %5)
br label %78
76: ; preds = %71
%77 = call i32 @fputs(i8* %4, i32* %47)
br label %78
78: ; preds = %69, %76, %74, %64
%79 = call i64 @fgets(i8* %4, i32 1023, i32* %44)
%80 = icmp eq i64 %79, 0
br i1 %80, label %81, label %58
81: ; preds = %58, %78, %55, %52
%82 = call i64 @fgets(i8* %4, i32 1023, i32* %44)
%83 = icmp eq i64 %82, 0
br i1 %83, label %84, label %52
84: ; preds = %81, %49, %46, %42
ret i32 0
}