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

@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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 @MA27_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.Ma27_Data, ptr %3, i32 0, i32 20
  %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.Ma27_Data, ptr %8, i32 0, i32 20
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %10, ptr noundef @.str.17) #3
  br label %12

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

34:                                               ; preds = %12
  %35 = load ptr, ptr %2, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.Ma27_Data, ptr %35, i32 0, i32 20
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef @.str.1) #3
  br label %39

39:                                               ; preds = %34, %12
  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 376}
!10 = !{!"Ma27_Data", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 132, !7, i64 216, !6, i64 264, !6, i64 272, !6, i64 280, !11, i64 288, !6, i64 296, !6, i64 304, !11, i64 312, !11, i64 316, !12, i64 320, !11, i64 328, !6, i64 336, !11, i64 344, !6, i64 352, !6, i64 360, !7, i64 368, !6, i64 376}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !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.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [37 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 @MA27_Finalize(ptr noundef %0) local_unnamed_addr #2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 376
  %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.17) #4
  br label %6

6:                                                ; preds = %4, %1
  %7 = getelementptr inbounds i8, ptr %0, i64 264
  tail call void @LBL_Free_Object(ptr noundef nonnull %7) #4
  %8 = getelementptr inbounds i8, ptr %0, i64 272
  tail call void @LBL_Free_Object(ptr noundef nonnull %8) #4
  %9 = getelementptr inbounds i8, ptr %0, i64 280
  tail call void @LBL_Free_Object(ptr noundef nonnull %9) #4
  %10 = getelementptr inbounds i8, ptr %0, i64 296
  tail call void @LBL_Free_Object(ptr noundef nonnull %10) #4
  %11 = getelementptr inbounds i8, ptr %0, i64 304
  tail call void @LBL_Free_Object(ptr noundef nonnull %11) #4
  %12 = getelementptr inbounds i8, ptr %0, i64 336
  tail call void @LBL_Free_Object(ptr noundef nonnull %12) #4
  %13 = getelementptr inbounds i8, ptr %0, i64 360
  tail call void @LBL_Free_Object(ptr noundef nonnull %13) #4
  %14 = getelementptr inbounds i8, ptr %0, i64 352
  tail call void @LBL_Free_Object(ptr noundef nonnull %14) #4
  tail call void @free(ptr noundef nonnull %0) #4
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %.not14 = icmp eq ptr %15, null
  br i1 %.not14, label %18, label %16

16:                                               ; preds = %6
  %17 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %15, ptr noundef nonnull @.str.1) #4
  br label %18

18:                                               ; preds = %16, %6
  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 376}
!6 = !{!"Ma27_Data", !7, i64 0, !7, i64 4, !8, i64 8, !8, i64 132, !8, i64 216, !10, i64 264, !10, i64 272, !10, i64 280, !7, i64 288, !10, i64 296, !10, i64 304, !7, i64 312, !7, i64 316, !11, i64 320, !7, i64 328, !10, i64 336, !7, i64 344, !10, i64 352, !10, i64 360, !8, i64 368, !10, i64 376}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"double", !8, i64 0}


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