; LLVM IR from Slingshot-Physics/slingshot-community :: datamodel (data_matrix33)

; 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.matrix33 = type { [3 x [3 x float]] }

@.str = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 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
define dso_local i32 @matrix33_from_json(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca [9 x float], align 16
  %7 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %4, align 8, !tbaa !5
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  store i32 0, ptr %3, align 4
  br label %82

11:                                               ; preds = %2
  %12 = load ptr, ptr %5, align 8, !tbaa !5
  %13 = icmp eq ptr %12, null
  br i1 %13, label %14, label %15

14:                                               ; preds = %11
  store i32 0, ptr %3, align 4
  br label %82

15:                                               ; preds = %11
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call i32 @verify_typename(ptr noundef %16, ptr noundef @.str)
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  store i32 0, ptr %3, align 4
  br label %82

20:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 36, ptr %6) #3
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 0
  %23 = call i32 @copy_fixed_float_array_field(ptr noundef %21, ptr noundef @.str.1, i32 noundef 9, ptr noundef %22)
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %20
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %81

26:                                               ; preds = %20
  %27 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 0
  %28 = load float, ptr %27, align 16, !tbaa !9
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.matrix33, ptr %29, i32 0, i32 0
  %31 = getelementptr inbounds [3 x [3 x float]], ptr %30, i64 0, i64 0
  %32 = getelementptr inbounds [3 x float], ptr %31, i64 0, i64 0
  store float %28, ptr %32, align 4, !tbaa !9
  %33 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 1
  %34 = load float, ptr %33, align 4, !tbaa !9
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.matrix33, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds [3 x [3 x float]], ptr %36, i64 0, i64 0
  %38 = getelementptr inbounds [3 x float], ptr %37, i64 0, i64 1
  store float %34, ptr %38, align 4, !tbaa !9
  %39 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 2
  %40 = load float, ptr %39, align 8, !tbaa !9
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.matrix33, ptr %41, i32 0, i32 0
  %43 = getelementptr inbounds [3 x [3 x float]], ptr %42, i64 0, i64 0
  %44 = getelementptr inbounds [3 x float], ptr %43, i64 0, i64 2
  store float %40, ptr %44, align 4, !tbaa !9
  %45 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 3
  %46 = load float, ptr %45, align 4, !tbaa !9
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.matrix33, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds [3 x [3 x float]], ptr %48, i64 0, i64 1
  %50 = getelementptr inbounds [3 x float], ptr %49, i64 0, i64 0
  store float %46, ptr %50, align 4, !tbaa !9
  %51 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 4
  %52 = load float, ptr %51, align 16, !tbaa !9
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.matrix33, ptr %53, i32 0, i32 0
  %55 = getelementptr inbounds [3 x [3 x float]], ptr %54, i64 0, i64 1
  %56 = getelementptr inbounds [3 x float], ptr %55, i64 0, i64 1
  store float %52, ptr %56, align 4, !tbaa !9
  %57 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 5
  %58 = load float, ptr %57, align 4, !tbaa !9
  %59 = load ptr, ptr %5, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.matrix33, ptr %59, i32 0, i32 0
  %61 = getelementptr inbounds [3 x [3 x float]], ptr %60, i64 0, i64 1
  %62 = getelementptr inbounds [3 x float], ptr %61, i64 0, i64 2
  store float %58, ptr %62, align 4, !tbaa !9
  %63 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 6
  %64 = load float, ptr %63, align 8, !tbaa !9
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.matrix33, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds [3 x [3 x float]], ptr %66, i64 0, i64 2
  %68 = getelementptr inbounds [3 x float], ptr %67, i64 0, i64 0
  store float %64, ptr %68, align 4, !tbaa !9
  %69 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 7
  %70 = load float, ptr %69, align 4, !tbaa !9
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.matrix33, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds [3 x [3 x float]], ptr %72, i64 0, i64 2
  %74 = getelementptr inbounds [3 x float], ptr %73, i64 0, i64 1
  store float %70, ptr %74, align 4, !tbaa !9
  %75 = getelementptr inbounds [9 x float], ptr %6, i64 0, i64 8
  %76 = load float, ptr %75, align 16, !tbaa !9
  %77 = load ptr, ptr %5, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.matrix33, ptr %77, i32 0, i32 0
  %79 = getelementptr inbounds [3 x [3 x float]], ptr %78, i64 0, i64 2
  %80 = getelementptr inbounds [3 x float], ptr %79, i64 0, i64 2
  store float %76, ptr %80, align 4, !tbaa !9
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %81

81:                                               ; preds = %26, %25
  call void @llvm.lifetime.end.p0(i64 36, ptr %6) #3
  br label %82

82:                                               ; preds = %81, %19, %14, %10
  %83 = load i32, ptr %3, align 4
  ret i32 %83
}

declare i32 @verify_typename(ptr noundef, ptr noundef) #2

declare i32 @copy_fixed_float_array_field(ptr noundef, ptr noundef, i32 noundef, ptr 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 = { "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 = !{!"float", !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 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1

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

; Function Attrs: mustprogress 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 range(i32 0, 2) i32 @matrix33_from_json(ptr noundef %0, ptr noundef writeonly %1) local_unnamed_addr #1 {
  %3 = alloca [9 x float], align 16
  %4 = icmp eq ptr %0, null
  %5 = icmp eq ptr %1, null
  %or.cond = or i1 %4, %5
  br i1 %or.cond, label %19, label %6

6:                                                ; preds = %2
  %7 = tail call i32 @verify_typename(ptr noundef nonnull %0, ptr noundef nonnull @.str) #3
  %.not = icmp eq i32 %7, 0
  br i1 %.not, label %19, label %8

8:                                                ; preds = %6
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %3) #3
  %9 = call i32 @copy_fixed_float_array_field(ptr noundef nonnull %0, ptr noundef nonnull @.str.1, i32 noundef 9, ptr noundef nonnull %3) #3
  %.not15 = icmp eq i32 %9, 0
  br i1 %.not15, label %18, label %10

10:                                               ; preds = %8
  %11 = load <4 x float>, ptr %3, align 16, !tbaa !5
  store <4 x float> %11, ptr %1, align 4, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  %13 = getelementptr inbounds i8, ptr %1, i64 16
  %14 = load <4 x float>, ptr %12, align 16, !tbaa !5
  store <4 x float> %14, ptr %13, align 4, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %3, i64 32
  %16 = load float, ptr %15, align 16, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %1, i64 32
  store float %16, ptr %17, align 4, !tbaa !5
  br label %18

18:                                               ; preds = %8, %10
  %.0 = phi i32 [ 1, %10 ], [ 0, %8 ]
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %3) #3
  br label %19

19:                                               ; preds = %6, %2, %18
  %.1 = phi i32 [ %.0, %18 ], [ 0, %2 ], [ 0, %6 ]
  ret i32 %.1
}

declare i32 @verify_typename(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @copy_fixed_float_array_field(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress 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 = { "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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}


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