; LLVM IR from jgaeddert/liquid-dsp :: sandbox (iirdes_gradsearch_test)

; 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.gs_s = type { i32, i32, i32, i32, i32, ptr, ptr, float, float, float, ptr, ptr, i32, ptr, float, float, float }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [24 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #1 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i64, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca float, align 4
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %12 = call i64 @time(ptr noundef null) #6
  %13 = trunc i64 %12 to i32
  call void @srand(i32 noundef %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  %14 = call ptr @gs_create(i32 noundef 2)
  store ptr %14, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.gs_s, ptr %15, i32 0, i32 4
  %17 = load i32, ptr %16, align 8, !tbaa !9
  store i32 %17, ptr %3, align 4, !tbaa !13
  %18 = load i32, ptr %3, align 4, !tbaa !13
  %19 = zext i32 %18 to i64
  %20 = call ptr @llvm.stacksave.p0()
  store ptr %20, ptr %4, align 8
  %21 = alloca float, i64 %19, align 16
  store i64 %19, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %22

22:                                               ; preds = %30, %0
  %23 = load i32, ptr %6, align 4, !tbaa !13
  %24 = load i32, ptr %3, align 4, !tbaa !13
  %25 = icmp ult i32 %23, %24
  br i1 %25, label %26, label %33

26:                                               ; preds = %22
  %27 = load i32, ptr %6, align 4, !tbaa !13
  %28 = zext i32 %27 to i64
  %29 = getelementptr inbounds float, ptr %21, i64 %28
  store float 0.000000e+00, ptr %29, align 4, !tbaa !14
  br label %30

30:                                               ; preds = %26
  %31 = load i32, ptr %6, align 4, !tbaa !13
  %32 = add i32 %31, 1
  store i32 %32, ptr %6, align 4, !tbaa !13
  br label %22, !llvm.loop !15

33:                                               ; preds = %22
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  call void @gs_unpack(ptr noundef %34, ptr noundef %21, i32 noundef 1)
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  call void @gs_expand(ptr noundef %35, i32 noundef 1)
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = call float @gs_evaluate(ptr noundef %36, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 250, ptr %7, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %38 = call noalias ptr @fopen(ptr noundef @.str, ptr noundef @.str.1)
  store ptr %38, ptr %8, align 8, !tbaa !5
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %39, ptr noundef @.str.2, ptr noundef @.str) #6
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef @.str.3) #6
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str.4) #6
  %45 = call i32 (ptr, ...) @printf(ptr noundef @.str.5)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %46 = load ptr, ptr %2, align 8, !tbaa !5
  %47 = load i32, ptr %3, align 4, !tbaa !13
  %48 = call ptr @gradsearch_create(ptr noundef %46, ptr noundef %21, i32 noundef %47, ptr noundef @gs_callback, i32 noundef 0)
  store ptr %48, ptr %9, align 8, !tbaa !5
  %49 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  %50 = load ptr, ptr %8, align 8, !tbaa !5
  %51 = load i32, ptr %7, align 4, !tbaa !13
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef @.str.7, i32 noundef %51) #6
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = load i32, ptr %3, align 4, !tbaa !13
  %55 = load i32, ptr %7, align 4, !tbaa !13
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.8, i32 noundef %54, i32 noundef %55) #6
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %57

57:                                               ; preds = %96, %33
  %58 = load i32, ptr %6, align 4, !tbaa !13
  %59 = load i32, ptr %7, align 4, !tbaa !13
  %60 = icmp ult i32 %58, %59
  br i1 %60, label %61, label %99

61:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = load i32, ptr %3, align 4, !tbaa !13
  %64 = call float @gs_callback(ptr noundef %62, ptr noundef %21, i32 noundef %63)
  store float %64, ptr %10, align 4, !tbaa !14
  %65 = load ptr, ptr %8, align 8, !tbaa !5
  %66 = load i32, ptr %6, align 4, !tbaa !13
  %67 = add i32 %66, 1
  %68 = load float, ptr %10, align 4, !tbaa !14
  %69 = fpext float %68 to double
  %70 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %65, ptr noundef @.str.9, i32 noundef %67, double noundef %69) #6
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = load i32, ptr %6, align 4, !tbaa !13
  %73 = add i32 %72, 1
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %71, ptr noundef @.str.10, i32 noundef %73) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !13
  br label %75

75:                                               ; preds = %87, %61
  %76 = load i32, ptr %11, align 4, !tbaa !13
  %77 = load i32, ptr %3, align 4, !tbaa !13
  %78 = icmp ult i32 %76, %77
  br i1 %78, label %79, label %90

79:                                               ; preds = %75
  %80 = load ptr, ptr %8, align 8, !tbaa !5
  %81 = load i32, ptr %11, align 4, !tbaa !13
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds float, ptr %21, i64 %82
  %84 = load float, ptr %83, align 4, !tbaa !14
  %85 = fpext float %84 to double
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %80, ptr noundef @.str.11, double noundef %85) #6
  br label %87

87:                                               ; preds = %79
  %88 = load i32, ptr %11, align 4, !tbaa !13
  %89 = add i32 %88, 1
  store i32 %89, ptr %11, align 4, !tbaa !13
  br label %75, !llvm.loop !17

90:                                               ; preds = %75
  %91 = load ptr, ptr %8, align 8, !tbaa !5
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %91, ptr noundef @.str.12) #6
  %93 = load ptr, ptr %9, align 8, !tbaa !5
  %94 = call float @gradsearch_step(ptr noundef %93)
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gradsearch_print(ptr noundef %95)
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %96

96:                                               ; preds = %90
  %97 = load i32, ptr %6, align 4, !tbaa !13
  %98 = add i32 %97, 1
  store i32 %98, ptr %6, align 4, !tbaa !13
  br label %57, !llvm.loop !18

99:                                               ; preds = %57
  %100 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %101 = load i32, ptr %7, align 4, !tbaa !13
  %102 = call i32 (ptr, ...) @printf(ptr noundef @.str.14, i32 noundef %101)
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gradsearch_print(ptr noundef %103)
  %104 = load ptr, ptr %8, align 8, !tbaa !5
  %105 = load ptr, ptr %2, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.gs_s, ptr %105, i32 0, i32 12
  %107 = load i32, ptr %106, align 8, !tbaa !19
  %108 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %104, ptr noundef @.str.15, i32 noundef %107) #6
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str.16) #6
  store i32 0, ptr %6, align 4, !tbaa !13
  br label %111

111:                                              ; preds = %130, %99
  %112 = load i32, ptr %6, align 4, !tbaa !13
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.gs_s, ptr %113, i32 0, i32 12
  %115 = load i32, ptr %114, align 8, !tbaa !19
  %116 = icmp ult i32 %112, %115
  br i1 %116, label %117, label %133

117:                                              ; preds = %111
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = load i32, ptr %6, align 4, !tbaa !13
  %120 = add i32 %119, 1
  %121 = load ptr, ptr %2, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.gs_s, ptr %121, i32 0, i32 13
  %123 = load ptr, ptr %122, align 8, !tbaa !20
  %124 = load i32, ptr %6, align 4, !tbaa !13
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds float, ptr %123, i64 %125
  %127 = load float, ptr %126, align 4, !tbaa !14
  %128 = fpext float %127 to double
  %129 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.17, i32 noundef %120, double noundef %128) #6
  br label %130

130:                                              ; preds = %117
  %131 = load i32, ptr %6, align 4, !tbaa !13
  %132 = add i32 %131, 1
  store i32 %132, ptr %6, align 4, !tbaa !13
  br label %111, !llvm.loop !21

133:                                              ; preds = %111
  %134 = load ptr, ptr %8, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.18) #6
  %136 = load ptr, ptr %8, align 8, !tbaa !5
  %137 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %136, ptr noundef @.str.19) #6
  %138 = load ptr, ptr %8, align 8, !tbaa !5
  %139 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %138, ptr noundef @.str.20) #6
  %140 = load ptr, ptr %8, align 8, !tbaa !5
  %141 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %140, ptr noundef @.str.21) #6
  %142 = load ptr, ptr %8, align 8, !tbaa !5
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.22) #6
  %144 = load ptr, ptr %8, align 8, !tbaa !5
  %145 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %144, ptr noundef @.str.23) #6
  %146 = load ptr, ptr %8, align 8, !tbaa !5
  %147 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.18) #6
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %148, ptr noundef @.str.24) #6
  %150 = load ptr, ptr %8, align 8, !tbaa !5
  %151 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %150, ptr noundef @.str.25) #6
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %152, ptr noundef @.str.26) #6
  %154 = load ptr, ptr %8, align 8, !tbaa !5
  %155 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.23) #6
  %156 = load ptr, ptr %8, align 8, !tbaa !5
  %157 = call i32 @fclose(ptr noundef %156)
  %158 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef @.str)
  %159 = load ptr, ptr %2, align 8, !tbaa !5
  call void @gs_print(ptr noundef %159, i32 noundef 1)
  %160 = load ptr, ptr %9, align 8, !tbaa !5
  call void @gradsearch_destroy(ptr noundef %160)
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  call void @gs_destroy(ptr noundef %161)
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %162 = load ptr, ptr %4, align 8
  call void @llvm.stackrestore.p0(ptr %162)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  %163 = load i32, ptr %1, align 4
  ret i32 %163
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) #2

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @gs_create(i32 noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #3

; Function Attrs: nounwind uwtable
declare dso_local void @gs_unpack(ptr noundef, ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @gs_expand(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local float @gs_evaluate(ptr noundef, i32 noundef) #4

declare noalias ptr @fopen(ptr noundef, ptr noundef) #5

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

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

declare ptr @gradsearch_create(ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local float @gs_callback(ptr noundef, ptr noundef, i32 noundef) #1

declare float @gradsearch_step(ptr noundef) #5

declare void @gradsearch_print(ptr noundef) #5

declare i32 @fclose(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @gs_print(ptr noundef, i32 noundef) #1

declare void @gradsearch_destroy(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare dso_local void @gs_destroy(ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn }
attributes #4 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

!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, !11, i64 16}
!10 = !{!"gs_s", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96}
!11 = !{!"int", !7, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!12, !12, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!10, !11, i64 72}
!20 = !{!10, !6, i64 80}
!21 = distinct !{!21, !16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [24 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = tail call i64 @time(ptr noundef null) #6
  %2 = trunc i64 %1 to i32
  tail call void @srand(i32 noundef %2) #6
  %3 = tail call ptr @gs_create(i32 noundef 2)
  %4 = getelementptr inbounds i8, ptr %3, i64 16
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %.fr79 = freeze i32 %5
  %6 = zext i32 %.fr79 to i64
  %7 = alloca float, i64 %6, align 16
  %.not = icmp eq i32 %.fr79, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %0
  %8 = shl nuw nsw i64 %6, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 16 %7, i8 0, i64 %8, i1 false), !tbaa !12
  br label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph.preheader, %0
  call void @gs_unpack(ptr noundef nonnull %3, ptr noundef nonnull %7, i32 noundef 1)
  call void @gs_expand(ptr noundef nonnull %3, i32 noundef 1)
  %9 = call float @gs_evaluate(ptr noundef nonnull %3, i32 noundef 1)
  %10 = call noalias ptr @fopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1)
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str) #6
  %12 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.3) #6
  %13 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.4) #6
  %14 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5)
  %15 = call ptr @gradsearch_create(ptr noundef nonnull %3, ptr noundef nonnull %7, i32 noundef %.fr79, ptr noundef nonnull @gs_callback, i32 noundef 0) #6
  %16 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %17 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.7, i32 noundef 250) #6
  %18 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.8, i32 noundef %.fr79, i32 noundef 250) #6
  br i1 %.not, label %.split, label %.lr.ph70.us

.lr.ph70.us:                                      ; preds = %._crit_edge, %._crit_edge71.us
  %.172.us = phi i32 [ %20, %._crit_edge71.us ], [ 0, %._crit_edge ]
  %19 = call float @gs_callback(ptr noundef %3, ptr noundef nonnull %7, i32 noundef %.fr79)
  %20 = add nuw nsw i32 %.172.us, 1
  %21 = fpext float %19 to double
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.9, i32 noundef %20, double noundef %21) #6
  %23 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.10, i32 noundef %20) #6
  br label %24

24:                                               ; preds = %.lr.ph70.us, %24
  %indvars.iv = phi i64 [ 0, %.lr.ph70.us ], [ %indvars.iv.next, %24 ]
  %25 = getelementptr inbounds float, ptr %7, i64 %indvars.iv
  %26 = load float, ptr %25, align 4, !tbaa !12
  %27 = fpext float %26 to double
  %28 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.11, double noundef %27) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %6
  br i1 %exitcond.not, label %._crit_edge71.us, label %24, !llvm.loop !13

._crit_edge71.us:                                 ; preds = %24
  %29 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.12) #6
  %30 = call float @gradsearch_step(ptr noundef %15) #6
  call void @gradsearch_print(ptr noundef %15) #6
  %exitcond85.not = icmp eq i32 %20, 250
  br i1 %exitcond85.not, label %.split74.us, label %.lr.ph70.us, !llvm.loop !15

.split:                                           ; preds = %._crit_edge, %.split
  %.172 = phi i32 [ %32, %.split ], [ 0, %._crit_edge ]
  %31 = call float @gs_callback(ptr noundef %3, ptr noundef nonnull %7, i32 noundef 0)
  %32 = add nuw nsw i32 %.172, 1
  %33 = fpext float %31 to double
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.9, i32 noundef %32, double noundef %33) #6
  %35 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.10, i32 noundef %32) #6
  %36 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.12) #6
  %37 = call float @gradsearch_step(ptr noundef %15) #6
  call void @gradsearch_print(ptr noundef %15) #6
  %exitcond86.not = icmp eq i32 %32, 250
  br i1 %exitcond86.not, label %.split74.us, label %.split, !llvm.loop !15

.split74.us:                                      ; preds = %._crit_edge71.us, %.split
  %38 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %39 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14, i32 noundef 250)
  call void @gradsearch_print(ptr noundef %15) #6
  %40 = getelementptr inbounds i8, ptr %3, i64 72
  %41 = load i32, ptr %40, align 8, !tbaa !16
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.15, i32 noundef %41) #6
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.16) #6
  %44 = load i32, ptr %40, align 8, !tbaa !16
  %.not81 = icmp eq i32 %44, 0
  br i1 %.not81, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %.split74.us
  %45 = getelementptr inbounds i8, ptr %3, i64 80
  br label %46

46:                                               ; preds = %.lr.ph77, %46
  %indvars.iv87 = phi i64 [ 0, %.lr.ph77 ], [ %indvars.iv.next88, %46 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %47 = load ptr, ptr %45, align 8, !tbaa !17
  %48 = getelementptr inbounds float, ptr %47, i64 %indvars.iv87
  %49 = load float, ptr %48, align 4, !tbaa !12
  %50 = fpext float %49 to double
  %51 = trunc nuw i64 %indvars.iv.next88 to i32
  %52 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.17, i32 noundef %51, double noundef %50) #6
  %53 = load i32, ptr %40, align 8, !tbaa !16
  %54 = zext i32 %53 to i64
  %55 = icmp ult i64 %indvars.iv.next88, %54
  br i1 %55, label %46, label %._crit_edge78, !llvm.loop !18

._crit_edge78:                                    ; preds = %46, %.split74.us
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.18) #6
  %57 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.19) #6
  %58 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.20) #6
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.21) #6
  %60 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.22) #6
  %61 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.23) #6
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.18) #6
  %63 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.24) #6
  %64 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.25) #6
  %65 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.26) #6
  %66 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef nonnull @.str.23) #6
  %67 = call i32 @fclose(ptr noundef %10)
  %68 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef nonnull @.str)
  call void @gs_print(ptr noundef nonnull %3, i32 noundef 1)
  call void @gradsearch_destroy(ptr noundef %15) #6
  call void @gs_destroy(ptr noundef nonnull %3)
  ret i32 0
}

; Function Attrs: nounwind
declare void @srand(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @gs_create(i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @gs_unpack(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @gs_expand(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local float @gs_evaluate(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local float @gs_callback(ptr noundef, ptr noundef, i32 noundef) #0

declare float @gradsearch_step(ptr noundef) local_unnamed_addr #4

declare void @gradsearch_print(ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @gs_print(ptr noundef, i32 noundef) local_unnamed_addr #0

declare void @gradsearch_destroy(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local void @gs_destroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { 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 #2 = { nounwind uwtable "min-legal-vector-width"="64" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 nounwind willreturn memory(argmem: write) }
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 16}
!6 = !{!"gs_s", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !10, i64 80, !11, i64 88, !11, i64 92, !11, i64 96}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"float", !8, i64 0}
!12 = !{!11, !11, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = !{!6, !7, i64 72}
!17 = !{!6, !10, i64 80}
!18 = distinct !{!18, !14}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopIdiomRecognizePass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass