; LLVM IR from Xingyu-Lin/softgym :: PyFlex/core/pfm.ll (Z7PfmLoadPKcR8PfmImage)

; 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.(anonymous namespace)::FilePointer" = type { ptr }
%struct.PfmImage = type { i32, i32, i32, float, ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z7PfmLoadPKcR8PfmImage(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i1, align 1
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"struct.(anonymous namespace)::FilePointer", align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [1024 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #9
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = call noalias ptr @fopen(ptr noundef %15, ptr noundef @.str)
  call void @_ZN12_GLOBAL__N_111FilePointerC2EP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %16)
  %17 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %18 unwind label %21

18:                                               ; preds = %2
  %19 = icmp ne ptr %17, null
  br i1 %19, label %25, label %20

20:                                               ; preds = %18
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %157

21:                                               ; preds = %2
  %22 = landingpad { ptr, i32 }
          cleanup
  %23 = extractvalue { ptr, i32 } %22, 0
  store ptr %23, ptr %7, align 8
  %24 = extractvalue { ptr, i32 } %22, 1
  store i32 %24, ptr %8, align 4
  br label %159

25:                                               ; preds = %18
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %26, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 1024, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1024, ptr %11) #9
  %27 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %28 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %29 unwind label %34

29:                                               ; preds = %25
  %30 = invoke ptr @fgets(ptr noundef %27, i32 noundef 1024, ptr noundef %28)
          to label %31 unwind label %34

31:                                               ; preds = %29
  %32 = icmp ne ptr %30, null
  br i1 %32, label %38, label %33

33:                                               ; preds = %31
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %155

34:                                               ; preds = %64, %51, %46, %43, %29, %25
  %35 = landingpad { ptr, i32 }
          cleanup
  %36 = extractvalue { ptr, i32 } %35, 0
  store ptr %36, ptr %7, align 8
  %37 = extractvalue { ptr, i32 } %35, 1
  store i32 %37, ptr %8, align 4
  br label %156

38:                                               ; preds = %31
  %39 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %40 = call i32 @strcmp(ptr noundef %39, ptr noundef @.str.1) #10
  %41 = icmp ne i32 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %155

43:                                               ; preds = %38
  %44 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %45 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %46 unwind label %34

46:                                               ; preds = %43
  %47 = invoke ptr @fgets(ptr noundef %44, i32 noundef 1024, ptr noundef %45)
          to label %48 unwind label %34

48:                                               ; preds = %46
  %49 = icmp ne ptr %47, null
  br i1 %49, label %51, label %50

50:                                               ; preds = %48
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %155

51:                                               ; preds = %48
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.PfmImage, ptr %52, i32 0, i32 2
  store i32 1, ptr %53, align 8, !tbaa !11
  %54 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.PfmImage, ptr %55, i32 0, i32 0
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.PfmImage, ptr %57, i32 0, i32 1
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.PfmImage, ptr %59, i32 0, i32 2
  %61 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %54, ptr noundef @.str.2, ptr noundef %56, ptr noundef %58, ptr noundef %60) #9
  %62 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %63 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %64 unwind label %34

64:                                               ; preds = %51
  %65 = invoke ptr @fgets(ptr noundef %62, i32 noundef 1024, ptr noundef %63)
          to label %66 unwind label %34

66:                                               ; preds = %64
  %67 = icmp ne ptr %65, null
  br i1 %67, label %69, label %68

68:                                               ; preds = %66
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %155

69:                                               ; preds = %66
  %70 = getelementptr inbounds [1024 x i8], ptr %11, i64 0, i64 0
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.PfmImage, ptr %71, i32 0, i32 3
  %73 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %70, ptr noundef @.str.3, ptr noundef %72) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #9
  %74 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %75 unwind label %116

75:                                               ; preds = %69
  %76 = invoke i64 @ftell(ptr noundef %74)
          to label %77 unwind label %116

77:                                               ; preds = %75
  %78 = trunc i64 %76 to i32
  store i32 %78, ptr %12, align 4, !tbaa !9
  %79 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %80 unwind label %116

80:                                               ; preds = %77
  %81 = invoke i32 @fseek(ptr noundef %79, i64 noundef 0, i32 noundef 2)
          to label %82 unwind label %116

82:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  %83 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %84 unwind label %120

84:                                               ; preds = %82
  %85 = invoke i64 @ftell(ptr noundef %83)
          to label %86 unwind label %120

86:                                               ; preds = %84
  %87 = trunc i64 %85 to i32
  store i32 %87, ptr %13, align 4, !tbaa !9
  %88 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %89 unwind label %120

89:                                               ; preds = %86
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = invoke i32 @fseek(ptr noundef %88, i64 noundef %91, i32 noundef 0)
          to label %93 unwind label %120

93:                                               ; preds = %89
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #9
  %94 = load i32, ptr %13, align 4, !tbaa !9
  %95 = load i32, ptr %12, align 4, !tbaa !9
  %96 = sub i32 %94, %95
  store i32 %96, ptr %14, align 4, !tbaa !9
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = zext i32 %97 to i64
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.PfmImage, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !14
  %102 = zext i32 %101 to i64
  %103 = mul i64 4, %102
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.PfmImage, ptr %104, i32 0, i32 1
  %106 = load i32, ptr %105, align 4, !tbaa !15
  %107 = zext i32 %106 to i64
  %108 = mul i64 %103, %107
  %109 = load ptr, ptr %5, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.PfmImage, ptr %109, i32 0, i32 2
  %111 = load i32, ptr %110, align 8, !tbaa !11
  %112 = zext i32 %111 to i64
  %113 = mul i64 %108, %112
  %114 = icmp ne i64 %98, %113
  br i1 %114, label %115, label %124

115:                                              ; preds = %93
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %152

116:                                              ; preds = %80, %77, %75, %69
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %7, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %8, align 4
  br label %154

120:                                              ; preds = %89, %86, %84, %82
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %7, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %8, align 4
  br label %153

124:                                              ; preds = %93
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = udiv i32 %125, 4
  %127 = zext i32 %126 to i64
  %128 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %127, i64 4)
  %129 = extractvalue { i64, i1 } %128, 1
  %130 = extractvalue { i64, i1 } %128, 0
  %131 = select i1 %129, i64 -1, i64 %130
  %132 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %131) #11
          to label %133 unwind label %147

133:                                              ; preds = %124
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.PfmImage, ptr %134, i32 0, i32 4
  store ptr %132, ptr %135, align 8, !tbaa !16
  %136 = load ptr, ptr %5, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.PfmImage, ptr %136, i32 0, i32 4
  %138 = load ptr, ptr %137, align 8, !tbaa !16
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = zext i32 %139 to i64
  %141 = invoke noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %142 unwind label %147

142:                                              ; preds = %133
  %143 = invoke i64 @fread(ptr noundef %138, i64 noundef %140, i64 noundef 1, ptr noundef %141)
          to label %144 unwind label %147

144:                                              ; preds = %142
  %145 = icmp ne i64 %143, 1
  br i1 %145, label %146, label %151

146:                                              ; preds = %144
  store i1 false, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %152

147:                                              ; preds = %142, %133, %124
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %7, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  br label %153

151:                                              ; preds = %144
  store i1 true, ptr %3, align 1
  store i32 1, ptr %9, align 4
  br label %152

152:                                              ; preds = %151, %146, %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %155

153:                                              ; preds = %147, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %154

154:                                              ; preds = %153, %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #9
  br label %156

155:                                              ; preds = %152, %68, %50, %42, %33
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %157

156:                                              ; preds = %154, %34
  call void @llvm.lifetime.end.p0(i64 1024, ptr %11) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %159

157:                                              ; preds = %155, %20
  call void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  %158 = load i1, ptr %3, align 1
  ret i1 %158

159:                                              ; preds = %156, %21
  call void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #9
  br label %160

160:                                              ; preds = %159
  %161 = load ptr, ptr %7, align 8
  %162 = load i32, ptr %8, align 4
  %163 = insertvalue { ptr, i32 } poison, ptr %161, 0
  %164 = insertvalue { ptr, i32 } %163, i32 %162, 1
  resume { ptr, i32 } %164
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_111FilePointerC2EP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

declare i64 @ftell(ptr noundef) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #7

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #8

declare i64 @fread(ptr noundef, i64 noundef, i64 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: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 = { mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind willreturn memory(read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nobuiltin 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 #9 = { nounwind }
attributes #10 = { nounwind willreturn memory(read) }
attributes #11 = { builtin allocsize(0) }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 8}
!12 = !{!"_ZTS8PfmImage", !10, i64 0, !10, i64 4, !10, i64 8, !13, i64 12, !6, i64 16}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !10, i64 0}
!15 = !{!12, !10, i64 4}
!16 = !{!12, !6, i64 16}


; 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.(anonymous namespace)::FilePointer" = type { ptr }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z7PfmLoadPKcR8PfmImage(ptr nocapture noundef readonly %0, ptr noundef nonnull align 8 dereferenceable(24) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"struct.(anonymous namespace)::FilePointer", align 8
  %4 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %5 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  call void @_ZN12_GLOBAL__N_111FilePointerC2EP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef %5)
  %6 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %57, label %7

7:                                                ; preds = %2
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %1, i8 0, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %4) #7
  %8 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %9 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 1024, ptr noundef %8)
  %.not21 = icmp eq ptr %9, null
  br i1 %.not21, label %56, label %10

10:                                               ; preds = %7
  %11 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.1) #8
  %.not22 = icmp eq i32 %11, 0
  br i1 %.not22, label %12, label %56

12:                                               ; preds = %10
  %13 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %14 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 1024, ptr noundef %13)
  %.not23 = icmp eq ptr %14, null
  br i1 %.not23, label %56, label %15

15:                                               ; preds = %12
  %16 = getelementptr inbounds i8, ptr %1, i64 8
  store i32 1, ptr %16, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %1, i64 4
  %18 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %4, ptr noundef nonnull @.str.2, ptr noundef nonnull %1, ptr noundef nonnull %17, ptr noundef nonnull %16) #7
  %19 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %20 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 1024, ptr noundef %19)
  %.not24 = icmp eq ptr %20, null
  br i1 %.not24, label %56, label %21

21:                                               ; preds = %15
  %22 = getelementptr inbounds i8, ptr %1, i64 12
  %23 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, ptr noundef nonnull %22) #7
  %24 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = call i64 @ftell(ptr noundef %24)
  %26 = trunc i64 %25 to i32
  %27 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = call i32 @fseek(ptr noundef %27, i64 noundef 0, i32 noundef 2)
  %29 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %30 = call i64 @ftell(ptr noundef %29)
  %31 = trunc i64 %30 to i32
  %32 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %33 = and i64 %25, 4294967295
  %34 = call i32 @fseek(ptr noundef %32, i64 noundef %33, i32 noundef 0)
  %35 = sub i32 %31, %26
  %36 = zext i32 %35 to i64
  %37 = load i32, ptr %1, align 8, !tbaa !12
  %38 = zext i32 %37 to i64
  %39 = shl nuw nsw i64 %38, 2
  %40 = load i32, ptr %17, align 4, !tbaa !13
  %41 = zext i32 %40 to i64
  %42 = mul i64 %39, %41
  %43 = load i32, ptr %16, align 8, !tbaa !5
  %44 = zext i32 %43 to i64
  %45 = mul i64 %42, %44
  %.not25 = icmp eq i64 %45, %36
  br i1 %.not25, label %46, label %56

46:                                               ; preds = %21
  %47 = and i32 %35, -4
  %48 = zext i32 %47 to i64
  %49 = invoke noalias noundef nonnull ptr @_Znam(i64 noundef %48) #9
          to label %50 unwind label %54

50:                                               ; preds = %46
  %51 = getelementptr inbounds i8, ptr %1, i64 16
  store ptr %49, ptr %51, align 8, !tbaa !14
  %52 = call noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %53 = call i64 @fread(ptr noundef nonnull %49, i64 noundef %36, i64 noundef 1, ptr noundef %52)
  %.not26 = icmp eq i64 %53, 1
  br label %56

54:                                               ; preds = %46
  %55 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #7
  call void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  resume { ptr, i32 } %55

56:                                               ; preds = %21, %50, %15, %12, %10, %7
  %.1 = phi i1 [ false, %7 ], [ false, %10 ], [ false, %12 ], [ false, %15 ], [ false, %21 ], [ %.not26, %50 ]
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %4) #7
  br label %57

57:                                               ; preds = %2, %56
  %.2 = phi i1 [ %.1, %56 ], [ false, %2 ]
  call void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  ret i1 %.2
}

; 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 noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_111FilePointerC2EP8_IO_FILE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN12_GLOBAL__N_111FilePointercvP8_IO_FILEEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

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

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

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #6

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) 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: mustprogress nounwind uwtable
declare hidden void @_ZN12_GLOBAL__N_111FilePointerD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

attributes #0 = { mustprogress 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 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nobuiltin 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { builtin allocsize(0) }

!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 8}
!6 = !{!"_ZTS8PfmImage", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!6, !11, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass