; LLVM IR from EntityFX/anybench :: src/benchmarks/generic/gsynth/gsynth.ll (Z6warmupv)

; 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.GSynth = type { [16 x %struct.Granula], i32, float, float, float, float, float, float, float, float, float, float, float }
%struct.Granula = type { float, float, float, float }

@_tmp = external dso_local global float, align 4
@_ZZ6warmupvE5synth = external hidden global [2 x %struct.GSynth], align 16
@_ZGVZ6warmupvE5synth = external hidden global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6warmupv() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca float, align 4
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca float, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  store float 1.000000e+00, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  store double 4.800000e+04, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %14 = load double, ptr %2, align 8, !tbaa !9
  %15 = load float, ptr %1, align 4, !tbaa !5
  %16 = fpext float %15 to double
  %17 = fmul double %14, %16
  %18 = fptosi double %17 to i32
  %19 = or i32 %18, 255
  %20 = add nsw i32 %19, 1
  store i32 %20, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %21 = load i32, ptr %3, align 4, !tbaa !11
  %22 = sext i32 %21 to i64
  %23 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %22, i64 4)
  %24 = extractvalue { i64, i1 } %23, 1
  %25 = extractvalue { i64, i1 } %23, 0
  %26 = select i1 %24, i64 -1, i64 %25
  %27 = call noalias noundef nonnull ptr @_Znam(i64 noundef %26) #7
  store ptr %27, ptr %4, align 8, !tbaa !13
  %28 = load ptr, ptr %4, align 8, !tbaa !13
  %29 = load i32, ptr %3, align 4, !tbaa !11
  %30 = sext i32 %29 to i64
  %31 = mul i64 4, %30
  call void @llvm.memset.p0.i64(ptr align 4 %28, i8 0, i64 %31, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 2, ptr %5, align 4, !tbaa !11
  %32 = load atomic i8, ptr @_ZGVZ6warmupvE5synth acquire, align 8
  %33 = icmp eq i8 %32, 0
  br i1 %33, label %34, label %44, !prof !15

34:                                               ; preds = %0
  %35 = call i32 @__cxa_guard_acquire(ptr @_ZGVZ6warmupvE5synth) #5
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %44

37:                                               ; preds = %34
  br label %38

38:                                               ; preds = %40, %37
  %39 = phi ptr [ @_ZZ6warmupvE5synth, %37 ], [ %41, %40 ]
  invoke void @_ZN6GSynthILi16EEC2Ev(ptr noundef nonnull align 4 dereferenceable(304) %39)
          to label %40 unwind label %50

40:                                               ; preds = %38
  %41 = getelementptr inbounds %struct.GSynth, ptr %39, i64 1
  %42 = icmp eq ptr %41, getelementptr inbounds (%struct.GSynth, ptr @_ZZ6warmupvE5synth, i64 2)
  br i1 %42, label %43, label %38

43:                                               ; preds = %40
  call void @__cxa_guard_release(ptr @_ZGVZ6warmupvE5synth) #5
  br label %44

44:                                               ; preds = %43, %34, %0
  call void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304) @_ZZ6warmupvE5synth, float noundef 0x40441999A0000000, i32 noundef 0, float noundef 0x3FE9EB8520000000, float noundef 0x3FBC28F5C0000000, float noundef 0x3F847AE140000000, float noundef 0x4000147AE0000000, float noundef 0x3FBC28F5C0000000)
  call void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304) getelementptr inbounds ([2 x %struct.GSynth], ptr @_ZZ6warmupvE5synth, i64 0, i64 1), float noundef 0x40569999A0000000, i32 noundef 0, float noundef 0x3FC353F7C0000000, float noundef 0x3FAA1CAC00000000, float noundef 0x3F847AE140000000, float noundef 0x4024051EC0000000, float noundef 0x3FED1EB860000000)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 256, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store float 5.000000e-01, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  br label %45

45:                                               ; preds = %72, %44
  %46 = load i32, ptr %11, align 4, !tbaa !11
  %47 = load i32, ptr %3, align 4, !tbaa !11
  %48 = icmp slt i32 %46, %47
  br i1 %48, label %54, label %49

49:                                               ; preds = %45
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %76

50:                                               ; preds = %38
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %6, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %7, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZ6warmupvE5synth) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  br label %84

54:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  br label %55

55:                                               ; preds = %68, %54
  %56 = load i32, ptr %13, align 4, !tbaa !11
  %57 = icmp slt i32 %56, 2
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %71

59:                                               ; preds = %55
  %60 = load i32, ptr %13, align 4, !tbaa !11
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [2 x %struct.GSynth], ptr @_ZZ6warmupvE5synth, i64 0, i64 %61
  %63 = load ptr, ptr %4, align 8, !tbaa !13
  %64 = load i32, ptr %11, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds float, ptr %63, i64 %65
  %67 = load i32, ptr %8, align 4, !tbaa !11
  call void @_ZN6GSynthILi16EE10fillBufferEPfi(ptr noundef nonnull align 4 dereferenceable(304) %62, ptr noundef %66, i32 noundef %67)
  br label %68

68:                                               ; preds = %59
  %69 = load i32, ptr %13, align 4, !tbaa !11
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %13, align 4, !tbaa !11
  br label %55, !llvm.loop !16

71:                                               ; preds = %58
  br label %72

72:                                               ; preds = %71
  %73 = load i32, ptr %8, align 4, !tbaa !11
  %74 = load i32, ptr %11, align 4, !tbaa !11
  %75 = add nsw i32 %74, %73
  store i32 %75, ptr %11, align 4, !tbaa !11
  br label %45, !llvm.loop !18

76:                                               ; preds = %49
  %77 = load ptr, ptr %4, align 8, !tbaa !13
  %78 = getelementptr inbounds float, ptr %77, i64 123
  %79 = load float, ptr %78, align 4, !tbaa !5
  store volatile float %79, ptr @_tmp, align 4, !tbaa !5
  %80 = load ptr, ptr %4, align 8, !tbaa !13
  %81 = icmp eq ptr %80, null
  br i1 %81, label %83, label %82

82:                                               ; preds = %76
  call void @_ZdaPv(ptr noundef %80) #8
  br label %83

83:                                               ; preds = %82, %76
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void

84:                                               ; preds = %50
  %85 = load ptr, ptr %6, align 8
  %86 = load i32, ptr %7, align 4
  %87 = insertvalue { ptr, i32 } poison, ptr %85, 0
  %88 = insertvalue { ptr, i32 } %87, i32 %86, 1
  resume { ptr, i32 } %88
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #2

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #3

; 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: nounwind
declare i32 @__cxa_guard_acquire(ptr) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EEC2Ev(ptr noundef nonnull align 4 dereferenceable(304)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #5

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304), float noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EE10fillBufferEPfi(ptr noundef nonnull align 4 dereferenceable(304), ptr noundef, i32 noundef) #0 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #6

attributes #0 = { mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nobuiltin 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 #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { nobuiltin 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 #7 = { builtin allocsize(0) }
attributes #8 = { builtin 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"branch_weights", i32 1, i32 1048575}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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.GSynth = type { [16 x %struct.Granula], i32, float, float, float, float, float, float, float, float, float, float, float }
%struct.Granula = type { float, float, float, float }

@_tmp = external dso_local global float, align 4
@_ZZ6warmupvE5synth = external hidden global [2 x %struct.GSynth], align 16
@_ZGVZ6warmupvE5synth = external hidden global i64, align 8

; Function Attrs: mustprogress uwtable
define dso_local void @_Z6warmupv() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = tail call noalias noundef nonnull dereferenceable(192512) ptr @_Znam(i64 noundef 192512) #5
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(192512) %1, i8 0, i64 192512, i1 false)
  %2 = load atomic i8, ptr @_ZGVZ6warmupvE5synth acquire, align 8
  %3 = icmp eq i8 %2, 0
  br i1 %3, label %4, label %7, !prof !5

4:                                                ; preds = %0
  %5 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZ6warmupvE5synth) #6
  %.not = icmp eq i32 %5, 0
  br i1 %.not, label %7, label %.preheader21.preheader

.preheader21.preheader:                           ; preds = %4
  invoke void @_ZN6GSynthILi16EEC2Ev(ptr noundef nonnull align 4 dereferenceable(304) @_ZZ6warmupvE5synth)
          to label %.preheader21.1 unwind label %13

.preheader21.1:                                   ; preds = %.preheader21.preheader
  invoke void @_ZN6GSynthILi16EEC2Ev(ptr noundef nonnull align 4 dereferenceable(304) getelementptr inbounds (i8, ptr @_ZZ6warmupvE5synth, i64 304))
          to label %6 unwind label %13

6:                                                ; preds = %.preheader21.1
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZ6warmupvE5synth) #6
  br label %7

7:                                                ; preds = %6, %4, %0
  tail call void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304) @_ZZ6warmupvE5synth, float noundef 0x40441999A0000000, i32 noundef 0, float noundef 0x3FE9EB8520000000, float noundef 0x3FBC28F5C0000000, float noundef 0x3F847AE140000000, float noundef 0x4000147AE0000000, float noundef 0x3FBC28F5C0000000)
  tail call void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304) getelementptr inbounds (i8, ptr @_ZZ6warmupvE5synth, i64 304), float noundef 0x40569999A0000000, i32 noundef 0, float noundef 0x3FC353F7C0000000, float noundef 0x3FAA1CAC00000000, float noundef 0x3F847AE140000000, float noundef 0x4024051EC0000000, float noundef 0x3FED1EB860000000)
  br label %.preheader

.preheader:                                       ; preds = %7, %.preheader
  %indvars.iv = phi i64 [ 0, %7 ], [ %indvars.iv.next, %.preheader ]
  %8 = getelementptr inbounds float, ptr %1, i64 %indvars.iv
  tail call void @_ZN6GSynthILi16EE10fillBufferEPfi(ptr noundef nonnull align 4 dereferenceable(304) @_ZZ6warmupvE5synth, ptr noundef nonnull %8, i32 noundef 256)
  tail call void @_ZN6GSynthILi16EE10fillBufferEPfi(ptr noundef nonnull align 4 dereferenceable(304) getelementptr inbounds (i8, ptr @_ZZ6warmupvE5synth, i64 304), ptr noundef nonnull %8, i32 noundef 256)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 256
  %9 = icmp ult i64 %indvars.iv, 47872
  br i1 %9, label %.preheader, label %10, !llvm.loop !6

10:                                               ; preds = %.preheader
  %11 = getelementptr inbounds i8, ptr %1, i64 492
  %12 = load float, ptr %11, align 4, !tbaa !8
  store volatile float %12, ptr @_tmp, align 4, !tbaa !8
  tail call void @_ZdaPv(ptr noundef nonnull %1) #7
  ret void

13:                                               ; preds = %.preheader21.1, %.preheader21.preheader
  %14 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZ6warmupvE5synth) #6
  resume { ptr, i32 } %14
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EEC2Ev(ptr noundef nonnull align 4 dereferenceable(304)) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EE9setParamsEfifffff(ptr noundef nonnull align 4 dereferenceable(304), float noundef, i32 noundef, float noundef, float noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN6GSynthILi16EE10fillBufferEPfi(ptr noundef nonnull align 4 dereferenceable(304), ptr noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #4

attributes #0 = { mustprogress 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 = { nobuiltin 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 #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nofree nounwind }
attributes #4 = { nobuiltin 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 = { builtin allocsize(0) }
attributes #6 = { nounwind }
attributes #7 = { builtin 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 = !{!"branch_weights", i32 1, i32 1048575}
!6 = distinct !{!6, !7}
!7 = !{!"llvm.loop.mustprogress"}
!8 = !{!9, !9, i64 0}
!9 = !{!"float", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C++ TBAA"}


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