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

; 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.TARFileInfo = type { [100 x i8], [60 x i8], i32, i32 }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.TARFileList = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @OctToDec(ptr noundef) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TARFileList(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %struct.TARFileInfo, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca [12 x i8], align 1
  %9 = alloca [8 x i8], align 1
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 168, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = call i32 @fseek(ptr noundef %16, i64 noundef 0, i32 noundef 2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = call i64 @ftell(ptr noundef %18)
  %20 = trunc i64 %19 to i32
  store i32 %20, ptr %7, align 4, !tbaa !9
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = call i32 @fseek(ptr noundef %21, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %23 = call ptr @ListCreate(i32 noundef -1, ptr noundef null)
  store ptr %23, ptr %10, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %160, %56, %2
  br label %25

25:                                               ; preds = %24
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp sge i32 %26, %27
  br i1 %28, label %29, label %30

29:                                               ; preds = %25
  br label %161

30:                                               ; preds = %25
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = call i32 @fseek(ptr noundef %31, i64 noundef %33, i32 noundef 0)
  br label %35

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %36 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %37 = getelementptr inbounds [100 x i8], ptr %36, i64 0, i64 0
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = call i64 @fread(ptr noundef %37, i64 noundef 100, i64 noundef 1, ptr noundef %38)
  %40 = trunc i64 %39 to i32
  %41 = sext i32 %40 to i64
  %42 = icmp ne i64 %41, 1
  %43 = zext i1 %42 to i32
  store i32 %43, ptr %11, align 4, !tbaa !9
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %35
  %47 = load i32, ptr %11, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %47, i32 noundef -1, ptr noundef @.str, i32 noundef 43, ptr noundef @__FUNCTION__.TARFileList, ptr noundef @.str.1)
  br label %48

48:                                               ; preds = %46, %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %49

49:                                               ; preds = %48
  br label %50

50:                                               ; preds = %49
  %51 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %52 = getelementptr inbounds [100 x i8], ptr %51, i64 0, i64 0
  %53 = load i8, ptr %52, align 4, !tbaa !11
  %54 = sext i8 %53 to i32
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %59

56:                                               ; preds = %50
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = add nsw i32 %57, 512
  store i32 %58, ptr %6, align 4, !tbaa !9
  br label %24

59:                                               ; preds = %50
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = load i32, ptr %6, align 4, !tbaa !9
  %62 = add nsw i32 %61, 124
  %63 = sext i32 %62 to i64
  %64 = call i32 @fseek(ptr noundef %60, i64 noundef %63, i32 noundef 0)
  br label %65

65:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %66 = getelementptr inbounds [12 x i8], ptr %8, i64 0, i64 0
  %67 = load ptr, ptr %3, align 8, !tbaa !5
  %68 = call i64 @fread(ptr noundef %66, i64 noundef 12, i64 noundef 1, ptr noundef %67)
  %69 = trunc i64 %68 to i32
  %70 = sext i32 %69 to i64
  %71 = icmp ne i64 %70, 1
  %72 = zext i1 %71 to i32
  store i32 %72, ptr %12, align 4, !tbaa !9
  %73 = load i32, ptr %12, align 4, !tbaa !9
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %65
  %76 = load i32, ptr %12, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %76, i32 noundef -1, ptr noundef @.str, i32 noundef 53, ptr noundef @__FUNCTION__.TARFileList, ptr noundef @.str.1)
  br label %77

77:                                               ; preds = %75, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %78

78:                                               ; preds = %77
  br label %79

79:                                               ; preds = %78
  %80 = getelementptr inbounds [12 x i8], ptr %8, i64 0, i64 0
  %81 = call i32 @OctToDec(ptr noundef %80)
  %82 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 2
  store i32 %81, ptr %82, align 4, !tbaa !12
  %83 = load ptr, ptr %3, align 8, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !9
  %85 = add nsw i32 %84, 257
  %86 = sext i32 %85 to i64
  %87 = call i32 @fseek(ptr noundef %83, i64 noundef %86, i32 noundef 0)
  br label %88

88:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %89 = getelementptr inbounds [8 x i8], ptr %9, i64 0, i64 0
  %90 = load ptr, ptr %3, align 8, !tbaa !5
  %91 = call i64 @fread(ptr noundef %89, i64 noundef 8, i64 noundef 1, ptr noundef %90)
  %92 = trunc i64 %91 to i32
  %93 = sext i32 %92 to i64
  %94 = icmp ne i64 %93, 1
  %95 = zext i1 %94 to i32
  store i32 %95, ptr %13, align 4, !tbaa !9
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %100

98:                                               ; preds = %88
  %99 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %99, i32 noundef -1, ptr noundef @.str, i32 noundef 59, ptr noundef @__FUNCTION__.TARFileList, ptr noundef @.str.1)
  br label %100

100:                                              ; preds = %98, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %101

101:                                              ; preds = %100
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %6, align 4, !tbaa !9
  %104 = add nsw i32 %103, 512
  store i32 %104, ptr %6, align 4, !tbaa !9
  %105 = getelementptr inbounds [8 x i8], ptr %9, i64 0, i64 0
  %106 = call i32 @strcmp(ptr noundef %105, ptr noundef @.str.2) #6
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %160

108:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %109 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %110 = getelementptr inbounds [100 x i8], ptr %109, i64 0, i64 0
  %111 = call i64 @strlen(ptr noundef %110) #6
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %14, align 4, !tbaa !9
  br label %113

113:                                              ; preds = %144, %108
  %114 = load i32, ptr %14, align 4, !tbaa !9
  %115 = icmp sgt i32 %114, 0
  br i1 %115, label %117, label %116

116:                                              ; preds = %113
  store i32 10, ptr %15, align 4
  br label %147

117:                                              ; preds = %113
  %118 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %119 = load i32, ptr %14, align 4, !tbaa !9
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [100 x i8], ptr %118, i64 0, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !11
  %123 = sext i8 %122 to i32
  %124 = icmp eq i32 %123, 47
  br i1 %124, label %133, label %125

125:                                              ; preds = %117
  %126 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %127 = load i32, ptr %14, align 4, !tbaa !9
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [100 x i8], ptr %126, i64 0, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !11
  %131 = sext i8 %130 to i32
  %132 = icmp eq i32 %131, 92
  br i1 %132, label %133, label %143

133:                                              ; preds = %125, %117
  %134 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 1
  %135 = getelementptr inbounds [60 x i8], ptr %134, i64 0, i64 0
  %136 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 0
  %137 = getelementptr inbounds [100 x i8], ptr %136, i64 0, i64 0
  %138 = load i32, ptr %14, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %137, i64 %139
  %141 = getelementptr inbounds i8, ptr %140, i64 1
  %142 = call ptr @strncpy(ptr noundef %135, ptr noundef %141, i64 noundef 59) #5
  store i32 10, ptr %15, align 4
  br label %147

143:                                              ; preds = %125
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %14, align 4, !tbaa !9
  %146 = add nsw i32 %145, -1
  store i32 %146, ptr %14, align 4, !tbaa !9
  br label %113, !llvm.loop !14

147:                                              ; preds = %133, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %6, align 4, !tbaa !9
  %150 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 3
  store i32 %149, ptr %150, align 4, !tbaa !16
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = call ptr @mListWrite(ptr noundef %151, i32 noundef -1, ptr noundef %5, i32 noundef 168)
  %153 = load i32, ptr %6, align 4, !tbaa !9
  %154 = getelementptr inbounds %struct.TARFileInfo, ptr %5, i32 0, i32 2
  %155 = load i32, ptr %154, align 4, !tbaa !12
  %156 = add nsw i32 %155, 511
  %157 = sdiv i32 %156, 512
  %158 = mul nsw i32 %157, 512
  %159 = add nsw i32 %153, %158
  store i32 %159, ptr %6, align 4, !tbaa !9
  br label %160

160:                                              ; preds = %148, %102
  br label %24

161:                                              ; preds = %29
  %162 = load ptr, ptr %10, align 8, !tbaa !5
  call void @mListRelease(ptr noundef %162)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 168, ptr %5) #5
  ret void
}

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #2

declare i64 @ftell(ptr noundef) #2

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

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

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

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

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #4

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

declare void @mListRelease(ptr 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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind 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 = { 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 #5 = { nounwind }
attributes #6 = { 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 = !{!13, !10, i64 160}
!13 = !{!"TARFileInfo", !7, i64 0, !7, i64 100, !10, i64 160, !10, i64 164}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!13, !10, i64 164}


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

%struct.TARFileInfo = type { [100 x i8], [60 x i8], i32, i32 }

@.str = external hidden unnamed_addr constant [75 x i8], align 1
@__FUNCTION__.TARFileList = external hidden unnamed_addr constant [12 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @OctToDec(ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @TARFileList(ptr nocapture noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca %struct.TARFileInfo, align 4
  %4 = alloca [12 x i8], align 1
  %5 = alloca [8 x i8], align 1
  call void @llvm.lifetime.start.p0(i64 168, ptr nonnull %3) #6
  %6 = tail call i32 @fseek(ptr noundef %0, i64 noundef 0, i32 noundef 2)
  %7 = tail call i64 @ftell(ptr noundef %0)
  %8 = trunc i64 %7 to i32
  %9 = tail call i32 @fseek(ptr noundef %0, i64 noundef 0, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %10 = tail call ptr @ListCreate(i32 noundef -1, ptr noundef null) #6
  %invariant.gep = getelementptr inbounds i8, ptr %3, i64 1
  %.not38 = icmp sgt i32 %8, 0
  br i1 %.not38, label %.lr.ph40, label %._crit_edge

.lr.ph40:                                         ; preds = %2
  %11 = getelementptr inbounds i8, ptr %3, i64 160
  %12 = getelementptr inbounds i8, ptr %3, i64 100
  %13 = getelementptr inbounds i8, ptr %3, i64 164
  br label %14

14:                                               ; preds = %.lr.ph40, %.backedge
  %.03039 = phi i32 [ 0, %.lr.ph40 ], [ %.030.be, %.backedge ]
  %15 = sext i32 %.03039 to i64
  %16 = call i32 @fseek(ptr noundef %0, i64 noundef %15, i32 noundef 0)
  %17 = call i64 @fread(ptr noundef nonnull %3, i64 noundef 100, i64 noundef 1, ptr noundef %0)
  %sext.mask = and i64 %17, 4294967295
  %.not34 = icmp eq i64 %sext.mask, 1
  br i1 %.not34, label %19, label %18

18:                                               ; preds = %14
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 43, ptr noundef nonnull @__FUNCTION__.TARFileList, ptr noundef nonnull @.str.1) #6
  br label %19

19:                                               ; preds = %18, %14
  %20 = load i8, ptr %3, align 4, !tbaa !5
  %21 = icmp eq i8 %20, 0
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %23 = add nsw i32 %.03039, 512
  br label %.backedge

.backedge:                                        ; preds = %37, %.loopexit, %22
  %.030.be = phi i32 [ %23, %22 ], [ %57, %.loopexit ], [ %38, %37 ]
  %.not = icmp slt i32 %.030.be, %8
  br i1 %.not, label %14, label %._crit_edge

24:                                               ; preds = %19
  %25 = add nsw i32 %.03039, 124
  %26 = sext i32 %25 to i64
  %27 = call i32 @fseek(ptr noundef %0, i64 noundef %26, i32 noundef 0)
  %28 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 12, i64 noundef 1, ptr noundef %0)
  %sext.mask32 = and i64 %28, 4294967295
  %.not35 = icmp eq i64 %sext.mask32, 1
  br i1 %.not35, label %30, label %29

29:                                               ; preds = %24
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 53, ptr noundef nonnull @__FUNCTION__.TARFileList, ptr noundef nonnull @.str.1) #6
  br label %30

30:                                               ; preds = %29, %24
  %31 = call i32 @OctToDec(ptr noundef nonnull %4)
  store i32 %31, ptr %11, align 4, !tbaa !8
  %32 = add nsw i32 %.03039, 257
  %33 = sext i32 %32 to i64
  %34 = call i32 @fseek(ptr noundef %0, i64 noundef %33, i32 noundef 0)
  %35 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 8, i64 noundef 1, ptr noundef %0)
  %sext.mask33 = and i64 %35, 4294967295
  %.not36 = icmp eq i64 %sext.mask33, 1
  br i1 %.not36, label %37, label %36

36:                                               ; preds = %30
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 59, ptr noundef nonnull @__FUNCTION__.TARFileList, ptr noundef nonnull @.str.1) #6
  br label %37

37:                                               ; preds = %36, %30
  %38 = add nsw i32 %.03039, 512
  %39 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %5, ptr noundef nonnull dereferenceable(1) @.str.2) #7
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %.backedge

41:                                               ; preds = %37
  %42 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #7
  %43 = trunc i64 %42 to i32
  %44 = icmp sgt i32 %43, 0
  br i1 %44, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %41
  %45 = and i64 %42, 2147483647
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %50
  %indvars.iv = phi i64 [ %45, %.lr.ph.preheader ], [ %indvars.iv.next, %50 ]
  %46 = getelementptr inbounds [100 x i8], ptr %3, i64 0, i64 %indvars.iv
  %47 = load i8, ptr %46, align 1, !tbaa !5
  switch i8 %47, label %50 [
    i8 47, label %48
    i8 92, label %48
  ]

48:                                               ; preds = %.lr.ph, %.lr.ph
  %gep = getelementptr inbounds i8, ptr %invariant.gep, i64 %indvars.iv
  %49 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) %gep, i64 noundef 59) #6
  br label %.loopexit

50:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %51 = icmp sgt i64 %indvars.iv, 1
  br i1 %51, label %.lr.ph, label %.loopexit, !llvm.loop !11

.loopexit:                                        ; preds = %50, %41, %48
  store i32 %38, ptr %13, align 4, !tbaa !13
  %52 = call ptr @mListWrite(ptr noundef %1, i32 noundef -1, ptr noundef nonnull %3, i32 noundef 168) #6
  %53 = load i32, ptr %11, align 4, !tbaa !8
  %54 = add nsw i32 %53, 511
  %55 = sdiv i32 %54, 512
  %56 = shl nsw i32 %55, 9
  %57 = add nsw i32 %56, %38
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %2
  call void @mListRelease(ptr noundef %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 168, ptr nonnull %3) #6
  ret void
}

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

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture 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: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #4

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

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

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

declare void @mListRelease(ptr noundef) local_unnamed_addr #3

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 nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 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 #5 = { 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 #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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !10, i64 160}
!9 = !{!"TARFileInfo", !6, i64 0, !6, i64 100, !10, i64 160, !10, i64 164}
!10 = !{!"int", !6, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!9, !10, i64 164}


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