; LLVM IR from Discngine/fpocket :: src (tparams)

; 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.s_tparams = type { ptr, ptr, ptr, ptr, ptr, [128 x i8], [128 x i8], float, i32, i32, ptr }
%struct.s_fparams = type { [2000 x i8], [2000 x i8], [2000 x i8], [8000 x i8], ptr, ptr, ptr, i32, i32, ptr, ptr, ptr, i8, i8, i32, i32, i16, i32, i32, i32, i16, i32, i32, i32, i16, float, float, float, float, float, [20 x ptr], i16, i16, [20 x ptr], i32, [10 x i8] }

@.str.16 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [26 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
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local void @print_params(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %6 = load ptr, ptr %3, align 8, !tbaa !5
  %7 = icmp ne ptr %6, null
  br i1 %7, label %8, label %102

8:                                                ; preds = %2
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef @.str.16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %11

11:                                               ; preds = %43, %8
  %12 = load i32, ptr %5, align 4, !tbaa !9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.s_tparams, ptr %13, i32 0, i32 8
  %15 = load i32, ptr %14, align 4, !tbaa !11
  %16 = icmp slt i32 %12, %15
  br i1 %16, label %17, label %46

17:                                               ; preds = %11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = load i32, ptr %5, align 4, !tbaa !9
  %20 = add nsw i32 %19, 1
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.s_tparams, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds ptr, ptr %23, i64 %25
  %27 = load ptr, ptr %26, align 8, !tbaa !5
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.s_tparams, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = load i32, ptr %5, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds ptr, ptr %30, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.s_tparams, ptr %35, i32 0, i32 2
  %37 = load ptr, ptr %36, align 8, !tbaa !16
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef @.str.17, i32 noundef %20, ptr noundef %27, ptr noundef %34, ptr noundef %41) #3
  br label %43

43:                                               ; preds = %17
  %44 = load i32, ptr %5, align 4, !tbaa !9
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %5, align 4, !tbaa !9
  br label %11, !llvm.loop !17

46:                                               ; preds = %11
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = load ptr, ptr %3, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.s_tparams, ptr %48, i32 0, i32 10
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = getelementptr inbounds %struct.s_fparams, ptr %50, i32 0, i32 27
  %52 = load float, ptr %51, align 8, !tbaa !20
  %53 = fpext float %52 to double
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str.18, double noundef %53) #3
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = load ptr, ptr %3, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.s_tparams, ptr %56, i32 0, i32 10
  %58 = load ptr, ptr %57, align 8, !tbaa !19
  %59 = getelementptr inbounds %struct.s_fparams, ptr %58, i32 0, i32 29
  %60 = load float, ptr %59, align 8, !tbaa !23
  %61 = fpext float %60 to double
  %62 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.19, double noundef %61) #3
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.s_tparams, ptr %64, i32 0, i32 10
  %66 = load ptr, ptr %65, align 8, !tbaa !19
  %67 = getelementptr inbounds %struct.s_fparams, ptr %66, i32 0, i32 21
  %68 = load i32, ptr %67, align 8, !tbaa !24
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %63, ptr noundef @.str.20, i32 noundef %68) #3
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.s_tparams, ptr %71, i32 0, i32 10
  %73 = load ptr, ptr %72, align 8, !tbaa !19
  %74 = getelementptr inbounds %struct.s_fparams, ptr %73, i32 0, i32 25
  %75 = load float, ptr %74, align 8, !tbaa !25
  %76 = fpext float %75 to double
  %77 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.21, double noundef %76) #3
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = load ptr, ptr %3, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.s_tparams, ptr %79, i32 0, i32 10
  %81 = load ptr, ptr %80, align 8, !tbaa !19
  %82 = getelementptr inbounds %struct.s_fparams, ptr %81, i32 0, i32 26
  %83 = load float, ptr %82, align 4, !tbaa !26
  %84 = fpext float %83 to double
  %85 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %78, ptr noundef @.str.22, double noundef %84) #3
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.s_tparams, ptr %87, i32 0, i32 10
  %89 = load ptr, ptr %88, align 8, !tbaa !19
  %90 = getelementptr inbounds %struct.s_fparams, ptr %89, i32 0, i32 22
  %91 = load i32, ptr %90, align 4, !tbaa !27
  %92 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %86, ptr noundef @.str.23, i32 noundef %91) #3
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.s_tparams, ptr %94, i32 0, i32 10
  %96 = load ptr, ptr %95, align 8, !tbaa !19
  %97 = getelementptr inbounds %struct.s_fparams, ptr %96, i32 0, i32 23
  %98 = load i32, ptr %97, align 8, !tbaa !28
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %93, ptr noundef @.str.24, i32 noundef %98) #3
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %100, ptr noundef @.str.25) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %105

102:                                              ; preds = %2
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %103, ptr noundef @.str.26) #3
  br label %105

105:                                              ; preds = %102, %46
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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"="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 }

!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 300}
!12 = !{!"s_tparams", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 168, !13, i64 296, !10, i64 300, !10, i64 304, !6, i64 312}
!13 = !{!"float", !7, i64 0}
!14 = !{!12, !6, i64 0}
!15 = !{!12, !6, i64 8}
!16 = !{!12, !6, i64 16}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!12, !6, i64 312}
!20 = !{!21, !13, i64 14112}
!21 = !{!"s_fparams", !7, i64 0, !7, i64 2000, !7, i64 4000, !7, i64 6000, !6, i64 14000, !6, i64 14008, !6, i64 14016, !10, i64 14024, !10, i64 14028, !6, i64 14032, !6, i64 14040, !6, i64 14048, !7, i64 14056, !7, i64 14057, !10, i64 14060, !10, i64 14064, !22, i64 14068, !10, i64 14072, !10, i64 14076, !10, i64 14080, !22, i64 14084, !10, i64 14088, !10, i64 14092, !10, i64 14096, !22, i64 14100, !13, i64 14104, !13, i64 14108, !13, i64 14112, !13, i64 14116, !13, i64 14120, !7, i64 14128, !22, i64 14288, !22, i64 14290, !7, i64 14296, !10, i64 14456, !7, i64 14460}
!22 = !{!"short", !7, i64 0}
!23 = !{!21, !13, i64 14120}
!24 = !{!21, !10, i64 14088}
!25 = !{!21, !13, i64 14104}
!26 = !{!21, !13, i64 14108}
!27 = !{!21, !10, i64 14092}
!28 = !{!21, !10, i64 14096}


; 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.16 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [35 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [56 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [62 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: nofree nounwind uwtable
define dso_local void @print_params(ptr noundef readonly %0, ptr nocapture noundef %1) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %58, label %3

3:                                                ; preds = %2
  %4 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.16) #2
  %5 = getelementptr inbounds i8, ptr %0, i64 300
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  br label %10

10:                                               ; preds = %.lr.ph, %10
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %10 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %11 = load ptr, ptr %0, align 8, !tbaa !12
  %12 = getelementptr inbounds ptr, ptr %11, i64 %indvars.iv
  %13 = load ptr, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %8, align 8, !tbaa !14
  %15 = getelementptr inbounds ptr, ptr %14, i64 %indvars.iv
  %16 = load ptr, ptr %15, align 8, !tbaa !13
  %17 = load ptr, ptr %9, align 8, !tbaa !15
  %18 = getelementptr inbounds ptr, ptr %17, i64 %indvars.iv
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = trunc nuw nsw i64 %indvars.iv.next to i32
  %21 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.17, i32 noundef %20, ptr noundef %13, ptr noundef %16, ptr noundef %19) #2
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %10, label %._crit_edge, !llvm.loop !16

._crit_edge:                                      ; preds = %10, %3
  %25 = getelementptr inbounds i8, ptr %0, i64 312
  %26 = load ptr, ptr %25, align 8, !tbaa !18
  %27 = getelementptr inbounds i8, ptr %26, i64 14112
  %28 = load float, ptr %27, align 8, !tbaa !19
  %29 = fpext float %28 to double
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.18, double noundef %29) #2
  %31 = load ptr, ptr %25, align 8, !tbaa !18
  %32 = getelementptr inbounds i8, ptr %31, i64 14120
  %33 = load float, ptr %32, align 8, !tbaa !22
  %34 = fpext float %33 to double
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.19, double noundef %34) #2
  %36 = load ptr, ptr %25, align 8, !tbaa !18
  %37 = getelementptr inbounds i8, ptr %36, i64 14088
  %38 = load i32, ptr %37, align 8, !tbaa !23
  %39 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.20, i32 noundef %38) #2
  %40 = load ptr, ptr %25, align 8, !tbaa !18
  %41 = getelementptr inbounds i8, ptr %40, i64 14104
  %42 = load float, ptr %41, align 8, !tbaa !24
  %43 = fpext float %42 to double
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.21, double noundef %43) #2
  %45 = load ptr, ptr %25, align 8, !tbaa !18
  %46 = getelementptr inbounds i8, ptr %45, i64 14108
  %47 = load float, ptr %46, align 4, !tbaa !25
  %48 = fpext float %47 to double
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.22, double noundef %48) #2
  %50 = load ptr, ptr %25, align 8, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %50, i64 14092
  %52 = load i32, ptr %51, align 4, !tbaa !26
  %53 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.23, i32 noundef %52) #2
  %54 = load ptr, ptr %25, align 8, !tbaa !18
  %55 = getelementptr inbounds i8, ptr %54, i64 14096
  %56 = load i32, ptr %55, align 8, !tbaa !27
  %57 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull @.str.24, i32 noundef %56) #2
  br label %58

58:                                               ; preds = %2, %._crit_edge
  %.str.26.sink = phi ptr [ @.str.25, %._crit_edge ], [ @.str.26, %2 ]
  %59 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %1, ptr noundef nonnull %.str.26.sink) #2
  ret void
}

attributes #0 = { 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 #1 = { nofree 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 }

!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, !11, i64 300}
!6 = !{!"s_tparams", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !8, i64 40, !8, i64 168, !10, i64 296, !11, i64 300, !11, i64 304, !7, i64 312}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"float", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = !{!6, !7, i64 8}
!15 = !{!6, !7, i64 16}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!6, !7, i64 312}
!19 = !{!20, !10, i64 14112}
!20 = !{!"s_fparams", !8, i64 0, !8, i64 2000, !8, i64 4000, !8, i64 6000, !7, i64 14000, !7, i64 14008, !7, i64 14016, !11, i64 14024, !11, i64 14028, !7, i64 14032, !7, i64 14040, !7, i64 14048, !8, i64 14056, !8, i64 14057, !11, i64 14060, !11, i64 14064, !21, i64 14068, !11, i64 14072, !11, i64 14076, !11, i64 14080, !21, i64 14084, !11, i64 14088, !11, i64 14092, !11, i64 14096, !21, i64 14100, !10, i64 14104, !10, i64 14108, !10, i64 14112, !10, i64 14116, !10, i64 14120, !8, i64 14128, !21, i64 14288, !21, i64 14290, !8, i64 14296, !11, i64 14456, !8, i64 14460}
!21 = !{!"short", !8, i64 0}
!22 = !{!20, !10, i64 14120}
!23 = !{!20, !11, i64 14088}
!24 = !{!20, !10, i64 14104}
!25 = !{!20, !10, i64 14108}
!26 = !{!20, !11, i64 14092}
!27 = !{!20, !11, i64 14096}


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