; LLVM IR from libprima/prima :: c/tests (data)

; 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.prima_options_t = type { double, double, i32, i32, double, i32, double, ptr, ptr }
%struct.prima_problem_t = type { i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, ptr, i32, double, ptr }
%struct.prima_result_t = type { ptr, double, double, ptr, i32, i32, i8, ptr }

@debug = external dso_local global i32, align 4
@data_ref = external dso_local global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@__const.main.xl = external hidden unnamed_addr constant [2 x double], align 16
@__const.main.xu = external hidden unnamed_addr constant [2 x double], align 16
@__const.main.bineq = external hidden unnamed_addr constant [3 x double], align 16
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.prima_options_t, align 8
  %9 = alloca [2 x double], align 16
  %10 = alloca [2 x double], align 16
  %11 = alloca [2 x double], align 16
  %12 = alloca [6 x double], align 16
  %13 = alloca [3 x double], align 16
  %14 = alloca %struct.prima_problem_t, align 8
  %15 = alloca i32, align 4
  %16 = alloca %struct.prima_result_t, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store ptr @.str, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %20 = icmp sgt i32 %19, 1
  br i1 %20, label %21, label %25

21:                                               ; preds = %2
  %22 = load ptr, ptr %5, align 8, !tbaa !9
  %23 = getelementptr inbounds ptr, ptr %22, i64 1
  %24 = load ptr, ptr %23, align 8, !tbaa !9
  store ptr %24, ptr %6, align 8, !tbaa !9
  br label %25

25:                                               ; preds = %21, %2
  %26 = load ptr, ptr %6, align 8, !tbaa !9
  %27 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %26)
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = icmp sgt i32 %28, 2
  br i1 %29, label %30, label %37

30:                                               ; preds = %25
  %31 = load ptr, ptr %5, align 8, !tbaa !9
  %32 = getelementptr inbounds ptr, ptr %31, i64 2
  %33 = load ptr, ptr %32, align 8, !tbaa !9
  %34 = call i32 @strcmp(ptr noundef %33, ptr noundef @.str.2) #8
  %35 = icmp eq i32 %34, 0
  %36 = zext i1 %35 to i32
  store i32 %36, ptr @debug, align 4, !tbaa !5
  br label %37

37:                                               ; preds = %30, %25
  %38 = load i32, ptr @debug, align 4, !tbaa !5
  %39 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %38)
  call void @llvm.lifetime.start.p0(i64 64, ptr %8) #7
  %40 = call i32 @prima_init_options(ptr noundef %8)
  %41 = getelementptr inbounds %struct.prima_options_t, ptr %8, i32 0, i32 3
  store i32 2, ptr %41, align 4, !tbaa !11
  %42 = getelementptr inbounds %struct.prima_options_t, ptr %8, i32 0, i32 2
  store i32 1000, ptr %42, align 8, !tbaa !14
  %43 = load ptr, ptr @data_ref, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.prima_options_t, ptr %8, i32 0, i32 7
  store ptr %43, ptr %44, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 16 %9, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %10, ptr align 16 @__const.main.xl, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %11, ptr align 16 @__const.main.xu, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr %12) #7
  call void @llvm.memset.p0.i64(ptr align 16 %12, i8 0, i64 48, i1 false)
  %45 = getelementptr inbounds [6 x double], ptr %12, i32 0, i32 0
  store double 1.000000e+00, ptr %45, align 16
  %46 = getelementptr inbounds [6 x double], ptr %12, i32 0, i32 3
  store double 1.000000e+00, ptr %46, align 8
  %47 = getelementptr inbounds [6 x double], ptr %12, i32 0, i32 4
  store double 1.000000e+00, ptr %47, align 16
  %48 = getelementptr inbounds [6 x double], ptr %12, i32 0, i32 5
  store double 1.000000e+00, ptr %48, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %13, ptr align 16 @__const.main.bineq, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 120, ptr %14) #7
  %49 = call i32 @prima_init_problem(ptr noundef %14, i32 noundef 2)
  %50 = getelementptr inbounds [2 x double], ptr %9, i64 0, i64 0
  %51 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 3
  store ptr %50, ptr %51, align 8, !tbaa !16
  %52 = load ptr, ptr %6, align 8, !tbaa !9
  %53 = call i32 @strcmp(ptr noundef %52, ptr noundef @.str) #8
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %57

55:                                               ; preds = %37
  store i32 0, ptr %7, align 4, !tbaa !5
  %56 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 1
  store ptr @fun, ptr %56, align 8, !tbaa !18
  br label %111

57:                                               ; preds = %37
  %58 = load ptr, ptr %6, align 8, !tbaa !9
  %59 = call i32 @strcmp(ptr noundef %58, ptr noundef @.str.4) #8
  %60 = icmp eq i32 %59, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  store i32 1, ptr %7, align 4, !tbaa !5
  %62 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 1
  store ptr @fun, ptr %62, align 8, !tbaa !18
  br label %110

63:                                               ; preds = %57
  %64 = load ptr, ptr %6, align 8, !tbaa !9
  %65 = call i32 @strcmp(ptr noundef %64, ptr noundef @.str.5) #8
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %67, label %73

67:                                               ; preds = %63
  store i32 2, ptr %7, align 4, !tbaa !5
  %68 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 1
  store ptr @fun, ptr %68, align 8, !tbaa !18
  %69 = getelementptr inbounds [2 x double], ptr %10, i64 0, i64 0
  %70 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 4
  store ptr %69, ptr %70, align 8, !tbaa !19
  %71 = getelementptr inbounds [2 x double], ptr %11, i64 0, i64 0
  %72 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 5
  store ptr %71, ptr %72, align 8, !tbaa !20
  br label %109

73:                                               ; preds = %63
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = call i32 @strcmp(ptr noundef %74, ptr noundef @.str.6) #8
  %76 = icmp eq i32 %75, 0
  br i1 %76, label %77, label %88

77:                                               ; preds = %73
  store i32 3, ptr %7, align 4, !tbaa !5
  %78 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 1
  store ptr @fun, ptr %78, align 8, !tbaa !18
  %79 = getelementptr inbounds [2 x double], ptr %10, i64 0, i64 0
  %80 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 4
  store ptr %79, ptr %80, align 8, !tbaa !19
  %81 = getelementptr inbounds [2 x double], ptr %11, i64 0, i64 0
  %82 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 5
  store ptr %81, ptr %82, align 8, !tbaa !20
  %83 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 6
  store i32 3, ptr %83, align 8, !tbaa !21
  %84 = getelementptr inbounds [6 x double], ptr %12, i64 0, i64 0
  %85 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 7
  store ptr %84, ptr %85, align 8, !tbaa !22
  %86 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %87 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 8
  store ptr %86, ptr %87, align 8, !tbaa !23
  br label %108

88:                                               ; preds = %73
  %89 = load ptr, ptr %6, align 8, !tbaa !9
  %90 = call i32 @strcmp(ptr noundef %89, ptr noundef @.str.7) #8
  %91 = icmp eq i32 %90, 0
  br i1 %91, label %92, label %104

92:                                               ; preds = %88
  store i32 4, ptr %7, align 4, !tbaa !5
  %93 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 12
  store i32 1, ptr %93, align 8, !tbaa !24
  %94 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 2
  store ptr @fun_con, ptr %94, align 8, !tbaa !25
  %95 = getelementptr inbounds [2 x double], ptr %10, i64 0, i64 0
  %96 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 4
  store ptr %95, ptr %96, align 8, !tbaa !19
  %97 = getelementptr inbounds [2 x double], ptr %11, i64 0, i64 0
  %98 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 5
  store ptr %97, ptr %98, align 8, !tbaa !20
  %99 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 6
  store i32 3, ptr %99, align 8, !tbaa !21
  %100 = getelementptr inbounds [6 x double], ptr %12, i64 0, i64 0
  %101 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 7
  store ptr %100, ptr %101, align 8, !tbaa !22
  %102 = getelementptr inbounds [3 x double], ptr %13, i64 0, i64 0
  %103 = getelementptr inbounds %struct.prima_problem_t, ptr %14, i32 0, i32 8
  store ptr %102, ptr %103, align 8, !tbaa !23
  br label %107

