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

; Function Attrs: nounwind uwtable
define dso_local ptr @MA27_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) #5
  %8 = call ptr @LBL_Calloc(i32 noundef 1, i64 noundef 384)
  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.Ma27_Data, ptr %10, i32 0, i32 20
  store ptr %9, ptr %11, align 8, !tbaa !11
  %12 = load ptr, ptr %7, align 8, !tbaa !9
  %13 = getelementptr inbounds %struct.Ma27_Data, ptr %12, i32 0, i32 20
  %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.Ma27_Data, ptr %17, i32 0, i32 20
  %19 = load ptr, ptr %18, align 8, !tbaa !11
  %20 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %19, ptr noundef @.str) #5
  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.Ma27_Data, ptr %23, i32 0, i32 0
  store i32 %22, ptr %24, align 8, !tbaa !14
  %25 = load i32, ptr %4, align 4, !tbaa !5
  %26 = load ptr, ptr %7, align 8, !tbaa !9
  %27 = getelementptr inbounds %struct.Ma27_Data, ptr %26, i32 0, i32 1
  store i32 %25, ptr %27, align 4, !tbaa !15
  %28 = load ptr, ptr %7, align 8, !tbaa !9
  %29 = getelementptr inbounds %struct.Ma27_Data, ptr %28, i32 0, i32 19
  store i8 0, ptr %29, align 8, !tbaa !16
  %30 = load i32, ptr %4, align 4, !tbaa !5
  %31 = sitofp i32 %30 to double
  %32 = fmul double 1.200000e+00, %31
  %33 = call double @llvm.ceil.f64(double %32)
  %34 = fptosi double %33 to i32
  %35 = load ptr, ptr %7, align 8, !tbaa !9
  %36 = getelementptr inbounds %struct.Ma27_Data, ptr %35, i32 0, i32 14
  store i32 %34, ptr %36, align 8, !tbaa !17
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = mul nsw i32 2, %37
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = mul nsw i32 3, %39
  %41 = add nsw i32 %38, %40
  %42 = sitofp i32 %41 to double
  %43 = fmul double 1.200000e+00, %42
  %44 = call double @llvm.ceil.f64(double %43)
  %45 = fcmp ogt double %44, 5.000000e+02
  br i1 %45, label %46, label %55

46:                                               ; preds = %21
  %47 = load i32, ptr %4, align 4, !tbaa !5
  %48 = mul nsw i32 2, %47
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = mul nsw i32 3, %49
  %51 = add nsw i32 %48, %50
  %52 = sitofp i32 %51 to double
  %53 = fmul double 1.200000e+00, %52
  %54 = call double @llvm.ceil.f64(double %53)
  br label %56

55:                                               ; preds = %21
  br label %56

56:                                               ; preds = %55, %46
  %57 = phi double [ %54, %46 ], [ 5.000000e+02, %55 ]
  %58 = fptosi double %57 to i32
  %59 = load ptr, ptr %7, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.Ma27_Data, ptr %59, i32 0, i32 8
  store i32 %58, ptr %60, align 8, !tbaa !18
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = call ptr @LBL_Calloc(i32 noundef %61, i64 noundef 4)
  %63 = load ptr, ptr %7, align 8, !tbaa !9
  %64 = getelementptr inbounds %struct.Ma27_Data, ptr %63, i32 0, i32 5
  store ptr %62, ptr %64, align 8, !tbaa !19
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = call ptr @LBL_Calloc(i32 noundef %65, i64 noundef 4)
  %67 = load ptr, ptr %7, align 8, !tbaa !9
  %68 = getelementptr inbounds %struct.Ma27_Data, ptr %67, i32 0, i32 6
  store ptr %66, ptr %68, align 8, !tbaa !20
  %69 = load ptr, ptr %7, align 8, !tbaa !9
  %70 = getelementptr inbounds %struct.Ma27_Data, ptr %69, i32 0, i32 8
  %71 = load i32, ptr %70, align 8, !tbaa !18
  %72 = call ptr @LBL_Calloc(i32 noundef %71, i64 noundef 4)
  %73 = load ptr, ptr %7, align 8, !tbaa !9
  %74 = getelementptr inbounds %struct.Ma27_Data, ptr %73, i32 0, i32 7
  store ptr %72, ptr %74, align 8, !tbaa !21
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = mul nsw i32 3, %75
  %77 = call ptr @LBL_Calloc(i32 noundef %76, i64 noundef 4)
  %78 = load ptr, ptr %7, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.Ma27_Data, ptr %78, i32 0, i32 9
  store ptr %77, ptr %79, align 8, !tbaa !22
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = mul nsw i32 2, %80
  %82 = call ptr @LBL_Calloc(i32 noundef %81, i64 noundef 4)
  %83 = load ptr, ptr %7, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.Ma27_Data, ptr %83, i32 0, i32 10
  store ptr %82, ptr %84, align 8, !tbaa !23
  %85 = load ptr, ptr %7, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.Ma27_Data, ptr %85, i32 0, i32 14
  %87 = load i32, ptr %86, align 8, !tbaa !17
  %88 = call ptr @LBL_Calloc(i32 noundef %87, i64 noundef 8)
  %89 = load ptr, ptr %7, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.Ma27_Data, ptr %89, i32 0, i32 15
  store ptr %88, ptr %90, align 8, !tbaa !24
  %91 = load ptr, ptr %7, align 8, !tbaa !9
  %92 = getelementptr inbounds %struct.Ma27_Data, ptr %91, i32 0, i32 0
  %93 = load i32, ptr %92, align 8, !tbaa !14
  %94 = call ptr @LBL_Calloc(i32 noundef %93, i64 noundef 8)
  %95 = load ptr, ptr %7, align 8, !tbaa !9
  %96 = getelementptr inbounds %struct.Ma27_Data, ptr %95, i32 0, i32 18
  store ptr %94, ptr %96, align 8, !tbaa !25
  %97 = load ptr, ptr %7, align 8, !tbaa !9
  %98 = getelementptr inbounds %struct.Ma27_Data, ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds [31 x i32], ptr %98, i64 0, i64 0
  %100 = load ptr, ptr %7, align 8, !tbaa !9
  %101 = getelementptr inbounds %struct.Ma27_Data, ptr %100, i32 0, i32 4
  %102 = getelementptr inbounds [6 x double], ptr %101, i64 0, i64 0
  call void @ma27id_(ptr noundef %99, ptr noundef %102)
  %103 = load ptr, ptr %7, align 8, !tbaa !9
  %104 = getelementptr inbounds %struct.Ma27_Data, ptr %103, i32 0, i32 2
  %105 = getelementptr inbounds [31 x i32], ptr %104, i64 0, i64 0
  store i32 0, ptr %105, align 8, !tbaa !5
  %106 = load ptr, ptr %7, align 8, !tbaa !9
  %107 = getelementptr inbounds %struct.Ma27_Data, ptr %106, i32 0, i32 2
  %108 = getelementptr inbounds [31 x i32], ptr %107, i64 0, i64 1
  store i32 0, ptr %108, align 4, !tbaa !5
  %109 = load ptr, ptr %7, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.Ma27_Data, ptr %109, i32 0, i32 2
  %111 = getelementptr inbounds [31 x i32], ptr %110, i64 0, i64 2
  store i32 0, ptr %111, align 8, !tbaa !5
  %112 = load ptr, ptr %7, align 8, !tbaa !9
  %113 = getelementptr inbounds %struct.Ma27_Data, ptr %112, i32 0, i32 4
  %114 = getelementptr inbounds [6 x double], ptr %113, i64 0, i64 0
  store double 1.000000e-15, ptr %114, align 8, !tbaa !26
  %115 = load ptr, ptr %7, align 8, !tbaa !9
  %116 = getelementptr inbounds %struct.Ma27_Data, ptr %115, i32 0, i32 20
  %117 = load ptr, ptr %116, align 8, !tbaa !11
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %124

119:                                              ; preds = %56
  %120 = load ptr, ptr %7, align 8, !tbaa !9
  %121 = getelementptr inbounds %struct.Ma27_Data, ptr %120, i32 0, i32 20
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str.1) #5
  br label %124

124:                                              ; preds = %119, %56
  %125 = load ptr, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #4

declare void @ma27id_(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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !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 376}
!12 = !{!"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, !13, i64 320, !6, i64 328, !10, i64 336, !6, i64 344, !10, i64 352, !10, i64 360, !7, i64 368, !10, i64 376}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !6, i64 0}
!15 = !{!12, !6, i64 4}
!16 = !{!12, !7, i64 368}
!17 = !{!12, !6, i64 328}
!18 = !{!12, !6, i64 288}
!19 = !{!12, !10, i64 264}
!20 = !{!12, !10, i64 272}
!21 = !{!12, !10, i64 280}
!22 = !{!12, !10, i64 296}
!23 = !{!12, !10, i64 304}
!24 = !{!12, !10, i64 336}
!25 = !{!12, !10, i64 360}
!26 = !{!13, !13, 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 [25 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @MA27_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 384) #4
  %5 = getelementptr inbounds i8, ptr %4, i64 376
  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) #4
  br label %8

8:                                                ; preds = %6, %3
  store i32 %1, ptr %4, align 8, !tbaa !12
  %9 = getelementptr inbounds i8, ptr %4, i64 4
  store i32 %0, ptr %9, align 4, !tbaa !13
  %10 = getelementptr inbounds i8, ptr %4, i64 368
  store i8 0, ptr %10, align 8, !tbaa !14
  %11 = sitofp i32 %0 to double
  %12 = fmul double %11, 1.200000e+00
  %13 = tail call double @llvm.ceil.f64(double %12)
  %14 = fptosi double %13 to i32
  %15 = getelementptr inbounds i8, ptr %4, i64 328
  store i32 %14, ptr %15, align 8, !tbaa !15
  %16 = shl nsw i32 %0, 1
  %17 = mul nsw i32 %1, 3
  %18 = add nsw i32 %17, %16
  %19 = sitofp i32 %18 to double
  %20 = fmul double %19, 1.200000e+00
  %21 = tail call double @llvm.ceil.f64(double %20)
  %22 = fcmp ogt double %21, 5.000000e+02
  %23 = select i1 %22, double %21, double 5.000000e+02
  %24 = fptosi double %23 to i32
  %25 = getelementptr inbounds i8, ptr %4, i64 288
  store i32 %24, ptr %25, align 8, !tbaa !16
  %26 = tail call ptr @LBL_Calloc(i32 noundef %0, i64 noundef 4) #4
  %27 = getelementptr inbounds i8, ptr %4, i64 264
  store ptr %26, ptr %27, align 8, !tbaa !17
  %28 = tail call ptr @LBL_Calloc(i32 noundef %0, i64 noundef 4) #4
  %29 = getelementptr inbounds i8, ptr %4, i64 272
  store ptr %28, ptr %29, align 8, !tbaa !18
  %30 = load i32, ptr %25, align 8, !tbaa !16
  %31 = tail call ptr @LBL_Calloc(i32 noundef %30, i64 noundef 4) #4
  %32 = getelementptr inbounds i8, ptr %4, i64 280
  store ptr %31, ptr %32, align 8, !tbaa !19
  %33 = tail call ptr @LBL_Calloc(i32 noundef %17, i64 noundef 4) #4
  %34 = getelementptr inbounds i8, ptr %4, i64 296
  store ptr %33, ptr %34, align 8, !tbaa !20
  %35 = shl nsw i32 %1, 1
  %36 = tail call ptr @LBL_Calloc(i32 noundef %35, i64 noundef 4) #4
  %37 = getelementptr inbounds i8, ptr %4, i64 304
  store ptr %36, ptr %37, align 8, !tbaa !21
  %38 = load i32, ptr %15, align 8, !tbaa !15
  %39 = tail call ptr @LBL_Calloc(i32 noundef %38, i64 noundef 8) #4
  %40 = getelementptr inbounds i8, ptr %4, i64 336
  store ptr %39, ptr %40, align 8, !tbaa !22
  %41 = load i32, ptr %4, align 8, !tbaa !12
  %42 = tail call ptr @LBL_Calloc(i32 noundef %41, i64 noundef 8) #4
  %43 = getelementptr inbounds i8, ptr %4, i64 360
  store ptr %42, ptr %43, align 8, !tbaa !23
  %44 = getelementptr inbounds i8, ptr %4, i64 8
  %45 = getelementptr inbounds i8, ptr %4, i64 216
  tail call void @ma27id_(ptr noundef nonnull %44, ptr noundef nonnull %45) #4
  store i32 0, ptr %44, align 8, !tbaa !24
  %46 = getelementptr inbounds i8, ptr %4, i64 12
  store i32 0, ptr %46, align 4, !tbaa !24
  %47 = getelementptr inbounds i8, ptr %4, i64 16
  store i32 0, ptr %47, align 8, !tbaa !24
  store double 1.000000e-15, ptr %45, align 8, !tbaa !25
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %.not40 = icmp eq ptr %48, null
  br i1 %.not40, label %51, label %49

49:                                               ; preds = %8
  %50 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef nonnull %48, ptr noundef nonnull @.str.1) #4
  br label %51

51:                                               ; preds = %49, %8
  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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #3

declare void @ma27id_(ptr 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 = { 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 4}
!14 = !{!6, !8, i64 368}
!15 = !{!6, !7, i64 328}
!16 = !{!6, !7, i64 288}
!17 = !{!6, !10, i64 264}
!18 = !{!6, !10, i64 272}
!19 = !{!6, !10, i64 280}
!20 = !{!6, !10, i64 296}
!21 = !{!6, !10, i64 304}
!22 = !{!6, !10, i64 336}
!23 = !{!6, !10, i64 360}
!24 = !{!7, !7, i64 0}
!25 = !{!11, !11, i64 0}


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