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

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

@lapack_state = external hidden global %struct.anon, align 8

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @initialize_lapack() #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

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

; Function Attrs: nounwind uwtable
declare hidden void @convert_layout(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef) #0

; 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
declare hidden zeroext i1 @is_hermitian(ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @is_positive_definite(ptr noundef, i64 noundef) #0

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @lapack_solve_symmetric(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4, i1 noundef zeroext %5, i32 noundef %6) #0 {
  %8 = alloca i1, align 1
  %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 i8, align 1
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca ptr, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store i64 %3, ptr %12, align 8, !tbaa !9
  store i64 %4, ptr %13, align 8, !tbaa !9
  %26 = zext i1 %5 to i8
  store i8 %26, ptr %14, align 1, !tbaa !11
  store i32 %6, ptr %15, align 4, !tbaa !13
  %27 = call zeroext i1 @initialize_lapack()
  br i1 %27, label %28, label %43

28:                                               ; preds = %7
  %29 = load ptr, ptr %9, align 8, !tbaa !5
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %43

31:                                               ; preds = %28
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %34, label %43

34:                                               ; preds = %31
  %35 = load ptr, ptr %11, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %37, label %43

37:                                               ; preds = %34
  %38 = load i64, ptr %12, align 8, !tbaa !9
  %39 = icmp eq i64 %38, 0
  br i1 %39, label %43, label %40

40:                                               ; preds = %37
  %41 = load i64, ptr %13, align 8, !tbaa !9
  %42 = icmp eq i64 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %40, %37, %34, %31, %28, %7
  store i32 -1, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  br label %133

44:                                               ; preds = %40
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i64, ptr %12, align 8, !tbaa !9
  %47 = call zeroext i1 @is_hermitian(ptr noundef %45, i64 noundef %46)
  br i1 %47, label %49, label %48

48:                                               ; preds = %44
  store i32 -1, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  br label %133

49:                                               ; preds = %44
  %50 = load i8, ptr %14, align 1, !tbaa !11, !range !17, !noundef !18
  %51 = trunc i8 %50 to i1
  br i1 %51, label %52, label %57

52:                                               ; preds = %49
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  %54 = load i64, ptr %12, align 8, !tbaa !9
  %55 = call zeroext i1 @is_positive_definite(ptr noundef %53, i64 noundef %54)
  br i1 %55, label %57, label %56

56:                                               ; preds = %52
  store i32 -1, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  br label %133

57:                                               ; preds = %52, %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %58 = load i64, ptr %12, align 8, !tbaa !9
  %59 = load i64, ptr %12, align 8, !tbaa !9
  %60 = mul i64 %58, %59
  %61 = mul i64 %60, 8
  %62 = call noalias ptr @malloc(i64 noundef %61) #6
  store ptr %62, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %63 = load i64, ptr %12, align 8, !tbaa !9
  %64 = load i64, ptr %13, align 8, !tbaa !9
  %65 = mul i64 %63, %64
  %66 = mul i64 %65, 8
  %67 = call noalias ptr @malloc(i64 noundef %66) #6
  store ptr %67, ptr %17, align 8, !tbaa !5
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = icmp ne ptr %68, null
  br i1 %69, label %70, label %73

70:                                               ; preds = %57
  %71 = load ptr, ptr %17, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %76, label %73

73:                                               ; preds = %70, %57
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %74) #5
  %75 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %75) #5
  store i32 -2, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  store i32 1, ptr %18, align 4
  br label %132

76:                                               ; preds = %70
  %77 = load ptr, ptr %16, align 8, !tbaa !5
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = load i64, ptr %12, align 8, !tbaa !9
  %80 = load i64, ptr %12, align 8, !tbaa !9
  %81 = load i32, ptr %15, align 4, !tbaa !13
  call void @convert_layout(ptr noundef %77, ptr noundef %78, i64 noundef %79, i64 noundef %80, i32 noundef %81, i32 noundef 102)
  %82 = load ptr, ptr %17, align 8, !tbaa !5
  %83 = load ptr, ptr %10, align 8, !tbaa !5
  %84 = load i64, ptr %12, align 8, !tbaa !9
  %85 = load i64, ptr %13, align 8, !tbaa !9
  %86 = load i32, ptr %15, align 4, !tbaa !13
  call void @convert_layout(ptr noundef %82, ptr noundef %83, i64 noundef %84, i64 noundef %85, i32 noundef %86, i32 noundef 102)
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #5
  store i8 85, ptr %19, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %87 = load i64, ptr %12, align 8, !tbaa !9
  %88 = trunc i64 %87 to i32
  store i32 %88, ptr %20, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %89 = load i64, ptr %13, align 8, !tbaa !9
  %90 = trunc i64 %89 to i32
  store i32 %90, ptr %21, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %91 = load i32, ptr %20, align 4, !tbaa !13
  store i32 %91, ptr %22, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %92 = load i32, ptr %20, align 4, !tbaa !13
  store i32 %92, ptr %23, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %93 = load i8, ptr %14, align 1, !tbaa !11, !range !17, !noundef !18
  %94 = trunc i8 %93 to i1
  br i1 %94, label %95, label %98

95:                                               ; preds = %76
  %96 = load ptr, ptr %16, align 8, !tbaa !5
  %97 = load ptr, ptr %17, align 8, !tbaa !5
  call void @cposv_(ptr noundef %19, ptr noundef %20, ptr noundef %21, ptr noundef %96, ptr noundef %22, ptr noundef %97, ptr noundef %23, ptr noundef %24)
  br label %115

98:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %99 = load i64, ptr %12, align 8, !tbaa !9
  %100 = mul i64 %99, 4
  %101 = call noalias ptr @malloc(i64 noundef %100) #6
  store ptr %101, ptr %25, align 8, !tbaa !5
  %102 = load ptr, ptr %25, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %107, label %104

104:                                              ; preds = %98
  %105 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %105) #5
  %106 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %106) #5
  store i32 -2, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  store i32 1, ptr %18, align 4
  br label %112

107:                                              ; preds = %98
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = load ptr, ptr %25, align 8, !tbaa !5
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  call void @cgesv_(ptr noundef %20, ptr noundef %21, ptr noundef %108, ptr noundef %22, ptr noundef %109, ptr noundef %110, ptr noundef %23, ptr noundef %24)
  %111 = load ptr, ptr %25, align 8, !tbaa !5
  call void @free(ptr noundef %111) #5
  store i32 0, ptr %18, align 4
  br label %112

112:                                              ; preds = %107, %104
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  %113 = load i32, ptr %18, align 4
  switch i32 %113, label %131 [
    i32 0, label %114
  ]

114:                                              ; preds = %112
  br label %115

115:                                              ; preds = %114, %95
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = load ptr, ptr %17, align 8, !tbaa !5
  %118 = load i64, ptr %12, align 8, !tbaa !9
  %119 = load i64, ptr %13, align 8, !tbaa !9
  %120 = load i32, ptr %15, align 4, !tbaa !13
  call void @convert_layout(ptr noundef %116, ptr noundef %117, i64 noundef %118, i64 noundef %119, i32 noundef 102, i32 noundef %120)
  %121 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %121) #5
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %122) #5
  %123 = load i32, ptr %24, align 4, !tbaa !13
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %130

125:                                              ; preds = %115
  %126 = load i32, ptr %24, align 4, !tbaa !13
  %127 = icmp sgt i32 %126, 0
  %128 = zext i1 %127 to i64
  %129 = select i1 %127, i32 -3, i32 -1
  store i32 %129, ptr @lapack_state, align 8, !tbaa !15
  store i1 false, ptr %8, align 1
  store i32 1, ptr %18, align 4
  br label %131

130:                                              ; preds = %115
  store i32 0, ptr @lapack_state, align 8, !tbaa !15
  store i1 true, ptr %8, align 1
  store i32 1, ptr %18, align 4
  br label %131

131:                                              ; preds = %130, %125, %112
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #5
  br label %132

132:                                              ; preds = %131, %73
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  br label %133

133:                                              ; preds = %132, %56, %48, %43
  %134 = load i1, ptr %8, align 1
  ret i1 %134
}

declare void @cposv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #4

declare void @cgesv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #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 = { 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 = { 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 = { "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) }

!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 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 0}
!16 = !{!"", !14, i64 0, !12, i64 4, !10, i64 8, !6, i64 16}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!7, !7, i64 0}


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

@lapack_state = external hidden local_unnamed_addr global %struct.anon, align 8

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @initialize_lapack() local_unnamed_addr #0

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 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
declare hidden void @convert_layout(ptr noundef, ptr noundef, i64 noundef, i64 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @is_hermitian(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @is_positive_definite(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @lapack_solve_symmetric(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4, i1 noundef zeroext %5, i32 noundef %6) local_unnamed_addr #0 {
  %8 = alloca i8, align 1
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = tail call zeroext i1 @initialize_lapack()
  %15 = icmp ne ptr %0, null
  %or.cond = and i1 %15, %14
  %16 = icmp ne ptr %1, null
  %or.cond3 = and i1 %16, %or.cond
  %17 = icmp ne ptr %2, null
  %or.cond5 = and i1 %17, %or.cond3
  %or.cond5.not = xor i1 %or.cond5, true
  %18 = icmp eq i64 %3, 0
  %or.cond7 = or i1 %18, %or.cond5.not
  %19 = icmp eq i64 %4, 0
  %or.cond9 = or i1 %19, %or.cond7
  br i1 %or.cond9, label %20, label %21

20:                                               ; preds = %7
  store i32 -1, ptr @lapack_state, align 8, !tbaa !5
  br label %51

21:                                               ; preds = %7
  %22 = tail call zeroext i1 @is_hermitian(ptr noundef %0, i64 noundef %3)
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  store i32 -1, ptr @lapack_state, align 8, !tbaa !5
  br label %51

24:                                               ; preds = %21
  br i1 %5, label %25, label %28

25:                                               ; preds = %24
  %26 = tail call zeroext i1 @is_positive_definite(ptr noundef %0, i64 noundef %3)
  br i1 %26, label %28, label %27

27:                                               ; preds = %25
  store i32 -1, ptr @lapack_state, align 8, !tbaa !5
  br label %51

28:                                               ; preds = %25, %24
  %29 = shl i64 %3, 3
  %30 = mul i64 %29, %3
  %31 = tail call noalias ptr @malloc(i64 noundef %30) #5
  %32 = mul i64 %29, %4
  %33 = tail call noalias ptr @malloc(i64 noundef %32) #5
  %34 = icmp ne ptr %31, null
  %35 = icmp ne ptr %33, null
  %or.cond11 = and i1 %34, %35
  br i1 %or.cond11, label %37, label %36

36:                                               ; preds = %28
  tail call void @free(ptr noundef %31) #6
  tail call void @free(ptr noundef %33) #6
  store i32 -2, ptr @lapack_state, align 8, !tbaa !5
  br label %51

37:                                               ; preds = %28
  tail call void @convert_layout(ptr noundef nonnull %31, ptr noundef %0, i64 noundef %3, i64 noundef %3, i32 noundef %6, i32 noundef 102)
  tail call void @convert_layout(ptr noundef nonnull %33, ptr noundef nonnull %1, i64 noundef %3, i64 noundef %4, i32 noundef %6, i32 noundef 102)
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %8) #6
  store i8 85, ptr %8, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  %38 = trunc i64 %3 to i32
  store i32 %38, ptr %9, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %39 = trunc i64 %4 to i32
  store i32 %39, ptr %10, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 %38, ptr %11, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  store i32 %38, ptr %12, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  br i1 %5, label %40, label %41

40:                                               ; preds = %37
  call void @cposv_(ptr noundef nonnull %8, ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %31, ptr noundef nonnull %11, ptr noundef nonnull %33, ptr noundef nonnull %12, ptr noundef nonnull %13) #6
  br label %45

41:                                               ; preds = %37
  %42 = shl i64 %3, 2
  %43 = tail call noalias ptr @malloc(i64 noundef %42) #5
  %.not.not = icmp eq ptr %43, null
  br i1 %.not.not, label %.thread, label %44

.thread:                                          ; preds = %41
  tail call void @free(ptr noundef nonnull %33) #6
  tail call void @free(ptr noundef nonnull %31) #6
  br label %50

44:                                               ; preds = %41
  call void @cgesv_(ptr noundef nonnull %9, ptr noundef nonnull %10, ptr noundef nonnull %31, ptr noundef nonnull %11, ptr noundef nonnull %43, ptr noundef nonnull %33, ptr noundef nonnull %12, ptr noundef nonnull %13) #6
  call void @free(ptr noundef nonnull %43) #6
  br label %45

45:                                               ; preds = %44, %40
  call void @convert_layout(ptr noundef nonnull %2, ptr noundef nonnull %33, i64 noundef %3, i64 noundef %4, i32 noundef 102, i32 noundef %6)
  call void @free(ptr noundef nonnull %33) #6
  call void @free(ptr noundef nonnull %31) #6
  %46 = load i32, ptr %13, align 4, !tbaa !14
  %.not = icmp eq i32 %46, 0
  br i1 %.not, label %50, label %47

47:                                               ; preds = %45
  %48 = icmp sgt i32 %46, 0
  %49 = select i1 %48, i32 -3, i32 -1
  br label %50

50:                                               ; preds = %45, %.thread, %47
  %.sink = phi i32 [ -2, %.thread ], [ %49, %47 ], [ 0, %45 ]
  %.1 = phi i1 [ false, %.thread ], [ false, %47 ], [ true, %45 ]
  store i32 %.sink, ptr @lapack_state, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %8) #6
  br label %51

51:                                               ; preds = %36, %50, %27, %23, %20
  %.3 = phi i1 [ false, %20 ], [ false, %27 ], [ false, %23 ], [ %.1, %50 ], [ false, %36 ]
  ret i1 %.3
}

declare void @cposv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

declare void @cgesv_(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #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 = { "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 allocsize(0) }
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, !7, i64 0}
!6 = !{!"", !7, i64 0, !10, i64 4, !11, i64 8, !12, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"_Bool", !8, i64 0}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!8, !8, i64 0}
!14 = !{!7, !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass