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

@.str.5 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__FUNCTION__.LogTail = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @close(i32 noundef) #1

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

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

; 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) #4

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

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

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

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

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

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

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local void @LogTail(ptr noundef %0) #5 {
  %2 = alloca ptr, align 8
  %3 = alloca [257 x i8], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 257, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 -1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 -1, ptr %9, align 4, !tbaa !9
  br label %19

19:                                               ; preds = %229, %71, %1
  br label %20

20:                                               ; preds = %26, %19
  br label %21

21:                                               ; preds = %20
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = call i32 @access(ptr noundef %22, i32 noundef 0) #6
  %24 = icmp sge i32 %23, 0
  br i1 %24, label %25, label %26

25:                                               ; preds = %21
  br label %28

26:                                               ; preds = %21
  store i32 0, ptr %4, align 4, !tbaa !9
  %27 = call i32 @usleep(i32 noundef 10000)
  br label %20

28:                                               ; preds = %25
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %39

31:                                               ; preds = %28
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = load i32, ptr %5, align 4, !tbaa !9
  %34 = sext i32 %33 to i64
  %35 = call i32 @munmap(ptr noundef %32, i64 noundef %34) #6
  %36 = load i32, ptr %7, align 4, !tbaa !9
  %37 = call i32 @close(i32 noundef %36)
  store ptr null, ptr %6, align 8, !tbaa !5
  %38 = call i32 @usleep(i32 noundef 10000)
  br label %39

39:                                               ; preds = %31, %28
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = call i32 (ptr, i32, ...) @open(ptr noundef %40, i32 noundef 66, i32 noundef 384)
  store i32 %41, ptr %7, align 4, !tbaa !9
  %42 = load i32, ptr %7, align 4, !tbaa !9
  %43 = call i64 @lseek(i32 noundef %42, i64 noundef 0, i32 noundef 2) #6
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %5, align 4, !tbaa !9
  br label %45

45:                                               ; preds = %39
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = call ptr @mmap(ptr noundef null, i64 noundef %47, i32 noundef 3, i32 noundef 1, i32 noundef %48, i64 noundef 0) #6
  store ptr %49, ptr %6, align 8, !tbaa !5
  br label %50

50:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = icmp eq ptr %51, null
  %53 = zext i1 %52 to i32
  store i32 %53, ptr %10, align 4, !tbaa !9
  %54 = load i32, ptr %10, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %58

56:                                               ; preds = %50
  %57 = load i32, ptr %10, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %57, i32 noundef -1, ptr noundef @.str.5, i32 noundef 314, ptr noundef @__FUNCTION__.LogTail, ptr noundef @.str.8)
  br label %58

58:                                               ; preds = %56, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %59

59:                                               ; preds = %58
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60
  br label %62

62:                                               ; preds = %61
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = load i32, ptr %5, align 4, !tbaa !9
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds i8, ptr %63, i64 %66
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %62
  br label %19

72:                                               ; preds = %62
  %73 = load i32, ptr %4, align 4, !tbaa !9
  %74 = icmp slt i32 %73, 0
  br i1 %74, label %75, label %79

75:                                               ; preds = %72
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = call i64 @strlen(ptr noundef %76) #7
  %78 = trunc i64 %77 to i32
  store i32 %78, ptr %4, align 4, !tbaa !9
  br label %94

79:                                               ; preds = %72
  %80 = load i32, ptr %4, align 4, !tbaa !9
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %82, label %93

82:                                               ; preds = %79
  %83 = load ptr, ptr %6, align 8, !tbaa !5
  %84 = load i32, ptr %4, align 4, !tbaa !9
  %85 = sub nsw i32 %84, 1
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds i8, ptr %83, i64 %86
  %88 = load i8, ptr %87, align 1, !tbaa !11
  %89 = sext i8 %88 to i32
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %82
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %92

92:                                               ; preds = %91, %82
  br label %93

93:                                               ; preds = %92, %79
  br label %94

94:                                               ; preds = %93, %75
  %95 = load i32, ptr %4, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  %97 = icmp ne i32 %95, %96
  br i1 %97, label %98, label %135

98:                                               ; preds = %94
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = icmp sgt i32 %99, 0
  br i1 %100, label %101, label %135

101:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %102, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %103 = load ptr, ptr %11, align 8, !tbaa !5
  %104 = call i64 @strlen(ptr noundef %103) #7
  %105 = trunc i64 %104 to i32
  store i32 %105, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %106, ptr %4, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %116, %101
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = icmp sgt i32 %108, 0
  br i1 %109, label %110, label %134

110:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = icmp slt i32 %111, 256
  br i1 %112, label %113, label %115

113:                                              ; preds = %110
  %114 = load i32, ptr %12, align 4, !tbaa !9
  br label %116

115:                                              ; preds = %110
  br label %116

116:                                              ; preds = %115, %113
  %117 = phi i32 [ %114, %113 ], [ 256, %115 ]
  store i32 %117, ptr %13, align 4, !tbaa !9
  %118 = load i32, ptr %13, align 4, !tbaa !9
  %119 = load i32, ptr %12, align 4, !tbaa !9
  %120 = sub nsw i32 %119, %118
  store i32 %120, ptr %12, align 4, !tbaa !9
  %121 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 0
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load i32, ptr %13, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %121, ptr align 1 %122, i64 %124, i1 false)
  %125 = load i32, ptr %13, align 4, !tbaa !9
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = sext i32 %125 to i64
  %128 = getelementptr inbounds i8, ptr %126, i64 %127
  store ptr %128, ptr %11, align 8, !tbaa !5
  %129 = load i32, ptr %13, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 %130
  store i8 0, ptr %131, align 1, !tbaa !11
  %132 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 0
  %133 = call i32 (ptr, ...) @printf(ptr noundef %132)
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %107, !llvm.loop !12

134:                                              ; preds = %107
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  br label %135

135:                                              ; preds = %134, %98, %94
  br label %136

136:                                              ; preds = %231, %135
  br label %137

137:                                              ; preds = %136
  %138 = call i32 @usleep(i32 noundef 10000)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %139 = load ptr, ptr %6, align 8, !tbaa !5
  %140 = load i32, ptr %4, align 4, !tbaa !9
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i8, ptr %139, i64 %141
  store ptr %142, ptr %14, align 8, !tbaa !5
  %143 = load ptr, ptr %14, align 8, !tbaa !5
  %144 = getelementptr inbounds i8, ptr %143, i64 0
  %145 = load i8, ptr %144, align 1, !tbaa !11
  %146 = icmp ne i8 %145, 0
  br i1 %146, label %147, label %220

147:                                              ; preds = %137
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %148 = load ptr, ptr %14, align 8, !tbaa !5
  %149 = call i64 @strlen(ptr noundef %148) #7
  %150 = trunc i64 %149 to i32
  store i32 %150, ptr %15, align 4, !tbaa !9
  %151 = load i32, ptr %15, align 4, !tbaa !9
  %152 = load i32, ptr %4, align 4, !tbaa !9
  %153 = add nsw i32 %152, %151
  store i32 %153, ptr %4, align 4, !tbaa !9
  %154 = load i32, ptr %4, align 4, !tbaa !9
  %155 = load i32, ptr %5, align 4, !tbaa !9
  %156 = icmp eq i32 %154, %155
  br i1 %156, label %157, label %183

157:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %158 = load i32, ptr %15, align 4, !tbaa !9
  %159 = sub nsw i32 %158, 1
  store i32 %159, ptr %16, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %175, %157
  %161 = load i32, ptr %16, align 4, !tbaa !9
  %162 = icmp sge i32 %161, 0
  br i1 %162, label %163, label %178

163:                                              ; preds = %160
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = load i32, ptr %16, align 4, !tbaa !9
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds i8, ptr %164, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !11
  %169 = sext i8 %168 to i32
  %170 = icmp ne i32 %169, 32
  br i1 %170, label %171, label %174

171:                                              ; preds = %163
  %172 = load i32, ptr %16, align 4, !tbaa !9
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %15, align 4, !tbaa !9
  br label %178

174:                                              ; preds = %163
  br label %175

175:                                              ; preds = %174
  %176 = load i32, ptr %16, align 4, !tbaa !9
  %177 = add nsw i32 %176, -1
  store i32 %177, ptr %16, align 4, !tbaa !9
  br label %160, !llvm.loop !14

178:                                              ; preds = %171, %160
  %179 = load i32, ptr %16, align 4, !tbaa !9
  %180 = icmp slt i32 %179, 0
  br i1 %180, label %181, label %182

181:                                              ; preds = %178
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %181, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %183

183:                                              ; preds = %182, %147
  br label %184

184:                                              ; preds = %193, %183
  %185 = load i32, ptr %15, align 4, !tbaa !9
  %186 = icmp sgt i32 %185, 0
  br i1 %186, label %187, label %211

187:                                              ; preds = %184
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %188 = load i32, ptr %15, align 4, !tbaa !9
  %189 = icmp slt i32 %188, 256
  br i1 %189, label %190, label %192

190:                                              ; preds = %187
  %191 = load i32, ptr %15, align 4, !tbaa !9
  br label %193

192:                                              ; preds = %187
  br label %193

193:                                              ; preds = %192, %190
  %194 = phi i32 [ %191, %190 ], [ 256, %192 ]
  store i32 %194, ptr %17, align 4, !tbaa !9
  %195 = load i32, ptr %17, align 4, !tbaa !9
  %196 = load i32, ptr %15, align 4, !tbaa !9
  %197 = sub nsw i32 %196, %195
  store i32 %197, ptr %15, align 4, !tbaa !9
  %198 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 0
  %199 = load ptr, ptr %14, align 8, !tbaa !5
  %200 = load i32, ptr %17, align 4, !tbaa !9
  %201 = sext i32 %200 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %198, ptr align 1 %199, i64 %201, i1 false)
  %202 = load i32, ptr %17, align 4, !tbaa !9
  %203 = load ptr, ptr %14, align 8, !tbaa !5
  %204 = sext i32 %202 to i64
  %205 = getelementptr inbounds i8, ptr %203, i64 %204
  store ptr %205, ptr %14, align 8, !tbaa !5
  %206 = load i32, ptr %17, align 4, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 %207
  store i8 0, ptr %208, align 1, !tbaa !11
  %209 = getelementptr inbounds [257 x i8], ptr %3, i64 0, i64 0
  %210 = call i32 (ptr, ...) @printf(ptr noundef %209)
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %184, !llvm.loop !15

211:                                              ; preds = %184
  %212 = load i32, ptr %4, align 4, !tbaa !9
  %213 = load i32, ptr %5, align 4, !tbaa !9
  %214 = icmp eq i32 %212, %213
  br i1 %214, label %215, label %216

215:                                              ; preds = %211
  store i32 2, ptr %18, align 4
  br label %217

216:                                              ; preds = %211
  store i32 0, ptr %18, align 4
  br label %217

217:                                              ; preds = %216, %215
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %218 = load i32, ptr %18, align 4
  switch i32 %218, label %229 [
    i32 0, label %219
  ]

219:                                              ; preds = %217
  br label %228

220:                                              ; preds = %137
  %221 = load i32, ptr %8, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %8, align 4, !tbaa !9
  %223 = load i32, ptr %8, align 4, !tbaa !9
  %224 = icmp eq i32 %223, 128
  br i1 %224, label %225, label %227

225:                                              ; preds = %220
  %226 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %226, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %18, align 4
  br label %229

227:                                              ; preds = %220
  br label %228

228:                                              ; preds = %227, %219
  store i32 0, ptr %18, align 4
  br label %229

229:                                              ; preds = %228, %225, %217
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %230 = load i32, ptr %18, align 4
  switch i32 %230, label %232 [
    i32 0, label %231
    i32 2, label %19
  ]

231:                                              ; preds = %229
  br label %136

232:                                              ; preds = %229
  unreachable
}

declare i32 @usleep(i32 noundef) #1

attributes #0 = { 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 #1 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


; 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.5 = external hidden unnamed_addr constant [75 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@__FUNCTION__.LogTail = external hidden unnamed_addr constant [8 x i8], align 1

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

declare i32 @close(i32 noundef) local_unnamed_addr #1

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

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

; 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) #4

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

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

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

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

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

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

; Function Attrs: noreturn nounwind uwtable
define dso_local void @LogTail(ptr nocapture noundef readonly %0) local_unnamed_addr #7 {
  %2 = alloca [257 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 257, ptr nonnull %2) #9
  br label %.outer

.outer.loopexit:                                  ; preds = %._crit_edge108, %77
  %.079.ph.ph = phi i32 [ %.4.ph136, %77 ], [ %.079.ph, %._crit_edge108 ]
  %.067.ph.ph = phi i32 [ %.4.ph136, %77 ], [ %26, %._crit_edge108 ]
  br label %.outer

.outer:                                           ; preds = %.outer.loopexit, %1
  %.086.ph = phi i32 [ 0, %1 ], [ %15, %.outer.loopexit ]
  %.079.ph = phi i32 [ -1, %1 ], [ %.079.ph.ph, %.outer.loopexit ]
  %.078.ph = phi ptr [ null, %1 ], [ %18, %.outer.loopexit ]
  %.075.ph = phi i64 [ 0, %1 ], [ %16, %.outer.loopexit ]
  %.067.ph = phi i32 [ -1, %1 ], [ %.067.ph.ph, %.outer.loopexit ]
  br label %3

3:                                                ; preds = %.outer, %21
  %.086 = phi i32 [ %15, %21 ], [ %.086.ph, %.outer ]
  %.078 = phi ptr [ %18, %21 ], [ %.078.ph, %.outer ]
  %.075 = phi i64 [ %16, %21 ], [ %.075.ph, %.outer ]
  %.067 = phi i32 [ %.168.lcssa, %21 ], [ %.067.ph, %.outer ]
  %4 = tail call i32 @access(ptr noundef %0, i32 noundef 0) #9
  %5 = icmp sgt i32 %4, -1
  br i1 %5, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %3, %.lr.ph
  %6 = tail call i32 @usleep(i32 noundef 10000) #9
  %7 = tail call i32 @access(ptr noundef %0, i32 noundef 0) #9
  %8 = icmp sgt i32 %7, -1
  br i1 %8, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %3
  %.168.lcssa = phi i32 [ %.067, %3 ], [ 0, %.lr.ph ]
  %.not = icmp eq ptr %.078, null
  br i1 %.not, label %14, label %9

9:                                                ; preds = %._crit_edge
  %sext = shl i64 %.075, 32
  %10 = ashr exact i64 %sext, 32
  %11 = tail call i32 @munmap(ptr noundef nonnull %.078, i64 noundef %10) #9
  %12 = tail call i32 @close(i32 noundef %.086) #9
  %13 = tail call i32 @usleep(i32 noundef 10000) #9
  br label %14

14:                                               ; preds = %9, %._crit_edge
  %15 = tail call i32 (ptr, i32, ...) @open(ptr noundef %0, i32 noundef 66, i32 noundef 384) #9
  %16 = tail call i64 @lseek(i32 noundef %15, i64 noundef 0, i32 noundef 2) #9
  %sext88 = shl i64 %16, 32
  %17 = ashr exact i64 %sext88, 32
  %18 = tail call ptr @mmap(ptr noundef null, i64 noundef %17, i32 noundef 3, i32 noundef 1, i32 noundef %15, i64 noundef 0) #9
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %14
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str.5, i32 noundef 314, ptr noundef nonnull @__FUNCTION__.LogTail, ptr noundef nonnull @.str.8) #9
  br label %21

21:                                               ; preds = %20, %14
  %sext89 = add i64 %sext88, -4294967296
  %22 = ashr exact i64 %sext89, 32
  %23 = getelementptr inbounds i8, ptr %18, i64 %22
  %24 = load i8, ptr %23, align 1, !tbaa !5
  %.not90 = icmp eq i8 %24, 0
  br i1 %.not90, label %25, label %3

25:                                               ; preds = %21
  %26 = trunc i64 %16 to i32
  %27 = icmp slt i32 %.168.lcssa, 0
  br i1 %27, label %28, label %31

28:                                               ; preds = %25
  %29 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %18) #10
  %30 = trunc i64 %29 to i32
  br label %38

31:                                               ; preds = %25
  %.not91 = icmp eq i32 %.168.lcssa, 0
  br i1 %.not91, label %38, label %32

32:                                               ; preds = %31
  %33 = zext nneg i32 %.168.lcssa to i64
  %34 = getelementptr i8, ptr %18, i64 %33
  %35 = getelementptr i8, ptr %34, i64 -1
  %36 = load i8, ptr %35, align 1, !tbaa !5
  %37 = icmp eq i8 %36, 0
  %spec.store.select = select i1 %37, i32 0, i32 %.168.lcssa
  br label %38

38:                                               ; preds = %31, %32, %28
  %.2 = phi i32 [ %30, %28 ], [ %spec.store.select, %32 ], [ 0, %31 ]
  %39 = icmp ne i32 %.2, %.079.ph
  %40 = icmp sgt i32 %.079.ph, 0
  %or.cond = and i1 %40, %39
  br i1 %or.cond, label %41, label %.loopexit95.preheader

41:                                               ; preds = %38
  %42 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %18) #10
  %43 = trunc i64 %42 to i32
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph103, label %.loopexit95.preheader

.lr.ph103:                                        ; preds = %41, %.lr.ph103
  %.076101 = phi i32 [ %46, %.lr.ph103 ], [ %43, %41 ]
  %.077100 = phi ptr [ %48, %.lr.ph103 ], [ %18, %41 ]
  %45 = tail call i32 @llvm.umin.i32(i32 %.076101, i32 256)
  %46 = sub nsw i32 %.076101, %45
  %47 = zext nneg i32 %45 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %2, ptr noundef nonnull align 1 dereferenceable(1) %.077100, i64 %47, i1 false)
  %48 = getelementptr inbounds i8, ptr %.077100, i64 %47
  %49 = getelementptr inbounds [257 x i8], ptr %2, i64 0, i64 %47
  store i8 0, ptr %49, align 1, !tbaa !5
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %2)
  %51 = icmp sgt i32 %46, 0
  br i1 %51, label %.lr.ph103, label %.loopexit95.preheader, !llvm.loop !8

.loopexit95.preheader:                            ; preds = %.lr.ph103, %41, %38
  %.4.ph = phi i32 [ %.2, %38 ], [ %43, %41 ], [ %43, %.lr.ph103 ]
  br label %.loopexit95.outer

.loopexit95.outer:                                ; preds = %.loopexit95.outer.backedge, %.loopexit95.preheader
  %.4.ph136 = phi i32 [ %.4.ph, %.loopexit95.preheader ], [ %60, %.loopexit95.outer.backedge ]
  %52 = sext i32 %.4.ph136 to i64
  %53 = getelementptr inbounds i8, ptr %18, i64 %52
  br label %.loopexit95

.loopexit95:                                      ; preds = %.loopexit95.outer, %77
  %.183 = phi i32 [ %78, %77 ], [ 0, %.loopexit95.outer ]
  %54 = tail call i32 @usleep(i32 noundef 10000) #9
  %55 = load i8, ptr %53, align 1, !tbaa !5
  %.not92 = icmp eq i8 %55, 0
  br i1 %.not92, label %77, label %56

56:                                               ; preds = %.loopexit95
  %57 = getelementptr inbounds i8, ptr %18, i64 %52
  %58 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %57) #10
  %59 = trunc i64 %58 to i32
  %60 = add nsw i32 %.4.ph136, %59
  %.not94 = icmp eq i32 %60, %26
  br i1 %.not94, label %.preheader.preheader, label %68

.preheader.preheader:                             ; preds = %56
  %61 = and i64 %58, 4294967295
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %64
  %indvars.iv = phi i64 [ %61, %.preheader.preheader ], [ %65, %64 ]
  %62 = trunc nuw i64 %indvars.iv to i32
  %63 = icmp sgt i32 %62, 0
  br i1 %63, label %64, label %._crit_edge108

64:                                               ; preds = %.preheader
  %65 = add nsw i64 %indvars.iv, -1
  %66 = getelementptr inbounds i8, ptr %57, i64 %65
  %67 = load i8, ptr %66, align 1, !tbaa !5
  %.not93 = icmp eq i8 %67, 32
  br i1 %.not93, label %.preheader, label %.lr.ph107.preheader, !llvm.loop !10

68:                                               ; preds = %56
  %69 = icmp sgt i32 %59, 0
  br i1 %69, label %.lr.ph107.preheader, label %.loopexit95.outer.backedge

.lr.ph107.preheader:                              ; preds = %64, %68
  %.373105.ph = phi i32 [ %59, %68 ], [ %62, %64 ]
  br label %.lr.ph107

.lr.ph107:                                        ; preds = %.lr.ph107.preheader, %.lr.ph107
  %.373105 = phi i32 [ %71, %.lr.ph107 ], [ %.373105.ph, %.lr.ph107.preheader ]
  %.074104 = phi ptr [ %73, %.lr.ph107 ], [ %57, %.lr.ph107.preheader ]
  %70 = tail call i32 @llvm.umin.i32(i32 %.373105, i32 256)
  %71 = sub nsw i32 %.373105, %70
  %72 = zext nneg i32 %70 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(1) %2, ptr noundef nonnull align 1 dereferenceable(1) %.074104, i64 %72, i1 false)
  %73 = getelementptr inbounds i8, ptr %.074104, i64 %72
  %74 = getelementptr inbounds [257 x i8], ptr %2, i64 0, i64 %72
  store i8 0, ptr %74, align 1, !tbaa !5
  %75 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) %2)
  %76 = icmp sgt i32 %71, 0
  br i1 %76, label %.lr.ph107, label %._crit_edge108, !llvm.loop !11

._crit_edge108:                                   ; preds = %.preheader, %.lr.ph107
  br i1 %.not94, label %.outer.loopexit, label %.loopexit95.outer.backedge

.loopexit95.outer.backedge:                       ; preds = %._crit_edge108, %68
  br label %.loopexit95.outer

77:                                               ; preds = %.loopexit95
  %78 = add nuw nsw i32 %.183, 1
  %79 = icmp eq i32 %78, 128
  br i1 %79, label %.outer.loopexit, label %.loopexit95
}

declare i32 @usleep(i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umin.i32(i32, i32) #8

attributes #0 = { 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 #1 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { 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 #7 = { noreturn 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = distinct !{!10, !9}
!11 = distinct !{!11, !9}


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