; LLVM IR from MQCPack/mqcPack :: src (mqc_util)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Input_Link_List = type { ptr, ptr, i32, i32, i32, ptr, ptr }

@EndOfString = external dso_local global [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

declare void @mqc_error_i_c2f_0(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare ptr @strcpy(ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_DupString(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_Alloc_Input_Link_List(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @mqc_Read_to_Link_List(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca [2048 x i8], align 16
  %24 = alloca [1024 x i8], align 16
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store ptr %5, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 2048, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 1024, ptr %24) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  store i32 0, ptr %16, align 4, !tbaa !9
  store i32 0, ptr %19, align 4, !tbaa !9
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds i32, ptr %29, i64 0
  store i32 -1, ptr %30, align 4, !tbaa !9
  store i32 0, ptr %15, align 4, !tbaa !9
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = call noalias ptr @fopen(ptr noundef %31, ptr noundef @.str.23)
  store ptr %32, ptr %13, align 8, !tbaa !5
  %33 = load ptr, ptr %13, align 8, !tbaa !5
  %34 = icmp eq ptr %33, null
  br i1 %34, label %35, label %40

35:                                               ; preds = %6
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %36, ptr noundef @.str.33, ptr noundef %37, ptr noundef @EndOfString) #4
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mqc_error_i_c2f_0(ptr noundef %39, ptr noundef %9)
  br label %40

40:                                               ; preds = %35, %6
  %41 = load ptr, ptr %11, align 8, !tbaa !5
  %42 = getelementptr inbounds i32, ptr %41, i64 0
  store i32 -1, ptr %42, align 4, !tbaa !9
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = call ptr @fgets(ptr noundef %43, i32 noundef 1024, ptr noundef %44)
  store ptr %45, ptr %21, align 8, !tbaa !5
  %46 = load ptr, ptr %21, align 8, !tbaa !5
  %47 = icmp ne ptr %46, null
  br i1 %47, label %48, label %53

48:                                               ; preds = %40
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %49, ptr noundef null, i32 noundef %50)
  store ptr %51, ptr %26, align 8, !tbaa !5
  %52 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %52, ptr %25, align 8, !tbaa !5
  br label %53

53:                                               ; preds = %48, %40
  br label %54

54:                                               ; preds = %253, %53
  %55 = load ptr, ptr %21, align 8, !tbaa !5
  %56 = icmp ne ptr %55, null
  br i1 %56, label %57, label %254

57:                                               ; preds = %54
  %58 = load ptr, ptr %26, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Input_Link_List, ptr %58, i32 0, i32 3
  %60 = load i32, ptr %59, align 4, !tbaa !11
  %61 = icmp eq i32 %60, 1
  br i1 %61, label %62, label %237

62:                                               ; preds = %57
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = getelementptr inbounds i32, ptr %63, i64 0
  store i32 0, ptr %64, align 4, !tbaa !9
  %65 = load i32, ptr %15, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %15, align 4, !tbaa !9
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = getelementptr inbounds i32, ptr %67, i64 0
  store i32 0, ptr %68, align 4, !tbaa !9
  %69 = load i32, ptr %16, align 4, !tbaa !9
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %16, align 4, !tbaa !9
  br label %71

71:                                               ; preds = %183, %62
  %72 = load ptr, ptr %26, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.Input_Link_List, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !13
  %75 = icmp eq i32 %74, 0
  br i1 %75, label %76, label %79

76:                                               ; preds = %71
  %77 = load ptr, ptr %21, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br label %79

79:                                               ; preds = %76, %71
  %80 = phi i1 [ false, %71 ], [ %78, %76 ]
  br i1 %80, label %81, label %184

81:                                               ; preds = %79
  %82 = load ptr, ptr %26, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.Input_Link_List, ptr %82, i32 0, i32 6
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  %85 = call i32 @mqc_FINDstrINline(ptr noundef @.str.34, ptr noundef %84)
  %86 = icmp ne i32 %85, -1
  br i1 %86, label %87, label %90

87:                                               ; preds = %81
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = getelementptr inbounds i32, ptr %88, i64 0
  store i32 1, ptr %89, align 4, !tbaa !9
  br label %90

90:                                               ; preds = %87, %81
  store i32 0, ptr %20, align 4, !tbaa !9
  %91 = load ptr, ptr %26, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Input_Link_List, ptr %91, i32 0, i32 6
  %93 = load ptr, ptr %92, align 8, !tbaa !14
  %94 = call i32 @mqc_FINDstrINline(ptr noundef @.str.35, ptr noundef %93)
  store i32 %94, ptr %17, align 4, !tbaa !9
  %95 = load i32, ptr %17, align 4, !tbaa !9
  %96 = icmp ne i32 %95, -1
  br i1 %96, label %97, label %134

97:                                               ; preds = %90
  %98 = getelementptr inbounds [1024 x i8], ptr %24, i64 0, i64 0
  %99 = load ptr, ptr %26, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Input_Link_List, ptr %99, i32 0, i32 6
  %101 = load ptr, ptr %100, align 8, !tbaa !14
  %102 = call ptr @strcpy(ptr noundef %98, ptr noundef %101) #4
  %103 = load ptr, ptr %8, align 8, !tbaa !5
  %104 = load i32, ptr %17, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [1024 x i8], ptr %24, i64 0, i64 %105
  %107 = call ptr @strcpy(ptr noundef %103, ptr noundef %106) #4
  %108 = load ptr, ptr %8, align 8, !tbaa !5
  %109 = call i32 @mqc_FINDstrINline(ptr noundef @.str.5, ptr noundef %108)
  store i32 %109, ptr %17, align 4, !tbaa !9
  %110 = load i32, ptr %17, align 4, !tbaa !9
  %111 = icmp ne i32 %110, -1
  br i1 %111, label %112, label %118

112:                                              ; preds = %97
  %113 = load ptr, ptr %8, align 8, !tbaa !5
  %114 = load i32, ptr %17, align 4, !tbaa !9
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %113, i64 %115
  %117 = call ptr @strcpy(ptr noundef %116, ptr noundef @EndOfString) #4
  br label %118

118:                                              ; preds = %112, %97
  %119 = load ptr, ptr %26, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.Input_Link_List, ptr %119, i32 0, i32 3
  store i32 1, ptr %120, align 4, !tbaa !11
  %121 = load ptr, ptr %26, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.Input_Link_List, ptr %121, i32 0, i32 6
  %123 = load ptr, ptr %122, align 8, !tbaa !14
  %124 = call i32 @mqc_FINDstrINline(ptr noundef @.str.36, ptr noundef %123)
  %125 = icmp ne i32 %124, -1
  br i1 %125, label %132, label %126

126:                                              ; preds = %118
  %127 = load ptr, ptr %26, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.Input_Link_List, ptr %127, i32 0, i32 6
  %129 = load ptr, ptr %128, align 8, !tbaa !14
  %130 = call i32 @mqc_FINDstrINline(ptr noundef @.str.37, ptr noundef %129)
  %131 = icmp ne i32 %130, -1
  br i1 %131, label %132, label %133

132:                                              ; preds = %126, %118
  store i32 1, ptr %20, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %132, %126
  br label %134

134:                                              ; preds = %133, %90
  %135 = load ptr, ptr %26, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.Input_Link_List, ptr %135, i32 0, i32 6
  %137 = load ptr, ptr %136, align 8, !tbaa !14
  %138 = call ptr @mqc_DupString(ptr noundef %137, ptr noundef null)
  store ptr %138, ptr %22, align 8, !tbaa !5
  %139 = load ptr, ptr %22, align 8, !tbaa !5
  %140 = call ptr @mqc_Replace_String(ptr noundef @.str.38, ptr noundef @.str.39, ptr noundef %139)
  store ptr %140, ptr %22, align 8, !tbaa !5
  %141 = load ptr, ptr %22, align 8, !tbaa !5
  %142 = call ptr @mqc_Replace_String(ptr noundef @.str.40, ptr noundef @.str.41, ptr noundef %141)
  store ptr %142, ptr %22, align 8, !tbaa !5
  %143 = load ptr, ptr %22, align 8, !tbaa !5
  %144 = call i32 @mqc_FINDstrINline(ptr noundef @.str.42, ptr noundef %143)
  %145 = icmp ne i32 %144, -1
  br i1 %145, label %146, label %147

146:                                              ; preds = %134
  store i32 1, ptr %18, align 4, !tbaa !9
  br label %148

147:                                              ; preds = %134
  store i32 0, ptr %18, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %147, %146
  %149 = load ptr, ptr %22, align 8, !tbaa !5
  call void @free(ptr noundef %149) #4
  %150 = load i32, ptr %20, align 4, !tbaa !9
  %151 = icmp eq i32 %150, 1
  br i1 %151, label %155, label %152

152:                                              ; preds = %148
  %153 = load i32, ptr %18, align 4, !tbaa !9
  %154 = icmp eq i32 %153, 1
  br i1 %154, label %155, label %171

155:                                              ; preds = %152, %148
  %156 = load ptr, ptr %10, align 8, !tbaa !5
  %157 = getelementptr inbounds i32, ptr %156, i64 0
  %158 = load i32, ptr %157, align 4, !tbaa !9
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %163

160:                                              ; preds = %155
  %161 = load i32, ptr %19, align 4, !tbaa !9
  %162 = add nsw i32 %161, 1
  store i32 %162, ptr %19, align 4, !tbaa !9
  br label %168

163:                                              ; preds = %155
  %164 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  %165 = load i32, ptr %15, align 4, !tbaa !9
  %166 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %164, ptr noundef @.str.43, i32 noundef %165, ptr noundef @EndOfString) #4
  %167 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  call void @print_line_c2f(ptr noundef %167, ptr noundef %9)
  br label %168

168:                                              ; preds = %163, %160
  %169 = load ptr, ptr %10, align 8, !tbaa !5
  %170 = getelementptr inbounds i32, ptr %169, i64 0
  store i32 1, ptr %170, align 4, !tbaa !9
  br label %171

171:                                              ; preds = %168, %152
  %172 = load ptr, ptr %8, align 8, !tbaa !5
  %173 = load ptr, ptr %13, align 8, !tbaa !5
  %174 = call ptr @fgets(ptr noundef %172, i32 noundef 1024, ptr noundef %173)
  store ptr %174, ptr %21, align 8, !tbaa !5
  %175 = load ptr, ptr %21, align 8, !tbaa !5
  %176 = icmp ne ptr %175, null
  br i1 %176, label %177, label %183

177:                                              ; preds = %171
  %178 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %178, ptr %27, align 8, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = load ptr, ptr %27, align 8, !tbaa !5
  %181 = load i32, ptr %9, align 4, !tbaa !9
  %182 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %179, ptr noundef %180, i32 noundef %181)
  store ptr %182, ptr %26, align 8, !tbaa !5
  br label %183

183:                                              ; preds = %177, %171
  br label %71, !llvm.loop !15

184:                                              ; preds = %79
  %185 = load ptr, ptr %10, align 8, !tbaa !5
  %186 = getelementptr inbounds i32, ptr %185, i64 0
  %187 = load i32, ptr %186, align 4, !tbaa !9
  %188 = icmp eq i32 %187, 0
  br i1 %188, label %189, label %219

189:                                              ; preds = %184
  %190 = load ptr, ptr %12, align 8, !tbaa !5
  %191 = getelementptr inbounds i32, ptr %190, i64 0
  %192 = load i32, ptr %191, align 4, !tbaa !9
  %193 = icmp eq i32 %192, 1
  br i1 %193, label %194, label %219

194:                                              ; preds = %189
  %195 = load ptr, ptr %11, align 8, !tbaa !5
  %196 = getelementptr inbounds i32, ptr %195, i64 0
  %197 = load i32, ptr %196, align 4, !tbaa !9
  %198 = icmp eq i32 %197, -1
  br i1 %198, label %199, label %204

199:                                              ; preds = %194
  %200 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  %201 = load i32, ptr %15, align 4, !tbaa !9
  %202 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %200, ptr noundef @.str.44, i32 noundef %201, ptr noundef @EndOfString) #4
  %203 = getelementptr inbounds [2048 x i8], ptr %23, i64 0, i64 0
  call void @print_line_c2f(ptr noundef %203, ptr noundef %9)
  br label %218

