; LLVM IR from libxsmm/libxsmm :: tests (rng)

; 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.libxsmm_matdiff_info = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32 }

; 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 i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.libxsmm_matdiff_info, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %struct.libxsmm_matdiff_info, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  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 4, ptr %6) #6
  store i32 1000, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 192, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = mul i64 4, %21
  %23 = call noalias ptr @malloc(i64 noundef %22) #7
  store ptr %23, ptr %10, align 8, !tbaa !9
  %24 = load ptr, ptr %10, align 8, !tbaa !9
  %25 = icmp eq ptr null, %24
  br i1 %25, label %26, label %27

26:                                               ; preds = %2
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %26, %2
  %28 = load i32, ptr %4, align 4, !tbaa !5
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  call void @libxsmm_matdiff_clear(ptr noundef %8)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %30

30:                                               ; preds = %119, %27
  %31 = load i32, ptr %11, align 4, !tbaa !5
  %32 = icmp slt i32 %31, 1000
  br i1 %32, label %33, label %122

33:                                               ; preds = %30
  %34 = call i64 @time(ptr noundef null) #6
  %35 = trunc i64 %34 to i32
  call void @libxsmm_rng_set_seed(i32 noundef %35)
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = srem i32 %36, 2
  switch i32 %37, label %54 [
    i32 1, label %38
  ]

38:                                               ; preds = %33
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %50, %38
  %40 = load i32, ptr %7, align 4, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %53

43:                                               ; preds = %39
  %44 = call double @libxsmm_rng_f64()
  %45 = fptrunc double %44 to float
  %46 = load ptr, ptr %10, align 8, !tbaa !9
  %47 = load i32, ptr %7, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds float, ptr %46, i64 %48
  store float %45, ptr %49, align 4, !tbaa !11
  br label %50

50:                                               ; preds = %43
  %51 = load i32, ptr %7, align 4, !tbaa !5
  %52 = add nsw i32 %51, 1
  store i32 %52, ptr %7, align 4, !tbaa !5
  br label %39, !llvm.loop !13

53:                                               ; preds = %39
  br label %57

54:                                               ; preds = %33
  %55 = load ptr, ptr %10, align 8, !tbaa !9
  %56 = load i32, ptr %6, align 4, !tbaa !5
  call void @libxsmm_rng_f32_seq(ptr noundef %55, i32 noundef %56)
  br label %57

57:                                               ; preds = %54, %53
  %58 = load i32, ptr %9, align 4, !tbaa !5
  %59 = icmp eq i32 0, %58
  br i1 %59, label %60, label %68

60:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 192, ptr %12) #6
  %61 = load i32, ptr %6, align 4, !tbaa !5
  %62 = load ptr, ptr %10, align 8, !tbaa !9
  %63 = call i32 @libxsmm_matdiff(ptr noundef %12, i32 noundef 1, i32 noundef 1, i32 noundef %61, ptr noundef null, ptr noundef %62, ptr noundef null, ptr noundef null)
  store i32 %63, ptr %9, align 4, !tbaa !5
  %64 = load i32, ptr %9, align 4, !tbaa !5
  %65 = icmp eq i32 0, %64
  br i1 %65, label %66, label %67

66:                                               ; preds = %60
  call void @libxsmm_matdiff_reduce(ptr noundef %8, ptr noundef %12)
  br label %67

67:                                               ; preds = %66, %60
  call void @llvm.lifetime.end.p0(i64 192, ptr %12) #6
  br label %68

68:                                               ; preds = %67, %57
  %69 = load i32, ptr %9, align 4, !tbaa !5
  %70 = icmp eq i32 0, %69
  br i1 %70, label %71, label %118

71:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store double 0x41EFFFFFFFE00000, ptr %15, align 8, !tbaa !15
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %72

72:                                               ; preds = %96, %71
  %73 = load i32, ptr %7, align 4, !tbaa !5
  %74 = load i32, ptr %6, align 4, !tbaa !5
  %75 = icmp slt i32 %73, %74
  br i1 %75, label %76, label %99

76:                                               ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %77 = load ptr, ptr %10, align 8, !tbaa !9
  %78 = load i32, ptr %7, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds float, ptr %77, i64 %79
  %81 = load float, ptr %80, align 4, !tbaa !11
  %82 = fpext float %81 to double
  %83 = fmul double %82, 0x41EFFFFFFFE00000
  %84 = call double @llvm.round.f64(double %83)
  %85 = fptoui double %84 to i32
  store i32 %85, ptr %16, align 4, !tbaa !5
  %86 = load i32, ptr %16, align 4, !tbaa !5
  %87 = and i32 %86, 1
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %92

89:                                               ; preds = %76
  %90 = load i32, ptr %13, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %13, align 4, !tbaa !5
  br label %95

92:                                               ; preds = %76
  %93 = load i32, ptr %14, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %14, align 4, !tbaa !5
  br label %95

95:                                               ; preds = %92, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %7, align 4, !tbaa !5
  br label %72, !llvm.loop !17

99:                                               ; preds = %72
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = load i32, ptr %13, align 4, !tbaa !5
  %102 = load i32, ptr %14, align 4, !tbaa !5
  %103 = icmp slt i32 %101, %102
  br i1 %103, label %104, label %108

104:                                              ; preds = %99
  %105 = load i32, ptr %14, align 4, !tbaa !5
  %106 = load i32, ptr %13, align 4, !tbaa !5
  %107 = sub nsw i32 %105, %106
  br label %112

108:                                              ; preds = %99
  %109 = load i32, ptr %13, align 4, !tbaa !5
  %110 = load i32, ptr %14, align 4, !tbaa !5
  %111 = sub nsw i32 %109, %110
  br label %112

112:                                              ; preds = %108, %104
  %113 = phi i32 [ %107, %104 ], [ %111, %108 ]
  %114 = mul nsw i32 4, %113
  %115 = icmp slt i32 %100, %114
  br i1 %115, label %116, label %117

116:                                              ; preds = %112
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %117

117:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %118

118:                                              ; preds = %117, %68
  br label %119

119:                                              ; preds = %118
  %120 = load i32, ptr %11, align 4, !tbaa !5
  %121 = add nsw i32 %120, 1
  store i32 %121, ptr %11, align 4, !tbaa !5
  br label %30, !llvm.loop !18

122:                                              ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  %123 = load i32, ptr %9, align 4, !tbaa !5
  %124 = icmp eq i32 0, %123
  br i1 %124, label %125, label %163

125:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %126 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 17
  %127 = load double, ptr %126, align 8, !tbaa !19
  %128 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 16
  %129 = load double, ptr %128, align 8, !tbaa !21
  %130 = fsub double %127, %129
  store double %130, ptr %17, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  store double 5.000000e-01, ptr %18, align 8, !tbaa !15
  %131 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 18
  %132 = load double, ptr %131, align 8, !tbaa !22
  %133 = fcmp olt double %132, 5.000000e-01
  br i1 %133, label %134, label %138

134:                                              ; preds = %125
  %135 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 18
  %136 = load double, ptr %135, align 8, !tbaa !22
  %137 = fsub double 5.000000e-01, %136
  br label %142

138:                                              ; preds = %125
  %139 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 18
  %140 = load double, ptr %139, align 8, !tbaa !22
  %141 = fsub double %140, 5.000000e-01
  br label %142

142:                                              ; preds = %138, %134
  %143 = phi double [ %137, %134 ], [ %141, %138 ]
  %144 = fmul double 5.000000e+00, %143
  %145 = fcmp olt double 5.000000e-01, %144
  br i1 %145, label %146, label %147

146:                                              ; preds = %142
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %146, %142
  %148 = load double, ptr %17, align 8, !tbaa !15
  %149 = fmul double 5.000000e-01, %148
  %150 = fcmp olt double %149, 5.000000e-01
  br i1 %150, label %151, label %154

151:                                              ; preds = %147
  %152 = load double, ptr %17, align 8, !tbaa !15
  %153 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %152, double 5.000000e-01)
  br label %157

154:                                              ; preds = %147
  %155 = load double, ptr %17, align 8, !tbaa !15
  %156 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %155, double -5.000000e-01)
  br label %157

157:                                              ; preds = %154, %151
  %158 = phi double [ %153, %151 ], [ %156, %154 ]
  %159 = fmul double 5.000000e+00, %158
  %160 = fcmp olt double 5.000000e-01, %159
  br i1 %160, label %161, label %162

161:                                              ; preds = %157
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %162

162:                                              ; preds = %161, %157
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %163

163:                                              ; preds = %162, %122
  %164 = load i32, ptr %9, align 4, !tbaa !5
  %165 = icmp eq i32 0, %164
  br i1 %165, label %166, label %184

166:                                              ; preds = %163
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store double 0x3FB5555555555555, ptr %19, align 8, !tbaa !15
  %167 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 19
  %168 = load double, ptr %167, align 8, !tbaa !23
  %169 = fcmp olt double %168, 0x3FB5555555555555
  br i1 %169, label %170, label %174

170:                                              ; preds = %166
  %171 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 19
  %172 = load double, ptr %171, align 8, !tbaa !23
  %173 = fsub double 0x3FB5555555555555, %172
  br label %178

174:                                              ; preds = %166
  %175 = getelementptr inbounds %struct.libxsmm_matdiff_info, ptr %8, i32 0, i32 19
  %176 = load double, ptr %175, align 8, !tbaa !23
  %177 = fsub double %176, 0x3FB5555555555555
  br label %178

178:                                              ; preds = %174, %170
  %179 = phi double [ %173, %170 ], [ %177, %174 ]
  %180 = fmul double 5.000000e+00, %179
  %181 = fcmp olt double 0x3FB5555555555555, %180
  br i1 %181, label %182, label %183

182:                                              ; preds = %178
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %184

184:                                              ; preds = %183, %163
  %185 = load ptr, ptr %10, align 8, !tbaa !9
  call void @free(ptr noundef %185) #6
  %186 = load i32, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 192, 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
  ret i32 %186
}

; 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

declare void @libxsmm_matdiff_clear(ptr noundef) #3

declare void @libxsmm_rng_set_seed(i32 noundef) #3

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

declare double @libxsmm_rng_f64() #3

declare void @libxsmm_rng_f32_seq(ptr noundef, i32 noundef) #3

declare i32 @libxsmm_matdiff(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #3

declare void @libxsmm_matdiff_reduce(ptr noundef, ptr noundef) #3

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

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

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

; Function Attrs: nounwind
declare void @free(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 = { "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 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"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, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = !{!20, !16, i64 136}
!20 = !{!"libxsmm_matdiff_info", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !16, i64 152, !16, i64 160, !16, i64 168, !6, i64 176, !6, i64 180, !6, i64 184, !6, i64 188}
!21 = !{!20, !16, i64 128}
!22 = !{!20, !16, i64 144}
!23 = !{!20, !16, i64 152}


; 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.libxsmm_matdiff_info = type { double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #0 {
  %3 = alloca %struct.libxsmm_matdiff_info, align 8
  %4 = alloca %struct.libxsmm_matdiff_info, align 8
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %3) #8
  %5 = tail call noalias dereferenceable_or_null(4000) ptr @malloc(i64 noundef 4000) #9
  %6 = icmp eq ptr %5, null
  %spec.select = select i1 %6, i32 0, i32 1000
  call void @libxsmm_matdiff_clear(ptr noundef nonnull %3) #8
  %umax = call i32 @llvm.umax.i32(i32 %spec.select, i32 1)
  %wide.trip.count = zext nneg i32 %umax to i64
  %wide.trip.count65 = zext nneg i32 %umax to i64
  %n.vec = and i64 %wide.trip.count, 1000
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br label %7

7:                                                ; preds = %2, %.thread
  %.04159 = phi i32 [ 0, %2 ], [ %.3, %.thread ]
  %.04358 = phi i32 [ 0, %2 ], [ %54, %.thread ]
  %8 = call i64 @time(ptr noundef null) #8
  %9 = trunc i64 %8 to i32
  call void @libxsmm_rng_set_seed(i32 noundef %9) #8
  %10 = and i32 %.04358, 1
  %cond.not = icmp eq i32 %10, 0
  br i1 %cond.not, label %14, label %.preheader

.preheader:                                       ; preds = %7
  br i1 %6, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader ]
  %11 = call double @libxsmm_rng_f64() #8
  %12 = fptrunc double %11 to float
  %13 = getelementptr inbounds float, ptr %5, i64 %indvars.iv
  store float %12, ptr %13, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.loopexit, label %.lr.ph, !llvm.loop !9

14:                                               ; preds = %7
  call void @libxsmm_rng_f32_seq(ptr noundef %5, i32 noundef %spec.select) #8
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph, %.preheader, %14
  %15 = icmp eq i32 %.04159, 0
  br i1 %15, label %16, label %.thread

16:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %4) #8
  %17 = call i32 @libxsmm_matdiff(ptr noundef nonnull %4, i32 noundef 1, i32 noundef 1, i32 noundef %spec.select, ptr noundef null, ptr noundef %5, ptr noundef null, ptr noundef null) #8
  %18 = icmp eq i32 %17, 0
  br i1 %18, label %19, label %.thread49

.thread49:                                        ; preds = %16
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #8
  br label %.thread

19:                                               ; preds = %16
  call void @libxsmm_matdiff_reduce(ptr noundef nonnull %3, ptr noundef nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #8
  br i1 %6, label %._crit_edge, label %vector.body

vector.body:                                      ; preds = %19, %vector.body
  %index = phi i64 [ %index.next, %vector.body ], [ 0, %19 ]
  %vec.phi = phi <4 x i32> [ %36, %vector.body ], [ zeroinitializer, %19 ]
  %vec.phi68 = phi <4 x i32> [ %37, %vector.body ], [ zeroinitializer, %19 ]
  %vec.phi69 = phi <4 x i32> [ %34, %vector.body ], [ zeroinitializer, %19 ]
  %vec.phi70 = phi <4 x i32> [ %35, %vector.body ], [ zeroinitializer, %19 ]
  %20 = getelementptr inbounds float, ptr %5, i64 %index
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %wide.load = load <4 x float>, ptr %20, align 4, !tbaa !5
  %wide.load71 = load <4 x float>, ptr %21, align 4, !tbaa !5
  %22 = fpext <4 x float> %wide.load to <4 x double>
  %23 = fpext <4 x float> %wide.load71 to <4 x double>
  %24 = fmul <4 x double> %22, <double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000>
  %25 = fmul <4 x double> %23, <double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000, double 0x41EFFFFFFFE00000>
  %26 = call <4 x double> @llvm.round.v4f64(<4 x double> %24)
  %27 = call <4 x double> @llvm.round.v4f64(<4 x double> %25)
  %28 = fptoui <4 x double> %26 to <4 x i32>
  %29 = fptoui <4 x double> %27 to <4 x i32>
  %30 = and <4 x i32> %28, <i32 1, i32 1, i32 1, i32 1>
  %31 = and <4 x i32> %29, <i32 1, i32 1, i32 1, i32 1>
  %32 = xor <4 x i32> %30, <i32 1, i32 1, i32 1, i32 1>
  %33 = xor <4 x i32> %31, <i32 1, i32 1, i32 1, i32 1>
  %34 = add <4 x i32> %32, %vec.phi69
  %35 = add <4 x i32> %33, %vec.phi70
  %36 = add <4 x i32> %30, %vec.phi
  %37 = add <4 x i32> %31, %vec.phi68
  %index.next = add nuw i64 %index, 8
  %38 = icmp eq i64 %index.next, %n.vec
  br i1 %38, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %37, %36
  %39 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %bin.rdx72 = add <4 x i32> %35, %34
  %40 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx72)
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph56

.lr.ph56:                                         ; preds = %middle.block, %.lr.ph56
  %indvars.iv61 = phi i64 [ %indvars.iv.next62, %.lr.ph56 ], [ %n.vec, %middle.block ]
  %.04454 = phi i32 [ %.145, %.lr.ph56 ], [ %39, %middle.block ]
  %.04653 = phi i32 [ %.147, %.lr.ph56 ], [ %40, %middle.block ]
  %41 = getelementptr inbounds float, ptr %5, i64 %indvars.iv61
  %42 = load float, ptr %41, align 4, !tbaa !5
  %43 = fpext float %42 to double
  %44 = fmul double %43, 0x41EFFFFFFFE00000
  %45 = call double @llvm.round.f64(double %44)
  %46 = fptoui double %45 to i32
  %47 = and i32 %46, 1
  %48 = xor i32 %47, 1
  %.147 = add i32 %48, %.04653
  %.145 = add i32 %47, %.04454
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count65
  br i1 %exitcond66.not, label %._crit_edge.loopexit, label %.lr.ph56, !llvm.loop !14

._crit_edge.loopexit:                             ; preds = %.lr.ph56, %middle.block
  %.147.lcssa = phi i32 [ %40, %middle.block ], [ %.147, %.lr.ph56 ]
  %.145.lcssa = phi i32 [ %39, %middle.block ], [ %.145, %.lr.ph56 ]
  %49 = sub nsw i32 %.145.lcssa, %.147.lcssa
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %19
  %50 = phi i32 [ 0, %19 ], [ %49, %._crit_edge.loopexit ]
  %51 = call i32 @llvm.abs.i32(i32 %50, i1 true)
  %52 = shl nsw i32 %51, 2
  %53 = icmp ult i32 %spec.select, %52
  %.2 = zext i1 %53 to i32
  br label %.thread

.thread:                                          ; preds = %.loopexit, %.thread49, %._crit_edge
  %.3 = phi i32 [ %.2, %._crit_edge ], [ %17, %.thread49 ], [ %.04159, %.loopexit ]
  %54 = add nuw nsw i32 %.04358, 1
  %exitcond67.not = icmp eq i32 %54, 1000
  br i1 %exitcond67.not, label %55, label %7, !llvm.loop !15

55:                                               ; preds = %.thread
  %56 = icmp eq i32 %.3, 0
  br i1 %56, label %57, label %.thread50

57:                                               ; preds = %55
  %58 = getelementptr inbounds i8, ptr %3, i64 136
  %59 = load double, ptr %58, align 8, !tbaa !16
  %60 = getelementptr inbounds i8, ptr %3, i64 128
  %61 = load double, ptr %60, align 8, !tbaa !20
  %62 = fsub double %59, %61
  %63 = getelementptr inbounds i8, ptr %3, i64 144
  %64 = load double, ptr %63, align 8
  %65 = fcmp olt double %64, 5.000000e-01
  %66 = fsub double 5.000000e-01, %64
  %67 = fadd double %64, -5.000000e-01
  %68 = select i1 %65, double %66, double %67
  %69 = fmul double %68, 5.000000e+00
  %70 = fcmp ule double %69, 5.000000e-01
  %71 = fmul double %62, 5.000000e-01
  %72 = fcmp olt double %71, 5.000000e-01
  %73 = call double @llvm.fmuladd.f64(double %62, double -5.000000e-01, double 5.000000e-01)
  %74 = call double @llvm.fmuladd.f64(double %62, double 5.000000e-01, double -5.000000e-01)
  %75 = select i1 %72, double %73, double %74
  %76 = fmul double %75, 5.000000e+00
  %77 = fcmp ule double %76, 5.000000e-01
  %or.cond = select i1 %77, i1 %70, i1 false
  br i1 %or.cond, label %78, label %.thread50

78:                                               ; preds = %57
  %79 = getelementptr inbounds i8, ptr %3, i64 152
  %80 = load double, ptr %79, align 8
  %81 = fcmp olt double %80, 0x3FB5555555555555
  %82 = fsub double 0x3FB5555555555555, %80
  %83 = fadd double %80, 0xBFB5555555555555
  %84 = select i1 %81, double %82, double %83
  %85 = fmul double %84, 5.000000e+00
  %86 = fcmp ogt double %85, 0x3FB5555555555555
  %.7 = zext i1 %86 to i32
  br label %.thread50

.thread50:                                        ; preds = %57, %55, %78
  %.8 = phi i32 [ %.7, %78 ], [ %.3, %55 ], [ 1, %57 ]
  call void @free(ptr noundef %5) #8
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %3) #8
  ret i32 %.8
}

; 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

declare void @libxsmm_matdiff_clear(ptr noundef) local_unnamed_addr #3

declare void @libxsmm_rng_set_seed(i32 noundef) local_unnamed_addr #3

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

declare double @libxsmm_rng_f64() local_unnamed_addr #3

declare void @libxsmm_rng_f32_seq(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @libxsmm_matdiff(ptr noundef, i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @libxsmm_matdiff_reduce(ptr noundef, ptr noundef) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.abs.i32(i32, i1 immarg) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <4 x double> @llvm.round.v4f64(<4 x double>) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #7

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 = { "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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10, !12, !13}
!12 = !{!"llvm.loop.isvectorized", i32 1}
!13 = !{!"llvm.loop.unroll.runtime.disable"}
!14 = distinct !{!14, !10, !13, !12}
!15 = distinct !{!15, !10}
!16 = !{!17, !18, i64 136}
!17 = !{!"libxsmm_matdiff_info", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !18, i64 32, !18, i64 40, !18, i64 48, !18, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !18, i64 104, !18, i64 112, !18, i64 120, !18, i64 128, !18, i64 136, !18, i64 144, !18, i64 152, !18, i64 160, !18, i64 168, !19, i64 176, !19, i64 180, !19, i64 184, !19, i64 188}
!18 = !{!"double", !7, i64 0}
!19 = !{!"int", !7, i64 0}
!20 = !{!17, !18, i64 128}


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