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

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @discriminator_backprop(ptr noundef, ptr noundef, double noundef) #0

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

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

declare ptr @copy_mlp(ptr noundef) #3

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

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

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

42:                                               ; preds = %78, %5
  %43 = load i64, ptr %16, align 8, !tbaa !11
  %44 = load i64, ptr %10, align 8, !tbaa !11
  %45 = icmp ult i64 %43, %44
  br i1 %45, label %47, label %46

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

47:                                               ; preds = %42
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = load i64, ptr %16, align 8, !tbaa !11
  %51 = load i64, ptr %13, align 8, !tbaa !11
  %52 = mul i64 %50, %51
  %53 = getelementptr inbounds double, ptr %49, i64 %52
  %54 = call ptr @discriminator_backprop(ptr noundef %48, ptr noundef %53, double noundef 1.000000e+00)
  store ptr %54, ptr %15, align 8, !tbaa !5
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = load ptr, ptr %15, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.grad_and_metrics, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !20
  call void @accumulate_grad_(ptr noundef %55, ptr noundef %58)
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.grad_and_metrics, ptr %59, i32 0, i32 1
  %61 = load ptr, ptr %60, align 8, !tbaa !22
  %62 = getelementptr inbounds %struct.metrics, ptr %61, i32 0, i32 0
  %63 = load double, ptr %62, align 8, !tbaa !13
  %64 = load ptr, ptr %11, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.metrics, ptr %64, i32 0, i32 0
  %66 = load double, ptr %65, align 8, !tbaa !13
  %67 = fadd double %66, %63
  store double %67, ptr %65, align 8, !tbaa !13
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.grad_and_metrics, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !22
  %71 = getelementptr inbounds %struct.metrics, ptr %70, i32 0, i32 1
  %72 = load double, ptr %71, align 8, !tbaa !15
  %73 = load ptr, ptr %11, align 8, !tbaa !5
  %74 = getelementptr inbounds %struct.metrics, ptr %73, i32 0, i32 1
  %75 = load double, ptr %74, align 8, !tbaa !15
  %76 = fadd double %75, %72
  store double %76, ptr %74, align 8, !tbaa !15
  %77 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free_grad_and_metrics(ptr noundef %77)
  br label %78

78:                                               ; preds = %47
  %79 = load i64, ptr %16, align 8, !tbaa !11
  %80 = add i64 %79, 1
  store i64 %80, ptr %16, align 8, !tbaa !11
  br label %42, !llvm.loop !23

81:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store i64 0, ptr %19, align 8, !tbaa !11
  br label %82

82:                                               ; preds = %125, %81
  %83 = load i64, ptr %19, align 8, !tbaa !11
  %84 = load i64, ptr %10, align 8, !tbaa !11
  %85 = icmp ult i64 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %128

87:                                               ; preds = %82
  %88 = call i64 @time(ptr noundef null) #6
  %89 = load i64, ptr %19, align 8, !tbaa !11
  %90 = add i64 %88, %89
  %91 = trunc i64 %90 to i32
  %92 = load i64, ptr %12, align 8, !tbaa !11
  %93 = call ptr @sample_noise(i32 noundef %91, i64 noundef %92)
  store ptr %93, ptr %18, align 8, !tbaa !5
  %94 = load ptr, ptr %7, align 8, !tbaa !5
  %95 = load ptr, ptr %18, align 8, !tbaa !5
  %96 = call ptr @generator_forward_pass(ptr noundef %94, ptr noundef %95)
  store ptr %96, ptr %17, align 8, !tbaa !5
  %97 = load ptr, ptr %18, align 8, !tbaa !5
  call void @free(ptr noundef %97) #6
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = call ptr @discriminator_backprop(ptr noundef %98, ptr noundef %99, double noundef 0.000000e+00)
  store ptr %100, ptr %15, align 8, !tbaa !5
  %101 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %101) #6
  %102 = load ptr, ptr %14, align 8, !tbaa !5
  %103 = load ptr, ptr %15, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.grad_and_metrics, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !20
  call void @accumulate_grad_(ptr noundef %102, ptr noundef %105)
  %106 = load ptr, ptr %15, align 8, !tbaa !5
  %107 = getelementptr inbounds %struct.grad_and_metrics, ptr %106, i32 0, i32 1
  %108 = load ptr, ptr %107, align 8, !tbaa !22
  %109 = getelementptr inbounds %struct.metrics, ptr %108, i32 0, i32 0
  %110 = load double, ptr %109, align 8, !tbaa !13
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.metrics, ptr %111, i32 0, i32 0
  %113 = load double, ptr %112, align 8, !tbaa !13
  %114 = fadd double %113, %110
  store double %114, ptr %112, align 8, !tbaa !13
  %115 = load ptr, ptr %15, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.grad_and_metrics, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !22
  %118 = getelementptr inbounds %struct.metrics, ptr %117, i32 0, i32 1
  %119 = load double, ptr %118, align 8, !tbaa !15
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.metrics, ptr %120, i32 0, i32 1
  %122 = load double, ptr %121, align 8, !tbaa !15
  %123 = fadd double %122, %119
  store double %123, ptr %121, align 8, !tbaa !15
  %124 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free_grad_and_metrics(ptr noundef %124)
  br label %125

125:                                              ; preds = %87
  %126 = load i64, ptr %19, align 8, !tbaa !11
  %127 = add i64 %126, 1
  store i64 %127, ptr %19, align 8, !tbaa !11
  br label %82, !llvm.loop !25

128:                                              ; preds = %86
  %129 = load ptr, ptr %14, align 8, !tbaa !5
  %130 = load i64, ptr %10, align 8, !tbaa !11
  call void @divide_grad_by_batch_size_(ptr noundef %129, i64 noundef %130)
  %131 = load i64, ptr %10, align 8, !tbaa !11
  %132 = uitofp i64 %131 to double
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.metrics, ptr %133, i32 0, i32 0
  %135 = load double, ptr %134, align 8, !tbaa !13
  %136 = fdiv double %135, %132
  store double %136, ptr %134, align 8, !tbaa !13
  %137 = load i64, ptr %10, align 8, !tbaa !11
  %138 = mul i64 %137, 2
  %139 = uitofp i64 %138 to double
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.metrics, ptr %140, i32 0, i32 1
  %142 = load double, ptr %141, align 8, !tbaa !15
  %143 = fdiv double %142, %139
  store double %143, ptr %141, align 8, !tbaa !15
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = load ptr, ptr %14, align 8, !tbaa !5
  %146 = load double, ptr %9, align 8, !tbaa !9
  call void @update_weights_(ptr noundef %144, ptr noundef %145, double noundef %146)
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free_gradient(ptr noundef %147)
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #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
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  ret ptr %148
}

declare void @initialize_mlp_zeros_(ptr noundef) #3

declare void @accumulate_grad_(ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @free_grad_and_metrics(ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sample_noise(i32 noundef, i64 noundef) #5

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @generator_forward_pass(ptr noundef, ptr noundef) #5

declare void @divide_grad_by_batch_size_(ptr noundef, i64 noundef) #3

declare void @update_weights_(ptr noundef, ptr noundef, double noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @free_gradient(ptr noundef) #5

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 = { 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 = { 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, !10, i64 0}
!14 = !{!"metrics", !10, i64 0, !10, i64 8}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"", !6, i64 0, !12, i64 8}
!18 = !{!19, !12, i64 16}
!19 = !{!"", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 24}
!20 = !{!21, !6, i64 0}
!21 = !{!"", !6, i64 0, !6, i64 8}
!22 = !{!21, !6, i64 8}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}


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

; Function Attrs: nounwind uwtable
declare dso_local ptr @discriminator_backprop(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

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

declare ptr @copy_mlp(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @discriminator_train_step(ptr noundef %0, ptr noundef %1, ptr noundef %2, double noundef %3, i64 noundef %4) local_unnamed_addr #0 {
  %6 = tail call noalias dereferenceable_or_null(16) ptr @malloc(i64 noundef 16) #6
  %7 = load ptr, ptr %1, align 8, !tbaa !5
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %8, i64 16
  %10 = load i64, ptr %9, align 8, !tbaa !12
  %11 = load ptr, ptr %0, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load i64, ptr %13, align 8, !tbaa !12
  %15 = tail call ptr @copy_mlp(ptr noundef nonnull %0) #7
  tail call void @initialize_mlp_zeros_(ptr noundef %15) #7
  %.not = icmp eq i64 %4, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5, %.lr.ph
  %.04850 = phi i64 [ %26, %.lr.ph ], [ 0, %5 ]
  %16 = phi <2 x double> [ %24, %.lr.ph ], [ zeroinitializer, %5 ]
  %17 = mul i64 %.04850, %14
  %18 = getelementptr inbounds double, ptr %2, i64 %17
  %19 = tail call ptr @discriminator_backprop(ptr noundef nonnull %0, ptr noundef %18, double noundef 1.000000e+00)
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  tail call void @accumulate_grad_(ptr noundef %15, ptr noundef %20) #7
  %21 = getelementptr inbounds i8, ptr %19, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !16
  %23 = load <2 x double>, ptr %22, align 8, !tbaa !17
  %24 = fadd <2 x double> %23, %16
  %25 = extractelement <2 x double> %24, i64 0
  store double %25, ptr %6, align 8, !tbaa !19
  tail call void @free_grad_and_metrics(ptr noundef nonnull %19)
  %26 = add nuw i64 %.04850, 1
  %exitcond.not = icmp eq i64 %26, %4
  br i1 %exitcond.not, label %.lr.ph52, label %.lr.ph, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph52, %5
  %27 = phi <2 x double> [ zeroinitializer, %5 ], [ %44, %.lr.ph52 ]
  tail call void @divide_grad_by_batch_size_(ptr noundef %15, i64 noundef %4) #7
  %28 = shl i64 %4, 1
  %29 = insertelement <2 x i64> poison, i64 %4, i64 0
  %30 = insertelement <2 x i64> %29, i64 %28, i64 1
  %31 = uitofp <2 x i64> %30 to <2 x double>
  %32 = fdiv <2 x double> %27, %31
  store <2 x double> %32, ptr %6, align 8, !tbaa !17
  tail call void @update_weights_(ptr noundef nonnull %0, ptr noundef %15, double noundef %3) #7
  tail call void @free_gradient(ptr noundef %15)
  ret ptr %6

.lr.ph52:                                         ; preds = %.lr.ph, %.lr.ph52
  %.051 = phi i64 [ %45, %.lr.ph52 ], [ 0, %.lr.ph ]
  %33 = phi <2 x double> [ %44, %.lr.ph52 ], [ %24, %.lr.ph ]
  %34 = tail call i64 @time(ptr noundef null) #7
  %35 = add i64 %34, %.051
  %36 = trunc i64 %35 to i32
  %37 = tail call ptr @sample_noise(i32 noundef %36, i64 noundef %10)
  %38 = tail call ptr @generator_forward_pass(ptr noundef nonnull %1, ptr noundef %37)
  tail call void @free(ptr noundef %37) #7
  %39 = tail call ptr @discriminator_backprop(ptr noundef nonnull %0, ptr noundef %38, double noundef 0.000000e+00)
  tail call void @free(ptr noundef %38) #7
  %40 = load ptr, ptr %39, align 8, !tbaa !14
  tail call void @accumulate_grad_(ptr noundef %15, ptr noundef %40) #7
  %41 = getelementptr inbounds i8, ptr %39, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !16
  %43 = load <2 x double>, ptr %42, align 8, !tbaa !17
  %44 = fadd <2 x double> %43, %33
  tail call void @free_grad_and_metrics(ptr noundef nonnull %39)
  %45 = add nuw i64 %.051, 1
  %exitcond54.not = icmp eq i64 %45, %4
  br i1 %exitcond54.not, label %._crit_edge, label %.lr.ph52, !llvm.loop !23
}

declare void @initialize_mlp_zeros_(ptr noundef) local_unnamed_addr #2

declare void @accumulate_grad_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @sample_noise(i32 noundef, i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #5

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

declare void @divide_grad_by_batch_size_(ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @update_weights_(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #2

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

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


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