204:                                              ; preds = %194
  %205 = load ptr, ptr %11, align 8, !tbaa !5
  %206 = getelementptr inbounds i32, ptr %205, i64 0
  %207 = load i32, ptr %206, align 4, !tbaa !9
  %208 = icmp ne i32 %207, 0
  br i1 %208, label %209, label %212

209:                                              ; preds = %204
  %210 = load i32, ptr %19, align 4, !tbaa !9
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %19, align 4, !tbaa !9
  br label %212

212:                                              ; preds = %209, %204
  %213 = load ptr, ptr %11, align 8, !tbaa !5
  %214 = getelementptr inbounds i32, ptr %213, i64 0
  %215 = load i32, ptr %214, align 4, !tbaa !9
  %216 = load ptr, ptr %10, align 8, !tbaa !5
  %217 = getelementptr inbounds i32, ptr %216, i64 0
  store i32 %215, ptr %217, align 4, !tbaa !9
  br label %218

218:                                              ; preds = %212, %199
  br label %236

219:                                              ; preds = %189, %184
  %220 = load ptr, ptr %11, align 8, !tbaa !5
  %221 = getelementptr inbounds i32, ptr %220, i64 0
  %222 = load i32, ptr %221, align 4, !tbaa !9
  %223 = icmp ne i32 %222, -1
  br i1 %223, label %229, label %224

224:                                              ; preds = %219
  %225 = load ptr, ptr %10, align 8, !tbaa !5
  %226 = getelementptr inbounds i32, ptr %225, i64 0
  %227 = load i32, ptr %226, align 4, !tbaa !9
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %235

229:                                              ; preds = %224, %219
  %230 = load ptr, ptr %10, align 8, !tbaa !5
  %231 = getelementptr inbounds i32, ptr %230, i64 0
  %232 = load i32, ptr %231, align 4, !tbaa !9
  %233 = load ptr, ptr %11, align 8, !tbaa !5
  %234 = getelementptr inbounds i32, ptr %233, i64 0
  store i32 %232, ptr %234, align 4, !tbaa !9
  br label %235

235:                                              ; preds = %229, %224
  br label %236

236:                                              ; preds = %235, %218
  br label %237

237:                                              ; preds = %236, %57
  %238 = load ptr, ptr %21, align 8, !tbaa !5
  %239 = icmp ne ptr %238, null
  br i1 %239, label %240, label %253

240:                                              ; preds = %237
  %241 = load ptr, ptr %8, align 8, !tbaa !5
  %242 = load ptr, ptr %13, align 8, !tbaa !5
  %243 = call ptr @fgets(ptr noundef %241, i32 noundef 1024, ptr noundef %242)
  store ptr %243, ptr %21, align 8, !tbaa !5
  %244 = load ptr, ptr %21, align 8, !tbaa !5
  %245 = icmp ne ptr %244, null
  br i1 %245, label %246, label %252

246:                                              ; preds = %240
  %247 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %247, ptr %27, align 8, !tbaa !5
  %248 = load ptr, ptr %8, align 8, !tbaa !5
  %249 = load ptr, ptr %27, align 8, !tbaa !5
  %250 = load i32, ptr %9, align 4, !tbaa !9
  %251 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %248, ptr noundef %249, i32 noundef %250)
  store ptr %251, ptr %26, align 8, !tbaa !5
  br label %252

252:                                              ; preds = %246, %240
  br label %253

253:                                              ; preds = %252, %237
  br label %54, !llvm.loop !17

254:                                              ; preds = %54
  %255 = load ptr, ptr %13, align 8, !tbaa !5
  %256 = call i32 @fclose(ptr noundef %255)
  store i32 %256, ptr %14, align 4, !tbaa !9
  store ptr null, ptr %13, align 8, !tbaa !5
  %257 = load i32, ptr %14, align 4, !tbaa !9
  %258 = icmp ne i32 %257, 0
  br i1 %258, label %259, label %264

259:                                              ; preds = %254
  %260 = load ptr, ptr %8, align 8, !tbaa !5
  %261 = load ptr, ptr %7, align 8, !tbaa !5
  %262 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %260, ptr noundef @.str.45, ptr noundef %261, ptr noundef @EndOfString) #4
  %263 = load ptr, ptr %8, align 8, !tbaa !5
  call void @mqc_error_i_c2f_0(ptr noundef %263, ptr noundef %9)
  br label %264

264:                                              ; preds = %259, %254
  %265 = load ptr, ptr %25, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 1024, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  ret ptr %265
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @mqc_FINDstrINline(ptr noundef, ptr noundef) #3

declare void @print_line_c2f(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #1

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_Replace_String(ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 20}
!12 = !{!"Input_Link_List", !6, i64 0, !6, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!12, !10, i64 16}
!14 = !{!12, !6, i64 40}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@EndOfString = external dso_local global [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [68 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [119 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [32 x i8], align 1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare void @mqc_error_i_c2f_0(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strcpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_DupString(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_Alloc_Input_Link_List(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local ptr @mqc_Read_to_Link_List(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr nocapture noundef %3, ptr nocapture noundef %4, ptr nocapture noundef %5) local_unnamed_addr #4 {
  %7 = alloca i32, align 4
  %8 = alloca [2048 x i8], align 16
  %9 = alloca [1024 x i8], align 16
  store i32 %2, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %9) #6
  store i32 -1, ptr %4, align 4, !tbaa !5
  %10 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str.23)
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %6
  %13 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.33, ptr noundef %0, ptr noundef nonnull @EndOfString) #6
  call void @mqc_error_i_c2f_0(ptr noundef %1, ptr noundef nonnull %7) #6
  br label %14

14:                                               ; preds = %12, %6
  store i32 -1, ptr %4, align 4, !tbaa !5
  %15 = call ptr @fgets(ptr noundef %1, i32 noundef 1024, ptr noundef %10)
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %._crit_edge140, label %.lr.ph139.preheader

.lr.ph139.preheader:                              ; preds = %14
  %16 = load i32, ptr %7, align 4, !tbaa !5
  %17 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %1, ptr noundef null, i32 noundef %16)
  br label %.lr.ph139

.lr.ph139:                                        ; preds = %85, %.lr.ph139.preheader
  %.1137 = phi ptr [ %87, %85 ], [ %17, %.lr.ph139.preheader ]
  %.077136 = phi ptr [ %84, %85 ], [ %15, %.lr.ph139.preheader ]
  %.091133 = phi i32 [ %.192121, %85 ], [ 0, %.lr.ph139.preheader ]
  %18 = getelementptr inbounds i8, ptr %.1137, i64 20
  %19 = load i32, ptr %18, align 4, !tbaa !9
  %20 = icmp eq i32 %19, 1
  br i1 %20, label %21, label %.thread114

21:                                               ; preds = %.lr.ph139
  store i32 0, ptr %5, align 4, !tbaa !5
  %22 = add nsw i32 %.091133, 1
  store i32 0, ptr %3, align 4, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %.1137, i64 16
  %24 = load i32, ptr %23, align 8, !tbaa !12
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %21, %67
  %.2129 = phi ptr [ %69, %67 ], [ %.1137, %21 ]
  %26 = getelementptr inbounds i8, ptr %.2129, i64 40
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.34, ptr noundef %27)
  %.not105 = icmp eq i32 %28, -1
  br i1 %.not105, label %30, label %29

29:                                               ; preds = %.lr.ph
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %29, %.lr.ph
  %31 = load ptr, ptr %26, align 8, !tbaa !13
  %32 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.35, ptr noundef %31)
  %.not106 = icmp eq i32 %32, -1
  br i1 %.not106, label %52, label %33

33:                                               ; preds = %30
  %34 = load ptr, ptr %26, align 8, !tbaa !13
  %35 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %9, ptr noundef nonnull dereferenceable(1) %34) #6
  %36 = sext i32 %32 to i64
  %37 = getelementptr inbounds [1024 x i8], ptr %9, i64 0, i64 %36
  %38 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) %37) #6
  %39 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.5, ptr noundef %1)
  %.not107 = icmp eq i32 %39, -1
  br i1 %.not107, label %44, label %40

40:                                               ; preds = %33
  %41 = sext i32 %39 to i64
  %42 = getelementptr inbounds i8, ptr %1, i64 %41
  %43 = call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %42, ptr noundef nonnull dereferenceable(1) @EndOfString) #6
  br label %44

44:                                               ; preds = %40, %33
  %45 = getelementptr inbounds i8, ptr %.2129, i64 20
  store i32 1, ptr %45, align 4, !tbaa !9
  %46 = load ptr, ptr %26, align 8, !tbaa !13
  %47 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.36, ptr noundef %46)
  %.not108 = icmp eq i32 %47, -1
  br i1 %.not108, label %48, label %51

48:                                               ; preds = %44
  %49 = load ptr, ptr %26, align 8, !tbaa !13
  %50 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.37, ptr noundef %49)
  %.not109 = icmp eq i32 %50, -1
  br i1 %.not109, label %52, label %51

51:                                               ; preds = %48, %44
  br label %52

52:                                               ; preds = %48, %51, %30
  %53 = phi i1 [ true, %51 ], [ false, %48 ], [ false, %30 ]
  %54 = load ptr, ptr %26, align 8, !tbaa !13
  %55 = call ptr @mqc_DupString(ptr noundef %54, ptr noundef null)
  %56 = call ptr @mqc_Replace_String(ptr noundef nonnull @.str.38, ptr noundef nonnull @.str.39, ptr noundef %55)
  %57 = call ptr @mqc_Replace_String(ptr noundef nonnull @.str.40, ptr noundef nonnull @.str.41, ptr noundef %56)
  %58 = call i32 @mqc_FINDstrINline(ptr noundef nonnull @.str.42, ptr noundef %57)
  %.not110 = icmp ne i32 %58, -1
  call void @free(ptr noundef %57) #6
  %or.cond = or i1 %53, %.not110
  br i1 %or.cond, label %59, label %65

59:                                               ; preds = %52
  %60 = load i32, ptr %3, align 4, !tbaa !5
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %64, label %62

62:                                               ; preds = %59
  %63 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.43, i32 noundef %22, ptr noundef nonnull @EndOfString) #6
  call void @print_line_c2f(ptr noundef nonnull %8, ptr noundef nonnull %7) #6
  br label %64

64:                                               ; preds = %59, %62
  store i32 1, ptr %3, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %52, %64
  %66 = call ptr @fgets(ptr noundef %1, i32 noundef 1024, ptr noundef %10)
  %.not111 = icmp eq ptr %66, null
  br i1 %.not111, label %._crit_edge, label %67

67:                                               ; preds = %65
  %68 = load i32, ptr %7, align 4, !tbaa !5
  %69 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %1, ptr noundef nonnull %.2129, i32 noundef %68)
  %70 = getelementptr inbounds i8, ptr %69, i64 16
  %71 = load i32, ptr %70, align 8, !tbaa !12
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %65, %67
  %.3145 = phi ptr [ %69, %67 ], [ %.2129, %65 ]
  %.pre = load i32, ptr %3, align 4, !tbaa !5
  %73 = icmp eq i32 %.pre, 0
  br i1 %73, label %._crit_edge.thread, label %.thread113

