; LLVM IR from Ryuk17/SpeechAlgorithms :: Goertzel (Goertzel)

; 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"

%class.DtmfDetector = type <{ %class.DtmfDetectorInterface.base, [6 x i8], ptr, [18 x i32], ptr, i32, i32, i8, i8, [6 x i8] }>
%class.DtmfDetectorInterface.base = type <{ [65 x i8], [7 x i8], ptr, i16 }>
%class.DtmfGenerator = type { i32, i32, i32, i32, i32, [20 x i8], i32, i32, i32, i16, i16, i32, i32, i32, i32 }

@__const.main.dialButtons = external hidden unnamed_addr constant <{ i8, i8, i8, i8, [12 x i8] }>, align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca [16 x i8], align 16
  %3 = alloca [160 x i16], align 16
  %4 = alloca [128 x i8], align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.DtmfDetector, align 8
  %9 = alloca %class.DtmfGenerator, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr %2) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.main.dialButtons, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %4) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 4, ptr %7, align 4, !tbaa !5
  %12 = getelementptr inbounds [128 x i8], ptr %4, i64 0, i64 0
  %13 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %12, ptr noundef @.str, ptr noundef @.str.1) #6
  %14 = getelementptr inbounds [128 x i8], ptr %4, i64 0, i64 0
  %15 = call noalias ptr @fopen(ptr noundef %14, ptr noundef @.str.2)
  store ptr %15, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 192, ptr %8) #6
  call void @_ZN12DtmfDetectorC1Ei(ptr noundef nonnull align 8 dereferenceable(186) %8, i32 noundef 160)
  call void @llvm.lifetime.start.p0(i64 72, ptr %9) #6
  invoke void @_ZN13DtmfGeneratorC1Eiii(ptr noundef nonnull align 4 dereferenceable(72) %9, i32 noundef 160, i32 noundef 400, i32 noundef 200)
          to label %16 unwind label %35

16:                                               ; preds = %0
  invoke void @_ZN13DtmfGenerator18dtmfGeneratorResetEv(ptr noundef nonnull align 4 dereferenceable(72) %9)
          to label %17 unwind label %39

17:                                               ; preds = %16
  invoke void @_ZNK21DtmfDetectorInterface20zerosIndexDialButtonEv(ptr noundef nonnull align 8 dereferenceable(82) %8)
          to label %18 unwind label %39

18:                                               ; preds = %17
  %19 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  %20 = load i32, ptr %7, align 4, !tbaa !5
  %21 = invoke noundef i32 @_ZN13DtmfGenerator27transmitNewDialButtonsArrayEPcj(ptr noundef nonnull align 4 dereferenceable(72) %9, ptr noundef %19, i32 noundef %20)
          to label %22 unwind label %39

22:                                               ; preds = %18
  br label %23

23:                                               ; preds = %34, %22
  %24 = invoke noundef i32 @_ZNK13DtmfGenerator12getReadyFlagEv(ptr noundef nonnull align 4 dereferenceable(72) %9)
          to label %25 unwind label %39

25:                                               ; preds = %23
  %26 = icmp ne i32 %24, 0
  %27 = xor i1 %26, true
  br i1 %27, label %28, label %43

28:                                               ; preds = %25
  %29 = getelementptr inbounds [160 x i16], ptr %3, i64 0, i64 0
  invoke void @_ZN13DtmfGenerator14dtmfGeneratingEPs(ptr noundef nonnull align 4 dereferenceable(72) %9, ptr noundef %29)
          to label %30 unwind label %39

30:                                               ; preds = %28
  %31 = getelementptr inbounds [160 x i16], ptr %3, i64 0, i64 0
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = invoke i64 @fwrite(ptr noundef %31, i64 noundef 2, i64 noundef 160, ptr noundef %32)
          to label %34 unwind label %39

34:                                               ; preds = %30
  br label %23, !llvm.loop !11

35:                                               ; preds = %0
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %10, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %11, align 4
  br label %73

39:                                               ; preds = %69, %67, %65, %62, %59, %53, %49, %46, %43, %30, %28, %23, %18, %17, %16
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %10, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %11, align 4
  call void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72) %9) #6
  br label %73

43:                                               ; preds = %25
  %44 = load ptr, ptr %6, align 8, !tbaa !9
  %45 = invoke i32 @fclose(ptr noundef %44)
          to label %46 unwind label %39

46:                                               ; preds = %43
  %47 = getelementptr inbounds [16 x i8], ptr %2, i64 0, i64 0
  %48 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, ptr noundef %47)
          to label %49 unwind label %39

49:                                               ; preds = %46
  %50 = getelementptr inbounds [128 x i8], ptr %4, i64 0, i64 0
  %51 = invoke noalias ptr @fopen(ptr noundef %50, ptr noundef @.str.4)
          to label %52 unwind label %39

52:                                               ; preds = %49
  store ptr %51, ptr %5, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %61, %52
  %54 = getelementptr inbounds [160 x i16], ptr %3, i64 0, i64 0
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = invoke i64 @fread(ptr noundef %54, i64 noundef 2, i64 noundef 160, ptr noundef %55)
          to label %57 unwind label %39

57:                                               ; preds = %53
  %58 = icmp ne i64 %56, 0
  br i1 %58, label %59, label %62

59:                                               ; preds = %57
  %60 = getelementptr inbounds [160 x i16], ptr %3, i64 0, i64 0
  invoke void @_ZN12DtmfDetector13dtmfDetectingEPs(ptr noundef nonnull align 8 dereferenceable(186) %8, ptr noundef %60)
          to label %61 unwind label %39

61:                                               ; preds = %59
  br label %53, !llvm.loop !13

62:                                               ; preds = %57
  %63 = load ptr, ptr %5, align 8, !tbaa !9
  %64 = invoke i32 @fclose(ptr noundef %63)
          to label %65 unwind label %39

65:                                               ; preds = %62
  %66 = invoke noundef ptr @_ZNK21DtmfDetectorInterface19getDialButtonsArrayEv(ptr noundef nonnull align 8 dereferenceable(82) %8)
          to label %67 unwind label %39

67:                                               ; preds = %65
  %68 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.5, ptr noundef %66)
          to label %69 unwind label %39

69:                                               ; preds = %67
  %70 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.6)
          to label %71 unwind label %39

71:                                               ; preds = %69
  store i32 0, ptr %1, align 4
  call void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72) %9) #6
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #6
  call void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186) %8) #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 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 320, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  %72 = load i32, ptr %1, align 4
  ret i32 %72

73:                                               ; preds = %39, %35
  call void @llvm.lifetime.end.p0(i64 72, ptr %9) #6
  call void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186) %8) #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 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 320, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %2) #6
  br label %74

74:                                               ; preds = %73
  %75 = load ptr, ptr %10, align 8
  %76 = load i32, ptr %11, align 4
  %77 = insertvalue { ptr, i32 } poison, ptr %75, 0
  %78 = insertvalue { ptr, i32 } %77, i32 %76, 1
  resume { ptr, i32 } %78
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #3

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

declare void @_ZN12DtmfDetectorC1Ei(ptr noundef nonnull align 8 dereferenceable(186), i32 noundef) unnamed_addr #4

declare void @_ZN13DtmfGeneratorC1Eiii(ptr noundef nonnull align 4 dereferenceable(72), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13DtmfGenerator18dtmfGeneratorResetEv(ptr noundef nonnull align 4 dereferenceable(72)) #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK21DtmfDetectorInterface20zerosIndexDialButtonEv(ptr noundef nonnull align 8 dereferenceable(82)) #5 align 2

declare noundef i32 @_ZN13DtmfGenerator27transmitNewDialButtonsArrayEPcj(ptr noundef nonnull align 4 dereferenceable(72), ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK13DtmfGenerator12getReadyFlagEv(ptr noundef nonnull align 4 dereferenceable(72)) #5 align 2

declare void @_ZN13DtmfGenerator14dtmfGeneratingEPs(ptr noundef nonnull align 4 dereferenceable(72), ptr noundef) #4

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare i32 @fclose(ptr noundef) #4

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

declare void @_ZN12DtmfDetector13dtmfDetectingEPs(ptr noundef nonnull align 8 dereferenceable(186), ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK21DtmfDetectorInterface19getDialButtonsArrayEv(ptr noundef nonnull align 8 dereferenceable(82)) #5 align 2

; Function Attrs: nounwind
declare void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72)) unnamed_addr #3

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

; Function Attrs: nounwind
declare void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186)) unnamed_addr #3

attributes #0 = { mustprogress norecurse 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 nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { mustprogress 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; 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"

%class.DtmfDetector = type <{ %class.DtmfDetectorInterface.base, [6 x i8], ptr, [18 x i32], ptr, i32, i32, i8, i8, [6 x i8] }>
%class.DtmfDetectorInterface.base = type <{ [65 x i8], [7 x i8], ptr, i16 }>
%class.DtmfGenerator = type { i32, i32, i32, i32, i32, [20 x i8], i32, i32, i32, i16, i16, i32, i32, i32, i32 }

@__const.main.dialButtons = external hidden unnamed_addr constant <{ i8, i8, i8, i8, [12 x i8] }>, align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca [16 x i8], align 16
  %2 = alloca [160 x i16], align 16
  %3 = alloca [128 x i8], align 16
  %4 = alloca %class.DtmfDetector, align 8
  %5 = alloca %class.DtmfGenerator, align 4
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %1, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.dialButtons, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 320, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #7
  %6 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str, ptr noundef nonnull @.str.1) #7
  %7 = call noalias ptr @fopen(ptr noundef nonnull %3, ptr noundef nonnull @.str.2)
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %4) #7
  call void @_ZN12DtmfDetectorC1Ei(ptr noundef nonnull align 8 dereferenceable(186) %4, i32 noundef 160)
  call void @llvm.lifetime.start.p0(i64 72, ptr nonnull %5) #7
  invoke void @_ZN13DtmfGeneratorC1Eiii(ptr noundef nonnull align 4 dereferenceable(72) %5, i32 noundef 160, i32 noundef 400, i32 noundef 200)
          to label %8 unwind label %14

8:                                                ; preds = %0
  call void @_ZN13DtmfGenerator18dtmfGeneratorResetEv(ptr noundef nonnull align 4 dereferenceable(72) %5)
  call void @_ZNK21DtmfDetectorInterface20zerosIndexDialButtonEv(ptr noundef nonnull align 8 dereferenceable(82) %4)
  %9 = invoke noundef i32 @_ZN13DtmfGenerator27transmitNewDialButtonsArrayEPcj(ptr noundef nonnull align 4 dereferenceable(72) %5, ptr noundef nonnull %1, i32 noundef 4)
          to label %.preheader unwind label %.loopexit.split-lp.loopexit.split-lp

.preheader:                                       ; preds = %8
  %10 = call noundef i32 @_ZNK13DtmfGenerator12getReadyFlagEv(ptr noundef nonnull align 4 dereferenceable(72) %5)
  %.not13 = icmp eq i32 %10, 0
  br i1 %.not13, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader, %11
  invoke void @_ZN13DtmfGenerator14dtmfGeneratingEPs(ptr noundef nonnull align 4 dereferenceable(72) %5, ptr noundef nonnull %2)
          to label %11 unwind label %.loopexit.split-lp.loopexit

11:                                               ; preds = %.lr.ph
  %12 = call i64 @fwrite(ptr noundef nonnull %2, i64 noundef 2, i64 noundef 160, ptr noundef %7)
  %13 = call noundef i32 @_ZNK13DtmfGenerator12getReadyFlagEv(ptr noundef nonnull align 4 dereferenceable(72) %5)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %.lr.ph, label %._crit_edge, !llvm.loop !5

14:                                               ; preds = %0
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %27

.loopexit:                                        ; preds = %21
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %.lr.ph
  %lpad.loopexit10 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp:             ; preds = %8
  %lpad.loopexit.split-lp11 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit10, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp11, %.loopexit.split-lp.loopexit.split-lp ]
  call void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72) %5) #7
  br label %27

._crit_edge:                                      ; preds = %11, %.preheader
  %16 = call i32 @fclose(ptr noundef %7)
  %17 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull %1)
  %18 = call noalias ptr @fopen(ptr noundef nonnull %3, ptr noundef nonnull @.str.4)
  br label %19

19:                                               ; preds = %21, %._crit_edge
  %20 = call i64 @fread(ptr noundef nonnull %2, i64 noundef 2, i64 noundef 160, ptr noundef %18)
  %.not8 = icmp eq i64 %20, 0
  br i1 %.not8, label %22, label %21

21:                                               ; preds = %19
  invoke void @_ZN12DtmfDetector13dtmfDetectingEPs(ptr noundef nonnull align 8 dereferenceable(186) %4, ptr noundef nonnull %2)
          to label %19 unwind label %.loopexit, !llvm.loop !7

22:                                               ; preds = %19
  %23 = call i32 @fclose(ptr noundef %18)
  %24 = call noundef ptr @_ZNK21DtmfDetectorInterface19getDialButtonsArrayEv(ptr noundef nonnull align 8 dereferenceable(82) %4)
  %25 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, ptr noundef %24)
  %26 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  call void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72) %5) #7
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #7
  call void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186) %4) #7
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  ret i32 0

27:                                               ; preds = %.loopexit.split-lp, %14
  %.pn = phi { ptr, i32 } [ %lpad.phi, %.loopexit.split-lp ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 72, ptr nonnull %5) #7
  call void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186) %4) #7
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 320, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn
}

; 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 nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

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

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

declare void @_ZN12DtmfDetectorC1Ei(ptr noundef nonnull align 8 dereferenceable(186), i32 noundef) unnamed_addr #4

declare void @_ZN13DtmfGeneratorC1Eiii(ptr noundef nonnull align 4 dereferenceable(72), i32 noundef, i32 noundef, i32 noundef) unnamed_addr #4

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN13DtmfGenerator18dtmfGeneratorResetEv(ptr noundef nonnull align 4 dereferenceable(72)) local_unnamed_addr #5 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNK21DtmfDetectorInterface20zerosIndexDialButtonEv(ptr noundef nonnull align 8 dereferenceable(82)) local_unnamed_addr #5 align 2

declare noundef i32 @_ZN13DtmfGenerator27transmitNewDialButtonsArrayEPcj(ptr noundef nonnull align 4 dereferenceable(72), ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK13DtmfGenerator12getReadyFlagEv(ptr noundef nonnull align 4 dereferenceable(72)) local_unnamed_addr #5 align 2

declare void @_ZN13DtmfGenerator14dtmfGeneratingEPs(ptr noundef nonnull align 4 dereferenceable(72), ptr noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

declare void @_ZN12DtmfDetector13dtmfDetectingEPs(ptr noundef nonnull align 8 dereferenceable(186), ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK21DtmfDetectorInterface19getDialButtonsArrayEv(ptr noundef nonnull align 8 dereferenceable(82)) local_unnamed_addr #5 align 2

; Function Attrs: nounwind
declare void @_ZN13DtmfGeneratorD1Ev(ptr noundef nonnull align 4 dereferenceable(72)) unnamed_addr #6

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

; Function Attrs: nounwind
declare void @_ZN12DtmfDetectorD1Ev(ptr noundef nonnull align 8 dereferenceable(186)) unnamed_addr #6

attributes #0 = { mustprogress norecurse 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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress 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 #6 = { 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 = { 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = distinct !{!7, !6}


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