; 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.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [11 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

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

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

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

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

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

declare i32 @bdestroy(ptr noundef) #4

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @expand_node_force_z(ptr noundef %0, double noundef %1, double noundef %2, double noundef %3, ptr noundef %4, ptr noundef %5) #1 {
  %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 i32, align 4
  %16 = 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 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !11
  %17 = load double, ptr %10, align 8, !tbaa !9
  %18 = load double, ptr %9, align 8, !tbaa !9
  %19 = call double @cos(double noundef %18) #6
  %20 = load double, ptr %11, align 8, !tbaa !9
  %21 = load double, ptr %9, align 8, !tbaa !9
  %22 = call double @sin(double noundef %21) #6
  %23 = fmul double %20, %22
  %24 = call double @llvm.fmuladd.f64(double %17, double %19, double %23)
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Vector_t, ptr %25, i32 0, i32 0
  store double %24, ptr %26, align 8, !tbaa !13
  %27 = load double, ptr %10, align 8, !tbaa !9
  %28 = fneg double %27
  %29 = load double, ptr %9, align 8, !tbaa !9
  %30 = call double @sin(double noundef %29) #6
  %31 = load double, ptr %11, align 8, !tbaa !9
  %32 = load double, ptr %9, align 8, !tbaa !9
  %33 = call double @cos(double noundef %32) #6
  %34 = fmul double %31, %33
  %35 = call double @llvm.fmuladd.f64(double %28, double %30, double %34)
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Vector_t, ptr %36, i32 0, i32 1
  store double %35, ptr %37, align 8, !tbaa !15
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = call i32 @is_numeric(ptr noundef %38)
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %56

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

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

62:                                               ; preds = %56
  %63 = load ptr, ptr %12, align 8, !tbaa !5
  %64 = call ptr @remove_first_character(ptr noundef %63)
  %65 = call i32 @is_numeric(ptr noundef %64)
  %66 = icmp ne i32 %65, 0
  br i1 %66, label %67, label %83

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

83:                                               ; preds = %62
  %84 = load ptr, ptr %8, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.Vector_t, ptr %84, i32 0, i32 2
  store double 0xC08F3F3333333333, ptr %85, align 8, !tbaa !16
  %86 = call ptr (ptr, ...) @bformat(ptr noundef @.str.46)
  store ptr %86, ptr %14, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %83, %67
  br label %94

88:                                               ; preds = %56
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = load ptr, ptr %14, align 8, !tbaa !5
  %91 = call i32 @bconcat(ptr noundef %89, ptr noundef %90)
  store i32 %91, ptr %15, align 4, !tbaa !11
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = call i32 @bdestroy(ptr noundef %92)
  store i32 %93, ptr %15, align 4, !tbaa !11
  store i32 3, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %101

94:                                               ; preds = %87
  br label %95

95:                                               ; preds = %94, %41
  %96 = load ptr, ptr %13, align 8, !tbaa !5
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = call i32 @bconcat(ptr noundef %96, ptr noundef %97)
  store i32 %98, ptr %15, align 4, !tbaa !11
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  %100 = call i32 @bdestroy(ptr noundef %99)
  store i32 %100, ptr %15, align 4, !tbaa !11
  store i32 0, ptr %7, align 4
  store i32 1, ptr %16, align 4
  br label %101

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

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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = { 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.44 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

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

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

declare i32 @bdestroy(ptr noundef) local_unnamed_addr #3

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

; 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

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 4) i32 @expand_node_force_z(ptr nocapture noundef %0, double noundef %1, double noundef %2, double noundef %3, ptr noundef %4, ptr noundef %5) local_unnamed_addr #0 {
  %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 i32 @is_numeric(ptr noundef %4)
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %24, label %18

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

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

27:                                               ; preds = %24
  %28 = tail call ptr @remove_first_character(ptr noundef nonnull %4)
  %29 = tail call i32 @is_numeric(ptr noundef %28)
  %.not31 = icmp eq i32 %29, 0
  br i1 %.not31, label %37, label %30

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

37:                                               ; preds = %27
  %38 = getelementptr inbounds i8, ptr %0, i64 16
  store double 0xC08F3F3333333333, ptr %38, align 8, !tbaa !11
  %39 = tail call ptr (ptr, ...) @bformat(ptr noundef nonnull @.str.46) #5
  br label %40

40:                                               ; preds = %18, %30, %37, %24
  %.0.sink32 = phi ptr [ null, %24 ], [ %23, %18 ], [ %36, %30 ], [ %39, %37 ]
  %.030 = phi i32 [ 3, %24 ], [ 0, %18 ], [ 0, %30 ], [ 0, %37 ]
  %41 = tail call i32 @bconcat(ptr noundef %5, ptr noundef %.0.sink32) #5
  %42 = tail call i32 @bdestroy(ptr noundef %.0.sink32) #5
  ret i32 %.030
}

attributes #0 = { 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 #1 = { 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { "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 = { 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