; LLVM IR from kkumatani/distant_speech_recognition :: btk20_src/common/mach_ind_io.ll (Z12write_floatsP8_IO_FILEPfi)

; 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.unionT = type { float }

@_ZL7machine = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZTI9jio_error = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.6 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 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 i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9jio_errorC2EPKcz(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef, ...) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZN7j_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #1

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12write_floatsP8_IO_FILEPfi(ptr noundef %0, ptr noundef %1, i32 noundef %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %union.unionT, align 4
  %9 = alloca %union.unionT, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca float, align 4
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %19 = load i32, ptr %7, align 4, !tbaa !9
  %20 = icmp sle i32 %19, 0
  br i1 %20, label %21, label %22

21:                                               ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %121

22:                                               ; preds = %3
  %23 = load i32, ptr %7, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = mul i64 4, %24
  %26 = call noalias ptr @malloc(i64 noundef %25) #6
  store ptr %26, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %10, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %34

29:                                               ; preds = %22
  %30 = load ptr, ptr @stderr, align 8, !tbaa !5
  %31 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %30, ptr noundef @.str.6) #5
  %32 = load ptr, ptr @stderr, align 8, !tbaa !5
  %33 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef @.str.7) #5
  store ptr %15, ptr %11, align 8, !tbaa !5
  br label %36

34:                                               ; preds = %22
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %35, ptr %11, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %34, %29
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %37, ptr %12, align 8, !tbaa !5
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %103, %36
  %39 = load i32, ptr %13, align 4, !tbaa !9
  %40 = load i32, ptr %7, align 4, !tbaa !9
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %42, label %108

42:                                               ; preds = %38
  %43 = load ptr, ptr %12, align 8, !tbaa !5
  %44 = load float, ptr %43, align 4, !tbaa !11
  store float %44, ptr %8, align 4, !tbaa !13
  %45 = load i32, ptr @_ZL7machine, align 4, !tbaa !9
  switch i32 %45, label %78 [
    i32 1, label %46
    i32 2, label %48
    i32 3, label %64
  ]

46:                                               ; preds = %42
  %47 = load float, ptr %8, align 4, !tbaa !13
  store float %47, ptr %9, align 4, !tbaa !13
  br label %86

48:                                               ; preds = %42
  %49 = load i32, ptr %8, align 4, !tbaa !13
  %50 = shl i32 %49, 24
  %51 = and i32 %50, -16777216
  %52 = load i32, ptr %8, align 4, !tbaa !13
  %53 = shl i32 %52, 8
  %54 = and i32 %53, 16711680
  %55 = or i32 %51, %54
  %56 = load i32, ptr %8, align 4, !tbaa !13
  %57 = ashr i32 %56, 8
  %58 = and i32 %57, 65280
  %59 = or i32 %55, %58
  %60 = load i32, ptr %8, align 4, !tbaa !13
  %61 = ashr i32 %60, 24
  %62 = and i32 %61, 255
  %63 = or i32 %59, %62
  store i32 %63, ptr %9, align 4, !tbaa !13
  br label %86

64:                                               ; preds = %42
  %65 = load i32, ptr %8, align 4, !tbaa !13
  %66 = shl i32 %65, 8
  %67 = and i32 %66, -16711936
  %68 = load i32, ptr %8, align 4, !tbaa !13
  %69 = ashr i32 %68, 8
  %70 = and i32 %69, 16711935
  %71 = or i32 %67, %70
  %72 = load i32, ptr %8, align 4, !tbaa !13
  %73 = and i32 %72, 65280
  %74 = icmp ne i32 %73, 0
  %75 = zext i1 %74 to i64
  %76 = select i1 %74, i32 1, i32 0
  %77 = sub i32 %71, %76
  store i32 %77, ptr %9, align 4, !tbaa !13
  br label %86

78:                                               ; preds = %42
  %79 = call ptr @__cxa_allocate_exception(i64 48) #5
  %80 = load i32, ptr @_ZL7machine, align 4, !tbaa !9
  invoke void (ptr, ptr, ...) @_ZN9jio_errorC2EPKcz(ptr noundef nonnull align 8 dereferenceable(44) %79, ptr noundef @.str.3, i32 noundef %80)
          to label %81 unwind label %82

81:                                               ; preds = %78
  call void @__cxa_throw(ptr %79, ptr @_ZTI9jio_error, ptr @_ZN7j_errorD2Ev) #7
  unreachable

82:                                               ; preds = %78
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %17, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %18, align 4
  call void @__cxa_free_exception(ptr %79) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %123

86:                                               ; preds = %64, %48, %46
  %87 = load float, ptr %9, align 4, !tbaa !13
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  store float %87, ptr %88, align 4, !tbaa !11
  %89 = load ptr, ptr %10, align 8, !tbaa !5
  %90 = icmp ne ptr %89, null
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds float, ptr %92, i32 1
  store ptr %93, ptr %11, align 8, !tbaa !5
  br label %102

94:                                               ; preds = %86
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = call i64 @fwrite(ptr noundef %95, i64 noundef 4, i64 noundef 1, ptr noundef %96)
  %98 = load i32, ptr %14, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = add i64 %99, %97
  %101 = trunc i64 %100 to i32
  store i32 %101, ptr %14, align 4, !tbaa !9
  br label %102

102:                                              ; preds = %94, %91
  br label %103

103:                                              ; preds = %102
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %13, align 4, !tbaa !9
  %106 = load ptr, ptr %12, align 8, !tbaa !5
  %107 = getelementptr inbounds float, ptr %106, i32 1
  store ptr %107, ptr %12, align 8, !tbaa !5
  br label %38, !llvm.loop !14

108:                                              ; preds = %38
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = icmp ne ptr %109, null
  br i1 %110, label %111, label %119

111:                                              ; preds = %108
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call i64 @fwrite(ptr noundef %112, i64 noundef 4, i64 noundef %114, ptr noundef %115)
  %117 = trunc i64 %116 to i32
  store i32 %117, ptr %14, align 4, !tbaa !9
  %118 = load ptr, ptr %10, align 8, !tbaa !5
  call void @free(ptr noundef %118) #5
  br label %119

119:                                              ; preds = %111, %108
  %120 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %120, ptr %4, align 4
  store i32 1, ptr %16, align 4
  br label %121

121:                                              ; preds = %119, %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  %122 = load i32, ptr %4, align 4
  ret i32 %122

123:                                              ; preds = %82
  %124 = load ptr, ptr %17, align 8
  %125 = load i32, ptr %18, align 4
  %126 = insertvalue { ptr, i32 } poison, ptr %124, 0
  %127 = insertvalue { ptr, i32 } %126, i32 %125, 1
  resume { ptr, i32 } %127
}

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 = { 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 #3 = { 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 #4 = { "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 }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn }

!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 = !{!"float", !7, i64 0}
!13 = !{!7, !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"

@_ZL7machine = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [32 x i8], align 1
@_ZTI9jio_error = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.6 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [45 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 i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9jio_errorC2EPKcz(ptr noundef nonnull align 8 dereferenceable(44), ptr noundef, ...) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZN7j_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(44)) unnamed_addr #3

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture 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 #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z12write_floatsP8_IO_FILEPfi(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca float, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %5 = icmp slt i32 %2, 1
  br i1 %5, label %64, label %6

6:                                                ; preds = %3
  %7 = zext nneg i32 %2 to i64
  %8 = shl nuw nsw i64 %7, 2
  %9 = tail call noalias ptr @malloc(i64 noundef %8) #8
  %10 = icmp eq ptr %9, null
  br i1 %10, label %.lr.ph.split.us.preheader, label %.lr.ph.split.preheader

.lr.ph.split.preheader:                           ; preds = %6
  %.pre = load i32, ptr @_ZL7machine, align 4, !tbaa !5
  br label %.lr.ph.split

.lr.ph.split.us.preheader:                        ; preds = %6
  %11 = load ptr, ptr @stderr, align 8, !tbaa !9
  %12 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.6) #9
  %13 = load ptr, ptr @stderr, align 8, !tbaa !9
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %13, ptr noundef nonnull @.str.7) #9
  br label %.lr.ph.split.us

.lr.ph.split.us:                                  ; preds = %.lr.ph.split.us.preheader, %31
  %.03146.us = phi i32 [ %34, %31 ], [ 0, %.lr.ph.split.us.preheader ]
  %.03245.us = phi i32 [ %35, %31 ], [ 0, %.lr.ph.split.us.preheader ]
  %.03344.us = phi ptr [ %36, %31 ], [ %1, %.lr.ph.split.us.preheader ]
  %15 = load float, ptr %.03344.us, align 4, !tbaa !11
  %16 = load i32, ptr @_ZL7machine, align 4, !tbaa !5
  switch i32 %16, label %.split.us [
    i32 1, label %31
    i32 2, label %27
    i32 3, label %17
  ]

17:                                               ; preds = %.lr.ph.split.us
  %18 = bitcast float %15 to i32
  %19 = shl i32 %18, 8
  %20 = and i32 %19, -16711936
  %21 = lshr i32 %18, 8
  %22 = and i32 %21, 16711935
  %23 = or disjoint i32 %20, %22
  %24 = and i32 %18, 65280
  %.not40.us = icmp ne i32 %24, 0
  %.neg.us = sext i1 %.not40.us to i32
  %25 = add i32 %23, %.neg.us
  %26 = bitcast i32 %25 to float
  br label %31

27:                                               ; preds = %.lr.ph.split.us
  %28 = bitcast float %15 to i32
  %29 = tail call i32 @llvm.bswap.i32(i32 %28)
  %30 = bitcast i32 %29 to float
  br label %31

31:                                               ; preds = %27, %17, %.lr.ph.split.us
  %.sroa.0.0.us = phi float [ %26, %17 ], [ %30, %27 ], [ %15, %.lr.ph.split.us ]
  store float %.sroa.0.0.us, ptr %4, align 4, !tbaa !11
  %32 = call i64 @fwrite(ptr noundef nonnull %4, i64 noundef 4, i64 noundef 1, ptr noundef %0)
  %33 = trunc i64 %32 to i32
  %34 = add i32 %.03146.us, %33
  %35 = add nuw nsw i32 %.03245.us, 1
  %36 = getelementptr inbounds i8, ptr %.03344.us, i64 4
  %exitcond50.not = icmp eq i32 %35, %2
  br i1 %exitcond50.not, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !13

.lr.ph.split:                                     ; preds = %.lr.ph.split.preheader, %57
  %.03245 = phi i32 [ %59, %57 ], [ 0, %.lr.ph.split.preheader ]
  %.03344 = phi ptr [ %60, %57 ], [ %1, %.lr.ph.split.preheader ]
  %.13543 = phi ptr [ %58, %57 ], [ %9, %.lr.ph.split.preheader ]
  %37 = load float, ptr %.03344, align 4, !tbaa !11
  switch i32 %.pre, label %.split.us [
    i32 1, label %57
    i32 2, label %38
    i32 3, label %42
  ]

38:                                               ; preds = %.lr.ph.split
  %39 = bitcast float %37 to i32
  %40 = tail call i32 @llvm.bswap.i32(i32 %39)
  %41 = bitcast i32 %40 to float
  br label %57

42:                                               ; preds = %.lr.ph.split
  %43 = bitcast float %37 to i32
  %44 = shl i32 %43, 8
  %45 = and i32 %44, -16711936
  %46 = lshr i32 %43, 8
  %47 = and i32 %46, 16711935
  %48 = or disjoint i32 %45, %47
  %49 = and i32 %43, 65280
  %.not40 = icmp ne i32 %49, 0
  %.neg = sext i1 %.not40 to i32
  %50 = add i32 %48, %.neg
  %51 = bitcast i32 %50 to float
  br label %57

.split.us:                                        ; preds = %.lr.ph.split, %.lr.ph.split.us
  %52 = tail call ptr @__cxa_allocate_exception(i64 48) #7
  %53 = load i32, ptr @_ZL7machine, align 4, !tbaa !5
  invoke void (ptr, ptr, ...) @_ZN9jio_errorC2EPKcz(ptr noundef nonnull align 8 dereferenceable(44) %52, ptr noundef nonnull @.str.3, i32 noundef %53)
          to label %54 unwind label %55

54:                                               ; preds = %.split.us
  tail call void @__cxa_throw(ptr nonnull %52, ptr nonnull @_ZTI9jio_error, ptr nonnull @_ZN7j_errorD2Ev) #10
  unreachable

55:                                               ; preds = %.split.us
  %56 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_free_exception(ptr %52) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  resume { ptr, i32 } %56

57:                                               ; preds = %.lr.ph.split, %42, %38
  %.sroa.0.0 = phi float [ %51, %42 ], [ %41, %38 ], [ %37, %.lr.ph.split ]
  store float %.sroa.0.0, ptr %.13543, align 4, !tbaa !11
  %58 = getelementptr inbounds i8, ptr %.13543, i64 4
  %59 = add nuw nsw i32 %.03245, 1
  %60 = getelementptr inbounds i8, ptr %.03344, i64 4
  %exitcond.not = icmp eq i32 %59, %2
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !13

._crit_edge:                                      ; preds = %57, %31
  %.031.lcssa = phi i32 [ %34, %31 ], [ 0, %57 ]
  br i1 %10, label %64, label %61

61:                                               ; preds = %._crit_edge
  %62 = tail call i64 @fwrite(ptr noundef nonnull %9, i64 noundef 4, i64 noundef %7, ptr noundef %0)
  %63 = trunc i64 %62 to i32
  tail call void @free(ptr noundef nonnull %9) #7
  br label %64

64:                                               ; preds = %._crit_edge, %61, %3
  %.0 = phi i32 [ 0, %3 ], [ %63, %61 ], [ %.031.lcssa, %._crit_edge ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  ret i32 %.0
}

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

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 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 #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 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass