#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 */
char *GetNextToken(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ SEEK_SET;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, char *);
char *realloc(char *, int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
void GenTopicLoc(FILE *infile, FILE *outfile) {
  char *topic, *topicFile, *topicPos;
  char *trueTopicID = NULL;
  char *locationIdNew = NULL;
  char *idList = NULL;
  fseek(infile, 0, SEEK_SET);
  fprintf(
      outfile,
      "# Topic Locations (file names, file positions, and non-topic IDs)\n");
  while (1) {
    if ((topic = GetNextToken(infile, 1)) == NULL)
      break;
    if (*(topic + strlen(topic) - 1) == ':') {
      *(topic + strlen(topic) - 1) = '\0';
      if (trueTopicID != (char *)NULL && idList != (char *)NULL) {
        fprintf(outfile, "*.%s.locationIDs:\t%s\n", trueTopicID, idList);
        free(trueTopicID);
        free(idList);
        idList = (char *)NULL;
      }
      trueTopicID = malloc(strlen(topic) + 1);
      strcpy(trueTopicID, topic);
      if ((topicFile = GetNextToken(infile, 1)) == NULL)
        break;
      if ((topicPos = GetNextToken(infile, 1)) == NULL)
        break;
      fprintf(outfile, "*.%s.filename:\t%s\n", topic, topicFile);
      fprintf(outfile, "*.%s.filepos:\t%s\n", topic, topicPos);
      free(topicFile);
      free(topicPos);
    } else if (*(topic + strlen(topic) - 1) == '>') {
      if ((locationIdNew = GetNextToken(infile, 1)) == NULL)
        break;
      if (idList == (char *)NULL) {
        idList = malloc(strlen(locationIdNew) + 1);
        strcpy(idList, locationIdNew);
      } else {
        idList = realloc(idList, strlen(idList) + strlen(locationIdNew) + 2);
        strcat(idList, " ");
        strcat(idList, locationIdNew);
      }
    } else {
      printf("The <volume>%s file is corrupt!\n", ".idt");
    }
    free(topic);
  }
  if (trueTopicID != (char *)NULL && idList != (char *)NULL) {
    fprintf(outfile, "*.%s.locationIDs:\t%s\n", trueTopicID, idList);
    free(trueTopicID);
    free(idList);
  }
  fprintf(outfile, "\n\n");
}


x86 assembly (clang, -O0):
<GenTopicLoc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2e0d(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
mov    -0x10(%rbp),%rdi
lea    0xe19(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    120f <GenTopicLoc+0x6f>
jmp    1448 <GenTopicLoc+0x2a8>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x48(%rbp),%rax
movslq %ecx,%rcx
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x3a,%eax
jne    1351 <GenTopicLoc+0x1b1>
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
movslq %ecx,%rcx
movb   $0x0,-0x1(%rax,%rcx,1)
cmpq   $0x0,-0x30(%rbp)
je     12a0 <GenTopicLoc+0x100>
cmpq   $0x0,-0x40(%rbp)
je     12a0 <GenTopicLoc+0x100>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x40(%rbp),%rcx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1090 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcpy@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
jne    12e5 <GenTopicLoc+0x145>
jmp    1448 <GenTopicLoc+0x2a8>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    1306 <GenTopicLoc+0x166>
jmp    1448 <GenTopicLoc+0x2a8>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xd40(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0xd39(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rdi
call   1030 <free@plt>
jmp    143a <GenTopicLoc+0x29a>
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%rax
movslq %ecx,%rcx
movsbl -0x1(%rax,%rcx,1),%eax
cmp    $0x3e,%eax
jne    1422 <GenTopicLoc+0x282>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    139a <GenTopicLoc+0x1fa>
jmp    1448 <GenTopicLoc+0x2a8>
cmpq   $0x0,-0x40(%rbp)
jne    13ce <GenTopicLoc+0x22e>
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,%edi
add    $0x1,%edi
call   1090 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   1040 <strcpy@plt>
jmp    141d <GenTopicLoc+0x27d>
mov    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rdi
call   1050 <strlen@plt>
mov    %eax,-0x64(%rbp)
mov    -0x38(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x64(%rbp),%esi
mov    -0x60(%rbp),%rdi
add    %eax,%esi
add    $0x2,%esi
call   10b0 <realloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xc73(%rip),%rsi
call   10c0 <strcat@plt>
mov    -0x40(%rbp),%rdi
mov    -0x38(%rbp),%rsi
call   10c0 <strcat@plt>
jmp    1435 <GenTopicLoc+0x295>
lea    0xc57(%rip),%rdi
lea    0xc71(%rip),%rsi
call   1060 <printf@plt>
jmp    143a <GenTopicLoc+0x29a>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
jmp    11ee <GenTopicLoc+0x4e>
cmpq   $0x0,-0x30(%rbp)
je     148a <GenTopicLoc+0x2ea>
cmpq   $0x0,-0x40(%rbp)
je     148a <GenTopicLoc+0x2ea>
mov    -0x10(%rbp),%rdi
mov    -0x30(%rbp),%rdx
mov    -0x40(%rbp),%rcx
lea    0xbd2(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x10(%rbp),%rdi
lea    0xc11(%rip),%rsi
mov    $0x0,%al
call   1080 <fprintf@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GenTopicLoc>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0x2e18(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   10a0 <fseek@plt>
lea    0xe28(%rip),%rdi
mov    $0x42,%esi
mov    $0x1,%edx
mov    %r13,%rcx
call   10d0 <fwrite@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
test   %rax,%rax
je     1406 <GenTopicLoc+0x256>
mov    %rax,%r15
xor    %r12d,%r12d
xor    %r14d,%r14d
mov    %rbp,(%rsp)
jmp    1244 <GenTopicLoc+0x94>
nop
lea    0xe69(%rip),%rdi
lea    0xe83(%rip),%rsi
call   1060 <printf@plt>
mov    %r15,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
mov    %rax,%r15
test   %rax,%rax
je     13d5 <GenTopicLoc+0x225>
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
movzbl -0x1(%r15,%rax,1),%ebx
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
cmp    $0x3a,%bl
jne    1340 <GenTopicLoc+0x190>
movb   $0x0,-0x1(%r15,%rax,1)
test   %r14,%r14
je     12a1 <GenTopicLoc+0xf1>
test   %r12,%r12
je     12a1 <GenTopicLoc+0xf1>
mov    %r13,%rdi
lea    0xdc2(%rip),%rsi
mov    %r14,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
xor    %r12d,%r12d
mov    %r15,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1090 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
mov    %r15,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
test   %rax,%rax
je     13d5 <GenTopicLoc+0x225>
mov    %rbp,%rdi
mov    %rax,%rbp
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
test   %rax,%rax
je     13d5 <GenTopicLoc+0x225>
mov    %rax,%rbx
mov    %r13,%rdi
lea    0xd5e(%rip),%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r13,%rdi
lea    0xd5a(%rip),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    (%rsp),%rbp
jmp    1223 <GenTopicLoc+0x73>
nopl   0x0(%rax,%rax,1)
cmpb   $0x3e,-0x1(%r15,%rax,1)
jne    1210 <GenTopicLoc+0x60>
mov    %rbp,%rdi
mov    %r13,%rbp
mov    $0x1,%esi
call   1070 <GetNextToken@plt>
test   %rax,%rax
je     13d2 <GenTopicLoc+0x222>
mov    %rax,%r13
test   %r12,%r12
je     13a8 <GenTopicLoc+0x1f8>
mov    %r12,%rdi
call   1050 <strlen@plt>
mov    %eax,%ebx
mov    %r13,%rdi
call   1050 <strlen@plt>
lea    (%rbx,%rax,1),%esi
add    $0x2,%esi
mov    %r12,%rdi
call   10b0 <realloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
lea    0xce8(%rip),%rsi
call   10c0 <strcat@plt>
mov    %r12,%rdi
mov    %r13,%rsi
call   10c0 <strcat@plt>
jmp    13c6 <GenTopicLoc+0x216>
mov    %r13,%rdi
call   1050 <strlen@plt>
lea    0x1(%rax),%edi
call   1090 <malloc@plt>
mov    %rax,%r12
mov    %rax,%rdi
mov    %r13,%rsi
call   1040 <strcpy@plt>
mov    %rbp,%r13
mov    (%rsp),%rbp
jmp    1223 <GenTopicLoc+0x73>
mov    %rbp,%r13
test   %r14,%r14
je     1406 <GenTopicLoc+0x256>
test   %r12,%r12
je     1406 <GenTopicLoc+0x256>
lea    0xc5d(%rip),%rsi
mov    %r13,%rdi
mov    %r14,%rdx
mov    %r12,%rcx
xor    %eax,%eax
call   1080 <fprintf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %r12,%rdi
call   1030 <free@plt>
lea    0xc99(%rip),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
mov    %r13,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10d0 <fwrite@plt>

LLVM IR (-O0):
@SEEK_SET = global i32 0
@.str = [67 x i8] c"# Topic Locations (file names, file positions, and non-topic IDs)\0A\00"
@.str.1 = [22 x i8] c"*.%s.locationIDs:\09%s\0A\00"
@.str.2 = [19 x i8] c"*.%s.filename:\09%s\0A\00"
@.str.3 = [18 x i8] c"*.%s.filepos:\09%s\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [33 x i8] c"The <volume>%s file is corrupt!\0A\00"
@.str.6 = [5 x i8] c".idt\00"
@.str.7 = [3 x i8] c"\0A\0A\00"
define void @GenTopicLoc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i32* %0, i32** %3
store i32* %1, i32** %4
store i8* null, i8** %8
store i8* null, i8** %9
store i8* null, i8** %10
%11 = load i32*, i32** %3
%12 = load i32, i32* @SEEK_SET
%13 = call i32 @fseek(i32* %11, i32 0, i32 %12)
%14 = load i32*, i32** %4
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %14, i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0))
br label %16
16: ; preds = %2, %126
%17 = load i32*, i32** %3
%18 = call i8* @GetNextToken(i32* %17, i32 1)
store i8* %18, i8** %5
%19 = icmp eq i8* %18, null
br i1 %19, label %20, label %21
20: ; preds = %16
br label %129
21: ; preds = %16
%22 = load i8*, i8** %5
%23 = load i8*, i8** %5
%24 = call i32 @strlen(i8* %23)
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i8, i8* %22, i64 %25
%27 = getelementptr inbounds i8, i8* %26, i64 -1
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp eq i32 %29, 58
br i1 %30, label %31, label %82
31: ; preds = %21
%32 = load i8*, i8** %5
%33 = load i8*, i8** %5
%34 = call i32 @strlen(i8* %33)
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds i8, i8* %32, i64 %35
%37 = getelementptr inbounds i8, i8* %36, i64 -1
store i8 0, i8* %37
%38 = load i8*, i8** %8
%39 = icmp ne i8* %38, null
br i1 %39, label %40, label %52
40: ; preds = %31
%41 = load i8*, i8** %10
%42 = icmp ne i8* %41, null
br i1 %42, label %43, label %52
43: ; preds = %40
%44 = load i32*, i32** %4
%45 = load i8*, i8** %8
%46 = load i8*, i8** %10
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %45, i8* %46)
%48 = load i8*, i8** %8
%49 = call i32 @free(i8* %48)
%50 = load i8*, i8** %10
%51 = call i32 @free(i8* %50)
store i8* null, i8** %10
br label %52
52: ; preds = %43, %40, %31
%53 = load i8*, i8** %5
%54 = call i32 @strlen(i8* %53)
%55 = add nsw i32 %54, 1
%56 = call i8* @malloc(i32 %55)
store i8* %56, i8** %8
%57 = load i8*, i8** %8
%58 = load i8*, i8** %5
%59 = call i32 @strcpy(i8* %57, i8* %58)
%60 = load i32*, i32** %3
%61 = call i8* @GetNextToken(i32* %60, i32 1)
store i8* %61, i8** %6
%62 = icmp eq i8* %61, null
br i1 %62, label %63, label %64
63: ; preds = %52
br label %129
64: ; preds = %52
%65 = load i32*, i32** %3
%66 = call i8* @GetNextToken(i32* %65, i32 1)
store i8* %66, i8** %7
%67 = icmp eq i8* %66, null
br i1 %67, label %68, label %69
68: ; preds = %64
br label %129
69: ; preds = %64
%70 = load i32*, i32** %4
%71 = load i8*, i8** %5
%72 = load i8*, i8** %6
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %71, i8* %72)
%74 = load i32*, i32** %4
%75 = load i8*, i8** %5
%76 = load i8*, i8** %7
%77 = call i32 (i32*, i8*, ...) @fprintf(i32* %74, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %75, i8* %76)
%78 = load i8*, i8** %6
%79 = call i32 @free(i8* %78)
%80 = load i8*, i8** %7
%81 = call i32 @free(i8* %80)
br label %126
82: ; preds = %21
%83 = load i8*, i8** %5
%84 = load i8*, i8** %5
%85 = call i32 @strlen(i8* %84)
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds i8, i8* %83, i64 %86
%88 = getelementptr inbounds i8, i8* %87, i64 -1
%89 = load i8, i8* %88
%90 = sext i8 %89 to i32
%91 = icmp eq i32 %90, 62
br i1 %91, label %92, label %123
92: ; preds = %82
%93 = load i32*, i32** %3
%94 = call i8* @GetNextToken(i32* %93, i32 1)
store i8* %94, i8** %9
%95 = icmp eq i8* %94, null
br i1 %95, label %96, label %97
96: ; preds = %92
br label %129
97: ; preds = %92
%98 = load i8*, i8** %10
%99 = icmp eq i8* %98, null
br i1 %99, label %100, label %108
100: ; preds = %97
%101 = load i8*, i8** %9
%102 = call i32 @strlen(i8* %101)
%103 = add nsw i32 %102, 1
%104 = call i8* @malloc(i32 %103)
store i8* %104, i8** %10
%105 = load i8*, i8** %10
%106 = load i8*, i8** %9
%107 = call i32 @strcpy(i8* %105, i8* %106)
br label %122
108: ; preds = %97
%109 = load i8*, i8** %10
%110 = load i8*, i8** %10
%111 = call i32 @strlen(i8* %110)
%112 = load i8*, i8** %9
%113 = call i32 @strlen(i8* %112)
%114 = add nsw i32 %111, %113
%115 = add nsw i32 %114, 2
%116 = call i8* @realloc(i8* %109, i32 %115)
store i8* %116, i8** %10
%117 = load i8*, i8** %10
%118 = call i32 @strcat(i8* %117, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%119 = load i8*, i8** %10
%120 = load i8*, i8** %9
%121 = call i32 @strcat(i8* %119, i8* %120)
br label %122
122: ; preds = %108, %100
br label %125
123: ; preds = %82
%124 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %125
125: ; preds = %123, %122
br label %126
126: ; preds = %125, %69
%127 = load i8*, i8** %5
%128 = call i32 @free(i8* %127)
br label %16
129: ; preds = %96, %68, %63, %20
%130 = load i8*, i8** %8
%131 = icmp ne i8* %130, null
br i1 %131, label %132, label %144
132: ; preds = %129
%133 = load i8*, i8** %10
%134 = icmp ne i8* %133, null
br i1 %134, label %135, label %144
135: ; preds = %132
%136 = load i32*, i32** %4
%137 = load i8*, i8** %8
%138 = load i8*, i8** %10
%139 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %137, i8* %138)
%140 = load i8*, i8** %8
%141 = call i32 @free(i8* %140)
%142 = load i8*, i8** %10
%143 = call i32 @free(i8* %142)
br label %144
144: ; preds = %135, %132, %129
%145 = load i32*, i32** %4
%146 = call i32 (i32*, i8*, ...) @fprintf(i32* %145, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@SEEK_SET = global i32 0
@.str = [67 x i8] c"# Topic Locations (file names, file positions, and non-topic IDs)\0A\00"
@.str.1 = [22 x i8] c"*.%s.locationIDs:\09%s\0A\00"
@.str.2 = [19 x i8] c"*.%s.filename:\09%s\0A\00"
@.str.3 = [18 x i8] c"*.%s.filepos:\09%s\0A\00"
@.str.4 = [2 x i8] c" \00"
@.str.5 = [33 x i8] c"The <volume>%s file is corrupt!\0A\00"
@.str.6 = [5 x i8] c".idt\00"
@.str.7 = [3 x i8] c"\0A\0A\00"
define void @GenTopicLoc(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* @SEEK_SET
%4 = tail call i32 @fseek(i32* %0, i32 0, i32 %3)
%5 = tail call i64 @fwrite(i8* getelementptr inbounds ([67 x i8], [67 x i8]* @.str, i64 0, i64 0), i64 66, i64 1, i32* %1)
%6 = tail call i8* @GetNextToken(i32* %0, i32 1)
%7 = icmp eq i8* %6, null
br i1 %7, label %85, label %8
8: ; preds = %2, %69
%9 = phi i8* [ %73, %69 ], [ %6, %2 ]
%10 = phi i8* [ %71, %69 ], [ null, %2 ]
%11 = phi i8* [ %70, %69 ], [ null, %2 ]
%12 = tail call i32 @strlen(i8* %9)
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %9, i64 -1
%15 = getelementptr inbounds i8, i8* %14, i64 %13
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 58
%18 = tail call i32 @strlen(i8* %9)
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %9, i64 -1
%21 = getelementptr inbounds i8, i8* %20, i64 %19
br i1 %17, label %22, label %46
22: ; preds = %8
store i8 0, i8* %21
%23 = icmp ne i8* %11, null
%24 = icmp ne i8* %10, null
%25 = select i1 %23, i1 %24, i1 false
br i1 %25, label %26, label %30
26: ; preds = %22
%27 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %11, i8* %10)
%28 = tail call i32 @free(i8* %11)
%29 = tail call i32 @free(i8* %10)
br label %30
30: ; preds = %26, %22
%31 = phi i8* [ null, %26 ], [ %10, %22 ]
%32 = tail call i32 @strlen(i8* %9)
%33 = add nsw i32 %32, 1
%34 = tail call i8* @malloc(i32 %33)
%35 = tail call i32 @strcpy(i8* %34, i8* %9)
%36 = tail call i8* @GetNextToken(i32* %0, i32 1)
%37 = icmp eq i8* %36, null
br i1 %37, label %75, label %38
38: ; preds = %30
%39 = tail call i8* @GetNextToken(i32* %0, i32 1)
%40 = icmp eq i8* %39, null
br i1 %40, label %75, label %41
41: ; preds = %38
%42 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0), i8* %9, i8* %36)
%43 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %9, i8* %39)
%44 = tail call i32 @free(i8* %36)
%45 = tail call i32 @free(i8* %39)
br label %69
46: ; preds = %8
%47 = load i8, i8* %21
%48 = icmp eq i8 %47, 62
br i1 %48, label %49, label %67
49: ; preds = %46
%50 = tail call i8* @GetNextToken(i32* %0, i32 1)
%51 = icmp eq i8* %50, null
br i1 %51, label %75, label %52
52: ; preds = %49
%53 = icmp eq i8* %10, null
br i1 %53, label %54, label %59
54: ; preds = %52
%55 = tail call i32 @strlen(i8* %50)
%56 = add nsw i32 %55, 1
%57 = tail call i8* @malloc(i32 %56)
%58 = tail call i32 @strcpy(i8* %57, i8* %50)
br label %69
59: ; preds = %52
%60 = tail call i32 @strlen(i8* %10)
%61 = tail call i32 @strlen(i8* %50)
%62 = add i32 %60, 2
%63 = add i32 %62, %61
%64 = tail call i8* @realloc(i8* %10, i32 %63)
%65 = tail call i32 @strcat(i8* %64, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%66 = tail call i32 @strcat(i8* %64, i8* %50)
br label %69
67: ; preds = %46
%68 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %69
69: ; preds = %67, %59, %54, %41
%70 = phi i8* [ %34, %41 ], [ %11, %54 ], [ %11, %59 ], [ %11, %67 ]
%71 = phi i8* [ %31, %41 ], [ %57, %54 ], [ %64, %59 ], [ %10, %67 ]
%72 = tail call i32 @free(i8* %9)
%73 = tail call i8* @GetNextToken(i32* %0, i32 1)
%74 = icmp eq i8* %73, null
br i1 %74, label %75, label %8
75: ; preds = %69, %30, %38, %49
%76 = phi i8* [ %70, %69 ], [ %34, %30 ], [ %34, %38 ], [ %11, %49 ]
%77 = phi i8* [ %71, %69 ], [ %31, %30 ], [ %31, %38 ], [ %10, %49 ]
%78 = icmp ne i8* %76, null
%79 = icmp ne i8* %77, null
%80 = select i1 %78, i1 %79, i1 false
br i1 %80, label %81, label %85
81: ; preds = %75
%82 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %1, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %76, i8* %77)
%83 = tail call i32 @free(i8* %76)
%84 = tail call i32 @free(i8* %77)
br label %85
85: ; preds = %2, %81, %75
%86 = tail call i64 @fwrite(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i64 2, i64 1, i32* %1)
ret void
}