._crit_edge.thread:                               ; preds = %21, %._crit_edge
  %.2.lcssa153 = phi ptr [ %.3145, %._crit_edge ], [ %.1137, %21 ]
  %.178.lcssa150 = phi ptr [ %66, %._crit_edge ], [ %.077136, %21 ]
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = icmp eq i32 %74, 1
  %76 = load i32, ptr %4, align 4, !tbaa !5
  %cond = icmp eq i32 %76, -1
  br i1 %75, label %77, label %81

77:                                               ; preds = %._crit_edge.thread
  br i1 %cond, label %78, label %80

78:                                               ; preds = %77
  %79 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.44, i32 noundef %22, ptr noundef nonnull @EndOfString) #6
  call void @print_line_c2f(ptr noundef nonnull %8, ptr noundef nonnull %7) #6
  br label %83

80:                                               ; preds = %77
  store i32 %76, ptr %3, align 4, !tbaa !5
  br label %83

81:                                               ; preds = %._crit_edge.thread
  br i1 %cond, label %83, label %.thread113

.thread113:                                       ; preds = %._crit_edge, %81
  %.2.lcssa152 = phi ptr [ %.3145, %._crit_edge ], [ %.2.lcssa153, %81 ]
  %.178.lcssa149 = phi ptr [ %66, %._crit_edge ], [ %.178.lcssa150, %81 ]
  %82 = phi i32 [ %.pre, %._crit_edge ], [ 0, %81 ]
  store i32 %82, ptr %4, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %81, %80, %78, %.thread113
  %.2.lcssa151 = phi ptr [ %.2.lcssa153, %81 ], [ %.2.lcssa153, %80 ], [ %.2.lcssa153, %78 ], [ %.2.lcssa152, %.thread113 ]
  %.178.lcssa148 = phi ptr [ %.178.lcssa150, %81 ], [ %.178.lcssa150, %80 ], [ %.178.lcssa150, %78 ], [ %.178.lcssa149, %.thread113 ]
  %.not103 = icmp eq ptr %.178.lcssa148, null
  br i1 %.not103, label %._crit_edge140, label %.thread114

.thread114:                                       ; preds = %.lr.ph139, %83
  %.4127 = phi ptr [ %.2.lcssa151, %83 ], [ %.1137, %.lr.ph139 ]
  %.192121 = phi i32 [ %22, %83 ], [ %.091133, %.lr.ph139 ]
  %84 = call ptr @fgets(ptr noundef %1, i32 noundef 1024, ptr noundef %10)
  %.not104 = icmp eq ptr %84, null
  br i1 %.not104, label %._crit_edge140, label %85

85:                                               ; preds = %.thread114
  %86 = load i32, ptr %7, align 4, !tbaa !5
  %87 = call ptr @mqc_Alloc_Input_Link_List(ptr noundef %1, ptr noundef nonnull %.4127, i32 noundef %86)
  br label %.lr.ph139, !llvm.loop !16

._crit_edge140:                                   ; preds = %83, %.thread114, %14
  %.0142 = phi ptr [ undef, %14 ], [ %17, %.thread114 ], [ %17, %83 ]
  %88 = call i32 @fclose(ptr noundef %10)
  %.not99 = icmp eq i32 %88, 0
  br i1 %.not99, label %91, label %89

89:                                               ; preds = %._crit_edge140
  %90 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.45, ptr noundef %0, ptr noundef nonnull @EndOfString) #6
  call void @mqc_error_i_c2f_0(ptr noundef %1, ptr noundef nonnull %7) #6
  br label %91

91:                                               ; preds = %89, %._crit_edge140
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %8) #6
  ret ptr %.0142
}

; Function Attrs: nounwind uwtable
declare dso_local i32 @mqc_FINDstrINline(ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @print_line_c2f(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @mqc_Replace_String(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 20}
!10 = !{!"Input_Link_List", !11, i64 0, !11, i64 8, !6, i64 16, !6, i64 20, !6, i64 24, !11, i64 32, !11, i64 40}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!10, !6, i64 16}
!13 = !{!10, !11, i64 40}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass