; LLVM IR from KhawajaAbaid/machine-learning-in-c :: gan (fit)

; 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.dataset = type { ptr, ptr, i64, i64 }
%struct.mlp = type { ptr, i64 }
%struct.layer = type { ptr, ptr, i64, i64 }
%struct.metrics = type { double, double }

@.str = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1

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

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

; Function Attrs: nounwind
declare void @free(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
declare dso_local ptr @discriminator_train_step(ptr noundef, ptr noundef, ptr noundef, double noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local ptr @generator_train_step(ptr noundef, ptr noundef, double noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local void @fit(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3, i64 noundef %4, i64 noundef %5) #3 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca double, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca [50 x i8], align 16
  %19 = alloca i64, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store double %3, ptr %10, align 8, !tbaa !9
  store i64 %4, ptr %11, align 8, !tbaa !11
  store i64 %5, ptr %12, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %24 = load ptr, ptr %9, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.dataset, ptr %24, i32 0, i32 2
  %26 = load i64, ptr %25, align 8, !tbaa !13
  %27 = load i64, ptr %11, align 8, !tbaa !11
  %28 = udiv i64 %26, %27
  store i64 %28, ptr %13, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %29 = call noalias ptr @malloc(i64 noundef 16) #7
  store ptr %29, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %30 = call noalias ptr @malloc(i64 noundef 16) #7
  store ptr %30, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 50, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %31 = load ptr, ptr %8, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.mlp, ptr %31, i32 0, i32 0
  %33 = load ptr, ptr %32, align 8, !tbaa !15
  %34 = getelementptr inbounds ptr, ptr %33, i64 0
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.layer, ptr %35, i32 0, i32 2
  %37 = load i64, ptr %36, align 8, !tbaa !13
  store i64 %37, ptr %21, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  store i64 0, ptr %22, align 8, !tbaa !11
  br label %38

38:                                               ; preds = %155, %6
  %39 = load i64, ptr %22, align 8, !tbaa !11
  %40 = load i64, ptr %12, align 8, !tbaa !11
  %41 = icmp ult i64 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  br label %158

43:                                               ; preds = %38
  %44 = load ptr, ptr %15, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.metrics, ptr %44, i32 0, i32 0
  store double 0.000000e+00, ptr %45, align 8, !tbaa !17
  %46 = load ptr, ptr %17, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.metrics, ptr %46, i32 0, i32 0
  store double 0.000000e+00, ptr %47, align 8, !tbaa !17
  %48 = load ptr, ptr %17, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.metrics, ptr %48, i32 0, i32 1
  store double 0.000000e+00, ptr %49, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  store i64 0, ptr %23, align 8, !tbaa !11
  br label %50

50:                                               ; preds = %120, %43
  %51 = load i64, ptr %23, align 8, !tbaa !11
  %52 = load i64, ptr %13, align 8, !tbaa !11
  %53 = icmp ult i64 %51, %52
  br i1 %53, label %54, label %123

54:                                               ; preds = %50
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.dataset, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !20
  %60 = load i64, ptr %23, align 8, !tbaa !11
  %61 = load i64, ptr %11, align 8, !tbaa !11
  %62 = mul i64 %60, %61
  %63 = load i64, ptr %21, align 8, !tbaa !11
  %64 = mul i64 %62, %63
  %65 = getelementptr inbounds double, ptr %59, i64 %64
  %66 = load double, ptr %10, align 8, !tbaa !9
  %67 = load i64, ptr %11, align 8, !tbaa !11
  %68 = call ptr @discriminator_train_step(ptr noundef %55, ptr noundef %56, ptr noundef %65, double noundef %66, i64 noundef %67)
  store ptr %68, ptr %16, align 8, !tbaa !5
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = load double, ptr %10, align 8, !tbaa !9
  %72 = load i64, ptr %11, align 8, !tbaa !11
  %73 = call ptr @generator_train_step(ptr noundef %69, ptr noundef %70, double noundef %71, i64 noundef %72)
  store ptr %73, ptr %14, align 8, !tbaa !5
  %74 = load i64, ptr %23, align 8, !tbaa !11
  %75 = urem i64 %74, 25
  %76 = icmp eq i64 %75, 0
  br i1 %76, label %77, label %84

77:                                               ; preds = %54
  %78 = getelementptr inbounds [50 x i8], ptr %18, i64 0, i64 0
  %79 = load i64, ptr %22, align 8, !tbaa !11
  %80 = load i64, ptr %23, align 8, !tbaa !11
  %81 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %78, ptr noundef @.str, i64 noundef %79, i64 noundef %80) #6
  %82 = load ptr, ptr %7, align 8, !tbaa !5
  %83 = getelementptr inbounds [50 x i8], ptr %18, i64 0, i64 0
  call void @generate_and_save_image(ptr noundef %82, ptr noundef %83)
  br label %84

84:                                               ; preds = %77, %54
  %85 = load i64, ptr %22, align 8, !tbaa !11
  %86 = load i64, ptr %23, align 8, !tbaa !11
  %87 = load ptr, ptr %14, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.metrics, ptr %87, i32 0, i32 0
  %89 = load double, ptr %88, align 8, !tbaa !17
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.metrics, ptr %90, i32 0, i32 0
  %92 = load double, ptr %91, align 8, !tbaa !17
  %93 = load ptr, ptr %16, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.metrics, ptr %93, i32 0, i32 1
  %95 = load double, ptr %94, align 8, !tbaa !19
  %96 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %85, i64 noundef %86, double noundef %89, double noundef %92, double noundef %95)
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.metrics, ptr %97, i32 0, i32 0
  %99 = load double, ptr %98, align 8, !tbaa !17
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.metrics, ptr %100, i32 0, i32 0
  %102 = load double, ptr %101, align 8, !tbaa !17
  %103 = fadd double %102, %99
  store double %103, ptr %101, align 8, !tbaa !17
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.metrics, ptr %104, i32 0, i32 0
  %106 = load double, ptr %105, align 8, !tbaa !17
  %107 = load ptr, ptr %17, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.metrics, ptr %107, i32 0, i32 0
  %109 = load double, ptr %108, align 8, !tbaa !17
  %110 = fadd double %109, %106
  store double %110, ptr %108, align 8, !tbaa !17
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.metrics, ptr %111, i32 0, i32 1
  %113 = load double, ptr %112, align 8, !tbaa !19
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.metrics, ptr %114, i32 0, i32 1
  %116 = load double, ptr %115, align 8, !tbaa !19
  %117 = fadd double %116, %113
  store double %117, ptr %115, align 8, !tbaa !19
  %118 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %118) #6
  %119 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %119) #6
  br label %120

120:                                              ; preds = %84
  %121 = load i64, ptr %23, align 8, !tbaa !11
  %122 = add i64 %121, 1
  store i64 %122, ptr %23, align 8, !tbaa !11
  br label %50, !llvm.loop !21

123:                                              ; preds = %50
  %124 = load i64, ptr %13, align 8, !tbaa !11
  %125 = uitofp i64 %124 to double
  %126 = load ptr, ptr %15, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.metrics, ptr %126, i32 0, i32 0
  %128 = load double, ptr %127, align 8, !tbaa !17
  %129 = fdiv double %128, %125
  store double %129, ptr %127, align 8, !tbaa !17
  %130 = load i64, ptr %13, align 8, !tbaa !11
  %131 = uitofp i64 %130 to double
  %132 = load ptr, ptr %17, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.metrics, ptr %132, i32 0, i32 0
  %134 = load double, ptr %133, align 8, !tbaa !17
  %135 = fdiv double %134, %131
  store double %135, ptr %133, align 8, !tbaa !17
  %136 = load i64, ptr %13, align 8, !tbaa !11
  %137 = uitofp i64 %136 to double
  %138 = load ptr, ptr %17, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.metrics, ptr %138, i32 0, i32 1
  %140 = load double, ptr %139, align 8, !tbaa !19
  %141 = fdiv double %140, %137
  store double %141, ptr %139, align 8, !tbaa !19
  %142 = load i64, ptr %22, align 8, !tbaa !11
  %143 = load i64, ptr %23, align 8, !tbaa !11
  %144 = load ptr, ptr %15, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.metrics, ptr %144, i32 0, i32 0
  %146 = load double, ptr %145, align 8, !tbaa !17
  %147 = load ptr, ptr %17, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.metrics, ptr %147, i32 0, i32 0
  %149 = load double, ptr %148, align 8, !tbaa !17
  %150 = load ptr, ptr %17, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.metrics, ptr %150, i32 0, i32 1
  %152 = load double, ptr %151, align 8, !tbaa !19
  %153 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %142, i64 noundef %143, double noundef %146, double noundef %149, double noundef %152)
  %154 = call i32 (ptr, ...) @printf(ptr noundef @.str.2)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  br label %155

155:                                              ; preds = %123
  %156 = load i64, ptr %22, align 8, !tbaa !11
  %157 = add i64 %156, 1
  store i64 %157, ptr %22, align 8, !tbaa !11
  br label %38, !llvm.loop !23

158:                                              ; preds = %42
  %159 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %159) #6
  %160 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %160) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 50, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  ret void
}

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @generate_and_save_image(ptr noundef, ptr noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = { "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 }
attributes #7 = { nounwind 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!15 = !{!16, !6, i64 0}
!16 = !{!"", !6, i64 0, !12, i64 8}
!17 = !{!18, !10, i64 0}
!18 = !{!"metrics", !10, i64 0, !10, i64 8}
!19 = !{!18, !10, i64 8}
!20 = !{!14, !6, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}


; 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 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [85 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 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: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) 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

; Function Attrs: nounwind uwtable
declare dso_local ptr @discriminator_train_step(ptr noundef, ptr noundef, ptr noundef, double noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @generator_train_step(ptr noundef, ptr noundef, double noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @fit(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readonly %2, double noundef %3, i64 noundef %4, i64 noundef %5) local_unnamed_addr #2 {
  %7 = alloca [50 x i8], align 16
  %8 = getelementptr inbounds i8, ptr %2, i64 16
  %9 = load i64, ptr %8, align 8, !tbaa !5
  %10 = udiv i64 %9, %4
  call void @llvm.lifetime.start.p0(i64 50, ptr nonnull %7) #5
  %.not = icmp eq i64 %5, 0
  br i1 %.not, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %6
  %11 = load ptr, ptr %1, align 8, !tbaa !11
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load i64, ptr %13, align 8, !tbaa !5
  %.not67 = icmp ult i64 %9, %4
  %15 = mul i64 %14, %4
  %16 = uitofp i64 %10 to double
  br i1 %.not67, label %.lr.ph58.split, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %.lr.ph58, %._crit_edge.us
  %.05356.us = phi i64 [ %48, %._crit_edge.us ], [ 0, %.lr.ph58 ]
  br label %17

17:                                               ; preds = %.lr.ph.us, %29
  %18 = phi double [ 0.000000e+00, %.lr.ph.us ], [ %36, %29 ]
  %.055.us = phi i64 [ 0, %.lr.ph.us ], [ %39, %29 ]
  %19 = phi <2 x double> [ zeroinitializer, %.lr.ph.us ], [ %38, %29 ]
  %20 = load ptr, ptr %2, align 8, !tbaa !14
  %21 = mul i64 %15, %.055.us
  %22 = getelementptr inbounds double, ptr %20, i64 %21
  %23 = call ptr @discriminator_train_step(ptr noundef nonnull %1, ptr noundef %0, ptr noundef %22, double noundef %3, i64 noundef %4)
  %24 = call ptr @generator_train_step(ptr noundef %0, ptr noundef nonnull %1, double noundef %3, i64 noundef %4)
  %25 = urem i64 %.055.us, 25
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %27, label %29

27:                                               ; preds = %17
  %28 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %7, ptr noundef nonnull dereferenceable(1) @.str, i64 noundef %.05356.us, i64 noundef %.055.us) #5
  call void @generate_and_save_image(ptr noundef %0, ptr noundef nonnull %7)
  br label %29

29:                                               ; preds = %27, %17
  %30 = load double, ptr %24, align 8, !tbaa !15
  %31 = load double, ptr %23, align 8, !tbaa !15
  %32 = getelementptr inbounds i8, ptr %23, i64 8
  %33 = load double, ptr %32, align 8, !tbaa !18
  %34 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.05356.us, i64 noundef %.055.us, double noundef %30, double noundef %31, double noundef %33)
  %35 = load double, ptr %24, align 8, !tbaa !15
  %36 = fadd double %35, %18
  %37 = load <2 x double>, ptr %23, align 8, !tbaa !19
  %38 = fadd <2 x double> %37, %19
  call void @free(ptr noundef %24) #5
  call void @free(ptr noundef %23) #5
  %39 = add nuw i64 %.055.us, 1
  %40 = icmp ult i64 %39, %10
  br i1 %40, label %17, label %._crit_edge.us, !llvm.loop !20

._crit_edge.us:                                   ; preds = %29
  %41 = fdiv double %36, %16
  %42 = extractelement <2 x double> %38, i64 0
  %43 = fdiv double %42, %16
  %44 = extractelement <2 x double> %38, i64 1
  %45 = fdiv double %44, %16
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.05356.us, i64 noundef %39, double noundef %41, double noundef %43, double noundef %45)
  %47 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %48 = add nuw i64 %.05356.us, 1
  %exitcond.not = icmp eq i64 %48, %5
  br i1 %exitcond.not, label %._crit_edge59, label %.lr.ph.us, !llvm.loop !22

.lr.ph58.split:                                   ; preds = %.lr.ph58
  %49 = fdiv double 0.000000e+00, %16
  br label %50

._crit_edge59:                                    ; preds = %._crit_edge.us, %50, %6
  call void @llvm.lifetime.end.p0(i64 50, ptr nonnull %7) #5
  ret void

50:                                               ; preds = %.lr.ph58.split, %50
  %.05356 = phi i64 [ 0, %.lr.ph58.split ], [ %53, %50 ]
  %51 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef %.05356, i64 noundef 0, double noundef %49, double noundef %49, double noundef %49)
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2)
  %53 = add nuw i64 %.05356, 1
  %exitcond72.not = icmp eq i64 %53, %5
  br i1 %exitcond72.not, label %._crit_edge59, label %50, !llvm.loop !22
}

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @generate_and_save_image(ptr noundef, ptr noundef) local_unnamed_addr #4

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

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

!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, !10, i64 16}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16, !10, i64 24}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"", !7, i64 0, !10, i64 8}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 0}
!15 = !{!16, !17, i64 0}
!16 = !{!"metrics", !17, i64 0, !17, i64 8}
!17 = !{!"double", !8, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!17, !17, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


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