; LLVM IR from sourceryinstitute/MORFEUS-Source :: src/FV/src/mesh_optimize/OptMS (SMinit)

; 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.__SMsmooth_data = type { i32, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.__SMparam = type { i32, i32, i32, double, double, double, double, i32, i32, i32, double, double, ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 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

declare i32 @SMerror(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) #1

; 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 i32 @SMinitSmoothParam(i32 noundef %0, i32 noundef %1, double noundef %2, ptr noundef %3) #2 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca double, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store i32 %0, ptr %6, align 4, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !5
  store double %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %14 = load ptr, ptr %9, align 8, !tbaa !11
  store ptr %14, ptr %11, align 8, !tbaa !11
  %15 = load ptr, ptr %11, align 8, !tbaa !11
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %19

17:                                               ; preds = %4
  %18 = call i32 @SMerror(i32 noundef 372, ptr noundef @.str.24, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 56, i32 noundef 0, ptr noundef null)
  store i32 %18, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

19:                                               ; preds = %4
  %20 = load ptr, ptr %11, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct.__SMsmooth_data, ptr %20, i32 0, i32 2
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  store ptr %22, ptr %12, align 8, !tbaa !11
  %23 = load ptr, ptr %12, align 8, !tbaa !11
  %24 = icmp eq ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %19
  %26 = call i32 @SMerror(i32 noundef 374, ptr noundef @.str.24, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 56, i32 noundef 0, ptr noundef null)
  store i32 %26, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

27:                                               ; preds = %19
  %28 = load ptr, ptr %12, align 8, !tbaa !11
  %29 = getelementptr inbounds %struct.__SMparam, ptr %28, i32 0, i32 0
  store i32 0, ptr %29, align 8, !tbaa !15
  %30 = load ptr, ptr %12, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.__SMparam, ptr %30, i32 0, i32 1
  store i32 -1, ptr %31, align 4, !tbaa !17
  %32 = load ptr, ptr %12, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.__SMparam, ptr %32, i32 0, i32 2
  store i32 20, ptr %33, align 8, !tbaa !18
  %34 = load ptr, ptr %12, align 8, !tbaa !11
  %35 = getelementptr inbounds %struct.__SMparam, ptr %34, i32 0, i32 3
  store double 1.000000e-10, ptr %35, align 8, !tbaa !19
  %36 = load ptr, ptr %12, align 8, !tbaa !11
  %37 = getelementptr inbounds %struct.__SMparam, ptr %36, i32 0, i32 4
  store double 3.000000e-05, ptr %37, align 8, !tbaa !20
  %38 = load ptr, ptr %12, align 8, !tbaa !11
  %39 = getelementptr inbounds %struct.__SMparam, ptr %38, i32 0, i32 5
  store double 0x3EB0C6F7A0B5ED8D, ptr %39, align 8, !tbaa !21
  %40 = load ptr, ptr %12, align 8, !tbaa !11
  %41 = getelementptr inbounds %struct.__SMparam, ptr %40, i32 0, i32 6
  store double 0x3EB0C6F7A0B5ED8D, ptr %41, align 8, !tbaa !22
  %42 = load i32, ptr %7, align 4, !tbaa !5
  %43 = load ptr, ptr %12, align 8, !tbaa !11
  %44 = getelementptr inbounds %struct.__SMparam, ptr %43, i32 0, i32 7
  store i32 %42, ptr %44, align 8, !tbaa !23
  %45 = load ptr, ptr %12, align 8, !tbaa !11
  %46 = getelementptr inbounds %struct.__SMparam, ptr %45, i32 0, i32 11
  store double 1.000000e+300, ptr %46, align 8, !tbaa !24
  %47 = load ptr, ptr %9, align 8, !tbaa !11
  %48 = load i32, ptr %6, align 4, !tbaa !5
  %49 = call i32 @SMsetSmoothTechnique(ptr noundef %47, i32 noundef %48)
  store i32 %49, ptr %10, align 4, !tbaa !5
  %50 = load i32, ptr %10, align 4, !tbaa !5
  %51 = icmp ne i32 %50, 0
  br i1 %51, label %52, label %55

52:                                               ; preds = %27
  %53 = load i32, ptr %10, align 4, !tbaa !5
  %54 = call i32 @SMerror(i32 noundef 385, ptr noundef @.str.24, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %53, i32 noundef 0, ptr noundef null)
  store i32 %54, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

55:                                               ; preds = %27
  %56 = load ptr, ptr %9, align 8, !tbaa !11
  %57 = load i32, ptr %7, align 4, !tbaa !5
  %58 = call i32 @SMsetSmoothFunction(ptr noundef %56, i32 noundef %57)
  store i32 %58, ptr %10, align 4, !tbaa !5
  %59 = load i32, ptr %10, align 4, !tbaa !5
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %64

61:                                               ; preds = %55
  %62 = load i32, ptr %10, align 4, !tbaa !5
  %63 = call i32 @SMerror(i32 noundef 386, ptr noundef @.str.24, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %62, i32 noundef 0, ptr noundef null)
  store i32 %63, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

64:                                               ; preds = %55
  %65 = load ptr, ptr %9, align 8, !tbaa !11
  %66 = load double, ptr %8, align 8, !tbaa !9
  %67 = call i32 @SMsetSmoothThreshold(ptr noundef %65, double noundef %66)
  store i32 %67, ptr %10, align 4, !tbaa !5
  %68 = load i32, ptr %10, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %73

70:                                               ; preds = %64
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = call i32 @SMerror(i32 noundef 387, ptr noundef @.str.24, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef %71, i32 noundef 0, ptr noundef null)
  store i32 %72, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

73:                                               ; preds = %64
  store i32 0, ptr %10, align 4, !tbaa !5
  store i32 0, ptr %5, align 4
  store i32 1, ptr %13, align 4
  br label %74

74:                                               ; preds = %73, %70, %61, %52, %25, %17
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  %75 = load i32, ptr %5, align 4
  ret i32 %75
}

declare i32 @SMsetSmoothTechnique(ptr noundef, i32 noundef) #1

declare i32 @SMsetSmoothFunction(ptr noundef, i32 noundef) #1

declare i32 @SMsetSmoothThreshold(ptr noundef, double noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !12, i64 16}
!14 = !{!"__SMsmooth_data", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48}
!15 = !{!16, !6, i64 0}
!16 = !{!"__SMparam", !6, i64 0, !6, i64 4, !6, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !10, i64 64, !10, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !6, i64 8}
!19 = !{!16, !10, i64 16}
!20 = !{!16, !10, i64 24}
!21 = !{!16, !10, i64 32}
!22 = !{!16, !10, i64 40}
!23 = !{!16, !6, i64 48}
!24 = !{!16, !10, i64 72}


; 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.1 = external hidden unnamed_addr constant [106 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [18 x i8], align 1

declare i32 @SMerror(i32 noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i32 @SMinitSmoothParam(i32 noundef %0, i32 noundef %1, double noundef %2, ptr noundef %3) local_unnamed_addr #1 {
  %5 = icmp eq ptr %3, null
  br i1 %5, label %6, label %8

6:                                                ; preds = %4
  %7 = tail call i32 @SMerror(i32 noundef 372, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 56, i32 noundef 0, ptr noundef null) #2
  br label %32

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %3, i64 16
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = icmp eq ptr %10, null
  br i1 %11, label %12, label %14

12:                                               ; preds = %8
  %13 = tail call i32 @SMerror(i32 noundef 374, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 56, i32 noundef 0, ptr noundef null) #2
  br label %32

14:                                               ; preds = %8
  store i32 0, ptr %10, align 8, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %10, i64 4
  store i32 -1, ptr %15, align 4, !tbaa !14
  %16 = getelementptr inbounds i8, ptr %10, i64 8
  store i32 20, ptr %16, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %10, i64 16
  store <2 x double> <double 1.000000e-10, double 3.000000e-05>, ptr %17, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %10, i64 32
  store <2 x double> <double 0x3EB0C6F7A0B5ED8D, double 0x3EB0C6F7A0B5ED8D>, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %10, i64 48
  store i32 %1, ptr %19, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %10, i64 72
  store double 1.000000e+300, ptr %20, align 8, !tbaa !18
  %21 = tail call i32 @SMsetSmoothTechnique(ptr noundef nonnull %3, i32 noundef %0) #2
  %.not = icmp eq i32 %21, 0
  br i1 %.not, label %24, label %22

22:                                               ; preds = %14
  %23 = tail call i32 @SMerror(i32 noundef 385, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %21, i32 noundef 0, ptr noundef null) #2
  br label %32

24:                                               ; preds = %14
  %25 = tail call i32 @SMsetSmoothFunction(ptr noundef nonnull %3, i32 noundef %1) #2
  %.not31 = icmp eq i32 %25, 0
  br i1 %.not31, label %28, label %26

26:                                               ; preds = %24
  %27 = tail call i32 @SMerror(i32 noundef 386, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %25, i32 noundef 0, ptr noundef null) #2
  br label %32

28:                                               ; preds = %24
  %29 = tail call i32 @SMsetSmoothThreshold(ptr noundef nonnull %3, double noundef %2) #2
  %.not32 = icmp eq i32 %29, 0
  br i1 %.not32, label %32, label %30

30:                                               ; preds = %28
  %31 = tail call i32 @SMerror(i32 noundef 387, ptr noundef nonnull @.str.24, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef %29, i32 noundef 0, ptr noundef null) #2
  br label %32

32:                                               ; preds = %28, %30, %26, %22, %12, %6
  %.0 = phi i32 [ %7, %6 ], [ %13, %12 ], [ %23, %22 ], [ %27, %26 ], [ %31, %30 ], [ 0, %28 ]
  ret i32 %.0
}

declare i32 @SMsetSmoothTechnique(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @SMsetSmoothFunction(ptr noundef, i32 noundef) local_unnamed_addr #0

declare i32 @SMsetSmoothThreshold(ptr noundef, double noundef) local_unnamed_addr #0

attributes #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 = { 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, !10, i64 16}
!6 = !{!"__SMsmooth_data", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"__SMparam", !7, i64 0, !7, i64 4, !7, i64 8, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !13, i64 64, !13, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104}
!13 = !{!"double", !8, i64 0}
!14 = !{!12, !7, i64 4}
!15 = !{!12, !7, i64 8}
!16 = !{!13, !13, i64 0}
!17 = !{!12, !7, i64 48}
!18 = !{!12, !13, i64 72}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass