; LLVM IR from Syrocco/Graphical-EDMD :: parser (init_rdump)

; 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.Dump = type { ptr, ptr, i8, i32, ptr, i32, i32, i64, ptr, i32, [10 x [256 x i8]], [11 x ptr] }

@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @init_rdump(ptr noundef %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.Dump, ptr %9, i32 0, i32 0
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = call noalias ptr @fopen(ptr noundef %11, ptr noundef @.str.2)
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Dump, ptr %13, i32 0, i32 1
  store ptr %12, ptr %14, align 8, !tbaa !13
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Dump, ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !13
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %24

19:                                               ; preds = %1
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Dump, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %22)
  call void @exit(i32 noundef 1) #8
  unreachable

24:                                               ; preds = %1
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Dump, ptr %25, i32 0, i32 3
  store i32 0, ptr %26, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 1000, ptr %3, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 2, ptr %4, align 4, !tbaa !15
  %27 = load i32, ptr %3, align 4, !tbaa !15
  %28 = sext i32 %27 to i64
  %29 = mul i64 %28, 8
  %30 = call noalias ptr @malloc(i64 noundef %29) #10
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Dump, ptr %31, i32 0, i32 4
  store ptr %30, ptr %32, align 8, !tbaa !16
  %33 = load ptr, ptr %2, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.Dump, ptr %33, i32 0, i32 4
  %35 = load ptr, ptr %34, align 8, !tbaa !16
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %42

37:                                               ; preds = %24
  %38 = load i32, ptr %3, align 4, !tbaa !15
  %39 = sext i32 %38 to i64
  %40 = mul i64 %39, 8
  %41 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %40)
  call void @exit(i32 noundef 1) #8
  unreachable

42:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #9
  %43 = call noalias ptr @malloc(i64 noundef 1048576) #10
  store ptr %43, ptr %5, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = icmp eq ptr %44, null
  br i1 %45, label %46, label %48

46:                                               ; preds = %42
  %47 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef 1048576)
  call void @exit(i32 noundef 1) #8
  unreachable

48:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  store i32 0, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 13, ptr %7, align 4, !tbaa !15
  br label %49

49:                                               ; preds = %137, %48
  %50 = load ptr, ptr %2, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.Dump, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = call i32 @feof(ptr noundef %52) #9
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %140

55:                                               ; preds = %49
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.Dump, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !13
  %61 = call i64 @fread(ptr noundef %57, i64 noundef 1, i64 noundef 1048575, ptr noundef %60)
  %62 = getelementptr inbounds i8, ptr %56, i64 %61
  store i8 0, ptr %62, align 1, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #9
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %63, ptr %8, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %97, %55
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = call ptr @strstr(ptr noundef %65, ptr noundef @.str.6) #11
  store ptr %66, ptr %8, align 8, !tbaa !5
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %123

68:                                               ; preds = %64
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Dump, ptr %69, i32 0, i32 3
  %71 = load i32, ptr %70, align 4, !tbaa !14
  %72 = load i32, ptr %3, align 4, !tbaa !15
  %73 = icmp eq i32 %71, %72
  br i1 %73, label %74, label %97

74:                                               ; preds = %68
  %75 = load i32, ptr %4, align 4, !tbaa !15
  %76 = load i32, ptr %3, align 4, !tbaa !15
  %77 = mul nsw i32 %76, %75
  store i32 %77, ptr %3, align 4, !tbaa !15
  %78 = load ptr, ptr %2, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Dump, ptr %78, i32 0, i32 4
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = load i32, ptr %3, align 4, !tbaa !15
  %82 = sext i32 %81 to i64
  %83 = mul i64 %82, 8
  %84 = call ptr @realloc(ptr noundef %80, i64 noundef %83) #12
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.Dump, ptr %85, i32 0, i32 4
  store ptr %84, ptr %86, align 8, !tbaa !16
  %87 = load ptr, ptr %2, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Dump, ptr %87, i32 0, i32 4
  %89 = load ptr, ptr %88, align 8, !tbaa !16
  %90 = icmp eq ptr %89, null
  br i1 %90, label %91, label %96

91:                                               ; preds = %74
  %92 = load i32, ptr %3, align 4, !tbaa !15
  %93 = sext i32 %92 to i64
  %94 = mul i64 %93, 8
  %95 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %94)
  call void @exit(i32 noundef 1) #8
  unreachable

96:                                               ; preds = %74
  br label %97

97:                                               ; preds = %96, %68
  %98 = load i32, ptr %6, align 4, !tbaa !15
  %99 = load i32, ptr %7, align 4, !tbaa !15
  %100 = sub nsw i32 1048575, %99
  %101 = mul nsw i32 %98, %100
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = sext i32 %101 to i64
  %104 = getelementptr inbounds i8, ptr %102, i64 %103
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = ptrtoint ptr %104 to i64
  %107 = ptrtoint ptr %105 to i64
  %108 = sub i64 %106, %107
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.Dump, ptr %109, i32 0, i32 4
  %111 = load ptr, ptr %110, align 8, !tbaa !16
  %112 = load ptr, ptr %2, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.Dump, ptr %112, i32 0, i32 3
  %114 = load i32, ptr %113, align 4, !tbaa !14
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i64, ptr %111, i64 %115
  store i64 %108, ptr %116, align 8, !tbaa !18
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.Dump, ptr %117, i32 0, i32 3
  %119 = load i32, ptr %118, align 4, !tbaa !14
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %118, align 4, !tbaa !14
  %121 = load ptr, ptr %8, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i32 1
  store ptr %122, ptr %8, align 8, !tbaa !5
  br label %64, !llvm.loop !19

123:                                              ; preds = %64
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Dump, ptr %124, i32 0, i32 1
  %126 = load ptr, ptr %125, align 8, !tbaa !13
  %127 = call i32 @feof(ptr noundef %126) #9
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %129, label %137

129:                                              ; preds = %123
  %130 = load ptr, ptr %2, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.Dump, ptr %130, i32 0, i32 1
  %132 = load ptr, ptr %131, align 8, !tbaa !13
  %133 = load i32, ptr %7, align 4, !tbaa !15
  %134 = sub nsw i32 0, %133
  %135 = sext i32 %134 to i64
  %136 = call i32 @fseek(ptr noundef %132, i64 noundef %135, i32 noundef 1)
  br label %137

137:                                              ; preds = %129, %123
  %138 = load i32, ptr %6, align 4, !tbaa !15
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %6, align 4, !tbaa !15
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #9
  br label %49, !llvm.loop !21

140:                                              ; preds = %49
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  call void @free(ptr noundef %141) #9
  %142 = load ptr, ptr %2, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.Dump, ptr %142, i32 0, i32 4
  %144 = load ptr, ptr %143, align 8, !tbaa !16
  %145 = load ptr, ptr %2, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.Dump, ptr %145, i32 0, i32 3
  %147 = load i32, ptr %146, align 4, !tbaa !14
  %148 = add nsw i32 %147, 1
  %149 = sext i32 %148 to i64
  %150 = mul i64 %149, 8
  %151 = call ptr @realloc(ptr noundef %144, i64 noundef %150) #12
  %152 = load ptr, ptr %2, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.Dump, ptr %152, i32 0, i32 4
  store ptr %151, ptr %153, align 8, !tbaa !16
  %154 = load ptr, ptr %2, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.Dump, ptr %154, i32 0, i32 4
  %156 = load ptr, ptr %155, align 8, !tbaa !16
  %157 = icmp eq ptr %156, null
  br i1 %157, label %158, label %163

158:                                              ; preds = %140
  %159 = load i32, ptr %3, align 4, !tbaa !15
  %160 = sext i32 %159 to i64
  %161 = mul i64 %160, 8
  %162 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i64 noundef %161)
  call void @exit(i32 noundef 1) #8
  unreachable

163:                                              ; preds = %140
  %164 = load ptr, ptr %2, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.Dump, ptr %164, i32 0, i32 1
  %166 = load ptr, ptr %165, align 8, !tbaa !13
  %167 = call i64 @ftell(ptr noundef %166)
  %168 = load ptr, ptr %2, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.Dump, ptr %168, i32 0, i32 4
  %170 = load ptr, ptr %169, align 8, !tbaa !16
  %171 = load ptr, ptr %2, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.Dump, ptr %171, i32 0, i32 3
  %173 = load i32, ptr %172, align 4, !tbaa !14
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds i64, ptr %170, i64 %174
  store i64 %167, ptr %175, align 8, !tbaa !18
  %176 = load ptr, ptr %2, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.Dump, ptr %176, i32 0, i32 1
  %178 = load ptr, ptr %177, align 8, !tbaa !13
  call void @rewind(ptr noundef %178)
  %179 = load ptr, ptr %2, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.Dump, ptr %179, i32 0, i32 6
  store i32 0, ptr %180, align 4, !tbaa !22
  %181 = load ptr, ptr %2, align 8, !tbaa !5
  %182 = getelementptr inbounds %struct.Dump, ptr %181, i32 0, i32 7
  store i64 0, ptr %182, align 8, !tbaa !23
  %183 = load ptr, ptr %2, align 8, !tbaa !5
  %184 = getelementptr inbounds %struct.Dump, ptr %183, i32 0, i32 8
  store ptr null, ptr %184, align 8, !tbaa !24
  %185 = load ptr, ptr %2, align 8, !tbaa !5
  call void @jump_to_frame(i32 noundef 0, ptr noundef %185)
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  ret void
}

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

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

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #5

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #6

; Function Attrs: nounwind allocsize(1)
declare ptr @realloc(ptr noundef, i64 noundef) #7

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

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

declare i64 @ftell(ptr noundef) #2

declare void @rewind(ptr noundef) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(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 #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 = { 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 #4 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 #7 = { nounwind allocsize(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 #8 = { noreturn nounwind }
attributes #9 = { nounwind }
attributes #10 = { nounwind allocsize(0) }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(1) }

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

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


; 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.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @init_rdump(ptr noundef %0) local_unnamed_addr #3 {
  %2 = load ptr, ptr %0, align 8, !tbaa !5
  %3 = tail call noalias ptr @fopen(ptr noundef %2, ptr noundef nonnull @.str.2)
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %3, ptr %4, align 8, !tbaa !12
  %5 = icmp eq ptr %3, null
  br i1 %5, label %6, label %9

6:                                                ; preds = %1
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef %7)
  tail call void @exit(i32 noundef 1) #8
  unreachable

9:                                                ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 0, ptr %10, align 4, !tbaa !13
  %11 = tail call noalias dereferenceable_or_null(8000) ptr @malloc(i64 noundef 8000) #9
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store ptr %11, ptr %12, align 8, !tbaa !14
  %13 = icmp eq ptr %11, null
  br i1 %13, label %14, label %16

14:                                               ; preds = %9
  %15 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef 8000)
  tail call void @exit(i32 noundef 1) #8
  unreachable

16:                                               ; preds = %9
  %17 = tail call noalias dereferenceable_or_null(1048576) ptr @malloc(i64 noundef 1048576) #9
  %18 = icmp eq ptr %17, null
  br i1 %18, label %22, label %.preheader

.preheader:                                       ; preds = %16
  %19 = tail call i32 @feof(ptr noundef nonnull %3) #10
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %.lr.ph60, label %._crit_edge61

.lr.ph60:                                         ; preds = %.preheader
  %21 = ptrtoint ptr %17 to i64
  br label %24

22:                                               ; preds = %16
  %23 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef 1048576)
  tail call void @exit(i32 noundef 1) #8
  unreachable

24:                                               ; preds = %.lr.ph60, %58
  %indvars.iv = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next, %58 ]
  %.05059 = phi i32 [ 1000, %.lr.ph60 ], [ %.1.lcssa, %58 ]
  %25 = load ptr, ptr %4, align 8, !tbaa !12
  %26 = tail call i64 @fread(ptr noundef nonnull %17, i64 noundef 1, i64 noundef 1048575, ptr noundef %25)
  %27 = getelementptr inbounds i8, ptr %17, i64 %26
  store i8 0, ptr %27, align 1, !tbaa !15
  %28 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %17, ptr noundef nonnull dereferenceable(1) @.str.6) #11
  %.not56 = icmp eq ptr %28, null
  br i1 %.not56, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %29 = mul nuw nsw i64 %indvars.iv, 1048562
  %.pre = load i32, ptr %10, align 4, !tbaa !13
  %.pre64.pre = load ptr, ptr %12, align 8, !tbaa !14
  br label %30

30:                                               ; preds = %.lr.ph, %42
  %.pre64 = phi ptr [ %.pre64.pre, %.lr.ph ], [ %.pre6467, %42 ]
  %31 = phi i32 [ %.pre, %.lr.ph ], [ %49, %42 ]
  %32 = phi ptr [ %28, %.lr.ph ], [ %51, %42 ]
  %.157 = phi i32 [ %.05059, %.lr.ph ], [ %.2, %42 ]
  %33 = icmp eq i32 %31, %.157
  br i1 %33, label %34, label %42

34:                                               ; preds = %30
  %35 = shl nsw i32 %31, 1
  %36 = sext i32 %35 to i64
  %37 = shl nsw i64 %36, 3
  %38 = tail call ptr @realloc(ptr noundef %.pre64, i64 noundef %37) #12
  store ptr %38, ptr %12, align 8, !tbaa !14
  %39 = icmp eq ptr %38, null
  br i1 %39, label %40, label %._crit_edge65

._crit_edge65:                                    ; preds = %34
  %.pre66 = load i32, ptr %10, align 4, !tbaa !13
  br label %42

40:                                               ; preds = %34
  %41 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %37)
  tail call void @exit(i32 noundef 1) #8
  unreachable