104:                                              ; preds = %88
  %105 = load ptr, ptr %6, align 8, !tbaa !9
  %106 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, ptr noundef %105)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %15, align 4
  br label %155

107:                                              ; preds = %92
  br label %108

108:                                              ; preds = %107, %77
  br label %109

109:                                              ; preds = %108, %67
  br label %110

110:                                              ; preds = %109, %61
  br label %111

111:                                              ; preds = %110, %55
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = call i32 @prima_minimize(i32 noundef %112, ptr noundef byval(%struct.prima_problem_t) align 8 %14, ptr noundef byval(%struct.prima_options_t) align 8 %8, ptr noundef %16)
  store i32 %113, ptr %17, align 4, !tbaa !5
  %114 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 1
  %115 = load double, ptr %114, align 8, !tbaa !26
  %116 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 2
  %117 = load double, ptr %116, align 8, !tbaa !29
  %118 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 3
  %119 = load ptr, ptr %118, align 8, !tbaa !30
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %126

121:                                              ; preds = %111
  %122 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 3
  %123 = load ptr, ptr %122, align 8, !tbaa !30
  %124 = getelementptr inbounds double, ptr %123, i64 0
  %125 = load double, ptr %124, align 8, !tbaa !31
  br label %127

126:                                              ; preds = %111
  br label %127

127:                                              ; preds = %126, %121
  %128 = phi double [ %125, %121 ], [ 0.000000e+00, %126 ]
  %129 = load i32, ptr %17, align 4, !tbaa !5
  %130 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 7
  %131 = load ptr, ptr %130, align 8, !tbaa !32
  %132 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 4
  %133 = load i32, ptr %132, align 8, !tbaa !33
  %134 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, double noundef %115, double noundef %117, double noundef %128, i32 noundef %129, ptr noundef %131, i32 noundef %133)
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %135 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 0
  %136 = load ptr, ptr %135, align 8, !tbaa !34
  %137 = getelementptr inbounds double, ptr %136, i64 0
  %138 = load double, ptr %137, align 8, !tbaa !31
  %139 = fsub double %138, 3.000000e+00
  %140 = call double @llvm.fabs.f64(double %139)
  %141 = fcmp ogt double %140, 2.000000e-02
  br i1 %141, label %150, label %142

142:                                              ; preds = %127
  %143 = getelementptr inbounds %struct.prima_result_t, ptr %16, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !34
  %145 = getelementptr inbounds double, ptr %144, i64 1
  %146 = load double, ptr %145, align 8, !tbaa !31
  %147 = fsub double %146, 2.000000e+00
  %148 = call double @llvm.fabs.f64(double %147)
  %149 = fcmp ogt double %148, 2.000000e-02
  br label %150

150:                                              ; preds = %142, %127
  %151 = phi i1 [ true, %127 ], [ %149, %142 ]
  %152 = zext i1 %151 to i32
  store i32 %152, ptr %18, align 4, !tbaa !5
  %153 = call i32 @prima_free_result(ptr noundef %16)
  %154 = load i32, ptr %18, align 4, !tbaa !5
  store i32 %154, ptr %3, align 4
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #7
  br label %155

155:                                              ; preds = %150, %104
  call void @llvm.lifetime.end.p0(i64 120, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 64, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %156 = load i32, ptr %3, align 4
  ret i32 %156
}

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #3

declare i32 @prima_init_options(ptr noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

; 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) #5

declare i32 @prima_init_problem(ptr noundef, i32 noundef) #2

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

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

declare i32 @prima_minimize(i32 noundef, ptr noundef byval(%struct.prima_problem_t) align 8, ptr noundef byval(%struct.prima_options_t) align 8, ptr noundef) #2

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

declare i32 @prima_free_result(ptr noundef) #2

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

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 = { "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 willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 20}
!12 = !{!"", !13, i64 0, !13, i64 8, !6, i64 16, !6, i64 20, !13, i64 24, !6, i64 32, !13, i64 40, !10, i64 48, !10, i64 56}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{!12, !10, i64 48}
!16 = !{!17, !10, i64 24}
!17 = !{!"", !6, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !10, i64 56, !10, i64 64, !6, i64 72, !10, i64 80, !10, i64 88, !6, i64 96, !13, i64 104, !10, i64 112}
!18 = !{!17, !10, i64 8}
!19 = !{!17, !10, i64 32}
!20 = !{!17, !10, i64 40}
!21 = !{!17, !6, i64 48}
!22 = !{!17, !10, i64 56}
!23 = !{!17, !10, i64 64}
!24 = !{!17, !6, i64 96}
!25 = !{!17, !10, i64 16}
!26 = !{!27, !13, i64 8}
!27 = !{!"", !10, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !6, i64 32, !6, i64 36, !28, i64 40, !10, i64 48}
!28 = !{!"_Bool", !7, i64 0}
!29 = !{!27, !13, i64 16}
!30 = !{!27, !10, i64 24}
!31 = !{!13, !13, i64 0}
!32 = !{!27, !10, i64 48}
!33 = !{!27, !6, i64 32}
!34 = !{!27, !10, 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.prima_options_t = type { double, double, i32, i32, double, i32, double, ptr, ptr }
%struct.prima_problem_t = type { i32, ptr, ptr, ptr, ptr, ptr, i32, ptr, ptr, i32, ptr, ptr, i32, double, ptr }
%struct.prima_result_t = type { ptr, double, double, ptr, i32, i32, i8, ptr }

@debug = external dso_local local_unnamed_addr global i32, align 4
@data_ref = external dso_local local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@__const.main.xl = external hidden unnamed_addr constant [2 x double], align 16
@__const.main.xu = external hidden unnamed_addr constant [2 x double], align 16
@__const.main.bineq = external hidden unnamed_addr constant [3 x double], align 16
@.str.4 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [71 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca %struct.prima_options_t, align 8
  %4 = alloca [2 x double], align 16
  %5 = alloca [2 x double], align 16
  %6 = alloca [2 x double], align 16
  %7 = alloca [6 x double], align 16
  %8 = alloca [3 x double], align 16
  %9 = alloca %struct.prima_problem_t, align 8
  %10 = alloca %struct.prima_result_t, align 8
  %11 = icmp sgt i32 %0, 1
  %.sink22.sroa.gep = getelementptr inbounds i8, ptr %9, i64 56
  %.sink22.sroa.gep23 = getelementptr inbounds i8, ptr %9, i64 56
  %.sink22.sroa.gep24 = getelementptr inbounds i8, ptr %9, i64 32
  br i1 %11, label %13, label %.thread

.thread:                                          ; preds = %2
  %12 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str)
  br label %23

13:                                               ; preds = %2
  %14 = getelementptr inbounds i8, ptr %1, i64 8
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %15)
  %.not19 = icmp eq i32 %0, 2
  br i1 %.not19, label %23, label %17

17:                                               ; preds = %13
  %18 = getelementptr inbounds i8, ptr %1, i64 16
  %19 = load ptr, ptr %18, align 8, !tbaa !5
  %20 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %19, ptr noundef nonnull dereferenceable(1) @.str.2) #8
  %21 = icmp eq i32 %20, 0
  %22 = zext i1 %21 to i32
  store i32 %22, ptr @debug, align 4, !tbaa !9
  br label %23

23:                                               ; preds = %.thread, %17, %13
  %.01418 = phi ptr [ @.str, %.thread ], [ %15, %17 ], [ %15, %13 ]
  %24 = load i32, ptr @debug, align 4, !tbaa !9
  %25 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %24)
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %3) #9
  %26 = call i32 @prima_init_options(ptr noundef nonnull %3) #9
  %27 = getelementptr inbounds i8, ptr %3, i64 20
  store i32 2, ptr %27, align 4, !tbaa !11
  %28 = getelementptr inbounds i8, ptr %3, i64 16
  store i32 1000, ptr %28, align 8, !tbaa !14
  %29 = load ptr, ptr @data_ref, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %3, i64 48
  store ptr %29, ptr %30, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %4, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %5, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.xl, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %6, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.xu, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(48) %7, i8 0, i64 32, i1 false)
  store double 1.000000e+00, ptr %7, align 16
  %31 = getelementptr inbounds i8, ptr %7, i64 24
  store <2 x double> <double 1.000000e+00, double 1.000000e+00>, ptr %31, align 8
  %32 = getelementptr inbounds i8, ptr %7, i64 40
  store double 1.000000e+00, ptr %32, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #9
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(24) %8, ptr noundef nonnull align 16 dereferenceable(24) @__const.main.bineq, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 120, ptr nonnull %9) #9
  %33 = call i32 @prima_init_problem(ptr noundef nonnull %9, i32 noundef 2) #9
  %34 = getelementptr inbounds i8, ptr %9, i64 24
  store ptr %4, ptr %34, align 8, !tbaa !16
  %35 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.01418, ptr noundef nonnull dereferenceable(1) @.str) #8
  %36 = icmp eq i32 %35, 0
  br i1 %36, label %64, label %37

37:                                               ; preds = %23
  %38 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.01418, ptr noundef nonnull dereferenceable(1) @.str.4) #8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %64, label %40

40:                                               ; preds = %37
  %41 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.01418, ptr noundef nonnull dereferenceable(1) @.str.5) #8
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %45

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr @fun, ptr %44, align 8, !tbaa !18
  br label %.sink.split

45:                                               ; preds = %40
  %46 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.01418, ptr noundef nonnull dereferenceable(1) @.str.6) #8
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %53

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %9, i64 8
  store ptr @fun, ptr %49, align 8, !tbaa !18
  %50 = getelementptr inbounds i8, ptr %9, i64 32
  store ptr %5, ptr %50, align 8, !tbaa !19
  %51 = getelementptr inbounds i8, ptr %9, i64 40
  store ptr %6, ptr %51, align 8, !tbaa !20
  %52 = getelementptr inbounds i8, ptr %9, i64 48
  store i32 3, ptr %52, align 8, !tbaa !21
  br label %.sink.split

53:                                               ; preds = %45
  %54 = call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %.01418, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %62

56:                                               ; preds = %53
  %57 = getelementptr inbounds i8, ptr %9, i64 96
  store i32 1, ptr %57, align 8, !tbaa !22
  %58 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr @fun_con, ptr %58, align 8, !tbaa !23
  %59 = getelementptr inbounds i8, ptr %9, i64 32
  store ptr %5, ptr %59, align 8, !tbaa !19
  %60 = getelementptr inbounds i8, ptr %9, i64 40
  store ptr %6, ptr %60, align 8, !tbaa !20
  %61 = getelementptr inbounds i8, ptr %9, i64 48
  store i32 3, ptr %61, align 8, !tbaa !21
  br label %.sink.split

62:                                               ; preds = %53
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, ptr noundef %.01418)
  br label %97

.sink.split:                                      ; preds = %43, %56, %48
  %.sink22.sroa.phi = phi ptr [ %.sink22.sroa.gep, %48 ], [ %.sink22.sroa.gep23, %56 ], [ %.sink22.sroa.gep24, %43 ]
  %.sink = phi ptr [ %7, %48 ], [ %7, %56 ], [ %5, %43 ]
  %.sink20.ph = phi i64 [ 64, %48 ], [ 64, %56 ], [ 40, %43 ]
  %fun.sink.ph = phi ptr [ %8, %48 ], [ %8, %56 ], [ %6, %43 ]
  %.015.ph = phi i32 [ 3, %48 ], [ 4, %56 ], [ 2, %43 ]
  store ptr %.sink, ptr %.sink22.sroa.phi, align 8, !tbaa !5
  br label %64

64:                                               ; preds = %.sink.split, %37, %23
  %.sink20 = phi i64 [ 8, %23 ], [ 8, %37 ], [ %.sink20.ph, %.sink.split ]
  %fun.sink = phi ptr [ @fun, %23 ], [ @fun, %37 ], [ %fun.sink.ph, %.sink.split ]
  %.015 = phi i32 [ 0, %23 ], [ 1, %37 ], [ %.015.ph, %.sink.split ]
  %65 = getelementptr inbounds i8, ptr %9, i64 %.sink20
  store ptr %fun.sink, ptr %65, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %10) #9
  %66 = call i32 @prima_minimize(i32 noundef %.015, ptr noundef nonnull byval(%struct.prima_problem_t) align 8 %9, ptr noundef nonnull byval(%struct.prima_options_t) align 8 %3, ptr noundef nonnull %10) #9
  %67 = getelementptr inbounds i8, ptr %10, i64 8
  %68 = load double, ptr %67, align 8, !tbaa !24
  %69 = getelementptr inbounds i8, ptr %10, i64 16
  %70 = load double, ptr %69, align 8, !tbaa !27
  %71 = getelementptr inbounds i8, ptr %10, i64 24
  %72 = load ptr, ptr %71, align 8, !tbaa !28
  %.not = icmp eq ptr %72, null
  br i1 %.not, label %75, label %73

73:                                               ; preds = %64
  %74 = load double, ptr %72, align 8, !tbaa !29
  br label %75

75:                                               ; preds = %64, %73
  %76 = phi double [ %74, %73 ], [ 0.000000e+00, %64 ]
  %77 = getelementptr inbounds i8, ptr %10, i64 48
  %78 = load ptr, ptr %77, align 8, !tbaa !30
  %79 = getelementptr inbounds i8, ptr %10, i64 32
  %80 = load i32, ptr %79, align 8, !tbaa !31
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, double noundef %68, double noundef %70, double noundef %76, i32 noundef %66, ptr noundef %78, i32 noundef %80)
  %82 = load ptr, ptr %10, align 8, !tbaa !32
  %83 = load double, ptr %82, align 8, !tbaa !29
  %84 = fadd double %83, -3.000000e+00
  %85 = call double @llvm.fabs.f64(double %84)
  %86 = fcmp ogt double %85, 2.000000e-02
  br i1 %86, label %94, label %87

87:                                               ; preds = %75
  %88 = getelementptr inbounds i8, ptr %82, i64 8
  %89 = load double, ptr %88, align 8, !tbaa !29
  %90 = fadd double %89, -2.000000e+00
  %91 = call double @llvm.fabs.f64(double %90)
  %92 = fcmp ogt double %91, 2.000000e-02
  %93 = zext i1 %92 to i32
  br label %94

94:                                               ; preds = %87, %75
  %95 = phi i32 [ 1, %75 ], [ %93, %87 ]
  %96 = call i32 @prima_free_result(ptr noundef nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %10) #9
  br label %97

97:                                               ; preds = %94, %62
  %.0 = phi i32 [ %95, %94 ], [ 1, %62 ]
  call void @llvm.lifetime.end.p0(i64 120, ptr nonnull %9) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %3) #9
  ret i32 %.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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #3

declare i32 @prima_init_options(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; 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) #6

declare i32 @prima_init_problem(ptr noundef, i32 noundef) local_unnamed_addr #4

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

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

declare i32 @prima_minimize(i32 noundef, ptr noundef byval(%struct.prima_problem_t) align 8, ptr noundef byval(%struct.prima_options_t) align 8, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #7

declare i32 @prima_free_result(ptr noundef) local_unnamed_addr #4

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

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 = { 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 #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 20}
!12 = !{!"", !13, i64 0, !13, i64 8, !10, i64 16, !10, i64 20, !13, i64 24, !10, i64 32, !13, i64 40, !6, i64 48, !6, i64 56}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !6, i64 48}
!16 = !{!17, !6, i64 24}
!17 = !{!"", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !6, i64 56, !6, i64 64, !10, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !13, i64 104, !6, i64 112}
!18 = !{!17, !6, i64 8}
!19 = !{!17, !6, i64 32}
!20 = !{!17, !6, i64 40}
!21 = !{!17, !10, i64 48}
!22 = !{!17, !10, i64 96}
!23 = !{!17, !6, i64 16}
!24 = !{!25, !13, i64 8}
!25 = !{!"", !6, i64 0, !13, i64 8, !13, i64 16, !6, i64 24, !10, i64 32, !10, i64 36, !26, i64 40, !6, i64 48}
!26 = !{!"_Bool", !7, i64 0}
!27 = !{!25, !13, i64 16}
!28 = !{!25, !6, i64 24}
!29 = !{!13, !13, i64 0}
!30 = !{!25, !6, i64 48}
!31 = !{!25, !10, i64 32}
!32 = !{!25, !6, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,PostOrderFunctionAttrsPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass