; LLVM IR from OpenFAST/openfast :: modules/map/src (mapinit)

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

@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [25 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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_numeric(ptr noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare double @atof(ptr noundef nonnull) #3

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

declare ptr @bformat(ptr noundef, ...) #1

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

declare i32 @bdestroy(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @remove_first_character(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @expand_node_position_z(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3, ptr noundef %4, ptr noundef %5) #2 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store double %1, ptr %9, align 8, !tbaa !9
  store double %2, ptr %10, align 8, !tbaa !9
  store double %3, ptr %11, align 8, !tbaa !9
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !11
  %18 = load double, ptr %10, align 8, !tbaa !9
  %19 = load double, ptr %9, align 8, !tbaa !9
  %20 = call double @cos(double noundef %19) #6
  %21 = load double, ptr %11, align 8, !tbaa !9
  %22 = load double, ptr %9, align 8, !tbaa !9
  %23 = call double @sin(double noundef %22) #6
  %24 = fmul double %21, %23
  %25 = call double @llvm.fmuladd.f64(double %18, double %20, double %24)
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.Vector_t, ptr %26, i32 0, i32 0
  store double %25, ptr %27, align 8, !tbaa !13
  %28 = load double, ptr %10, align 8, !tbaa !9
  %29 = fneg double %28
  %30 = load double, ptr %9, align 8, !tbaa !9
  %31 = call double @sin(double noundef %30) #6
  %32 = load double, ptr %11, align 8, !tbaa !9
  %33 = load double, ptr %9, align 8, !tbaa !9
  %34 = call double @cos(double noundef %33) #6
  %35 = fmul double %32, %34
  %36 = call double @llvm.fmuladd.f64(double %29, double %31, double %35)
  %37 = load ptr, ptr %8, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.Vector_t, ptr %37, i32 0, i32 1
  store double %36, ptr %38, align 8, !tbaa !15
  %39 = load ptr, ptr %12, align 8, !tbaa !5
  %40 = call ptr (ptr, ...) @bformat(ptr noundef @.str.39, ptr noundef %39)
  store ptr %40, ptr %15, align 8, !tbaa !5
  %41 = load ptr, ptr %12, align 8, !tbaa !5
  %42 = call i32 @is_numeric(ptr noundef %41)
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %59

44:                                               ; preds = %6
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = call double @atof(ptr noundef %45) #7
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Vector_t, ptr %47, i32 0, i32 2
  store double %46, ptr %48, align 8, !tbaa !16
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.Vector_t, ptr %49, i32 0, i32 0
  %51 = load double, ptr %50, align 8, !tbaa !13
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.Vector_t, ptr %52, i32 0, i32 1
  %54 = load double, ptr %53, align 8, !tbaa !15
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Vector_t, ptr %55, i32 0, i32 2
  %57 = load double, ptr %56, align 8, !tbaa !16
  %58 = call ptr (ptr, ...) @bformat(ptr noundef @.str.40, double noundef %51, double noundef %54, double noundef %57)
  store ptr %58, ptr %14, align 8, !tbaa !5
  br label %101

59:                                               ; preds = %6
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 0
  %62 = load i8, ptr %61, align 1, !tbaa !17
  %63 = sext i8 %62 to i32
  %64 = icmp eq i32 %63, 35
  br i1 %64, label %65, label %81

65:                                               ; preds = %59
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = call ptr @remove_first_character(ptr noundef %66)
  %68 = call double @atof(ptr noundef %67) #7
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.Vector_t, ptr %69, i32 0, i32 2
  store double %68, ptr %70, align 8, !tbaa !16
  %71 = load ptr, ptr %8, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.Vector_t, ptr %71, i32 0, i32 0
  %73 = load double, ptr %72, align 8, !tbaa !13
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Vector_t, ptr %74, i32 0, i32 1
  %76 = load double, ptr %75, align 8, !tbaa !15
  %77 = load ptr, ptr %8, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.Vector_t, ptr %77, i32 0, i32 2
  %79 = load double, ptr %78, align 8, !tbaa !16
  %80 = call ptr (ptr, ...) @bformat(ptr noundef @.str.41, double noundef %73, double noundef %76, double noundef %79)
  store ptr %80, ptr %14, align 8, !tbaa !5
  br label %100

81:                                               ; preds = %59
  %82 = load ptr, ptr %15, align 8, !tbaa !5
  %83 = call i32 @biseqcstrcaseless(ptr noundef %82, ptr noundef @.str.42)
  %84 = icmp ne i32 %83, 0
  br i1 %84, label %85, label %96

85:                                               ; preds = %81
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Vector_t, ptr %86, i32 0, i32 0
  %88 = load double, ptr %87, align 8, !tbaa !13
  %89 = load ptr, ptr %8, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Vector_t, ptr %89, i32 0, i32 1
  %91 = load double, ptr %90, align 8, !tbaa !15
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.Vector_t, ptr %92, i32 0, i32 2
  %94 = load double, ptr %93, align 8, !tbaa !16
  %95 = call ptr (ptr, ...) @bformat(ptr noundef @.str.43, double noundef %88, double noundef %91, double noundef %94)
  store ptr %95, ptr %14, align 8, !tbaa !5
  br label %99

96:                                               ; preds = %81
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = call i32 @bdestroy(ptr noundef %97)
  store i32 3, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %109

99:                                               ; preds = %85
  br label %100

100:                                              ; preds = %99, %65
  br label %101

101:                                              ; preds = %100, %44
  %102 = load ptr, ptr %15, align 8, !tbaa !5
  %103 = call i32 @bdestroy(ptr noundef %102)
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = load ptr, ptr %14, align 8, !tbaa !5
  %106 = call i32 @bconcat(ptr noundef %104, ptr noundef %105)
  store i32 %106, ptr %16, align 4, !tbaa !11
  %107 = load ptr, ptr %14, align 8, !tbaa !5
  %108 = call i32 @bdestroy(ptr noundef %107)
  store i32 %108, ptr %16, align 4, !tbaa !11
  store i32 0, ptr %7, align 4
  store i32 1, ptr %17, align 4
  br label %109

109:                                              ; preds = %101, %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  %110 = load i32, ptr %7, align 4
  ret i32 %110
}

; Function Attrs: nounwind
declare double @cos(double noundef) #5

; Function Attrs: nounwind
declare double @sin(double noundef) #5

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 = { inlinehint nounwind willreturn memory(read) 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }

!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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"Vector_t", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!14, !10, i64 8}
!16 = !{!14, !10, i64 16}
!17 = !{!7, !7, i64 0}


; 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.39 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.43 = external hidden unnamed_addr constant [25 x i8], align 1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @is_numeric(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare double @atof(ptr nocapture noundef nonnull) local_unnamed_addr #2

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

declare ptr @bformat(ptr noundef, ...) local_unnamed_addr #0

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

declare i32 @bdestroy(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local ptr @remove_first_character(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 4) i32 @expand_node_position_z(ptr nocapture noundef %0, double noundef %1, double noundef %2, double noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #1 {
  %7 = tail call double @cos(double noundef %1) #5
  %8 = tail call double @sin(double noundef %1) #5
  %9 = fmul double %8, %3
  %10 = tail call double @llvm.fmuladd.f64(double %2, double %7, double %9)
  store double %10, ptr %0, align 8, !tbaa !5
  %11 = fneg double %2
  %12 = tail call double @sin(double noundef %1) #5
  %13 = tail call double @cos(double noundef %1) #5
  %14 = fmul double %13, %3
  %15 = tail call double @llvm.fmuladd.f64(double %11, double %12, double %14)
  %16 = getelementptr inbounds i8, ptr %0, i64 8
  store double %15, ptr %16, align 8, !tbaa !10
  %17 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.39, ptr noundef %4) #5
  %18 = tail call i32 @is_numeric(ptr noundef %4)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %25, label %19

19:                                               ; preds = %6
  %20 = tail call double @atof(ptr noundef %4) #6
  %21 = getelementptr inbounds i8, ptr %0, i64 16
  store double %20, ptr %21, align 8, !tbaa !11
  %22 = load double, ptr %0, align 8, !tbaa !5
  %23 = load double, ptr %16, align 8, !tbaa !10
  %24 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.40, double noundef %22, double noundef %23, double noundef %20) #5
  br label %43

25:                                               ; preds = %6
  %26 = load i8, ptr %4, align 1, !tbaa !12
  %27 = icmp eq i8 %26, 35
  br i1 %27, label %28, label %35

28:                                               ; preds = %25
  %29 = tail call ptr @remove_first_character(ptr noundef nonnull %4)
  %30 = tail call double @atof(ptr noundef %29) #6
  %31 = getelementptr inbounds i8, ptr %0, i64 16
  store double %30, ptr %31, align 8, !tbaa !11
  %32 = load double, ptr %0, align 8, !tbaa !5
  %33 = load double, ptr %16, align 8, !tbaa !10
  %34 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.41, double noundef %32, double noundef %33, double noundef %30) #5
  br label %43

35:                                               ; preds = %25
  %36 = tail call i32 @biseqcstrcaseless(ptr noundef %17, ptr noundef nonnull @.str.42) #5
  %.not33 = icmp eq i32 %36, 0
  br i1 %.not33, label %46, label %37

37:                                               ; preds = %35
  %38 = load double, ptr %0, align 8, !tbaa !5
  %39 = load double, ptr %16, align 8, !tbaa !10
  %40 = getelementptr inbounds i8, ptr %0, i64 16
  %41 = load double, ptr %40, align 8, !tbaa !11
  %42 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.43, double noundef %38, double noundef %39, double noundef %41) #5
  br label %43

43:                                               ; preds = %28, %37, %19
  %.0 = phi ptr [ %24, %19 ], [ %34, %28 ], [ %42, %37 ]
  %44 = tail call i32 @bdestroy(ptr noundef %17) #5
  %45 = tail call i32 @bconcat(ptr noundef %5, ptr noundef %.0) #5
  br label %46

46:                                               ; preds = %35, %43
  %.0.sink = phi ptr [ %.0, %43 ], [ %17, %35 ]
  %.032 = phi i32 [ 0, %43 ], [ 3, %35 ]
  %47 = tail call i32 @bdestroy(ptr noundef %.0.sink) #5
  ret i32 %.032
}

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

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

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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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, !7, i64 0}
!6 = !{!"Vector_t", !7, i64 0, !7, i64 8, !7, i64 16}
!7 = !{!"double", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 8}
!11 = !{!6, !7, i64 16}
!12 = !{!8, !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass