; LLVM IR from Aakriti05/DSP-implementation_LMS_RNN :: rnn_other (thanh)

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @thanh(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %4

4:                                                ; preds = %23, %1
  %5 = load i32, ptr %3, align 4, !tbaa !9
  %6 = icmp slt i32 %5, 16
  br i1 %6, label %8, label %7

7:                                                ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %26

8:                                                ; preds = %4
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = load i32, ptr %3, align 4, !tbaa !9
  %11 = sext i32 %10 to i64
  %12 = getelementptr inbounds double, ptr %9, i64 %11
  %13 = load double, ptr %12, align 8, !tbaa !11
  %14 = fmul double 2.000000e+00, %13
  %15 = call double @exp(double noundef %14) #3
  %16 = fadd double 1.000000e+00, %15
  %17 = fdiv double 2.000000e+00, %16
  %18 = fsub double 1.000000e+00, %17
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds double, ptr %19, i64 %21
  store double %18, ptr %22, align 8, !tbaa !11
  br label %23

23:                                               ; preds = %8
  %24 = load i32, ptr %3, align 4, !tbaa !9
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %3, align 4, !tbaa !9
  br label %4, !llvm.loop !13

26:                                               ; preds = %7
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  ret ptr %27
}

; Function Attrs: nounwind
declare double @exp(double noundef) #2

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


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

; Function Attrs: mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) uwtable
define dso_local noundef ptr @thanh(ptr noundef returned %0) local_unnamed_addr #0 {
  %2 = load double, ptr %0, align 8, !tbaa !5
  %3 = fmul double %2, 2.000000e+00
  %4 = tail call double @exp(double noundef %3) #2
  %5 = fadd double %4, 1.000000e+00
  %6 = fdiv double 2.000000e+00, %5
  %7 = fsub double 1.000000e+00, %6
  store double %7, ptr %0, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = fmul double %9, 2.000000e+00
  %11 = tail call double @exp(double noundef %10) #2
  %12 = fadd double %11, 1.000000e+00
  %13 = fdiv double 2.000000e+00, %12
  %14 = fsub double 1.000000e+00, %13
  store double %14, ptr %8, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load double, ptr %15, align 8, !tbaa !5
  %17 = fmul double %16, 2.000000e+00
  %18 = tail call double @exp(double noundef %17) #2
  %19 = fadd double %18, 1.000000e+00
  %20 = fdiv double 2.000000e+00, %19
  %21 = fsub double 1.000000e+00, %20
  store double %21, ptr %15, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %0, i64 24
  %23 = load double, ptr %22, align 8, !tbaa !5
  %24 = fmul double %23, 2.000000e+00
  %25 = tail call double @exp(double noundef %24) #2
  %26 = fadd double %25, 1.000000e+00
  %27 = fdiv double 2.000000e+00, %26
  %28 = fsub double 1.000000e+00, %27
  store double %28, ptr %22, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 32
  %30 = load double, ptr %29, align 8, !tbaa !5
  %31 = fmul double %30, 2.000000e+00
  %32 = tail call double @exp(double noundef %31) #2
  %33 = fadd double %32, 1.000000e+00
  %34 = fdiv double 2.000000e+00, %33
  %35 = fsub double 1.000000e+00, %34
  store double %35, ptr %29, align 8, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %0, i64 40
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = fmul double %37, 2.000000e+00
  %39 = tail call double @exp(double noundef %38) #2
  %40 = fadd double %39, 1.000000e+00
  %41 = fdiv double 2.000000e+00, %40
  %42 = fsub double 1.000000e+00, %41
  store double %42, ptr %36, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %0, i64 48
  %44 = load double, ptr %43, align 8, !tbaa !5
  %45 = fmul double %44, 2.000000e+00
  %46 = tail call double @exp(double noundef %45) #2
  %47 = fadd double %46, 1.000000e+00
  %48 = fdiv double 2.000000e+00, %47
  %49 = fsub double 1.000000e+00, %48
  store double %49, ptr %43, align 8, !tbaa !5
  %50 = getelementptr inbounds i8, ptr %0, i64 56
  %51 = load double, ptr %50, align 8, !tbaa !5
  %52 = fmul double %51, 2.000000e+00
  %53 = tail call double @exp(double noundef %52) #2
  %54 = fadd double %53, 1.000000e+00
  %55 = fdiv double 2.000000e+00, %54
  %56 = fsub double 1.000000e+00, %55
  store double %56, ptr %50, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %0, i64 64
  %58 = load double, ptr %57, align 8, !tbaa !5
  %59 = fmul double %58, 2.000000e+00
  %60 = tail call double @exp(double noundef %59) #2
  %61 = fadd double %60, 1.000000e+00
  %62 = fdiv double 2.000000e+00, %61
  %63 = fsub double 1.000000e+00, %62
  store double %63, ptr %57, align 8, !tbaa !5
  %64 = getelementptr inbounds i8, ptr %0, i64 72
  %65 = load double, ptr %64, align 8, !tbaa !5
  %66 = fmul double %65, 2.000000e+00
  %67 = tail call double @exp(double noundef %66) #2
  %68 = fadd double %67, 1.000000e+00
  %69 = fdiv double 2.000000e+00, %68
  %70 = fsub double 1.000000e+00, %69
  store double %70, ptr %64, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %0, i64 80
  %72 = load double, ptr %71, align 8, !tbaa !5
  %73 = fmul double %72, 2.000000e+00
  %74 = tail call double @exp(double noundef %73) #2
  %75 = fadd double %74, 1.000000e+00
  %76 = fdiv double 2.000000e+00, %75
  %77 = fsub double 1.000000e+00, %76
  store double %77, ptr %71, align 8, !tbaa !5
  %78 = getelementptr inbounds i8, ptr %0, i64 88
  %79 = load double, ptr %78, align 8, !tbaa !5
  %80 = fmul double %79, 2.000000e+00
  %81 = tail call double @exp(double noundef %80) #2
  %82 = fadd double %81, 1.000000e+00
  %83 = fdiv double 2.000000e+00, %82
  %84 = fsub double 1.000000e+00, %83
  store double %84, ptr %78, align 8, !tbaa !5
  %85 = getelementptr inbounds i8, ptr %0, i64 96
  %86 = load double, ptr %85, align 8, !tbaa !5
  %87 = fmul double %86, 2.000000e+00
  %88 = tail call double @exp(double noundef %87) #2
  %89 = fadd double %88, 1.000000e+00
  %90 = fdiv double 2.000000e+00, %89
  %91 = fsub double 1.000000e+00, %90
  store double %91, ptr %85, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %0, i64 104
  %93 = load double, ptr %92, align 8, !tbaa !5
  %94 = fmul double %93, 2.000000e+00
  %95 = tail call double @exp(double noundef %94) #2
  %96 = fadd double %95, 1.000000e+00
  %97 = fdiv double 2.000000e+00, %96
  %98 = fsub double 1.000000e+00, %97
  store double %98, ptr %92, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %0, i64 112
  %100 = load double, ptr %99, align 8, !tbaa !5
  %101 = fmul double %100, 2.000000e+00
  %102 = tail call double @exp(double noundef %101) #2
  %103 = fadd double %102, 1.000000e+00
  %104 = fdiv double 2.000000e+00, %103
  %105 = fsub double 1.000000e+00, %104
  store double %105, ptr %99, align 8, !tbaa !5
  %106 = getelementptr inbounds i8, ptr %0, i64 120
  %107 = load double, ptr %106, align 8, !tbaa !5
  %108 = fmul double %107, 2.000000e+00
  %109 = tail call double @exp(double noundef %108) #2
  %110 = fadd double %109, 1.000000e+00
  %111 = fdiv double 2.000000e+00, %110
  %112 = fsub double 1.000000e+00, %111
  store double %112, ptr %106, align 8, !tbaa !5
  ret ptr %0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @exp(double noundef) local_unnamed_addr #1

attributes #0 = { mustprogress nofree nounwind willreturn memory(write, argmem: readwrite) 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 nofree nounwind willreturn memory(write) "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, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass