; LLVM IR from KamilSJaron/smudgeplot :: src_ploidyplot (libfastk)

; 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._Profile_Index = type { i32, i32, i32, ptr, ptr, i32, i32, i32, i32, ptr, ptr }

@stderr = external global ptr, align 8
@.str.41 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Malloc(i64 noundef, 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; 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
declare dso_local ptr @PathTo(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @Root(ptr noundef, ptr noundef) #0

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

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

declare i64 @read(i32 noundef, ptr noundef, i64 noundef) #5

declare i32 @close(i32 noundef) #5

; Function Attrs: nounwind uwtable
define dso_local ptr @Open_Profiles(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 i32, align 4
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = call ptr @PathTo(ptr noundef %20)
  store ptr %21, ptr %13, align 8, !tbaa !5
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = call ptr @Root(ptr noundef %22, ptr noundef @.str.41)
  store ptr %23, ptr %14, align 8, !tbaa !5
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = call i64 @strlen(ptr noundef %24) #7
  %26 = load ptr, ptr %14, align 8, !tbaa !5
  %27 = call i64 @strlen(ptr noundef %26) #7
  %28 = add i64 %25, %27
  %29 = add i64 %28, 20
  %30 = call ptr @Malloc(i64 noundef %29, ptr noundef @.str.42)
  store ptr %30, ptr %15, align 8, !tbaa !5
  %31 = load ptr, ptr %15, align 8, !tbaa !5
  %32 = load ptr, ptr %13, align 8, !tbaa !5
  %33 = load ptr, ptr %14, align 8, !tbaa !5
  %34 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %31, ptr noundef @.str.43, ptr noundef %32, ptr noundef %33) #6
  %35 = load ptr, ptr %15, align 8, !tbaa !5
  %36 = call i32 (ptr, i32, ...) @open(ptr noundef %35, i32 noundef 0)
  store i32 %36, ptr %11, align 4, !tbaa !9
  %37 = load ptr, ptr %15, align 8, !tbaa !5
  %38 = load ptr, ptr %13, align 8, !tbaa !5
  %39 = load ptr, ptr %14, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %37, ptr noundef @.str.44, ptr noundef %38, ptr noundef %39) #6
  %41 = load ptr, ptr %15, align 8, !tbaa !5
  %42 = call i64 @strlen(ptr noundef %41) #7
  %43 = trunc i64 %42 to i32
  store i32 %43, ptr %12, align 4, !tbaa !9
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %44) #6
  %45 = load ptr, ptr %13, align 8, !tbaa !5
  call void @free(ptr noundef %45) #6
  %46 = load i32, ptr %11, align 4, !tbaa !9
  %47 = icmp slt i32 %46, 0
  br i1 %47, label %48, label %49

48:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %19, align 4
  br label %217

49:                                               ; preds = %1
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = call i64 @read(i32 noundef %50, ptr noundef %16, i64 noundef 4)
  %52 = load i32, ptr %11, align 4, !tbaa !9
  %53 = call i64 @read(i32 noundef %52, ptr noundef %17, i64 noundef 4)
  %54 = load i32, ptr %11, align 4, !tbaa !9
  %55 = call i32 @close(i32 noundef %54)
  store i64 0, ptr %7, align 8, !tbaa !11
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %56

56:                                               ; preds = %96, %49
  %57 = load i32, ptr %6, align 4, !tbaa !9
  %58 = load i32, ptr %17, align 4, !tbaa !9
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %60, label %99

60:                                               ; preds = %56
  %61 = load ptr, ptr %15, align 8, !tbaa !5
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds i8, ptr %61, i64 %63
  %65 = load i32, ptr %6, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  %67 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %64, ptr noundef @.str.45, i32 noundef %66) #6
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = call i32 (ptr, i32, ...) @open(ptr noundef %68, i32 noundef 0)
  store i32 %69, ptr %11, align 4, !tbaa !9
  %70 = load i32, ptr %11, align 4, !tbaa !9
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %76

72:                                               ; preds = %60
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = load ptr, ptr %15, align 8, !tbaa !5
  %75 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str.46, ptr noundef %74) #6
  call void @exit(i32 noundef 1) #8
  unreachable

76:                                               ; preds = %60
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = call i64 @read(i32 noundef %77, ptr noundef %5, i64 noundef 4)
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = call i64 @read(i32 noundef %79, ptr noundef %18, i64 noundef 8)
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = call i64 @read(i32 noundef %81, ptr noundef %18, i64 noundef 8)
  %83 = load i64, ptr %18, align 8, !tbaa !11
  %84 = load i64, ptr %7, align 8, !tbaa !11
  %85 = add nsw i64 %84, %83
  store i64 %85, ptr %7, align 8, !tbaa !11
  %86 = load i32, ptr %5, align 4, !tbaa !9
  %87 = load i32, ptr %16, align 4, !tbaa !9
  %88 = icmp ne i32 %86, %87
  br i1 %88, label %89, label %93

89:                                               ; preds = %76
  %90 = load ptr, ptr @stderr, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %90, ptr noundef @.str.47, ptr noundef %91) #6
  call void @exit(i32 noundef 1) #8
  unreachable

93:                                               ; preds = %76
  %94 = load i32, ptr %11, align 4, !tbaa !9
  %95 = call i32 @close(i32 noundef %94)
  br label %96

96:                                               ; preds = %93
  %97 = load i32, ptr %6, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !9
  br label %56, !llvm.loop !13

99:                                               ; preds = %56
  %100 = call ptr @Malloc(i64 noundef 64, ptr noundef @.str.48)
  store ptr %100, ptr %4, align 8, !tbaa !5
  %101 = load i64, ptr %7, align 8, !tbaa !11
  %102 = add nsw i64 %101, 1
  %103 = mul i64 %102, 8
  %104 = call ptr @Malloc(i64 noundef %103, ptr noundef @.str.49)
  store ptr %104, ptr %9, align 8, !tbaa !5
  %105 = load i32, ptr %6, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = mul i64 %106, 8
  %108 = call ptr @Malloc(i64 noundef %107, ptr noundef @.str.49)
  store ptr %108, ptr %8, align 8, !tbaa !5
  %109 = call ptr @Malloc(i64 noundef 4096, ptr noundef @.str.49)
  store ptr %109, ptr %10, align 8, !tbaa !5
  %110 = load ptr, ptr %4, align 8, !tbaa !5
  %111 = icmp eq ptr %110, null
  br i1 %111, label %121, label %112

112:                                              ; preds = %99
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  %114 = icmp eq ptr %113, null
  br i1 %114, label %121, label %115

115:                                              ; preds = %112
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = icmp eq ptr %116, null
  br i1 %117, label %121, label %118

118:                                              ; preds = %115
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = icmp eq ptr %119, null
  br i1 %120, label %121, label %122

121:                                              ; preds = %118, %115, %112, %99
  call void @exit(i32 noundef 1) #8
  unreachable

122:                                              ; preds = %118
  store i64 0, ptr %7, align 8, !tbaa !11
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds i64, ptr %123, i64 0
  store i64 0, ptr %124, align 8, !tbaa !11
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %181, %122
  %126 = load i32, ptr %6, align 4, !tbaa !9
  %127 = load i32, ptr %17, align 4, !tbaa !9
  %128 = icmp slt i32 %126, %127
  br i1 %128, label %129, label %184

129:                                              ; preds = %125
  %130 = load ptr, ptr %15, align 8, !tbaa !5
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %130, i64 %132
  %134 = load i32, ptr %6, align 4, !tbaa !9
  %135 = add nsw i32 %134, 1
  %136 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %133, ptr noundef @.str.45, i32 noundef %135) #6
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = call i32 (ptr, i32, ...) @open(ptr noundef %137, i32 noundef 0)
  store i32 %138, ptr %11, align 4, !tbaa !9
  %139 = load i32, ptr %11, align 4, !tbaa !9
  %140 = call i64 @read(i32 noundef %139, ptr noundef %5, i64 noundef 4)
  %141 = load i32, ptr %11, align 4, !tbaa !9
  %142 = call i64 @read(i32 noundef %141, ptr noundef %18, i64 noundef 8)
  %143 = load i32, ptr %11, align 4, !tbaa !9
  %144 = call i64 @read(i32 noundef %143, ptr noundef %18, i64 noundef 8)
  %145 = load i32, ptr %11, align 4, !tbaa !9
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = load i64, ptr %7, align 8, !tbaa !11
  %148 = add nsw i64 %147, 1
  %149 = getelementptr inbounds i64, ptr %146, i64 %148
  %150 = load i64, ptr %18, align 8, !tbaa !11
  %151 = mul i64 %150, 8
  %152 = call i64 @read(i32 noundef %145, ptr noundef %149, i64 noundef %151)
  %153 = load i64, ptr %18, align 8, !tbaa !11
  %154 = load i64, ptr %7, align 8, !tbaa !11
  %155 = add nsw i64 %154, %153
  store i64 %155, ptr %7, align 8, !tbaa !11
  %156 = load i64, ptr %7, align 8, !tbaa !11
  %157 = load ptr, ptr %8, align 8, !tbaa !5
  %158 = load i32, ptr %6, align 4, !tbaa !9
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds i64, ptr %157, i64 %159
  store i64 %156, ptr %160, align 8, !tbaa !11
  %161 = load i32, ptr %11, align 4, !tbaa !9
  %162 = call i32 @close(i32 noundef %161)
  %163 = load ptr, ptr %15, align 8, !tbaa !5
  %164 = load i32, ptr %12, align 4, !tbaa !9
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i8, ptr %163, i64 %165
  %167 = load i32, ptr %6, align 4, !tbaa !9
  %168 = add nsw i32 %167, 1
  %169 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %166, ptr noundef @.str.50, i32 noundef %168) #6
  %170 = load ptr, ptr %15, align 8, !tbaa !5
  %171 = call i32 (ptr, i32, ...) @open(ptr noundef %170, i32 noundef 0)
  store i32 %171, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = icmp slt i32 %172, 0
  br i1 %173, label %174, label %178

174:                                              ; preds = %129
  %175 = load ptr, ptr @stderr, align 8, !tbaa !5
  %176 = load ptr, ptr %15, align 8, !tbaa !5
  %177 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.46, ptr noundef %176) #6
  call void @exit(i32 noundef 1) #8
  unreachable

178:                                              ; preds = %129
  %179 = load i32, ptr %11, align 4, !tbaa !9
  %180 = call i32 @close(i32 noundef %179)
  br label %181

181:                                              ; preds = %178
  %182 = load i32, ptr %6, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %6, align 4, !tbaa !9
  br label %125, !llvm.loop !15

184:                                              ; preds = %125
  %185 = load i32, ptr %5, align 4, !tbaa !9
  %186 = load ptr, ptr %4, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct._Profile_Index, ptr %186, i32 0, i32 0
  store i32 %185, ptr %187, align 8, !tbaa !16
  %188 = load i32, ptr %6, align 4, !tbaa !9
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct._Profile_Index, ptr %189, i32 0, i32 1
  store i32 %188, ptr %190, align 4, !tbaa !18
  %191 = load i64, ptr %7, align 8, !tbaa !11
  %192 = trunc i64 %191 to i32
  %193 = load ptr, ptr %4, align 8, !tbaa !5
  %194 = getelementptr inbounds %struct._Profile_Index, ptr %193, i32 0, i32 2
  store i32 %192, ptr %194, align 8, !tbaa !19
  %195 = load ptr, ptr %9, align 8, !tbaa !5
  %196 = load ptr, ptr %4, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct._Profile_Index, ptr %196, i32 0, i32 4
  store ptr %195, ptr %197, align 8, !tbaa !20
  %198 = load ptr, ptr %8, align 8, !tbaa !5
  %199 = load ptr, ptr %4, align 8, !tbaa !5
  %200 = getelementptr inbounds %struct._Profile_Index, ptr %199, i32 0, i32 3
  store ptr %198, ptr %200, align 8, !tbaa !21
  %201 = load ptr, ptr %4, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct._Profile_Index, ptr %201, i32 0, i32 5
  store i32 0, ptr %202, align 8, !tbaa !22
  %203 = load ptr, ptr %15, align 8, !tbaa !5
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct._Profile_Index, ptr %204, i32 0, i32 9
  store ptr %203, ptr %205, align 8, !tbaa !23
  %206 = load i32, ptr %12, align 4, !tbaa !9
  %207 = load ptr, ptr %4, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct._Profile_Index, ptr %207, i32 0, i32 8
  store i32 %206, ptr %208, align 4, !tbaa !24
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct._Profile_Index, ptr %209, i32 0, i32 7
  store i32 -1, ptr %210, align 8, !tbaa !25
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct._Profile_Index, ptr %211, i32 0, i32 6
  store i32 -1, ptr %212, align 4, !tbaa !26
  %213 = load ptr, ptr %10, align 8, !tbaa !5
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct._Profile_Index, ptr %214, i32 0, i32 10
  store ptr %213, ptr %215, align 8, !tbaa !27
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %216, ptr %2, align 8
  store i32 1, ptr %19, align 4
  br label %217

