; LLVM IR from NOAA-PMEL/Ferret :: fer/ccr (write_dods)

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

%union.anon.0 = type { double }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__.write_dods_double_ = external hidden unnamed_addr constant [69 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) #4

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

declare void @FerMem_Free(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

declare i32 @fclose(ptr noundef) #2

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

; Function Attrs: nounwind uwtable
define dso_local i32 @write_dods_double_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5) #6 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca %union.anon.0, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  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 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %22 = load ptr, ptr %8, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %6
  br label %26

25:                                               ; preds = %6
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.write_dods_double_) #8
  unreachable

26:                                               ; preds = %24
  %27 = load ptr, ptr %9, align 8, !tbaa !5
  %28 = load i32, ptr %27, align 4, !tbaa !9
  %29 = add nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = mul i64 1, %30
  %32 = call ptr @FerMem_Malloc(i64 noundef %31, ptr noundef @.str.1, i32 noundef 120)
  store ptr %32, ptr %18, align 8, !tbaa !5
  %33 = load ptr, ptr %18, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  br i1 %34, label %35, label %47

35:                                               ; preds = %26
  %36 = load ptr, ptr %18, align 8, !tbaa !5
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = load ptr, ptr %9, align 8, !tbaa !5
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = call ptr @strncpy(ptr noundef %36, ptr noundef %37, i64 noundef %40) #7
  %42 = load ptr, ptr %18, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  %44 = load i32, ptr %43, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %42, i64 %45
  store i8 0, ptr %46, align 1, !tbaa !11
  br label %48

47:                                               ; preds = %26
  br label %126

48:                                               ; preds = %35
  %49 = load ptr, ptr %10, align 8, !tbaa !5
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %48
  %53 = load ptr, ptr %18, align 8, !tbaa !5
  %54 = call noalias ptr @fopen(ptr noundef %53, ptr noundef @.str.2)
  store ptr %54, ptr %14, align 8, !tbaa !5
  br label %58

55:                                               ; preds = %48
  %56 = load ptr, ptr %18, align 8, !tbaa !5
  %57 = call noalias ptr @fopen(ptr noundef %56, ptr noundef @.str.3)
  store ptr %57, ptr %14, align 8, !tbaa !5
  br label %58

58:                                               ; preds = %55, %52
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = icmp ne ptr %59, null
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  br label %126

62:                                               ; preds = %58
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = call i32 @__bswap_32(i32 noundef %64)
  store i32 %65, ptr %16, align 4, !tbaa !9
  %66 = load ptr, ptr %14, align 8, !tbaa !5
  %67 = call i64 @fwrite(ptr noundef %16, i64 noundef 4, i64 noundef 1, ptr noundef %66)
  %68 = icmp ne i64 %67, 1
  br i1 %68, label %69, label %70

69:                                               ; preds = %62
  br label %126

70:                                               ; preds = %62
  %71 = load ptr, ptr %14, align 8, !tbaa !5
  %72 = call i64 @fwrite(ptr noundef %16, i64 noundef 4, i64 noundef 1, ptr noundef %71)
  %73 = icmp ne i64 %72, 1
  br i1 %73, label %74, label %75

74:                                               ; preds = %70
  br label %126

75:                                               ; preds = %70
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 0
  br i1 %78, label %79, label %112

79:                                               ; preds = %75
  store i32 0, ptr %15, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %108, %79
  %81 = load i32, ptr %15, align 4, !tbaa !9
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = load i32, ptr %82, align 4, !tbaa !9
  %84 = icmp slt i32 %81, %83
  br i1 %84, label %85, label %111

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  %86 = load ptr, ptr %13, align 8, !tbaa !5
  %87 = load i32, ptr %15, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !12
  store double %90, ptr %19, align 8, !tbaa !11
  %91 = getelementptr inbounds [2 x i32], ptr %19, i64 0, i64 0
  %92 = load i32, ptr %91, align 8, !tbaa !11
  store i32 %92, ptr %20, align 4, !tbaa !9
  %93 = getelementptr inbounds [2 x i32], ptr %19, i64 0, i64 1
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = call i32 @__bswap_32(i32 noundef %94)
  %96 = getelementptr inbounds [2 x i32], ptr %19, i64 0, i64 0
  store i32 %95, ptr %96, align 8, !tbaa !11
  %97 = load i32, ptr %20, align 4, !tbaa !9
  %98 = call i32 @__bswap_32(i32 noundef %97)
  %99 = getelementptr inbounds [2 x i32], ptr %19, i64 0, i64 1
  store i32 %98, ptr %99, align 4, !tbaa !11
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  %101 = call i64 @fwrite(ptr noundef %19, i64 noundef 8, i64 noundef 1, ptr noundef %100)
  %102 = icmp ne i64 %101, 1
  br i1 %102, label %103, label %104

103:                                              ; preds = %85
  store i32 2, ptr %21, align 4
  br label %105

104:                                              ; preds = %85
  store i32 0, ptr %21, align 4
  br label %105

105:                                              ; preds = %104, %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  %106 = load i32, ptr %21, align 4
  switch i32 %106, label %154 [
    i32 0, label %107
    i32 2, label %126
  ]

107:                                              ; preds = %105
  br label %108

108:                                              ; preds = %107
  %109 = load i32, ptr %15, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr %15, align 4, !tbaa !9
  br label %80, !llvm.loop !14

111:                                              ; preds = %80
  br label %125

112:                                              ; preds = %75
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = call i64 @fwrite(ptr noundef %113, i64 noundef 8, i64 noundef %116, ptr noundef %117)
  %119 = load ptr, ptr %12, align 8, !tbaa !5
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = icmp ne i64 %118, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %112
  br label %126

124:                                              ; preds = %112
  br label %125

125:                                              ; preds = %124, %111
  br label %126

126:                                              ; preds = %125, %123, %105, %74, %69, %61, %47
  %127 = load ptr, ptr %18, align 8, !tbaa !5
  %128 = icmp ne ptr %127, null
  br i1 %128, label %129, label %131

129:                                              ; preds = %126
  %130 = load ptr, ptr %18, align 8, !tbaa !5
  call void @FerMem_Free(ptr noundef %130, ptr noundef @.str.1, i32 noundef 154)
  br label %131

131:                                              ; preds = %129, %126
  %132 = call ptr @__errno_location() #9
  %133 = load i32, ptr %132, align 4, !tbaa !9
  store i32 %133, ptr %17, align 4, !tbaa !9
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %152

136:                                              ; preds = %131
  %137 = call ptr @__errno_location() #9
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = icmp ne i32 %138, 0
  br i1 %139, label %140, label %143

140:                                              ; preds = %136
  %141 = load ptr, ptr %14, align 8, !tbaa !5
  %142 = call i32 @fclose(ptr noundef %141)
  br label %151

143:                                              ; preds = %136
  %144 = load ptr, ptr %14, align 8, !tbaa !5
  %145 = call i32 @fclose(ptr noundef %144)
  %146 = icmp ne i32 %145, 0
  br i1 %146, label %147, label %150

147:                                              ; preds = %143
  %148 = call ptr @__errno_location() #9
  %149 = load i32, ptr %148, align 4, !tbaa !9
  store i32 %149, ptr %17, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %147, %143
  br label %151

151:                                              ; preds = %150, %140
  br label %152

152:                                              ; preds = %151, %131
  %153 = load i32, ptr %17, align 4, !tbaa !9
  store i32 %153, ptr %7, align 4
  store i32 1, ptr %21, align 4
  br label %154

154:                                              ; preds = %152, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, 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
  %155 = load i32, ptr %7, align 4
  ret i32 %155
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind "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 = { inlinehint 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 willreturn memory(none) "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 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 #7 = { nounwind }
attributes #8 = { noreturn nounwind }
attributes #9 = { nounwind willreturn memory(none) }

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

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


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

%union.anon.0 = type { double }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@__PRETTY_FUNCTION__.write_dods_double_ = external hidden unnamed_addr constant [69 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @FerMem_Malloc(i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @__bswap_32(i32 noundef) local_unnamed_addr #5

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

declare void @FerMem_Free(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @write_dods_double_(ptr noundef readonly %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef %5) local_unnamed_addr #7 {
  %7 = alloca i32, align 4
  %8 = alloca %union.anon.0, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %9, label %10

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 114, ptr noundef nonnull @__PRETTY_FUNCTION__.write_dods_double_) #10
  unreachable

10:                                               ; preds = %6
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = add nsw i32 %11, 1
  %13 = sext i32 %12 to i64
  %14 = tail call ptr @FerMem_Malloc(i64 noundef %13, ptr noundef nonnull @.str.1, i32 noundef 120) #9
  %.not42 = icmp ne ptr %14, null
  tail call void @llvm.assume(i1 %.not42)
  %15 = load i32, ptr %1, align 4, !tbaa !5
  %16 = sext i32 %15 to i64
  %17 = tail call ptr @strncpy(ptr noundef nonnull %14, ptr noundef nonnull %0, i64 noundef %16) #9
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds i8, ptr %14, i64 %19
  store i8 0, ptr %20, align 1, !tbaa !9
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %.not43 = icmp eq i32 %21, 0
  %.str.3.sink = select i1 %.not43, ptr @.str.3, ptr @.str.2
  %22 = tail call noalias ptr @fopen(ptr noundef nonnull %14, ptr noundef nonnull %.str.3.sink)
  %.not44 = icmp eq ptr %22, null
  br i1 %.not44, label %.thread, label %23

23:                                               ; preds = %10
  %24 = load i32, ptr %4, align 4, !tbaa !5
  %25 = tail call i32 @__bswap_32(i32 noundef %24)
  store i32 %25, ptr %7, align 4, !tbaa !5
  %26 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %22)
  %.not45 = icmp eq i64 %26, 1
  br i1 %.not45, label %27, label %.thread

27:                                               ; preds = %23
  %28 = call i64 @fwrite(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %22)
  %.not46 = icmp eq i64 %28, 1
  br i1 %.not46, label %29, label %.thread

29:                                               ; preds = %27
  %30 = load i32, ptr %3, align 4, !tbaa !5
  %.not47 = icmp eq i32 %30, 0
  %31 = load i32, ptr %4, align 4, !tbaa !5
  br i1 %.not47, label %47, label %.preheader

.preheader:                                       ; preds = %29
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.lr.ph, label %.thread

.lr.ph:                                           ; preds = %.preheader
  %33 = getelementptr inbounds i8, ptr %8, i64 4
  br label %38

34:                                               ; preds = %38
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  %37 = icmp slt i64 %indvars.iv.next, %36
  br i1 %37, label %38, label %.thread, !llvm.loop !10

38:                                               ; preds = %.lr.ph, %34
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %34 ]
  %39 = getelementptr inbounds double, ptr %5, i64 %indvars.iv
  %40 = load i64, ptr %39, align 8, !tbaa !12
  %41 = trunc i64 %40 to i32
  %42 = lshr i64 %40, 32
  %43 = trunc nuw i64 %42 to i32
  %44 = tail call i32 @__bswap_32(i32 noundef %43)
  store i32 %44, ptr %8, align 8, !tbaa !9
  %45 = tail call i32 @__bswap_32(i32 noundef %41)
  store i32 %45, ptr %33, align 4, !tbaa !9
  %46 = call i64 @fwrite(ptr noundef nonnull %8, i64 noundef 8, i64 noundef 1, ptr noundef nonnull %22)
  %.not48 = icmp eq i64 %46, 1
  br i1 %.not48, label %34, label %.thread

47:                                               ; preds = %29
  %48 = sext i32 %31 to i64
  %49 = tail call i64 @fwrite(ptr noundef %5, i64 noundef 8, i64 noundef %48, ptr noundef nonnull %22)
  br label %.thread

.thread:                                          ; preds = %38, %34, %.preheader, %10, %23, %27, %47
  tail call void @FerMem_Free(ptr noundef nonnull %14, ptr noundef nonnull @.str.1, i32 noundef 154) #9
  %50 = tail call ptr @__errno_location() #11
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %.not49 = icmp eq ptr %22, null
  br i1 %.not49, label %57, label %52

52:                                               ; preds = %.thread
  %.not50 = icmp eq i32 %51, 0
  %53 = tail call i32 @fclose(ptr noundef nonnull %22)
  br i1 %.not50, label %54, label %57

54:                                               ; preds = %52
  %.not51 = icmp eq i32 %53, 0
  br i1 %.not51, label %57, label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %50, align 4, !tbaa !5
  br label %57

57:                                               ; preds = %52, %.thread, %54, %55
  %.033 = phi i32 [ %56, %55 ], [ 0, %54 ], [ %51, %.thread ], [ %51, %52 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  ret i32 %.033
}

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: write)
declare void @llvm.assume(i1 noundef) #8

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

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"double", !7, i64 0}


; Effective O3 passes: ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass