; LLVM IR from tsotchke/quantum_geometric_tensor :: src/quantum_geometric/core (quantum_geometric_core)

; 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.quantum_geometric_config_t = type { i64, i64, i64, float, float, i8, i8, ptr }

@global_config = external hidden global %struct.quantum_geometric_config_t, align 8
@is_initialized = external hidden global 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @geometric_free(ptr noundef) #1

declare ptr @geometric_allocate(i64 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @geometric_core_minimize(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i64 noundef %4, i64 noundef %5) #4 {
  %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 i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca float, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca float, align 4
  %21 = alloca i64, align 8
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca float, 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 i64 %4, ptr %12, align 8, !tbaa !9
  store i64 %5, ptr %13, align 8, !tbaa !9
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %30

29:                                               ; preds = %6
  store i32 -1, ptr %7, align 4
  br label %174

30:                                               ; preds = %6
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %30
  store i32 -1, ptr %7, align 4
  br label %174

34:                                               ; preds = %30
  %35 = load ptr, ptr %10, align 8, !tbaa !5
  %36 = icmp eq ptr %35, null
  br i1 %36, label %37, label %38

37:                                               ; preds = %34
  store i32 -1, ptr %7, align 4
  br label %174

38:                                               ; preds = %34
  %39 = load ptr, ptr %11, align 8, !tbaa !5
  %40 = icmp eq ptr %39, null
  br i1 %40, label %41, label %42

41:                                               ; preds = %38
  store i32 -1, ptr %7, align 4
  br label %174

42:                                               ; preds = %38
  %43 = load i8, ptr @is_initialized, align 1, !tbaa !11, !range !13, !noundef !14
  %44 = trunc i8 %43 to i1
  br i1 %44, label %46, label %45

45:                                               ; preds = %42
  store i32 -4, ptr %7, align 4
  br label %174

46:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %47, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %48, ptr %15, align 8, !tbaa !5
  %49 = load ptr, ptr %14, align 8, !tbaa !5
  %50 = load ptr, ptr %15, align 8, !tbaa !5
  %51 = load i64, ptr %12, align 8, !tbaa !9
  %52 = mul i64 %51, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 4 %50, i64 %52, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %53 = load float, ptr getelementptr inbounds (%struct.quantum_geometric_config_t, ptr @global_config, i32 0, i32 3), align 8, !tbaa !15
  store float %53, ptr %16, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = mul i64 %54, 4
  %56 = call ptr @geometric_allocate(i64 noundef %55)
  store ptr %56, ptr %17, align 8, !tbaa !5
  %57 = load ptr, ptr %17, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %60, label %59

59:                                               ; preds = %46
  store i32 -2, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %173

60:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  store i64 0, ptr %19, align 8, !tbaa !9
  br label %61

61:                                               ; preds = %166, %60
  %62 = load i64, ptr %19, align 8, !tbaa !9
  %63 = load i64, ptr %13, align 8, !tbaa !9
  %64 = icmp ult i64 %62, %63
  br i1 %64, label %66, label %65

65:                                               ; preds = %61
  store i32 2, ptr %18, align 4
  br label %169

66:                                               ; preds = %61
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  %68 = load ptr, ptr %17, align 8, !tbaa !5
  %69 = load ptr, ptr %14, align 8, !tbaa !5
  call void %67(ptr noundef %68, ptr noundef %69)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store float 0.000000e+00, ptr %20, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %70

70:                                               ; preds = %92, %66
  %71 = load i64, ptr %21, align 8, !tbaa !9
  %72 = load i64, ptr %12, align 8, !tbaa !9
  %73 = icmp ult i64 %71, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %70
  store i32 5, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  br label %95

75:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %76 = load ptr, ptr %17, align 8, !tbaa !5
  %77 = load i64, ptr %21, align 8, !tbaa !9
  %78 = getelementptr inbounds float, ptr %76, i64 %77
  %79 = load float, ptr %78, align 4, !tbaa !18
  store float %79, ptr %22, align 4, !tbaa !18
  %80 = load float, ptr %20, align 4, !tbaa !18
  %81 = load float, ptr %22, align 4, !tbaa !18
  %82 = call float @llvm.fabs.f32(float %81)
  %83 = call float @llvm.maxnum.f32(float %80, float %82)
  store float %83, ptr %20, align 4, !tbaa !18
  %84 = load float, ptr %16, align 4, !tbaa !18
  %85 = load float, ptr %22, align 4, !tbaa !18
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = load i64, ptr %21, align 8, !tbaa !9
  %88 = getelementptr inbounds float, ptr %86, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !18
  %90 = fneg float %84
  %91 = call float @llvm.fmuladd.f32(float %90, float %85, float %89)
  store float %91, ptr %88, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %92

92:                                               ; preds = %75
  %93 = load i64, ptr %21, align 8, !tbaa !9
  %94 = add i64 %93, 1
  store i64 %94, ptr %21, align 8, !tbaa !9
  br label %70, !llvm.loop !19

95:                                               ; preds = %74
  %96 = load float, ptr %20, align 4, !tbaa !18
  %97 = load float, ptr getelementptr inbounds (%struct.quantum_geometric_config_t, ptr @global_config, i32 0, i32 4), align 4, !tbaa !21
  %98 = fcmp olt float %96, %97
  br i1 %98, label %99, label %101

99:                                               ; preds = %95
  %100 = load ptr, ptr %17, align 8, !tbaa !5
  call void @geometric_free(ptr noundef %100)
  store i32 0, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %163

101:                                              ; preds = %95
  %102 = load i64, ptr %19, align 8, !tbaa !9
  %103 = urem i64 %102, 10
  %104 = icmp eq i64 %103, 0
  br i1 %104, label %105, label %162

105:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  call void %106(ptr noundef %23, ptr noundef %107)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  %108 = load i64, ptr %12, align 8, !tbaa !9
  %109 = mul i64 %108, 4
  %110 = call ptr @geometric_allocate(i64 noundef %109)
  store ptr %110, ptr %24, align 8, !tbaa !5
  %111 = load ptr, ptr %24, align 8, !tbaa !5
  %112 = icmp ne ptr %111, null
  br i1 %112, label %115, label %113

113:                                              ; preds = %105
  %114 = load ptr, ptr %17, align 8, !tbaa !5
  call void @geometric_free(ptr noundef %114)
  store i32 -2, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %159

115:                                              ; preds = %105
  %116 = load ptr, ptr %24, align 8, !tbaa !5
  %117 = load ptr, ptr %14, align 8, !tbaa !5
  %118 = load i64, ptr %12, align 8, !tbaa !9
  %119 = mul i64 %118, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %116, ptr align 4 %117, i64 %119, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  store i64 0, ptr %25, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %138, %115
  %121 = load i64, ptr %25, align 8, !tbaa !9
  %122 = load i64, ptr %12, align 8, !tbaa !9
  %123 = icmp ult i64 %121, %122
  br i1 %123, label %125, label %124

124:                                              ; preds = %120
  store i32 8, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  br label %141

125:                                              ; preds = %120
  %126 = load float, ptr %16, align 4, !tbaa !18
  %127 = fmul float 2.000000e+00, %126
  %128 = load ptr, ptr %17, align 8, !tbaa !5
  %129 = load i64, ptr %25, align 8, !tbaa !9
  %130 = getelementptr inbounds float, ptr %128, i64 %129
  %131 = load float, ptr %130, align 4, !tbaa !18
  %132 = load ptr, ptr %24, align 8, !tbaa !5
  %133 = load i64, ptr %25, align 8, !tbaa !9
  %134 = getelementptr inbounds float, ptr %132, i64 %133
  %135 = load float, ptr %134, align 4, !tbaa !18
  %136 = fneg float %127
  %137 = call float @llvm.fmuladd.f32(float %136, float %131, float %135)
  store float %137, ptr %134, align 4, !tbaa !18
  br label %138

138:                                              ; preds = %125
  %139 = load i64, ptr %25, align 8, !tbaa !9
  %140 = add i64 %139, 1
  store i64 %140, ptr %25, align 8, !tbaa !9
  br label %120, !llvm.loop !22

141:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %142 = load ptr, ptr %9, align 8, !tbaa !5
  %143 = load ptr, ptr %24, align 8, !tbaa !5
  call void %142(ptr noundef %26, ptr noundef %143)
  %144 = load float, ptr %26, align 4, !tbaa !18
  %145 = load float, ptr %23, align 4, !tbaa !18
  %146 = fcmp olt float %144, %145
  br i1 %146, label %147, label %154

147:                                              ; preds = %141
  %148 = load float, ptr %16, align 4, !tbaa !18
  %149 = fmul float %148, 0x3FF19999A0000000
  store float %149, ptr %16, align 4, !tbaa !18
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  %151 = load ptr, ptr %24, align 8, !tbaa !5
  %152 = load i64, ptr %12, align 8, !tbaa !9
  %153 = mul i64 %152, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %150, ptr align 4 %151, i64 %153, i1 false)
  br label %157

154:                                              ; preds = %141
  %155 = load float, ptr %16, align 4, !tbaa !18
  %156 = fmul float %155, 0x3FECCCCCC0000000
  store float %156, ptr %16, align 4, !tbaa !18
  br label %157

157:                                              ; preds = %154, %147
  %158 = load ptr, ptr %24, align 8, !tbaa !5
  call void @geometric_free(ptr noundef %158)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  store i32 0, ptr %18, align 4
  br label %159

159:                                              ; preds = %157, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  %160 = load i32, ptr %18, align 4
  switch i32 %160, label %163 [
    i32 0, label %161
  ]

161:                                              ; preds = %159
  br label %162

162:                                              ; preds = %161, %101
  store i32 0, ptr %18, align 4
  br label %163

163:                                              ; preds = %162, %159, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  %164 = load i32, ptr %18, align 4
  switch i32 %164, label %169 [
    i32 0, label %165
  ]

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165
  %167 = load i64, ptr %19, align 8, !tbaa !9
  %168 = add i64 %167, 1
  store i64 %168, ptr %19, align 8, !tbaa !9
  br label %61, !llvm.loop !23

169:                                              ; preds = %163, %65
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  %170 = load i32, ptr %18, align 4
  switch i32 %170, label %173 [
    i32 2, label %171
  ]

171:                                              ; preds = %169
  %172 = load ptr, ptr %17, align 8, !tbaa !5
  call void @geometric_free(ptr noundef %172)
  store i32 -13, ptr %7, align 4
  store i32 1, ptr %18, align 4
  br label %173

173:                                              ; preds = %171, %169, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %174

174:                                              ; preds = %173, %45, %41, %37, %33, %29
  %175 = load i32, ptr %7, align 4
  ret i32 %175
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.maxnum.f32(float, float) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{i8 0, i8 2}
!14 = !{}
!15 = !{!16, !17, i64 24}
!16 = !{!"quantum_geometric_config_t", !10, i64 0, !10, i64 8, !10, i64 16, !17, i64 24, !17, i64 28, !12, i64 32, !12, i64 33, !6, i64 40}
!17 = !{!"float", !7, i64 0}
!18 = !{!17, !17, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!16, !17, i64 28}
!22 = distinct !{!22, !20}
!23 = distinct !{!23, !20}


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

%struct.quantum_geometric_config_t = type { i64, i64, i64, float, float, i8, i8, ptr }

@global_config = external hidden local_unnamed_addr global %struct.quantum_geometric_config_t, align 8
@is_initialized = external hidden local_unnamed_addr global 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare void @geometric_free(ptr noundef) local_unnamed_addr #1

declare ptr @geometric_allocate(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #2

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @geometric_core_minimize(ptr noundef %0, ptr noundef readonly %1, ptr noundef readonly %2, ptr noundef readonly %3, i64 noundef %4, i64 noundef %5) local_unnamed_addr #4 {
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = insertelement <4 x ptr> poison, ptr %0, i64 0
  %10 = insertelement <4 x ptr> %9, ptr %1, i64 1
  %11 = insertelement <4 x ptr> %10, ptr %2, i64 2
  %12 = insertelement <4 x ptr> %11, ptr %3, i64 3
  %13 = icmp eq <4 x ptr> %12, zeroinitializer
  %14 = bitcast <4 x i1> %13 to i4
  %.not117 = icmp eq i4 %14, 0
  br i1 %.not117, label %15, label %79

15:                                               ; preds = %6
  %16 = load i8, ptr @is_initialized, align 1, !tbaa !5, !range !9, !noundef !10
  %17 = trunc nuw i8 %16 to i1
  br i1 %17, label %18, label %79

18:                                               ; preds = %15
  %19 = shl i64 %4, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %0, ptr nonnull align 4 %3, i64 %19, i1 false)
  %20 = load float, ptr getelementptr inbounds (i8, ptr @global_config, i64 24), align 8, !tbaa !11
  %21 = tail call ptr @geometric_allocate(i64 noundef %19) #6
  %.not = icmp eq ptr %21, null
  br i1 %.not, label %79, label %.preheader

.preheader:                                       ; preds = %18
  %.not81105.not = icmp eq i64 %5, 0
  br i1 %.not81105.not, label %.thread97, label %.lr.ph108

.lr.ph108:                                        ; preds = %.preheader
  %.not109 = icmp eq i64 %4, 0
  %22 = shl i64 %4, 2
  %scevgep113 = getelementptr i8, ptr %21, i64 %22
  %min.iters.check = icmp ult i64 %4, 8
  %n.vec = and i64 %4, -8
  %cmp.n = icmp eq i64 %n.vec, %4
  %xtraiter = and i64 %4, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  %23 = add i64 %4, -1
  br label %24

24:                                               ; preds = %.lr.ph108, %.thread
  %.062107 = phi float [ %20, %.lr.ph108 ], [ %.46687, %.thread ]
  %.069106 = phi i64 [ 0, %.lr.ph108 ], [ %78, %.thread ]
  call void %2(ptr noundef nonnull %21, ptr noundef nonnull %0) #6
  br i1 %.not109, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %25 = fneg float %.062107
  br label %28

._crit_edge:                                      ; preds = %28, %24
  %.068.lcssa = phi float [ 0.000000e+00, %24 ], [ %32, %28 ]
  %26 = load float, ptr getelementptr inbounds (i8, ptr @global_config, i64 28), align 4, !tbaa !16
  %27 = fcmp olt float %.068.lcssa, %26
  br i1 %27, label %.thread89, label %37

28:                                               ; preds = %.lr.ph, %28
  %.067100 = phi i64 [ 0, %.lr.ph ], [ %36, %28 ]
  %.06899 = phi float [ 0.000000e+00, %.lr.ph ], [ %32, %28 ]
  %29 = getelementptr inbounds float, ptr %21, i64 %.067100
  %30 = load float, ptr %29, align 4, !tbaa !17
  %31 = call float @llvm.fabs.f32(float %30)
  %32 = call float @llvm.maxnum.f32(float %.06899, float %31)
  %33 = getelementptr inbounds float, ptr %0, i64 %.067100
  %34 = load float, ptr %33, align 4, !tbaa !17
  %35 = call float @llvm.fmuladd.f32(float %25, float %30, float %34)
  store float %35, ptr %33, align 4, !tbaa !17
  %36 = add nuw i64 %.067100, 1
  %exitcond.not = icmp eq i64 %36, %4
  br i1 %exitcond.not, label %._crit_edge, label %28, !llvm.loop !18

.thread89:                                        ; preds = %._crit_edge
  call void @geometric_free(ptr noundef nonnull %21) #6
  br label %79

37:                                               ; preds = %._crit_edge
  %38 = urem i64 %.069106, 10
  %39 = icmp eq i64 %38, 0
  br i1 %39, label %40, label %.thread

40:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  call void %1(ptr noundef nonnull %7, ptr noundef nonnull %0) #6
  %41 = call ptr @geometric_allocate(i64 noundef %19) #6
  %.not80.not = icmp eq ptr %41, null
  br i1 %.not80.not, label %77, label %42

42:                                               ; preds = %40
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %41, ptr nonnull align 4 %0, i64 %19, i1 false)
  br i1 %.not109, label %._crit_edge104, label %.lr.ph103

.lr.ph103:                                        ; preds = %42
  %43 = fmul float %.062107, -2.000000e+00
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.memcheck

scalar.ph.preheader:                              ; preds = %middle.block, %vector.memcheck, %.lr.ph103
  %.0101.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph103 ], [ %n.vec, %middle.block ]
  br i1 %lcmp.mod.not, label %scalar.ph.prol.loopexit, label %scalar.ph.prol

scalar.ph.prol:                                   ; preds = %scalar.ph.preheader
  %44 = getelementptr inbounds float, ptr %21, i64 %.0101.ph
  %45 = load float, ptr %44, align 4, !tbaa !17
  %46 = getelementptr inbounds float, ptr %41, i64 %.0101.ph
  %47 = load float, ptr %46, align 4, !tbaa !17
  %48 = call float @llvm.fmuladd.f32(float %43, float %45, float %47)
  store float %48, ptr %46, align 4, !tbaa !17
  %49 = or disjoint i64 %.0101.ph, 1
  br label %scalar.ph.prol.loopexit

scalar.ph.prol.loopexit:                          ; preds = %scalar.ph.prol, %scalar.ph.preheader
  %.0101.unr = phi i64 [ %.0101.ph, %scalar.ph.preheader ], [ %49, %scalar.ph.prol ]
  %50 = icmp eq i64 %.0101.ph, %23
  br i1 %50, label %._crit_edge104, label %scalar.ph

vector.memcheck:                                  ; preds = %.lr.ph103
  %scevgep = getelementptr i8, ptr %41, i64 %22
  %bound0 = icmp ult ptr %41, %scevgep113
  %bound1 = icmp ult ptr %21, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %broadcast.splatinsert = insertelement <4 x float> poison, float %43, i64 0
  %broadcast.splat = shufflevector <4 x float> %broadcast.splatinsert, <4 x float> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %51 = getelementptr inbounds float, ptr %21, i64 %index
  %52 = getelementptr inbounds i8, ptr %51, i64 16
  %wide.load = load <4 x float>, ptr %51, align 4, !tbaa !17, !alias.scope !20
  %wide.load114 = load <4 x float>, ptr %52, align 4, !tbaa !17, !alias.scope !20
  %53 = getelementptr inbounds float, ptr %41, i64 %index
  %54 = getelementptr inbounds i8, ptr %53, i64 16
  %wide.load115 = load <4 x float>, ptr %53, align 4, !tbaa !17, !alias.scope !23, !noalias !20
  %wide.load116 = load <4 x float>, ptr %54, align 4, !tbaa !17, !alias.scope !23, !noalias !20
  %55 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %broadcast.splat, <4 x float> %wide.load, <4 x float> %wide.load115)
  %56 = call <4 x float> @llvm.fmuladd.v4f32(<4 x float> %broadcast.splat, <4 x float> %wide.load114, <4 x float> %wide.load116)
  store <4 x float> %55, ptr %53, align 4, !tbaa !17, !alias.scope !23, !noalias !20
  store <4 x float> %56, ptr %54, align 4, !tbaa !17, !alias.scope !23, !noalias !20
  %index.next = add nuw i64 %index, 8
  %57 = icmp eq i64 %index.next, %n.vec
  br i1 %57, label %middle.block, label %vector.body, !llvm.loop !25

middle.block:                                     ; preds = %vector.body
  br i1 %cmp.n, label %._crit_edge104, label %scalar.ph.preheader

._crit_edge104:                                   ; preds = %scalar.ph.prol.loopexit, %scalar.ph, %middle.block, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  call void %1(ptr noundef nonnull %8, ptr noundef nonnull %41) #6
  %58 = load float, ptr %8, align 4, !tbaa !17
  %59 = load float, ptr %7, align 4, !tbaa !17
  %60 = fcmp olt float %58, %59
  br i1 %60, label %73, label %75

scalar.ph:                                        ; preds = %scalar.ph.prol.loopexit, %scalar.ph
  %.0101 = phi i64 [ %72, %scalar.ph ], [ %.0101.unr, %scalar.ph.prol.loopexit ]
  %61 = getelementptr inbounds float, ptr %21, i64 %.0101
  %62 = load float, ptr %61, align 4, !tbaa !17
  %63 = getelementptr inbounds float, ptr %41, i64 %.0101
  %64 = load float, ptr %63, align 4, !tbaa !17
  %65 = call float @llvm.fmuladd.f32(float %43, float %62, float %64)
  store float %65, ptr %63, align 4, !tbaa !17
  %66 = add nuw i64 %.0101, 1
  %67 = getelementptr inbounds float, ptr %21, i64 %66
  %68 = load float, ptr %67, align 4, !tbaa !17
  %69 = getelementptr inbounds float, ptr %41, i64 %66
  %70 = load float, ptr %69, align 4, !tbaa !17
  %71 = call float @llvm.fmuladd.f32(float %43, float %68, float %70)
  store float %71, ptr %69, align 4, !tbaa !17
  %72 = add nuw i64 %.0101, 2
  %exitcond111.not.1 = icmp eq i64 %72, %4
  br i1 %exitcond111.not.1, label %._crit_edge104, label %scalar.ph, !llvm.loop !28

73:                                               ; preds = %._crit_edge104
  %74 = fmul float %.062107, 0x3FF19999A0000000
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %0, ptr nonnull align 4 %41, i64 %19, i1 false)
  br label %.thread93

75:                                               ; preds = %._crit_edge104
  %76 = fmul float %.062107, 0x3FECCCCCC0000000
  br label %.thread93

.thread93:                                        ; preds = %73, %75
  %.163 = phi float [ %74, %73 ], [ %76, %75 ]
  call void @geometric_free(ptr noundef nonnull %41) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %.thread

77:                                               ; preds = %40
  call void @geometric_free(ptr noundef nonnull %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  br label %79

.thread:                                          ; preds = %37, %.thread93
  %.46687 = phi float [ %.163, %.thread93 ], [ %.062107, %37 ]
  %78 = add nuw i64 %.069106, 1
  %exitcond112.not = icmp eq i64 %78, %5
  br i1 %exitcond112.not, label %.thread97, label %24, !llvm.loop !29

.thread97:                                        ; preds = %.thread, %.preheader
  call void @geometric_free(ptr noundef nonnull %21) #6
  br label %79

79:                                               ; preds = %.thread89, %77, %.thread97, %18, %15, %6
  %.6 = phi i32 [ -1, %6 ], [ -4, %15 ], [ -13, %.thread97 ], [ -2, %18 ], [ -2, %77 ], [ 0, %.thread89 ]
  ret i32 %.6
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.maxnum.f32(float, float) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x float> @llvm.fmuladd.v4f32(<4 x float>, <4 x float>, <4 x float>) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !6, i64 0}
!6 = !{!"_Bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!12, !14, i64 24}
!12 = !{!"quantum_geometric_config_t", !13, i64 0, !13, i64 8, !13, i64 16, !14, i64 24, !14, i64 28, !6, i64 32, !6, i64 33, !15, i64 40}
!13 = !{!"long", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!12, !14, i64 28}
!17 = !{!14, !14, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!21}
!21 = distinct !{!21, !22}
!22 = distinct !{!22, !"LVerDomain"}
!23 = !{!24}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !19, !26, !27}
!26 = !{!"llvm.loop.isvectorized", i32 1}
!27 = !{!"llvm.loop.unroll.runtime.disable"}
!28 = distinct !{!28, !19, !26}
!29 = distinct !{!29, !19}


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