; LLVM IR from jingweizhanghuai/Morn :: src/util (morn_log)

; 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.MHandle = type { i32, i32, ptr, ptr }
%struct.HandleLog = type { i32, [128 x i8], [128 x i8], [16 x i8], i64, i32, i32, %struct.MThreadSignal, i32, i32, i32, i32, ptr, i32, i32, i32, ptr, ptr }
%struct.MThreadSignal = type { %union.pthread_mutex_t, %union.pthread_cond_t, %union.pthread_rwlock_t, i32 }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.LogFile = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endLog(ptr noundef) #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) #2

declare i32 @close(i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @LogFile(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca [256 x i8], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  %17 = icmp eq ptr %16, null
  br i1 %17, label %18, label %19

18:                                               ; preds = %1
  br label %445

19:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %20 = call ptr @mMornObject(ptr noundef @.str, i32 noundef -1)
  %21 = call ptr @GetHandle(ptr noundef %20, i32 noundef 504, i32 noundef 1060628209, ptr noundef @endLog)
  store ptr %21, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.MHandle, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %4, align 8, !tbaa !5
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = call i32 @strcmp(ptr noundef %25, ptr noundef @.str.1) #8
  %27 = icmp eq i32 %26, 0
  br i1 %27, label %28, label %84

28:                                               ; preds = %19
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.HandleLog, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !12
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %63

33:                                               ; preds = %28
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.HandleLog, ptr %34, i32 0, i32 12
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.HandleLog, ptr %37, i32 0, i32 11
  %39 = load i32, ptr %38, align 4, !tbaa !17
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %36, i64 %40
  %42 = load ptr, ptr %4, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.HandleLog, ptr %42, i32 0, i32 10
  %44 = load i32, ptr %43, align 8, !tbaa !18
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.HandleLog, ptr %45, i32 0, i32 11
  %47 = load i32, ptr %46, align 4, !tbaa !17
  %48 = sub nsw i32 %44, %47
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %41, i8 32, i64 %50, i1 false)
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.HandleLog, ptr %51, i32 0, i32 12
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = load ptr, ptr %4, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.HandleLog, ptr %54, i32 0, i32 10
  %56 = load i32, ptr %55, align 8, !tbaa !18
  %57 = sext i32 %56 to i64
  %58 = call i32 @munmap(ptr noundef %53, i64 noundef %57) #7
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.HandleLog, ptr %59, i32 0, i32 8
  %61 = load i32, ptr %60, align 8, !tbaa !19
  %62 = call i32 @close(i32 noundef %61)
  br label %63

63:                                               ; preds = %33, %28
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.HandleLog, ptr %64, i32 0, i32 2
  %66 = getelementptr inbounds [128 x i8], ptr %65, i64 0, i64 0
  store i8 0, ptr %66, align 4, !tbaa !20
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.HandleLog, ptr %67, i32 0, i32 0
  store i32 0, ptr %68, align 8, !tbaa !12
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.HandleLog, ptr %69, i32 0, i32 13
  %71 = load i32, ptr %70, align 8, !tbaa !21
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %79, label %73

73:                                               ; preds = %63
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.HandleLog, ptr %74, i32 0, i32 15
  %76 = load i32, ptr %75, align 8, !tbaa !22
  %77 = icmp ne i32 %76, 0
  %78 = xor i1 %77, true
  br label %79

79:                                               ; preds = %73, %63
  %80 = phi i1 [ true, %63 ], [ %78, %73 ]
  %81 = zext i1 %80 to i32
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.HandleLog, ptr %82, i32 0, i32 14
  store i32 %81, ptr %83, align 4, !tbaa !23
  store i32 1, ptr %5, align 4
  br label %443

84:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 256, ptr %6) #7
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.HandleLog, ptr %85, i32 0, i32 6
  %87 = load i32, ptr %86, align 4, !tbaa !24
  %88 = icmp sgt i32 %87, 0
  br i1 %88, label %89, label %259

89:                                               ; preds = %84
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.HandleLog, ptr %90, i32 0, i32 1
  %92 = getelementptr inbounds [128 x i8], ptr %91, i64 0, i64 0
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = call i32 @strcmp(ptr noundef %92, ptr noundef %93) #8
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %106

96:                                               ; preds = %89
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  call void @endLog(ptr noundef %97)
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.HandleLog, ptr %98, i32 0, i32 1
  %100 = getelementptr inbounds [128 x i8], ptr %99, i64 0, i64 0
  %101 = load ptr, ptr %2, align 8, !tbaa !5
  %102 = call ptr @strcpy(ptr noundef %100, ptr noundef %101) #7
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.HandleLog, ptr %103, i32 0, i32 2
  %105 = getelementptr inbounds [128 x i8], ptr %104, i64 0, i64 0
  store i8 0, ptr %105, align 4, !tbaa !20
  br label %119

106:                                              ; preds = %89
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.HandleLog, ptr %107, i32 0, i32 10
  %109 = load i32, ptr %108, align 8, !tbaa !18
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.HandleLog, ptr %110, i32 0, i32 11
  %112 = load i32, ptr %111, align 4, !tbaa !17
  %113 = sub nsw i32 %109, %112
  %114 = icmp sge i32 %113, 1024
  br i1 %114, label %115, label %116

115:                                              ; preds = %106
  store i32 1, ptr %5, align 4
  br label %442

116:                                              ; preds = %106
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  call void @endLog(ptr noundef %117)
  br label %118

118:                                              ; preds = %116
  br label %119

119:                                              ; preds = %118, %96
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.HandleLog, ptr %120, i32 0, i32 2
  %122 = getelementptr inbounds [128 x i8], ptr %121, i64 0, i64 0
  %123 = load i8, ptr %122, align 4, !tbaa !20
  %124 = sext i8 %123 to i32
  %125 = icmp eq i32 %124, 0
  br i1 %125, label %126, label %224

126:                                              ; preds = %119
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %127 = load ptr, ptr %2, align 8, !tbaa !5
  %128 = call i64 @strlen(ptr noundef %127) #8
  %129 = trunc i64 %128 to i32
  store i32 %129, ptr %7, align 4, !tbaa !25
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.HandleLog, ptr %130, i32 0, i32 2
  %132 = getelementptr inbounds [128 x i8], ptr %131, i64 0, i64 0
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  %134 = load i32, ptr %7, align 4, !tbaa !25
  %135 = add nsw i32 %134, 1
  %136 = sext i32 %135 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %132, ptr align 1 %133, i64 %136, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %137 = load i32, ptr %7, align 4, !tbaa !25
  store i32 %137, ptr %8, align 4, !tbaa !25
  br label %138

138:                                              ; preds = %169, %126
  %139 = load i32, ptr %8, align 4, !tbaa !25
  %140 = icmp sgt i32 %139, 0
  br i1 %140, label %142, label %141

141:                                              ; preds = %138
  store i32 2, ptr %5, align 4
  br label %172

142:                                              ; preds = %138
  %143 = load ptr, ptr %4, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.HandleLog, ptr %143, i32 0, i32 2
  %145 = load i32, ptr %8, align 4, !tbaa !25
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [128 x i8], ptr %144, i64 0, i64 %146
  %148 = load i8, ptr %147, align 1, !tbaa !20
  %149 = sext i8 %148 to i32
  %150 = icmp eq i32 %149, 46
  br i1 %150, label %151, label %168

151:                                              ; preds = %142
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.HandleLog, ptr %152, i32 0, i32 3
  %154 = getelementptr inbounds [16 x i8], ptr %153, i64 0, i64 0
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.HandleLog, ptr %155, i32 0, i32 2
  %157 = getelementptr inbounds [128 x i8], ptr %156, i64 0, i64 0
  %158 = load i32, ptr %8, align 4, !tbaa !25
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i8, ptr %157, i64 %159
  %161 = getelementptr inbounds i8, ptr %160, i64 1
  %162 = call ptr @strcpy(ptr noundef %154, ptr noundef %161) #7
  %163 = load ptr, ptr %4, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.HandleLog, ptr %163, i32 0, i32 2
  %165 = load i32, ptr %8, align 4, !tbaa !25
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [128 x i8], ptr %164, i64 0, i64 %166
  store i8 0, ptr %167, align 1, !tbaa !20
  store i32 2, ptr %5, align 4
  br label %172

168:                                              ; preds = %142
  br label %169

169:                                              ; preds = %168
  %170 = load i32, ptr %8, align 4, !tbaa !25
  %171 = add nsw i32 %170, -1
  store i32 %171, ptr %8, align 4, !tbaa !25
  br label %138, !llvm.loop !26

172:                                              ; preds = %151, %141
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %173

173:                                              ; preds = %172
  %174 = load ptr, ptr %4, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.HandleLog, ptr %174, i32 0, i32 4
  store i64 0, ptr %175, align 8, !tbaa !28
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.HandleLog, ptr %176, i32 0, i32 1
  %178 = getelementptr inbounds [128 x i8], ptr %177, i64 0, i64 0
  %179 = call i32 @access(ptr noundef %178, i32 noundef 0) #7
  %180 = icmp sge i32 %179, 0
  br i1 %180, label %181, label %223

181:                                              ; preds = %173
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %182 = load ptr, ptr %4, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.HandleLog, ptr %182, i32 0, i32 1
  %184 = getelementptr inbounds [128 x i8], ptr %183, i64 0, i64 0
  %185 = call noalias ptr @fopen(ptr noundef %184, ptr noundef @.str.2)
  store ptr %185, ptr %9, align 8, !tbaa !5
  %186 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %187 = load ptr, ptr %9, align 8, !tbaa !5
  %188 = call ptr @fgets(ptr noundef %186, i32 noundef 256, ptr noundef %187)
  %189 = icmp ne ptr %188, null
  br i1 %189, label %190, label %195

190:                                              ; preds = %181
  %191 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.HandleLog, ptr %192, i32 0, i32 4
  %194 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %191, ptr noundef @.str.3, ptr noundef %193) #7
  br label %195

195:                                              ; preds = %190, %181
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = call i32 @fclose(ptr noundef %196)
  %198 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct.HandleLog, ptr %199, i32 0, i32 2
  %201 = getelementptr inbounds [128 x i8], ptr %200, i64 0, i64 0
  %202 = load ptr, ptr %4, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.HandleLog, ptr %202, i32 0, i32 4
  %204 = load i64, ptr %203, align 8, !tbaa !28
  %205 = load ptr, ptr %4, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.HandleLog, ptr %205, i32 0, i32 5
  %207 = load i32, ptr %206, align 8, !tbaa !29
  %208 = sext i32 %207 to i64
  %209 = srem i64 %204, %208
  %210 = load ptr, ptr %4, align 8, !tbaa !5
  %211 = getelementptr inbounds %struct.HandleLog, ptr %210, i32 0, i32 3
  %212 = getelementptr inbounds [16 x i8], ptr %211, i64 0, i64 0
  %213 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %198, i64 noundef 256, ptr noundef @.str.4, ptr noundef %201, i64 noundef %209, ptr noundef %212) #7
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.HandleLog, ptr %214, i32 0, i32 1
  %216 = getelementptr inbounds [128 x i8], ptr %215, i64 0, i64 0
  %217 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %218 = call i32 @rename(ptr noundef %216, ptr noundef %217) #7
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.HandleLog, ptr %219, i32 0, i32 4
  %221 = load i64, ptr %220, align 8, !tbaa !28
  %222 = add nsw i64 %221, 1
  store i64 %222, ptr %220, align 8, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  br label %223

223:                                              ; preds = %195, %173
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %250

224:                                              ; preds = %119
  %225 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %226 = load ptr, ptr %4, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.HandleLog, ptr %226, i32 0, i32 2
  %228 = getelementptr inbounds [128 x i8], ptr %227, i64 0, i64 0
  %229 = load ptr, ptr %4, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.HandleLog, ptr %229, i32 0, i32 4
  %231 = load i64, ptr %230, align 8, !tbaa !28
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.HandleLog, ptr %232, i32 0, i32 5
  %234 = load i32, ptr %233, align 8, !tbaa !29
  %235 = sext i32 %234 to i64
  %236 = srem i64 %231, %235
  %237 = load ptr, ptr %4, align 8, !tbaa !5
  %238 = getelementptr inbounds %struct.HandleLog, ptr %237, i32 0, i32 3
  %239 = getelementptr inbounds [16 x i8], ptr %238, i64 0, i64 0
  %240 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %225, i64 noundef 256, ptr noundef @.str.4, ptr noundef %228, i64 noundef %236, ptr noundef %239) #7
  %241 = load ptr, ptr %4, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.HandleLog, ptr %241, i32 0, i32 1
  %243 = getelementptr inbounds [128 x i8], ptr %242, i64 0, i64 0
  %244 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %245 = call i32 @rename(ptr noundef %243, ptr noundef %244) #7
  %246 = load ptr, ptr %4, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.HandleLog, ptr %246, i32 0, i32 4
  %248 = load i64, ptr %247, align 8, !tbaa !28
  %249 = add nsw i64 %248, 1
  store i64 %249, ptr %247, align 8, !tbaa !28
  br label %250

250:                                              ; preds = %224, %223
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  %252 = getelementptr inbounds %struct.HandleLog, ptr %251, i32 0, i32 1
  %253 = getelementptr inbounds [128 x i8], ptr %252, i64 0, i64 0
  %254 = call i32 (ptr, i32, ...) @open(ptr noundef %253, i32 noundef 66, i32 noundef 384)
  %255 = load ptr, ptr %4, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.HandleLog, ptr %255, i32 0, i32 8
  store i32 %254, ptr %256, align 8, !tbaa !19
  %257 = load ptr, ptr %4, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.HandleLog, ptr %257, i32 0, i32 9
  store i32 0, ptr %258, align 4, !tbaa !30
  br label %293

259:                                              ; preds = %84
  %260 = load ptr, ptr %4, align 8, !tbaa !5
  %261 = getelementptr inbounds %struct.HandleLog, ptr %260, i32 0, i32 1
  %262 = getelementptr inbounds [128 x i8], ptr %261, i64 0, i64 0
  %263 = load ptr, ptr %2, align 8, !tbaa !5
  %264 = call i32 @strcmp(ptr noundef %262, ptr noundef %263) #8
  %265 = icmp ne i32 %264, 0
  br i1 %265, label %266, label %277

266:                                              ; preds = %259
  %267 = load ptr, ptr %4, align 8, !tbaa !5
  call void @endLog(ptr noundef %267)
  %268 = load ptr, ptr %4, align 8, !tbaa !5
  %269 = getelementptr inbounds %struct.HandleLog, ptr %268, i32 0, i32 1
  %270 = getelementptr inbounds [128 x i8], ptr %269, i64 0, i64 0
  %271 = load ptr, ptr %2, align 8, !tbaa !5
  %272 = call ptr @strcpy(ptr noundef %270, ptr noundef %271) #7
  %273 = load ptr, ptr %4, align 8, !tbaa !5
  %274 = getelementptr inbounds %struct.HandleLog, ptr %273, i32 0, i32 4
  store i64 0, ptr %274, align 8, !tbaa !28
  %275 = load ptr, ptr %4, align 8, !tbaa !5
  %276 = getelementptr inbounds %struct.HandleLog, ptr %275, i32 0, i32 9
  store i32 0, ptr %276, align 4, !tbaa !30
  br label %292

277:                                              ; preds = %259
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %278 = load ptr, ptr %4, align 8, !tbaa !5
  %279 = getelementptr inbounds %struct.HandleLog, ptr %278, i32 0, i32 10
  %280 = load i32, ptr %279, align 8, !tbaa !18
  %281 = load ptr, ptr %4, align 8, !tbaa !5
  %282 = getelementptr inbounds %struct.HandleLog, ptr %281, i32 0, i32 11
  %283 = load i32, ptr %282, align 4, !tbaa !17
  %284 = sub nsw i32 %280, %283
  store i32 %284, ptr %10, align 4, !tbaa !25
  %285 = load i32, ptr %10, align 4, !tbaa !25
  %286 = icmp sge i32 %285, 1024
  br i1 %286, label %287, label %288

287:                                              ; preds = %277
  store i32 1, ptr %5, align 4
  br label %289

288:                                              ; preds = %277
  store i32 0, ptr %5, align 4
  br label %289

289:                                              ; preds = %288, %287
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %290 = load i32, ptr %5, align 4
  switch i32 %290, label %442 [
    i32 0, label %291
  ]

291:                                              ; preds = %289
  br label %292

292:                                              ; preds = %291, %266
  br label %293

293:                                              ; preds = %292, %250
  %294 = load ptr, ptr %4, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.HandleLog, ptr %294, i32 0, i32 12
  %296 = load ptr, ptr %295, align 8, !tbaa !16
  %297 = icmp ne ptr %296, null
  br i1 %297, label %298, label %307

298:                                              ; preds = %293
  %299 = load ptr, ptr %4, align 8, !tbaa !5
  %300 = getelementptr inbounds %struct.HandleLog, ptr %299, i32 0, i32 12
  %301 = load ptr, ptr %300, align 8, !tbaa !16
  %302 = load ptr, ptr %4, align 8, !tbaa !5
  %303 = getelementptr inbounds %struct.HandleLog, ptr %302, i32 0, i32 10
  %304 = load i32, ptr %303, align 8, !tbaa !18
  %305 = sext i32 %304 to i64
  %306 = call i32 @munmap(ptr noundef %301, i64 noundef %305) #7
  br label %307

307:                                              ; preds = %298, %293
  %308 = load ptr, ptr %4, align 8, !tbaa !5
  %309 = getelementptr inbounds %struct.HandleLog, ptr %308, i32 0, i32 6
  %310 = load i32, ptr %309, align 4, !tbaa !24
  %311 = icmp eq i32 %310, 0
  br i1 %311, label %312, label %315

312:                                              ; preds = %307
  %313 = load ptr, ptr %4, align 8, !tbaa !5
  %314 = getelementptr inbounds %struct.HandleLog, ptr %313, i32 0, i32 10
  store i32 65536, ptr %314, align 8, !tbaa !18
  br label %325

315:                                              ; preds = %307
  %316 = load ptr, ptr %4, align 8, !tbaa !5
  %317 = getelementptr inbounds %struct.HandleLog, ptr %316, i32 0, i32 6
  %318 = load i32, ptr %317, align 4, !tbaa !24
  %319 = sub nsw i32 %318, 1
  %320 = sdiv i32 %319, 4096
  %321 = add nsw i32 %320, 1
  %322 = mul nsw i32 %321, 4096
  %323 = load ptr, ptr %4, align 8, !tbaa !5
  %324 = getelementptr inbounds %struct.HandleLog, ptr %323, i32 0, i32 10
  store i32 %322, ptr %324, align 8, !tbaa !18
  br label %325

325:                                              ; preds = %315, %312
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 0, ptr %11, align 1, !tbaa !20
  br label %326

326:                                              ; preds = %325
  br label %327

327:                                              ; preds = %326
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %328 = load ptr, ptr %4, align 8, !tbaa !5
  %329 = getelementptr inbounds %struct.HandleLog, ptr %328, i32 0, i32 8
  %330 = load i32, ptr %329, align 8, !tbaa !19
  %331 = load ptr, ptr %4, align 8, !tbaa !5
  %332 = getelementptr inbounds %struct.HandleLog, ptr %331, i32 0, i32 9
  %333 = load i32, ptr %332, align 4, !tbaa !30
  %334 = load ptr, ptr %4, align 8, !tbaa !5
  %335 = getelementptr inbounds %struct.HandleLog, ptr %334, i32 0, i32 10
  %336 = load i32, ptr %335, align 8, !tbaa !18
  %337 = add nsw i32 %333, %336
  %338 = sub nsw i32 %337, 1
  %339 = sext i32 %338 to i64
  %340 = call i64 @lseek(i32 noundef %330, i64 noundef %339, i32 noundef 0) #7
  %341 = load ptr, ptr %4, align 8, !tbaa !5
  %342 = getelementptr inbounds %struct.HandleLog, ptr %341, i32 0, i32 9
  %343 = load i32, ptr %342, align 4, !tbaa !30
  %344 = load ptr, ptr %4, align 8, !tbaa !5
  %345 = getelementptr inbounds %struct.HandleLog, ptr %344, i32 0, i32 10
  %346 = load i32, ptr %345, align 8, !tbaa !18
  %347 = add nsw i32 %343, %346
  %348 = sub nsw i32 %347, 1
  %349 = sext i32 %348 to i64
  %350 = icmp ne i64 %340, %349
  %351 = zext i1 %350 to i32
  store i32 %351, ptr %12, align 4, !tbaa !25
  %352 = load i32, ptr %12, align 4, !tbaa !25
  %353 = icmp ne i32 %352, 0
  br i1 %353, label %354, label %356

354:                                              ; preds = %327
  %355 = load i32, ptr %12, align 4, !tbaa !25
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %355, i32 noundef -1, ptr noundef @.str.5, i32 noundef 193, ptr noundef @__FUNCTION__.LogFile, ptr noundef @.str.6)
  br label %356

356:                                              ; preds = %354, %327
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %357

357:                                              ; preds = %356
  br label %358

358:                                              ; preds = %357
  br label %359

359:                                              ; preds = %358
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %360 = load ptr, ptr %4, align 8, !tbaa !5
  %361 = getelementptr inbounds %struct.HandleLog, ptr %360, i32 0, i32 8
  %362 = load i32, ptr %361, align 8, !tbaa !19
  %363 = call i64 @write(i32 noundef %362, ptr noundef %11, i64 noundef 1)
  %364 = icmp ne i64 %363, 1
  %365 = zext i1 %364 to i32
  store i32 %365, ptr %13, align 4, !tbaa !25
  %366 = load i32, ptr %13, align 4, !tbaa !25
  %367 = icmp ne i32 %366, 0
  br i1 %367, label %368, label %370

368:                                              ; preds = %359
  %369 = load i32, ptr %13, align 4, !tbaa !25
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %369, i32 noundef -1, ptr noundef @.str.5, i32 noundef 193, ptr noundef @__FUNCTION__.LogFile, ptr noundef @.str.7)
  br label %370

370:                                              ; preds = %368, %359
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %371

371:                                              ; preds = %370
  br label %372

372:                                              ; preds = %371
  br label %373

373:                                              ; preds = %372
  br label %374

374:                                              ; preds = %373
  br label %375

375:                                              ; preds = %374
  %376 = load ptr, ptr %4, align 8, !tbaa !5
  %377 = getelementptr inbounds %struct.HandleLog, ptr %376, i32 0, i32 10
  %378 = load i32, ptr %377, align 8, !tbaa !18
  %379 = sext i32 %378 to i64
  %380 = load ptr, ptr %4, align 8, !tbaa !5
  %381 = getelementptr inbounds %struct.HandleLog, ptr %380, i32 0, i32 8
  %382 = load i32, ptr %381, align 8, !tbaa !19
  %383 = load ptr, ptr %4, align 8, !tbaa !5
  %384 = getelementptr inbounds %struct.HandleLog, ptr %383, i32 0, i32 9
  %385 = load i32, ptr %384, align 4, !tbaa !30
  %386 = sext i32 %385 to i64
  %387 = call ptr @mmap(ptr noundef null, i64 noundef %379, i32 noundef 3, i32 noundef 1, i32 noundef %382, i64 noundef %386) #7
  %388 = load ptr, ptr %4, align 8, !tbaa !5
  %389 = getelementptr inbounds %struct.HandleLog, ptr %388, i32 0, i32 12
  store ptr %387, ptr %389, align 8, !tbaa !16
  br label %390

390:                                              ; preds = %375
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %391 = load ptr, ptr %4, align 8, !tbaa !5
  %392 = getelementptr inbounds %struct.HandleLog, ptr %391, i32 0, i32 12
  %393 = load ptr, ptr %392, align 8, !tbaa !16
  %394 = icmp eq ptr %393, null
  %395 = zext i1 %394 to i32
  store i32 %395, ptr %14, align 4, !tbaa !25
  %396 = load i32, ptr %14, align 4, !tbaa !25
  %397 = icmp ne i32 %396, 0
  br i1 %397, label %398, label %400

398:                                              ; preds = %390
  %399 = load i32, ptr %14, align 4, !tbaa !25
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %399, i32 noundef -1, ptr noundef @.str.5, i32 noundef 195, ptr noundef @__FUNCTION__.LogFile, ptr noundef @.str.8)
  br label %400

400:                                              ; preds = %398, %390
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %401

401:                                              ; preds = %400
  br label %402

402:                                              ; preds = %401
  br label %403

403:                                              ; preds = %402
  br label %404

404:                                              ; preds = %403
  %405 = load ptr, ptr %4, align 8, !tbaa !5
  %406 = getelementptr inbounds %struct.HandleLog, ptr %405, i32 0, i32 9
  %407 = load i32, ptr %406, align 4, !tbaa !30
  %408 = icmp eq i32 %407, 0
  br i1 %408, label %409, label %424

409:                                              ; preds = %404
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %410 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %411 = load ptr, ptr %4, align 8, !tbaa !5
  %412 = getelementptr inbounds %struct.HandleLog, ptr %411, i32 0, i32 4
  %413 = load i64, ptr %412, align 8, !tbaa !28
  %414 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %410, i64 noundef 256, ptr noundef @.str.9, i64 noundef %413) #7
  store i32 %414, ptr %15, align 4, !tbaa !25
  %415 = load ptr, ptr %4, align 8, !tbaa !5
  %416 = getelementptr inbounds %struct.HandleLog, ptr %415, i32 0, i32 12
  %417 = load ptr, ptr %416, align 8, !tbaa !16
  %418 = getelementptr inbounds [256 x i8], ptr %6, i64 0, i64 0
  %419 = load i32, ptr %15, align 4, !tbaa !25
  %420 = sext i32 %419 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %417, ptr align 16 %418, i64 %420, i1 false)
  %421 = load i32, ptr %15, align 4, !tbaa !25
  %422 = load ptr, ptr %4, align 8, !tbaa !5
  %423 = getelementptr inbounds %struct.HandleLog, ptr %422, i32 0, i32 11
  store i32 %421, ptr %423, align 4, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %427

424:                                              ; preds = %404
  %425 = load ptr, ptr %4, align 8, !tbaa !5
  %426 = getelementptr inbounds %struct.HandleLog, ptr %425, i32 0, i32 11
  store i32 0, ptr %426, align 4, !tbaa !17
  br label %427

427:                                              ; preds = %424, %409
  %428 = load ptr, ptr %4, align 8, !tbaa !5
  %429 = getelementptr inbounds %struct.HandleLog, ptr %428, i32 0, i32 10
  %430 = load i32, ptr %429, align 8, !tbaa !18
  %431 = load ptr, ptr %4, align 8, !tbaa !5
  %432 = getelementptr inbounds %struct.HandleLog, ptr %431, i32 0, i32 9
  %433 = load i32, ptr %432, align 4, !tbaa !30
  %434 = add nsw i32 %433, %430
  store i32 %434, ptr %432, align 4, !tbaa !30
  %435 = load ptr, ptr %4, align 8, !tbaa !5
  %436 = getelementptr inbounds %struct.HandleLog, ptr %435, i32 0, i32 0
  store i32 1, ptr %436, align 8, !tbaa !12
  %437 = load ptr, ptr %4, align 8, !tbaa !5
  %438 = getelementptr inbounds %struct.HandleLog, ptr %437, i32 0, i32 13
  %439 = load i32, ptr %438, align 8, !tbaa !21
  %440 = load ptr, ptr %4, align 8, !tbaa !5
  %441 = getelementptr inbounds %struct.HandleLog, ptr %440, i32 0, i32 14
  store i32 %439, ptr %441, align 4, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  store i32 0, ptr %5, align 4
  br label %442

442:                                              ; preds = %427, %289, %115
  call void @llvm.lifetime.end.p0(i64 256, ptr %6) #7
  br label %443

443:                                              ; preds = %442, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  %444 = load i32, ptr %5, align 4
  switch i32 %444, label %446 [
    i32 0, label %445
    i32 1, label %445
  ]

445:                                              ; preds = %443, %443, %18
  ret void

446:                                              ; preds = %443
  unreachable
}

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

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #3

declare ptr @mMornObject(ptr noundef, i32 noundef) #3

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #5

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

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #5

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

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

; Function Attrs: nounwind
declare i32 @access(ptr noundef, i32 noundef) #2

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

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

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #2

declare i32 @fclose(ptr noundef) #3

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #2

; Function Attrs: nounwind
declare i32 @rename(ptr noundef, ptr noundef) #2

declare i32 @open(ptr noundef, i32 noundef, ...) #3

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #3

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #3

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #3 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nounwind willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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, !6, i64 16}
!10 = !{!"MHandle", !11, i64 0, !11, i64 4, !6, i64 8, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"HandleLog", !11, i64 0, !7, i64 4, !7, i64 132, !7, i64 260, !14, i64 280, !11, i64 288, !11, i64 292, !15, i64 296, !11, i64 448, !11, i64 452, !11, i64 456, !11, i64 460, !6, i64 464, !11, i64 472, !11, i64 476, !11, i64 480, !6, i64 488, !6, i64 496}
!14 = !{!"long", !7, i64 0}
!15 = !{!"MThreadSignal", !7, i64 0, !7, i64 40, !7, i64 88, !11, i64 144}
!16 = !{!13, !6, i64 464}
!17 = !{!13, !11, i64 460}
!18 = !{!13, !11, i64 456}
!19 = !{!13, !11, i64 448}
!20 = !{!7, !7, i64 0}
!21 = !{!13, !11, i64 472}
!22 = !{!13, !11, i64 480}
!23 = !{!13, !11, i64 476}
!24 = !{!13, !11, i64 292}
!25 = !{!11, !11, i64 0}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!13, !14, i64 280}
!29 = !{!13, !11, i64 288}
!30 = !{!13, !11, i64 452}


; 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"

@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.LogFile = external hidden unnamed_addr constant [8 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @endLog(ptr noundef) #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

; Function Attrs: nounwind
declare i32 @munmap(ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @close(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @LogFile(ptr noundef readonly %0) local_unnamed_addr #0 {
  %2 = alloca [256 x i8], align 16
  %3 = alloca i8, align 1
  %4 = icmp eq ptr %0, null
  br i1 %4, label %185, label %5

5:                                                ; preds = %1
  %6 = tail call ptr @mMornObject(ptr noundef nonnull @.str, i32 noundef -1) #10
  %7 = tail call ptr @GetHandle(ptr noundef %6, i32 noundef 504, i32 noundef 1060628209, ptr noundef nonnull @endLog) #10
  %8 = getelementptr inbounds i8, ptr %7, i64 16
  %9 = load ptr, ptr %8, align 8, !tbaa !5
  %10 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %0, ptr noundef nonnull dereferenceable(1) @.str.1) #11
  %11 = icmp eq i32 %10, 0
  br i1 %11, label %12, label %44

12:                                               ; preds = %5
  %13 = load i32, ptr %9, align 8, !tbaa !11
  %.not115 = icmp eq i32 %13, 0
  br i1 %.not115, label %33, label %14

14:                                               ; preds = %12
  %15 = getelementptr inbounds i8, ptr %9, i64 464
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %9, i64 460
  %18 = load i32, ptr %17, align 4, !tbaa !16
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %16, i64 %19
  %21 = getelementptr inbounds i8, ptr %9, i64 456
  %22 = load i32, ptr %21, align 8, !tbaa !17
  %23 = xor i32 %18, -1
  %24 = add i32 %22, %23
  %25 = sext i32 %24 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %20, i8 32, i64 %25, i1 false)
  %26 = load ptr, ptr %15, align 8, !tbaa !15
  %27 = load i32, ptr %21, align 8, !tbaa !17
  %28 = sext i32 %27 to i64
  %29 = tail call i32 @munmap(ptr noundef %26, i64 noundef %28) #10
  %30 = getelementptr inbounds i8, ptr %9, i64 448
  %31 = load i32, ptr %30, align 8, !tbaa !18
  %32 = tail call i32 @close(i32 noundef %31) #10
  br label %33

33:                                               ; preds = %14, %12
  %34 = getelementptr inbounds i8, ptr %9, i64 132
  store i8 0, ptr %34, align 4, !tbaa !19
  store i32 0, ptr %9, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %9, i64 472
  %36 = load i32, ptr %35, align 8, !tbaa !20
  %.not116 = icmp eq i32 %36, 0
  br i1 %.not116, label %37, label %41

37:                                               ; preds = %33
  %38 = getelementptr inbounds i8, ptr %9, i64 480
  %39 = load i32, ptr %38, align 8, !tbaa !21
  %.not117 = icmp eq i32 %39, 0
  %40 = zext i1 %.not117 to i32
  br label %41

41:                                               ; preds = %37, %33
  %42 = phi i32 [ 1, %33 ], [ %40, %37 ]
  %43 = getelementptr inbounds i8, ptr %9, i64 476
  store i32 %42, ptr %43, align 4, !tbaa !22
  br label %185

44:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %2) #10
  %45 = getelementptr inbounds i8, ptr %9, i64 292
  %46 = load i32, ptr %45, align 4, !tbaa !23
  %47 = icmp sgt i32 %46, 0
  %48 = getelementptr inbounds i8, ptr %9, i64 4
  %49 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) %0) #11
  %.not112 = icmp eq i32 %49, 0
  br i1 %47, label %50, label %110

50:                                               ; preds = %44
  br i1 %.not112, label %54, label %.thread

.thread:                                          ; preds = %50
  tail call void @endLog(ptr noundef nonnull %9)
  %51 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) %0) #10
  %52 = getelementptr inbounds i8, ptr %9, i64 132
  store i8 0, ptr %52, align 4, !tbaa !19
  %53 = getelementptr inbounds i8, ptr %9, i64 132
  br label %64

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %9, i64 456
  %56 = load i32, ptr %55, align 8, !tbaa !17
  %57 = getelementptr inbounds i8, ptr %9, i64 460
  %58 = load i32, ptr %57, align 4, !tbaa !16
  %59 = sub nsw i32 %56, %58
  %60 = icmp sgt i32 %59, 1023
  br i1 %60, label %184, label %61

61:                                               ; preds = %54
  tail call void @endLog(ptr noundef nonnull %9)
  %.phi.trans.insert = getelementptr inbounds i8, ptr %9, i64 132
  %.pre = load i8, ptr %.phi.trans.insert, align 4, !tbaa !19
  %62 = icmp eq i8 %.pre, 0
  %63 = getelementptr inbounds i8, ptr %9, i64 132
  br i1 %62, label %64, label %95

64:                                               ; preds = %.thread, %61
  %65 = phi ptr [ %53, %.thread ], [ %63, %61 ]
  %66 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #11
  %67 = trunc i64 %66 to i32
  %68 = shl i64 %66, 32
  %sext = add i64 %68, 4294967296
  %69 = ashr exact i64 %sext, 32
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %65, ptr nonnull align 1 %0, i64 %69, i1 false)
  %70 = icmp sgt i32 %67, 0
  br i1 %70, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %64
  %71 = getelementptr inbounds i8, ptr %9, i64 132
  br label %.lr.ph

72:                                               ; preds = %.lr.ph
  %73 = add nsw i32 %.0108122, -1
  %74 = icmp sgt i32 %.0108122, 1
  br i1 %74, label %.lr.ph, label %.loopexit, !llvm.loop !24

.lr.ph:                                           ; preds = %.lr.ph.preheader, %72
  %.0108122 = phi i32 [ %73, %72 ], [ %67, %.lr.ph.preheader ]
  %75 = zext nneg i32 %.0108122 to i64
  %76 = getelementptr inbounds [128 x i8], ptr %71, i64 0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !19
  %78 = icmp eq i8 %77, 46
  br i1 %78, label %79, label %72

79:                                               ; preds = %.lr.ph
  %80 = getelementptr inbounds i8, ptr %9, i64 132
  %81 = getelementptr inbounds [128 x i8], ptr %80, i64 0, i64 %75
  %82 = getelementptr inbounds i8, ptr %9, i64 260
  %83 = getelementptr inbounds i8, ptr %81, i64 1
  %84 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %82, ptr noundef nonnull dereferenceable(1) %83) #10
  store i8 0, ptr %81, align 1, !tbaa !19
  br label %.loopexit

.loopexit:                                        ; preds = %72, %64, %79
  %85 = getelementptr inbounds i8, ptr %9, i64 280
  store i64 0, ptr %85, align 8, !tbaa !26
  %86 = tail call i32 @access(ptr noundef nonnull %48, i32 noundef 0) #10
  %87 = icmp sgt i32 %86, -1
  br i1 %87, label %88, label %107

88:                                               ; preds = %.loopexit
  %89 = tail call noalias ptr @fopen(ptr noundef nonnull %48, ptr noundef nonnull @.str.2)
  %90 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 256, ptr noundef %89)
  %.not113 = icmp eq ptr %90, null
  br i1 %.not113, label %93, label %91

91:                                               ; preds = %88
  %92 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %2, ptr noundef nonnull @.str.3, ptr noundef nonnull %85) #10
  br label %93

93:                                               ; preds = %91, %88
  %94 = call i32 @fclose(ptr noundef %89)
  br label %.sink.split

95:                                               ; preds = %61
  %96 = getelementptr inbounds i8, ptr %9, i64 280
  br label %.sink.split

.sink.split:                                      ; preds = %95, %93
  %.sink139 = phi ptr [ %85, %93 ], [ %96, %95 ]
  %.sink132 = phi ptr [ %65, %93 ], [ %63, %95 ]
  %97 = load i64, ptr %.sink139, align 8, !tbaa !26
  %98 = getelementptr inbounds i8, ptr %9, i64 288
  %99 = load i32, ptr %98, align 8, !tbaa !27
  %100 = sext i32 %99 to i64
  %101 = srem i64 %97, %100
  %102 = getelementptr inbounds i8, ptr %9, i64 260
  %103 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 256, ptr noundef nonnull @.str.4, ptr noundef nonnull %.sink132, i64 noundef %101, ptr noundef nonnull %102) #10
  %104 = call i32 @rename(ptr noundef nonnull %48, ptr noundef nonnull %2) #10
  %105 = load i64, ptr %.sink139, align 8, !tbaa !26
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %.sink139, align 8, !tbaa !26
  br label %107

107:                                              ; preds = %.sink.split, %.loopexit
  %108 = call i32 (ptr, i32, ...) @open(ptr noundef nonnull %48, i32 noundef 66, i32 noundef 384) #10
  %109 = getelementptr inbounds i8, ptr %9, i64 448
  store i32 %108, ptr %109, align 8, !tbaa !18
  br label %.sink.split140

110:                                              ; preds = %44
  br i1 %.not112, label %114, label %111

111:                                              ; preds = %110
  tail call void @endLog(ptr noundef nonnull %9)
  %112 = tail call ptr @strcpy(ptr noundef nonnull dereferenceable(1) %48, ptr noundef nonnull dereferenceable(1) %0) #10
  %113 = getelementptr inbounds i8, ptr %9, i64 280
  store i64 0, ptr %113, align 8, !tbaa !26
  br label %.sink.split140

114:                                              ; preds = %110
  %115 = getelementptr inbounds i8, ptr %9, i64 456
  %116 = load i32, ptr %115, align 8, !tbaa !17
  %117 = getelementptr inbounds i8, ptr %9, i64 460
  %118 = load i32, ptr %117, align 4, !tbaa !16
  %119 = sub nsw i32 %116, %118
  %120 = icmp slt i32 %119, 1024
  br i1 %120, label %122, label %184

.sink.split140:                                   ; preds = %107, %111
  %121 = getelementptr inbounds i8, ptr %9, i64 452
  store i32 0, ptr %121, align 4, !tbaa !28
  br label %122

122:                                              ; preds = %.sink.split140, %114
  %123 = getelementptr inbounds i8, ptr %9, i64 464
  %124 = load ptr, ptr %123, align 8, !tbaa !15
  %.not114 = icmp eq ptr %124, null
  br i1 %.not114, label %130, label %125

125:                                              ; preds = %122
  %126 = getelementptr inbounds i8, ptr %9, i64 456
  %127 = load i32, ptr %126, align 8, !tbaa !17
  %128 = sext i32 %127 to i64
  %129 = call i32 @munmap(ptr noundef nonnull %124, i64 noundef %128) #10
  br label %130

130:                                              ; preds = %125, %122
  %131 = load i32, ptr %45, align 4, !tbaa !23
  %132 = icmp eq i32 %131, 0
  br i1 %132, label %138, label %133

133:                                              ; preds = %130
  %134 = add nsw i32 %131, -1
  %135 = sdiv i32 %134, 4096
  %136 = shl nsw i32 %135, 12
  %137 = add i32 %136, 4096
  br label %138

138:                                              ; preds = %130, %133
  %.sink = phi i32 [ %137, %133 ], [ 65536, %130 ]
  %139 = getelementptr inbounds i8, ptr %9, i64 456
  store i32 %.sink, ptr %139, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #10
  store i8 0, ptr %3, align 1, !tbaa !19
  %140 = getelementptr inbounds i8, ptr %9, i64 448
  %141 = load i32, ptr %140, align 8, !tbaa !18
  %142 = getelementptr inbounds i8, ptr %9, i64 452
  %143 = load i32, ptr %142, align 4, !tbaa !28
  %144 = add i32 %143, -1
  %145 = add i32 %144, %.sink
  %146 = sext i32 %145 to i64
  %147 = call i64 @lseek(i32 noundef %141, i64 noundef %146, i32 noundef 0) #10
  %148 = load i32, ptr %142, align 4, !tbaa !28
  %149 = load i32, ptr %139, align 8, !tbaa !17
  %150 = add i32 %148, -1
  %151 = add i32 %150, %149
  %152 = sext i32 %151 to i64
  %.not118 = icmp eq i64 %147, %152
  br i1 %.not118, label %154, label %153

153:                                              ; preds = %138
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.5, i32 noundef 193, ptr noundef nonnull @__FUNCTION__.LogFile, ptr noundef nonnull @.str.6) #10
  br label %154

154:                                              ; preds = %153, %138
  %155 = load i32, ptr %140, align 8, !tbaa !18
  %156 = call i64 @write(i32 noundef %155, ptr noundef nonnull %3, i64 noundef 1) #10
  %.not119 = icmp eq i64 %156, 1
  br i1 %.not119, label %158, label %157

157:                                              ; preds = %154
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.5, i32 noundef 193, ptr noundef nonnull @__FUNCTION__.LogFile, ptr noundef nonnull @.str.7) #10
  br label %158

158:                                              ; preds = %157, %154
  %159 = load i32, ptr %139, align 8, !tbaa !17
  %160 = sext i32 %159 to i64
  %161 = load i32, ptr %140, align 8, !tbaa !18
  %162 = load i32, ptr %142, align 4, !tbaa !28
  %163 = sext i32 %162 to i64
  %164 = call ptr @mmap(ptr noundef null, i64 noundef %160, i32 noundef 3, i32 noundef 1, i32 noundef %161, i64 noundef %163) #10
  store ptr %164, ptr %123, align 8, !tbaa !15
  %165 = icmp eq ptr %164, null
  br i1 %165, label %166, label %167

166:                                              ; preds = %158
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.5, i32 noundef 195, ptr noundef nonnull @__FUNCTION__.LogFile, ptr noundef nonnull @.str.8) #10
  br label %167

167:                                              ; preds = %166, %158
  %168 = load i32, ptr %142, align 4, !tbaa !28
  %169 = icmp eq i32 %168, 0
  br i1 %169, label %170, label %176

170:                                              ; preds = %167
  %171 = getelementptr inbounds i8, ptr %9, i64 280
  %172 = load i64, ptr %171, align 8, !tbaa !26
  %173 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %2, i64 noundef 256, ptr noundef nonnull @.str.9, i64 noundef %172) #10
  %174 = load ptr, ptr %123, align 8, !tbaa !15
  %175 = sext i32 %173 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %174, ptr nonnull align 16 %2, i64 %175, i1 false)
  %.pre125 = load i32, ptr %142, align 4, !tbaa !28
  br label %176

176:                                              ; preds = %167, %170
  %177 = phi i32 [ %.pre125, %170 ], [ %168, %167 ]
  %.sink124 = phi i32 [ %173, %170 ], [ 0, %167 ]
  %178 = getelementptr inbounds i8, ptr %9, i64 460
  store i32 %.sink124, ptr %178, align 4
  %179 = load i32, ptr %139, align 8, !tbaa !17
  %180 = add nsw i32 %177, %179
  store i32 %180, ptr %142, align 4, !tbaa !28
  store i32 1, ptr %9, align 8, !tbaa !11
  %181 = getelementptr inbounds i8, ptr %9, i64 472
  %182 = load i32, ptr %181, align 8, !tbaa !20
  %183 = getelementptr inbounds i8, ptr %9, i64 476
  store i32 %182, ptr %183, align 4, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #10
  br label %184

184:                                              ; preds = %54, %114, %176
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %2) #10
  br label %185

185:                                              ; preds = %41, %184, %1
  ret void
}

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

declare ptr @GetHandle(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

declare ptr @mMornObject(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

; 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 #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #7

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

; Function Attrs: nofree nounwind
declare noundef i32 @access(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #8

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_sscanf(ptr nocapture noundef readonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #8

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @rename(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #8

; Function Attrs: nofree
declare noundef i32 @open(ptr nocapture noundef readonly, i32 noundef, ...) local_unnamed_addr #9

; Function Attrs: nounwind
declare i64 @lseek(i32 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #3

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #9

; Function Attrs: nounwind
declare ptr @mmap(ptr noundef, i64 noundef, i32 noundef, i32 noundef, i32 noundef, i64 noundef) local_unnamed_addr #2

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #2 = { 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 #3 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #7 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { 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 #9 = { nofree "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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }

!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, !10, i64 16}
!6 = !{!"MHandle", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"HandleLog", !7, i64 0, !8, i64 4, !8, i64 132, !8, i64 260, !13, i64 280, !7, i64 288, !7, i64 292, !14, i64 296, !7, i64 448, !7, i64 452, !7, i64 456, !7, i64 460, !10, i64 464, !7, i64 472, !7, i64 476, !7, i64 480, !10, i64 488, !10, i64 496}
!13 = !{!"long", !8, i64 0}
!14 = !{!"MThreadSignal", !8, i64 0, !8, i64 40, !8, i64 88, !7, i64 144}
!15 = !{!12, !10, i64 464}
!16 = !{!12, !7, i64 460}
!17 = !{!12, !7, i64 456}
!18 = !{!12, !7, i64 448}
!19 = !{!8, !8, i64 0}
!20 = !{!12, !7, i64 472}
!21 = !{!12, !7, i64 480}
!22 = !{!12, !7, i64 476}
!23 = !{!12, !7, i64 292}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !13, i64 280}
!27 = !{!12, !7, i64 288}
!28 = !{!12, !7, i64 452}


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