; LLVM IR from fetlang/fetlang :: src/thirdparty (whereami)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 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
declare ptr @realpath(ptr noundef, ptr noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

23:                                               ; preds = %115, %3
  %24 = load i32, ptr %9, align 4, !tbaa !9
  %25 = icmp slt i32 %24, 5
  br i1 %25, label %26, label %118

26:                                               ; preds = %23
  %27 = call noalias ptr @fopen(ptr noundef @.str.1, ptr noundef @.str.2)
  store ptr %27, ptr %8, align 8, !tbaa !5
  %28 = load ptr, ptr %8, align 8, !tbaa !5
  %29 = icmp ne ptr %28, null
  br i1 %29, label %31, label %30

30:                                               ; preds = %26
  br label %118

31:                                               ; preds = %26
  br label %32

32:                                               ; preds = %107, %31
  call void @llvm.lifetime.start.p0(i64 4096, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 5, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4096, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %33 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = call ptr @fgets(ptr noundef %33, i32 noundef 4096, ptr noundef %34)
  %36 = icmp ne ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  store i32 5, ptr %19, align 4
  br label %105

38:                                               ; preds = %32
  %39 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %40 = getelementptr inbounds [5 x i8], ptr %13, i64 0, i64 0
  %41 = getelementptr inbounds [4096 x i8], ptr %17, i64 0, i64 0
  %42 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %39, ptr noundef @.str.3, ptr noundef %11, ptr noundef %12, ptr noundef %40, ptr noundef %14, ptr noundef %15, ptr noundef %16, ptr noundef %18, ptr noundef %41) #7
  %43 = icmp eq i32 %42, 8
  br i1 %43, label %44, label %104

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %45 = call ptr @llvm.returnaddress(i32 0)
  %46 = ptrtoint ptr %45 to i64
  store i64 %46, ptr %20, align 8, !tbaa !11
  %47 = load i64, ptr %11, align 8, !tbaa !11
  %48 = load i64, ptr %20, align 8, !tbaa !11
  %49 = icmp ule i64 %47, %48
  br i1 %49, label %50, label %100

50:                                               ; preds = %44
  %51 = load i64, ptr %20, align 8, !tbaa !11
  %52 = load i64, ptr %12, align 8, !tbaa !11
  %53 = icmp ule i64 %51, %52
  br i1 %53, label %54, label %100

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %55 = getelementptr inbounds [4096 x i8], ptr %17, i64 0, i64 0
  %56 = getelementptr inbounds [4096 x i8], ptr %10, i64 0, i64 0
  %57 = call ptr @realpath(ptr noundef %55, ptr noundef %56) #7
  store ptr %57, ptr %21, align 8, !tbaa !5
  %58 = load ptr, ptr %21, align 8, !tbaa !5
  %59 = icmp ne ptr %58, null
  br i1 %59, label %61, label %60

60:                                               ; preds = %54
  store i32 5, ptr %19, align 4
  br label %99

61:                                               ; preds = %54
  %62 = load ptr, ptr %21, align 8, !tbaa !5
  %63 = call i64 @strlen(ptr noundef %62) #8
  %64 = trunc i64 %63 to i32
  store i32 %64, ptr %7, align 4, !tbaa !9
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = load i32, ptr %5, align 4, !tbaa !9
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %68, label %98

68:                                               ; preds = %61
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = load ptr, ptr %21, align 8, !tbaa !5
  %71 = load i32, ptr %7, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %69, ptr align 1 %70, i64 %72, i1 false)
  %73 = load ptr, ptr %6, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %97

75:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %76 = load i32, ptr %7, align 4, !tbaa !9
  %77 = sub nsw i32 %76, 1
  store i32 %77, ptr %22, align 4, !tbaa !9
  br label %78

78:                                               ; preds = %93, %75
  %79 = load i32, ptr %22, align 4, !tbaa !9
  %80 = icmp sge i32 %79, 0
  br i1 %80, label %81, label %96

81:                                               ; preds = %78
  %82 = load ptr, ptr %4, align 8, !tbaa !5
  %83 = load i32, ptr %22, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds i8, ptr %82, i64 %84
  %86 = load i8, ptr %85, align 1, !tbaa !13
  %87 = sext i8 %86 to i32
  %88 = icmp eq i32 %87, 47
  br i1 %88, label %89, label %92

89:                                               ; preds = %81
  %90 = load i32, ptr %22, align 4, !tbaa !9
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  store i32 %90, ptr %91, align 4, !tbaa !9
  br label %96

92:                                               ; preds = %81
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %22, align 4, !tbaa !9
  %95 = add nsw i32 %94, -1
  store i32 %95, ptr %22, align 4, !tbaa !9
  br label %78, !llvm.loop !14

96:                                               ; preds = %89, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %97

97:                                               ; preds = %96, %68
  br label %98

98:                                               ; preds = %97, %61
  store i32 5, ptr %19, align 4
  br label %99

99:                                               ; preds = %98, %60
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  br label %101

100:                                              ; preds = %50, %44
  store i32 0, ptr %19, align 4
  br label %101

101:                                              ; preds = %100, %99
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %102 = load i32, ptr %19, align 4
  switch i32 %102, label %105 [
    i32 0, label %103
  ]

103:                                              ; preds = %101
  br label %104

104:                                              ; preds = %103, %38
  store i32 0, ptr %19, align 4
  br label %105

105:                                              ; preds = %104, %101, %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 5, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4096, ptr %10) #7
  %106 = load i32, ptr %19, align 4
  switch i32 %106, label %120 [
    i32 0, label %107
    i32 5, label %108
  ]

107:                                              ; preds = %105
  br label %32, !llvm.loop !16

108:                                              ; preds = %105
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = call i32 @fclose(ptr noundef %109)
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = icmp ne i32 %111, -1
  br i1 %112, label %113, label %114

113:                                              ; preds = %108
  br label %118

114:                                              ; preds = %108
  br label %115

115:                                              ; preds = %114
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !9
  br label %23, !llvm.loop !17

118:                                              ; preds = %113, %30, %23
  %119 = load i32, ptr %7, align 4, !tbaa !9
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret i32 %119

120:                                              ; preds = %105
  unreachable
}

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare ptr @llvm.returnaddress(i32 immarg) #6

declare i32 @fclose(ptr noundef) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress noinline 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 = { "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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

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

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


; 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.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [28 x i8], align 1

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

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

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

; Function Attrs: mustprogress nofree noinline nounwind uwtable
define dso_local i32 @wai_getModulePath(ptr nocapture noundef %0, i32 noundef %1, ptr noundef writeonly %2) local_unnamed_addr #4 {
  %4 = alloca [4096 x i8], align 16
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca [5 x i8], align 1
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca [4096 x i8], align 16
  %12 = alloca i32, align 4
  %.not39 = icmp eq ptr %2, null
  br label %15

13:                                               ; preds = %.thread.thread, %.thread
  %14 = add nuw nsw i32 %.02955, 1
  %exitcond.not = icmp eq i32 %14, 5
  br i1 %exitcond.not, label %46, label %15, !llvm.loop !5

15:                                               ; preds = %3, %13
  %.02955 = phi i32 [ 0, %3 ], [ %14, %13 ]
  %16 = call noalias ptr @fopen(ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2)
  %.not = icmp eq ptr %16, null
  br i1 %.not, label %46, label %.preheader51

.preheader51:                                     ; preds = %15
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %17 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 4096, ptr noundef nonnull %16)
  %.not3454 = icmp eq ptr %17, null
  br i1 %.not3454, label %.thread.thread, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader51, %42
  %18 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %4, ptr noundef nonnull @.str.3, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7, ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %12, ptr noundef nonnull %11) #6
  %19 = icmp eq i32 %18, 8
  br i1 %19, label %20, label %42

20:                                               ; preds = %.lr.ph
  %21 = call ptr @llvm.returnaddress(i32 0)
  %22 = ptrtoint ptr %21 to i64
  %23 = load i64, ptr %5, align 8, !tbaa !7
  %.not35 = icmp ugt i64 %23, %22
  %24 = load i64, ptr %6, align 8
  %.not36 = icmp ult i64 %24, %22
  %or.cond = select i1 %.not35, i1 true, i1 %.not36
  br i1 %or.cond, label %42, label %25

25:                                               ; preds = %20
  %26 = call ptr @realpath(ptr noundef nonnull %11, ptr noundef nonnull %4) #6
  %.not37 = icmp eq ptr %26, null
  br i1 %.not37, label %.thread.thread, label %27

27:                                               ; preds = %25
  %28 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %26) #7
  %29 = trunc i64 %28 to i32
  %.not38 = icmp sgt i32 %29, %1
  br i1 %.not38, label %.thread, label %30

30:                                               ; preds = %27
  %sext = shl i64 %28, 32
  %31 = ashr exact i64 %sext, 32
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %0, ptr nonnull align 1 %26, i64 %31, i1 false)
  br i1 %.not39, label %.thread, label %.preheader.preheader

.preheader.preheader:                             ; preds = %30
  %32 = and i64 %28, 4294967295
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %35
  %indvars.iv = phi i64 [ %32, %.preheader.preheader ], [ %36, %35 ]
  %33 = trunc nuw i64 %indvars.iv to i32
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %35, label %.thread

35:                                               ; preds = %.preheader
  %36 = add nsw i64 %indvars.iv, -1
  %37 = getelementptr inbounds i8, ptr %0, i64 %36
  %38 = load i8, ptr %37, align 1, !tbaa !11
  %39 = icmp eq i8 %38, 47
  br i1 %39, label %40, label %.preheader, !llvm.loop !12

40:                                               ; preds = %35
  %41 = trunc i64 %36 to i32
  store i32 %41, ptr %2, align 4, !tbaa !13
  br label %.thread

42:                                               ; preds = %20, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 5, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %11) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %43 = call ptr @fgets(ptr noundef nonnull %4, i32 noundef 4096, ptr noundef nonnull %16)
  %.not34 = icmp eq ptr %43, null
  br i1 %.not34, label %.thread.thread, label %.lr.ph

.thread.thread:                                   ; preds = %42, %25, %.preheader51
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %4) #6
  %44 = call i32 @fclose(ptr noundef nonnull %16)
  br label %13

.thread:                                          ; preds = %.preheader, %40, %30, %27
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 5, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %4) #6
  %45 = call i32 @fclose(ptr noundef nonnull %16)
  %.not40 = icmp eq i32 %29, -1
  br i1 %.not40, label %13, label %46

46:                                               ; preds = %.thread, %15, %13
  %.6 = phi i32 [ %29, %.thread ], [ -1, %15 ], [ -1, %13 ]
  ret i32 %.6
}

; 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(none)
declare ptr @llvm.returnaddress(i32 immarg) #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress nofree noinline 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !8, i64 0}
!8 = !{!"long", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!9, !9, i64 0}
!12 = distinct !{!12, !6}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !9, i64 0}


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