; LLVM IR from siconos/siconos :: externals/lbl/src (lbl_lib)

; 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.LBL_Data = type { ptr, ptr, i32, ptr, ptr }
%struct.Ma27_Data = type { i32, i32, [31 x i32], [21 x i32], [6 x double], ptr, ptr, ptr, i32, ptr, ptr, i32, i32, double, i32, ptr, i32, ptr, ptr, i8, ptr }
%struct.Ma57_Data = type { i32, i32, [21 x i32], [6 x double], [41 x i32], [21 x double], ptr, ptr, i32, ptr, ptr, ptr, i32, ptr, i32, i32, i32, ptr, i32, ptr, i32, i32, ptr, ptr, i8, i32, i32, ptr }

; Function Attrs: nounwind uwtable
define dso_local ptr @LBL_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  store i32 %0, ptr %5, align 4, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %10 = call ptr @LBL_Calloc(i32 noundef 1, i64 noundef 40)
  store ptr %10, ptr %9, align 8, !tbaa !9
  %11 = load i32, ptr %8, align 4, !tbaa !5
  %12 = load ptr, ptr %9, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.LBL_Data, ptr %12, i32 0, i32 2
  store i32 %11, ptr %13, align 8, !tbaa !11
  %14 = load ptr, ptr %9, align 8, !tbaa !9
  %15 = getelementptr inbounds %struct.LBL_Data, ptr %14, i32 0, i32 2
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %39

18:                                               ; preds = %4
  %19 = load i32, ptr %5, align 4, !tbaa !5
  %20 = load i32, ptr %6, align 4, !tbaa !5
  %21 = load ptr, ptr %7, align 8, !tbaa !9
  %22 = call ptr @MA27_Initialize(i32 noundef %19, i32 noundef %20, ptr noundef %21)
  %23 = load ptr, ptr %9, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.LBL_Data, ptr %23, i32 0, i32 0
  store ptr %22, ptr %24, align 8, !tbaa !13
  %25 = load ptr, ptr %9, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.LBL_Data, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !13
  %28 = getelementptr inbounds %struct.Ma27_Data, ptr %27, i32 0, i32 5
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = load ptr, ptr %9, align 8, !tbaa !9
  %31 = getelementptr inbounds %struct.LBL_Data, ptr %30, i32 0, i32 3
  store ptr %29, ptr %31, align 8, !tbaa !17
  %32 = load ptr, ptr %9, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.LBL_Data, ptr %32, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !13
  %35 = getelementptr inbounds %struct.Ma27_Data, ptr %34, i32 0, i32 6
  %36 = load ptr, ptr %35, align 8, !tbaa !18
  %37 = load ptr, ptr %9, align 8, !tbaa !9
  %38 = getelementptr inbounds %struct.LBL_Data, ptr %37, i32 0, i32 4
  store ptr %36, ptr %38, align 8, !tbaa !19
  br label %66

39:                                               ; preds = %4
  %40 = load ptr, ptr %9, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.LBL_Data, ptr %40, i32 0, i32 2
  %42 = load i32, ptr %41, align 8, !tbaa !11
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %65

44:                                               ; preds = %39
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = load i32, ptr %6, align 4, !tbaa !5
  %47 = load ptr, ptr %7, align 8, !tbaa !9
  %48 = call ptr @Ma57_Initialize(i32 noundef %45, i32 noundef %46, ptr noundef %47)
  %49 = load ptr, ptr %9, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.LBL_Data, ptr %49, i32 0, i32 1
  store ptr %48, ptr %50, align 8, !tbaa !20
  %51 = load ptr, ptr %9, align 8, !tbaa !9
  %52 = getelementptr inbounds %struct.LBL_Data, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !20
  %54 = getelementptr inbounds %struct.Ma57_Data, ptr %53, i32 0, i32 6
  %55 = load ptr, ptr %54, align 8, !tbaa !21
  %56 = load ptr, ptr %9, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.LBL_Data, ptr %56, i32 0, i32 3
  store ptr %55, ptr %57, align 8, !tbaa !17
  %58 = load ptr, ptr %9, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.LBL_Data, ptr %58, i32 0, i32 1
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds %struct.Ma57_Data, ptr %60, i32 0, i32 7
  %62 = load ptr, ptr %61, align 8, !tbaa !23
  %63 = load ptr, ptr %9, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.LBL_Data, ptr %63, i32 0, i32 4
  store ptr %62, ptr %64, align 8, !tbaa !19
  br label %65

65:                                               ; preds = %44, %39
  br label %66

66:                                               ; preds = %65, %18
  %67 = load ptr, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  ret ptr %67
}

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

declare ptr @LBL_Calloc(i32 noundef, i64 noundef) #2

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

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

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"LBL_Data", !10, i64 0, !10, i64 8, !6, i64 16, !10, i64 24, !10, i64 32}
!13 = !{!12, !10, i64 0}
!14 = !{!15, !10, i64 264}
!15 = !{!"Ma27_Data", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 132, !7, i64 216, !10, i64 264, !10, i64 272, !10, i64 280, !6, i64 288, !10, i64 296, !10, i64 304, !6, i64 312, !6, i64 316, !16, i64 320, !6, i64 328, !10, i64 336, !6, i64 344, !10, i64 352, !10, i64 360, !7, i64 368, !10, i64 376}
!16 = !{!"double", !7, i64 0}
!17 = !{!12, !10, i64 24}
!18 = !{!15, !10, i64 272}
!19 = !{!12, !10, i64 32}
!20 = !{!12, !10, i64 8}
!21 = !{!22, !10, i64 480}
!22 = !{!"Ma57_Data", !6, i64 0, !6, i64 4, !7, i64 8, !7, i64 96, !7, i64 144, !7, i64 312, !10, i64 480, !10, i64 488, !6, i64 496, !10, i64 504, !10, i64 512, !10, i64 520, !6, i64 528, !10, i64 536, !6, i64 544, !6, i64 548, !6, i64 552, !10, i64 560, !6, i64 568, !10, i64 576, !6, i64 584, !6, i64 588, !10, i64 592, !10, i64 600, !7, i64 608, !6, i64 612, !6, i64 616, !10, i64 624}
!23 = !{!22, !10, i64 488}


; 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: nounwind uwtable
define dso_local ptr @LBL_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = tail call ptr @LBL_Calloc(i32 noundef 1, i64 noundef 40) #2
  %6 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 %3, ptr %6, align 8, !tbaa !5
  switch i32 %3, label %22 [
    i32 0, label %7
    i32 1, label %13
  ]

7:                                                ; preds = %4
  %8 = tail call ptr @MA27_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2) #2
  store ptr %8, ptr %5, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %8, i64 264
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %10, ptr %11, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %8, i64 272
  br label %.sink.split

13:                                               ; preds = %4
  %14 = tail call ptr @Ma57_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2) #2
  %15 = getelementptr inbounds i8, ptr %5, i64 8
  store ptr %14, ptr %15, align 8, !tbaa !16
  %16 = getelementptr inbounds i8, ptr %14, i64 480
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  %18 = getelementptr inbounds i8, ptr %5, i64 24
  store ptr %17, ptr %18, align 8, !tbaa !15
  %19 = getelementptr inbounds i8, ptr %14, i64 488
  br label %.sink.split

.sink.split:                                      ; preds = %7, %13
  %.sink21 = phi ptr [ %19, %13 ], [ %12, %7 ]
  %20 = load ptr, ptr %.sink21, align 8, !tbaa !19
  %21 = getelementptr inbounds i8, ptr %5, i64 32
  store ptr %20, ptr %21, align 8, !tbaa !20
  br label %22

22:                                               ; preds = %.sink.split, %4
  ret ptr %5
}

declare ptr @LBL_Calloc(i32 noundef, i64 noundef) local_unnamed_addr #1

declare ptr @MA27_Initialize(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

declare ptr @Ma57_Initialize(i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

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 = { "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 = !{!"LBL_Data", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !7, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !7, i64 264}
!13 = !{!"Ma27_Data", !10, i64 0, !10, i64 4, !8, i64 8, !8, i64 132, !8, i64 216, !7, i64 264, !7, i64 272, !7, i64 280, !10, i64 288, !7, i64 296, !7, i64 304, !10, i64 312, !10, i64 316, !14, i64 320, !10, i64 328, !7, i64 336, !10, i64 344, !7, i64 352, !7, i64 360, !8, i64 368, !7, i64 376}
!14 = !{!"double", !8, i64 0}
!15 = !{!6, !7, i64 24}
!16 = !{!6, !7, i64 8}
!17 = !{!18, !7, i64 480}
!18 = !{!"Ma57_Data", !10, i64 0, !10, i64 4, !8, i64 8, !8, i64 96, !8, i64 144, !8, i64 312, !7, i64 480, !7, i64 488, !10, i64 496, !7, i64 504, !7, i64 512, !7, i64 520, !10, i64 528, !7, i64 536, !10, i64 544, !10, i64 548, !10, i64 552, !7, i64 560, !10, i64 568, !7, i64 576, !10, i64 584, !10, i64 588, !7, i64 592, !7, i64 600, !8, i64 608, !10, i64 612, !10, i64 616, !7, i64 624}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !7, i64 32}


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