; LLVM IR from siconos/siconos :: externals/lbl/src (ma57_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.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 }

@.str = external hidden unnamed_addr constant [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @Ma57_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %8 = call ptr @LBL_Calloc(i32 noundef 1, i64 noundef 632)
  store ptr %8, ptr %7, align 8, !tbaa !9
  %9 = load ptr, ptr %6, align 8, !tbaa !9
  %10 = load ptr, ptr %7, align 8, !tbaa !9
  %11 = getelementptr inbounds %struct.Ma57_Data, ptr %10, i32 0, i32 27
  store ptr %9, ptr %11, align 8, !tbaa !11
  %12 = load ptr, ptr %7, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.Ma57_Data, ptr %12, i32 0, i32 27
  %14 = load ptr, ptr %13, align 8, !tbaa !11
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %21

16:                                               ; preds = %3
  %17 = load ptr, ptr %7, align 8, !tbaa !9
  %18 = getelementptr inbounds %struct.Ma57_Data, ptr %17, i32 0, i32 27
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str) #4
  br label %21

21:                                               ; preds = %16, %3
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %23 = load ptr, ptr %7, align 8, !tbaa !9
  %24 = getelementptr inbounds %struct.Ma57_Data, ptr %23, i32 0, i32 0
  store i32 %22, ptr %24, align 8, !tbaa !13
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.Ma57_Data, ptr %26, i32 0, i32 1
  store i32 %25, ptr %27, align 4, !tbaa !14
  %28 = load ptr, ptr %7, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.Ma57_Data, ptr %28, i32 0, i32 24
  store i8 0, ptr %29, align 8, !tbaa !15
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = call ptr @LBL_Calloc(i32 noundef %30, i64 noundef 4)
  %32 = load ptr, ptr %7, align 8, !tbaa !9
  %33 = getelementptr inbounds %struct.Ma57_Data, ptr %32, i32 0, i32 6
  store ptr %31, ptr %33, align 8, !tbaa !16
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = call ptr @LBL_Calloc(i32 noundef %34, i64 noundef 4)
  %36 = load ptr, ptr %7, align 8, !tbaa !9
  %37 = getelementptr inbounds %struct.Ma57_Data, ptr %36, i32 0, i32 7
  store ptr %35, ptr %37, align 8, !tbaa !17
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = mul nsw i32 5, %38
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = add nsw i32 %39, %40
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp sgt i32 %42, %43
  br i1 %44, label %45, label %47

45:                                               ; preds = %21
  %46 = load i32, ptr %5, align 4, !tbaa !5
  br label %49

47:                                               ; preds = %21
  %48 = load i32, ptr %4, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %47, %45
  %50 = phi i32 [ %46, %45 ], [ %48, %47 ]
  %51 = add nsw i32 %41, %50
  %52 = add nsw i32 %51, 42
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = add nsw i32 %52, %53
  %55 = load ptr, ptr %7, align 8, !tbaa !9
  %56 = getelementptr inbounds %struct.Ma57_Data, ptr %55, i32 0, i32 8
  store i32 %54, ptr %56, align 8, !tbaa !18
  %57 = load ptr, ptr %7, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.Ma57_Data, ptr %57, i32 0, i32 8
  %59 = load i32, ptr %58, align 8, !tbaa !18
  %60 = call ptr @LBL_Calloc(i32 noundef %59, i64 noundef 4)
  %61 = load ptr, ptr %7, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.Ma57_Data, ptr %61, i32 0, i32 9
  store ptr %60, ptr %62, align 8, !tbaa !19
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = mul nsw i32 5, %63
  %65 = call ptr @LBL_Calloc(i32 noundef %64, i64 noundef 4)
  %66 = load ptr, ptr %7, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.Ma57_Data, ptr %66, i32 0, i32 10
  store ptr %65, ptr %67, align 8, !tbaa !20
  %68 = load ptr, ptr %7, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.Ma57_Data, ptr %68, i32 0, i32 19
  store ptr null, ptr %69, align 8, !tbaa !21
  %70 = load ptr, ptr %7, align 8, !tbaa !9
  %71 = getelementptr inbounds %struct.Ma57_Data, ptr %70, i32 0, i32 27
  %72 = load ptr, ptr %71, align 8, !tbaa !11
  %73 = icmp ne ptr %72, null
  br i1 %73, label %74, label %79

74:                                               ; preds = %49
  %75 = load ptr, ptr %7, align 8, !tbaa !9
  %76 = getelementptr inbounds %struct.Ma57_Data, ptr %75, i32 0, i32 27
  %77 = load ptr, ptr %76, align 8, !tbaa !11
  %78 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.1) #4
  br label %79

79:                                               ; preds = %74, %49
  %80 = load ptr, ptr %7, align 8, !tbaa !9
  %81 = getelementptr inbounds %struct.Ma57_Data, ptr %80, i32 0, i32 3
  %82 = getelementptr inbounds [6 x double], ptr %81, i64 0, i64 0
  %83 = load ptr, ptr %7, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.Ma57_Data, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds [21 x i32], ptr %84, i64 0, i64 0
  call void @ma57id_(ptr noundef %82, ptr noundef %85)
  %86 = load ptr, ptr %7, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.Ma57_Data, ptr %86, i32 0, i32 2
  %88 = getelementptr inbounds [21 x i32], ptr %87, i64 0, i64 0
  store i32 -1, ptr %88, align 8, !tbaa !5
  %89 = load ptr, ptr %7, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.Ma57_Data, ptr %89, i32 0, i32 2
  %91 = getelementptr inbounds [21 x i32], ptr %90, i64 0, i64 1
  store i32 -1, ptr %91, align 4, !tbaa !5
  %92 = load ptr, ptr %7, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.Ma57_Data, ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds [21 x i32], ptr %93, i64 0, i64 2
  store i32 -1, ptr %94, align 8, !tbaa !5
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.Ma57_Data, ptr %95, i32 0, i32 2
  %97 = getelementptr inbounds [21 x i32], ptr %96, i64 0, i64 3
  store i32 -1, ptr %97, align 4, !tbaa !5
  %98 = load ptr, ptr %7, align 8, !tbaa !9
  %99 = getelementptr inbounds %struct.Ma57_Data, ptr %98, i32 0, i32 2
  %100 = getelementptr inbounds [21 x i32], ptr %99, i64 0, i64 4
  store i32 4, ptr %100, align 8, !tbaa !5
  %101 = load ptr, ptr %7, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.Ma57_Data, ptr %101, i32 0, i32 2
  %103 = getelementptr inbounds [21 x i32], ptr %102, i64 0, i64 5
  store i32 5, ptr %103, align 4, !tbaa !5
  %104 = load ptr, ptr %7, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.Ma57_Data, ptr %104, i32 0, i32 2
  %106 = getelementptr inbounds [21 x i32], ptr %105, i64 0, i64 6
  store i32 1, ptr %106, align 8, !tbaa !5
  %107 = load ptr, ptr %7, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.Ma57_Data, ptr %107, i32 0, i32 2
  %109 = getelementptr inbounds [21 x i32], ptr %108, i64 0, i64 7
  store i32 1, ptr %109, align 4, !tbaa !5
  %110 = load ptr, ptr %7, align 8, !tbaa !9
  %111 = getelementptr inbounds %struct.Ma57_Data, ptr %110, i32 0, i32 2
  %112 = getelementptr inbounds [21 x i32], ptr %111, i64 0, i64 15
  store i32 0, ptr %112, align 4, !tbaa !5
  %113 = load ptr, ptr %7, align 8, !tbaa !9
  %114 = getelementptr inbounds %struct.Ma57_Data, ptr %113, i32 0, i32 24
  store i8 0, ptr %114, align 8, !tbaa !15
  %115 = load ptr, ptr %7, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.Ma57_Data, ptr %115, i32 0, i32 27
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %124

119:                                              ; preds = %79
  %120 = load ptr, ptr %7, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.Ma57_Data, ptr %120, i32 0, i32 27
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str.2) #4
  br label %124

124:                                              ; preds = %119, %79
  %125 = load ptr, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret ptr %125
}

; 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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

declare void @ma57id_(ptr 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 "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 = { 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, !10, i64 624}
!12 = !{!"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}
!13 = !{!12, !6, i64 0}
!14 = !{!12, !6, i64 4}
!15 = !{!12, !7, i64 608}
!16 = !{!12, !10, i64 480}
!17 = !{!12, !10, i64 488}
!18 = !{!12, !6, i64 496}
!19 = !{!12, !10, i64 504}
!20 = !{!12, !10, i64 512}
!21 = !{!12, !10, i64 576}


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

; Function Attrs: nounwind uwtable
define dso_local ptr @Ma57_Initialize(i32 noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = tail call ptr @LBL_Calloc(i32 noundef 1, i64 noundef 632) #5
  %5 = getelementptr inbounds i8, ptr %4, i64 624
  store ptr %2, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %8, label %6

6:                                                ; preds = %3
  %7 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %2, ptr noundef nonnull @.str) #5
  br label %8

8:                                                ; preds = %6, %3
  store i32 %1, ptr %4, align 8, !tbaa !11
  %9 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %0, ptr %9, align 4, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %4, i64 608
  store i8 0, ptr %10, align 8, !tbaa !13
  %11 = tail call ptr @LBL_Calloc(i32 noundef %0, i64 noundef 4) #5
  %12 = getelementptr inbounds i8, ptr %4, i64 480
  store ptr %11, ptr %12, align 8, !tbaa !14
  %13 = tail call ptr @LBL_Calloc(i32 noundef %0, i64 noundef 4) #5
  %14 = getelementptr inbounds i8, ptr %4, i64 488
  store ptr %13, ptr %14, align 8, !tbaa !15
  %15 = mul nsw i32 %1, 5
  %16 = tail call i32 @llvm.smax.i32(i32 %1, i32 %0)
  %17 = add i32 %0, 42
  %18 = add i32 %17, %1
  %19 = add i32 %18, %15
  %20 = add i32 %19, %16
  %21 = getelementptr inbounds i8, ptr %4, i64 496
  store i32 %20, ptr %21, align 8, !tbaa !16
  %22 = tail call ptr @LBL_Calloc(i32 noundef %20, i64 noundef 4) #5
  %23 = getelementptr inbounds i8, ptr %4, i64 504
  store ptr %22, ptr %23, align 8, !tbaa !17
  %24 = tail call ptr @LBL_Calloc(i32 noundef %15, i64 noundef 4) #5
  %25 = getelementptr inbounds i8, ptr %4, i64 512
  store ptr %24, ptr %25, align 8, !tbaa !18
  %26 = getelementptr inbounds i8, ptr %4, i64 576
  store ptr null, ptr %26, align 8, !tbaa !19
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %.not44 = icmp eq ptr %27, null
  br i1 %.not44, label %30, label %28

28:                                               ; preds = %8
  %29 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %27, ptr noundef nonnull @.str.1) #5
  br label %30

30:                                               ; preds = %28, %8
  %31 = getelementptr inbounds i8, ptr %4, i64 96
  %32 = getelementptr inbounds i8, ptr %4, i64 8
  tail call void @ma57id_(ptr noundef nonnull %31, ptr noundef nonnull %32) #5
  %33 = getelementptr inbounds i8, ptr %4, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %32, i8 -1, i64 16, i1 false)
  store <4 x i32> <i32 4, i32 5, i32 1, i32 1>, ptr %33, align 8, !tbaa !20
  %34 = getelementptr inbounds i8, ptr %4, i64 68
  store i32 0, ptr %34, align 4, !tbaa !20
  store i8 0, ptr %10, align 8, !tbaa !13
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %.not45 = icmp eq ptr %35, null
  br i1 %.not45, label %38, label %36

36:                                               ; preds = %30
  %37 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %35, ptr noundef nonnull @.str.2) #5
  br label %38

38:                                               ; preds = %36, %30
  ret ptr %4
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

declare void @ma57id_(ptr noundef, ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { nofree 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { 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 624}
!6 = !{!"Ma57_Data", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 96, !8, i64 144, !8, i64 312, !10, i64 480, !10, i64 488, !7, i64 496, !10, i64 504, !10, i64 512, !10, i64 520, !7, i64 528, !10, i64 536, !7, i64 544, !7, i64 548, !7, i64 552, !10, i64 560, !7, i64 568, !10, i64 576, !7, i64 584, !7, i64 588, !10, i64 592, !10, i64 600, !8, i64 608, !7, i64 612, !7, i64 616, !10, i64 624}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!6, !7, i64 4}
!13 = !{!6, !8, i64 608}
!14 = !{!6, !10, i64 480}
!15 = !{!6, !10, i64 488}
!16 = !{!6, !7, i64 496}
!17 = !{!6, !10, i64 504}
!18 = !{!6, !10, i64 512}
!19 = !{!6, !10, i64 576}
!20 = !{!7, !7, i64 0}


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