217:                                              ; preds = %184, %48
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  %218 = load ptr, ptr %2, align 8
  ret ptr %218
}

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 = { 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 = { 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 = { noreturn 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 = { "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) }
attributes #8 = { noreturn nounwind }

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

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


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.41 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.44 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.47 = external hidden unnamed_addr constant [60 x i8], align 1
@.str.48 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.49 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [8 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local ptr @Malloc(i64 noundef, 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: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; 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
declare dso_local ptr @PathTo(ptr noundef) local_unnamed_addr #0

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @exit(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: nofree
declare noundef i64 @read(i32 noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #6

declare i32 @close(i32 noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local ptr @Open_Profiles(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %6 = tail call ptr @PathTo(ptr noundef %0)
  %7 = tail call ptr @Root(ptr noundef %0, ptr noundef nonnull @.str.41)
  %8 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %6) #9
  %9 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %7) #9
  %10 = add i64 %8, 20
  %11 = add i64 %10, %9
  %12 = tail call ptr @Malloc(i64 noundef %11, ptr noundef nonnull @.str.42)
  %13 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.43, ptr noundef %6, ptr noundef %7) #8
  %14 = tail call i32 (ptr, i32, ...) @open(ptr noundef %12, i32 noundef 0) #8
  %15 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %12, ptr noundef nonnull dereferenceable(1) @.str.44, ptr noundef %6, ptr noundef %7) #8
  %16 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %12) #9
  %17 = trunc i64 %16 to i32
  tail call void @free(ptr noundef %7) #8
  tail call void @free(ptr noundef %6) #8
  %18 = icmp slt i32 %14, 0
  br i1 %18, label %100, label %19

19:                                               ; preds = %1
  %20 = call i64 @read(i32 noundef %14, ptr noundef nonnull %3, i64 noundef 4) #8
  %21 = call i64 @read(i32 noundef %14, ptr noundef nonnull %4, i64 noundef 4) #8
  %22 = tail call i32 @close(i32 noundef %14) #8
  %23 = load i32, ptr %4, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %19
  %sext97 = shl i64 %16, 32
  %25 = ashr exact i64 %sext97, 32
  %26 = getelementptr inbounds i8, ptr %12, i64 %25
  %27 = load i32, ptr %3, align 4
  br label %28

28:                                               ; preds = %.lr.ph, %44
  %.087107 = phi i32 [ 0, %.lr.ph ], [ %29, %44 ]
  %.088106 = phi i64 [ 0, %.lr.ph ], [ %46, %44 ]
  %29 = add nuw nsw i32 %.087107, 1
  %30 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %26, ptr noundef nonnull dereferenceable(1) @.str.45, i32 noundef %29) #8
  %31 = tail call i32 (ptr, i32, ...) @open(ptr noundef %12, i32 noundef 0) #8
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %36

33:                                               ; preds = %28
  %34 = load ptr, ptr @stderr, align 8, !tbaa !9
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str.46, ptr noundef %12) #10
  tail call void @exit(i32 noundef 1) #11
  unreachable

36:                                               ; preds = %28
  %37 = call i64 @read(i32 noundef %31, ptr noundef nonnull %2, i64 noundef 4) #8
  %38 = call i64 @read(i32 noundef %31, ptr noundef nonnull %5, i64 noundef 8) #8
  %39 = call i64 @read(i32 noundef %31, ptr noundef nonnull %5, i64 noundef 8) #8
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %40, %27
  br i1 %.not, label %44, label %41

41:                                               ; preds = %36
  %42 = load ptr, ptr @stderr, align 8, !tbaa !9
  %43 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef nonnull @.str.47, ptr noundef %12) #10
  tail call void @exit(i32 noundef 1) #11
  unreachable

44:                                               ; preds = %36
  %45 = load i64, ptr %5, align 8, !tbaa !11
  %46 = add nsw i64 %45, %.088106
  %47 = tail call i32 @close(i32 noundef %31) #8
  %exitcond.not = icmp eq i32 %29, %23
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %28, !llvm.loop !13

._crit_edge.loopexit:                             ; preds = %44
  %48 = shl i64 %46, 3
  %49 = add i64 %48, 8
  %50 = zext nneg i32 %23 to i64
  %51 = shl nuw nsw i64 %50, 3
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %19
  %52 = phi i32 [ undef, %19 ], [ %27, %._crit_edge.loopexit ]
  %.088.lcssa = phi i64 [ 8, %19 ], [ %49, %._crit_edge.loopexit ]
  %.087.lcssa = phi i64 [ 0, %19 ], [ %51, %._crit_edge.loopexit ]
  %53 = tail call ptr @Malloc(i64 noundef 64, ptr noundef nonnull @.str.48)
  %54 = tail call ptr @Malloc(i64 noundef %.088.lcssa, ptr noundef nonnull @.str.49)
  %55 = tail call ptr @Malloc(i64 noundef %.087.lcssa, ptr noundef nonnull @.str.49)
  %56 = tail call ptr @Malloc(i64 noundef 4096, ptr noundef nonnull @.str.49)
  %57 = insertelement <4 x ptr> poison, ptr %53, i64 0
  %58 = insertelement <4 x ptr> %57, ptr %54, i64 1
  %59 = insertelement <4 x ptr> %58, ptr %55, i64 2
  %60 = insertelement <4 x ptr> %59, ptr %56, i64 3
  %.fr = freeze <4 x ptr> %60
  %61 = icmp eq <4 x ptr> %.fr, zeroinitializer
  %62 = bitcast <4 x i1> %61 to i4
  %.not127 = icmp eq i4 %62, 0
  br i1 %.not127, label %64, label %63

63:                                               ; preds = %._crit_edge
  tail call void @exit(i32 noundef 1) #11
  unreachable

64:                                               ; preds = %._crit_edge
  store i64 0, ptr %54, align 8, !tbaa !11
  %invariant.gep = getelementptr i8, ptr %54, i64 8
  br i1 %24, label %.lr.ph113, label %._crit_edge114

.lr.ph113:                                        ; preds = %64
  %sext = shl i64 %16, 32
  %65 = ashr exact i64 %sext, 32
  %66 = getelementptr inbounds i8, ptr %12, i64 %65
  %wide.trip.count = zext nneg i32 %23 to i64
  br label %67

67:                                               ; preds = %.lr.ph113, %86
  %indvars.iv = phi i64 [ 0, %.lr.ph113 ], [ %indvars.iv.next, %86 ]
  %.189110 = phi i64 [ 0, %.lr.ph113 ], [ %77, %86 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %68 = trunc nuw nsw i64 %indvars.iv.next to i32
  %69 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %66, ptr noundef nonnull dereferenceable(1) @.str.45, i32 noundef %68) #8
  %70 = tail call i32 (ptr, i32, ...) @open(ptr noundef %12, i32 noundef 0) #8
  %71 = call i64 @read(i32 noundef %70, ptr noundef nonnull %2, i64 noundef 4) #8
  %72 = call i64 @read(i32 noundef %70, ptr noundef nonnull %5, i64 noundef 8) #8
  %73 = call i64 @read(i32 noundef %70, ptr noundef nonnull %5, i64 noundef 8) #8
  %gep = getelementptr i64, ptr %invariant.gep, i64 %.189110
  %74 = load i64, ptr %5, align 8, !tbaa !11
  %75 = shl i64 %74, 3
  %76 = tail call i64 @read(i32 noundef %70, ptr noundef %gep, i64 noundef %75) #8
  %77 = add nsw i64 %74, %.189110
  %78 = getelementptr inbounds i64, ptr %55, i64 %indvars.iv
  store i64 %77, ptr %78, align 8, !tbaa !11
  %79 = tail call i32 @close(i32 noundef %70) #8
  %80 = tail call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %66, ptr noundef nonnull dereferenceable(1) @.str.50, i32 noundef %68) #8
  %81 = tail call i32 (ptr, i32, ...) @open(ptr noundef %12, i32 noundef 0) #8
  %82 = icmp slt i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %67
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef nonnull @.str.46, ptr noundef %12) #10
  tail call void @exit(i32 noundef 1) #11
  unreachable

86:                                               ; preds = %67
  %87 = tail call i32 @close(i32 noundef %81) #8
  %exitcond124.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond124.not, label %._crit_edge114.loopexit, label %67, !llvm.loop !15

._crit_edge114.loopexit:                          ; preds = %86
  %.pre = load i32, ptr %2, align 4, !tbaa !5
  %88 = trunc i64 %77 to i32
  br label %._crit_edge114

._crit_edge114:                                   ; preds = %._crit_edge114.loopexit, %64
  %89 = phi i32 [ %52, %64 ], [ %.pre, %._crit_edge114.loopexit ]
  %.189.lcssa = phi i32 [ 0, %64 ], [ %88, %._crit_edge114.loopexit ]
  %.1.lcssa = phi i32 [ 0, %64 ], [ %23, %._crit_edge114.loopexit ]
  store i32 %89, ptr %53, align 8, !tbaa !16
  %90 = getelementptr inbounds i8, ptr %53, i64 4
  store i32 %.1.lcssa, ptr %90, align 4, !tbaa !18
  %91 = getelementptr inbounds i8, ptr %53, i64 8
  store i32 %.189.lcssa, ptr %91, align 8, !tbaa !19
  %92 = getelementptr inbounds i8, ptr %53, i64 24
  store ptr %54, ptr %92, align 8, !tbaa !20
  %93 = getelementptr inbounds i8, ptr %53, i64 16
  store ptr %55, ptr %93, align 8, !tbaa !21
  %94 = getelementptr inbounds i8, ptr %53, i64 32
  store i32 0, ptr %94, align 8, !tbaa !22
  %95 = getelementptr inbounds i8, ptr %53, i64 48
  store ptr %12, ptr %95, align 8, !tbaa !23
  %96 = getelementptr inbounds i8, ptr %53, i64 44
  store i32 %17, ptr %96, align 4, !tbaa !24
  %97 = getelementptr inbounds i8, ptr %53, i64 40
  store i32 -1, ptr %97, align 8, !tbaa !25
  %98 = getelementptr inbounds i8, ptr %53, i64 36
  store i32 -1, ptr %98, align 4, !tbaa !26
  %99 = getelementptr inbounds i8, ptr %53, i64 56
  store ptr %56, ptr %99, align 8, !tbaa !27
  br label %100

100:                                              ; preds = %1, %._crit_edge114
  %.0 = phi ptr [ %53, %._crit_edge114 ], [ null, %1 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  ret ptr %.0
}

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 = { 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 nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn 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 = { "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 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { cold nounwind }
attributes #11 = { noreturn nounwind }

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

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


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