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

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

declare void @LBL_Free_Object(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @Ma57_Finalize(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %4 = getelementptr inbounds %struct.Ma57_Data, ptr %3, i32 0, i32 27
  %5 = load ptr, ptr %4, align 8, !tbaa !9
  %6 = icmp ne ptr %5, null
  br i1 %6, label %7, label %12

7:                                                ; preds = %1
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.Ma57_Data, ptr %8, i32 0, i32 27
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef @.str.24) #3
  br label %12

12:                                               ; preds = %7, %1
  %13 = load ptr, ptr %2, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.Ma57_Data, ptr %13, i32 0, i32 6
  call void @LBL_Free_Object(ptr noundef %14)
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.Ma57_Data, ptr %15, i32 0, i32 7
  call void @LBL_Free_Object(ptr noundef %16)
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.Ma57_Data, ptr %17, i32 0, i32 9
  call void @LBL_Free_Object(ptr noundef %18)
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.Ma57_Data, ptr %19, i32 0, i32 10
  call void @LBL_Free_Object(ptr noundef %20)
  %21 = load ptr, ptr %2, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.Ma57_Data, ptr %21, i32 0, i32 11
  call void @LBL_Free_Object(ptr noundef %22)
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Ma57_Data, ptr %23, i32 0, i32 13
  call void @LBL_Free_Object(ptr noundef %24)
  %25 = load ptr, ptr %2, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Ma57_Data, ptr %25, i32 0, i32 19
  call void @LBL_Free_Object(ptr noundef %26)
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.Ma57_Data, ptr %27, i32 0, i32 23
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = icmp ne ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %12
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.Ma57_Data, ptr %32, i32 0, i32 23
  call void @LBL_Free_Object(ptr noundef %33)
  br label %34

34:                                               ; preds = %31, %12
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Ma57_Data, ptr %35, i32 0, i32 27
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = icmp ne ptr %37, null
  br i1 %38, label %39, label %44

39:                                               ; preds = %34
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Ma57_Data, ptr %40, i32 0, i32 27
  %42 = load ptr, ptr %41, align 8, !tbaa !9
  %43 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %42, ptr noundef @.str.25) #3
  br label %44

44:                                               ; preds = %39, %34
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %45) #3
  ret void
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #0

attributes #0 = { 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 #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 = { 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, !6, i64 624}
!10 = !{!"Ma57_Data", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 96, !7, i64 144, !7, i64 312, !6, i64 480, !6, i64 488, !11, i64 496, !6, i64 504, !6, i64 512, !6, i64 520, !11, i64 528, !6, i64 536, !11, i64 544, !11, i64 548, !11, i64 552, !6, i64 560, !11, i64 568, !6, i64 576, !11, i64 584, !11, i64 588, !6, i64 592, !6, i64 600, !7, i64 608, !11, i64 612, !11, i64 616, !6, i64 624}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 600}


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

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

declare void @LBL_Free_Object(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @Ma57_Finalize(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 624
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %6, label %4

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

6:                                                ; preds = %4, %1
  %7 = getelementptr inbounds i8, ptr %0, i64 480
  tail call void @LBL_Free_Object(ptr noundef nonnull %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 488
  tail call void @LBL_Free_Object(ptr noundef nonnull %8) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 504
  tail call void @LBL_Free_Object(ptr noundef nonnull %9) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 512
  tail call void @LBL_Free_Object(ptr noundef nonnull %10) #4
  %11 = getelementptr inbounds i8, ptr %0, i64 520
  tail call void @LBL_Free_Object(ptr noundef nonnull %11) #4
  %12 = getelementptr inbounds i8, ptr %0, i64 536
  tail call void @LBL_Free_Object(ptr noundef nonnull %12) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 576
  tail call void @LBL_Free_Object(ptr noundef nonnull %13) #4
  %14 = getelementptr inbounds i8, ptr %0, i64 600
  %15 = load ptr, ptr %14, align 8, !tbaa !11
  %.not15 = icmp eq ptr %15, null
  br i1 %.not15, label %17, label %16

16:                                               ; preds = %6
  tail call void @LBL_Free_Object(ptr noundef nonnull %14) #4
  br label %17

17:                                               ; preds = %16, %6
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %.not16 = icmp eq ptr %18, null
  br i1 %.not16, label %21, label %19

19:                                               ; preds = %17
  %20 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %18, ptr noundef nonnull @.str.25) #4
  br label %21

21:                                               ; preds = %19, %17
  tail call void @free(ptr noundef nonnull %0) #4
  ret void
}

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

attributes #0 = { 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 #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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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, !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, !10, i64 600}


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