42:                                               ; preds = %._crit_edge65, %30
  %.pre6467 = phi ptr [ %38, %._crit_edge65 ], [ %.pre64, %30 ]
  %43 = phi i32 [ %.pre66, %._crit_edge65 ], [ %31, %30 ]
  %.2 = phi i32 [ %35, %._crit_edge65 ], [ %.157, %30 ]
  %44 = getelementptr inbounds i8, ptr %32, i64 %29
  %45 = ptrtoint ptr %44 to i64
  %46 = sub i64 %45, %21
  %47 = sext i32 %43 to i64
  %48 = getelementptr inbounds i64, ptr %.pre6467, i64 %47
  store i64 %46, ptr %48, align 8, !tbaa !16
  %49 = add nsw i32 %43, 1
  store i32 %49, ptr %10, align 4, !tbaa !13
  %50 = getelementptr inbounds i8, ptr %32, i64 1
  %51 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %50, ptr noundef nonnull dereferenceable(1) @.str.6) #11
  %.not = icmp eq ptr %51, null
  br i1 %.not, label %._crit_edge, label %30, !llvm.loop !17

._crit_edge:                                      ; preds = %42, %24
  %.1.lcssa = phi i32 [ %.05059, %24 ], [ %.2, %42 ]
  %52 = load ptr, ptr %4, align 8, !tbaa !12
  %53 = tail call i32 @feof(ptr noundef %52) #10
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %58

55:                                               ; preds = %._crit_edge
  %56 = load ptr, ptr %4, align 8, !tbaa !12
  %57 = tail call i32 @fseek(ptr noundef %56, i64 noundef -13, i32 noundef 1)
  br label %58

58:                                               ; preds = %55, %._crit_edge
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %59 = load ptr, ptr %4, align 8, !tbaa !12
  %60 = tail call i32 @feof(ptr noundef %59) #10
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %24, label %._crit_edge61.loopexit, !llvm.loop !19

._crit_edge61.loopexit:                           ; preds = %58
  %62 = sext i32 %.1.lcssa to i64
  %63 = shl nsw i64 %62, 3
  br label %._crit_edge61

._crit_edge61:                                    ; preds = %._crit_edge61.loopexit, %.preheader
  %.050.lcssa = phi i64 [ 8000, %.preheader ], [ %63, %._crit_edge61.loopexit ]
  tail call void @free(ptr noundef %17) #10
  %64 = load ptr, ptr %12, align 8, !tbaa !14
  %65 = load i32, ptr %10, align 4, !tbaa !13
  %66 = add nsw i32 %65, 1
  %67 = sext i32 %66 to i64
  %68 = shl nsw i64 %67, 3
  %69 = tail call ptr @realloc(ptr noundef %64, i64 noundef %68) #12
  store ptr %69, ptr %12, align 8, !tbaa !14
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %73

71:                                               ; preds = %._crit_edge61
  %72 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i64 noundef %.050.lcssa)
  tail call void @exit(i32 noundef 1) #8
  unreachable

73:                                               ; preds = %._crit_edge61
  %74 = load ptr, ptr %4, align 8, !tbaa !12
  %75 = tail call i64 @ftell(ptr noundef %74)
  %76 = load ptr, ptr %12, align 8, !tbaa !14
  %77 = load i32, ptr %10, align 4, !tbaa !13
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i64, ptr %76, i64 %78
  store i64 %75, ptr %79, align 8, !tbaa !16
  %80 = load ptr, ptr %4, align 8, !tbaa !12
  tail call void @rewind(ptr noundef %80)
  %81 = getelementptr inbounds i8, ptr %0, i64 36
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %81, i8 0, i64 20, i1 false)
  tail call void @jump_to_frame(i32 noundef 0, ptr noundef nonnull %0)
  ret void
}

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

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias noundef ptr @realloc(ptr allocptr nocapture noundef, i64 noundef) local_unnamed_addr #5

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

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

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

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

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

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

attributes #0 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(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 #1 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 nounwind willreturn allockind("realloc") allocsize(1) memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { nounwind allocsize(1) }

!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, !7, i64 0}
!6 = !{!"Dump", !7, i64 0, !7, i64 8, !8, i64 16, !10, i64 20, !7, i64 24, !10, i64 32, !10, i64 36, !11, i64 40, !7, i64 48, !10, i64 56, !8, i64 60, !8, i64 2624}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!6, !7, i64 8}
!13 = !{!6, !10, i64 20}
!14 = !{!6, !7, i64 24}
!15 = !{!8, !8, i64 0}
!16 = !{!11, !11, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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