; LLVM IR from HRI-EU/Rcs :: src/RcsCore (Rcs_shape)

; 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._RcsShape = type { i32, %struct.HTr, [3 x double], double, i8, i8, ptr, ptr, ptr, ptr, ptr }
%struct.HTr = type { [3 x double], [3 x [3 x double]] }

@Rcs_calloc = external global ptr, align 8

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @RcsShape_createFrameShape(double noundef %0) #1 {
  %2 = alloca double, align 8
  %3 = alloca ptr, align 8
  store double %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  %4 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !9
  %5 = call ptr %4(i64 noundef 1, i64 noundef 184)
  store ptr %5, ptr %3, align 8, !tbaa !9
  %6 = load ptr, ptr %3, align 8, !tbaa !9
  %7 = getelementptr inbounds %struct._RcsShape, ptr %6, i32 0, i32 1
  call void @HTr_setIdentity(ptr noundef %7)
  %8 = load double, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !9
  %10 = getelementptr inbounds %struct._RcsShape, ptr %9, i32 0, i32 3
  store double %8, ptr %10, align 8, !tbaa !11
  %11 = load ptr, ptr %3, align 8, !tbaa !9
  %12 = getelementptr inbounds %struct._RcsShape, ptr %11, i32 0, i32 0
  store i32 6, ptr %12, align 8, !tbaa !16
  %13 = load ptr, ptr %3, align 8, !tbaa !9
  %14 = getelementptr inbounds %struct._RcsShape, ptr %13, i32 0, i32 5
  %15 = load i8, ptr %14, align 1, !tbaa !17
  %16 = sext i8 %15 to i32
  %17 = or i32 %16, 4
  %18 = trunc i32 %17 to i8
  store i8 %18, ptr %14, align 1, !tbaa !17
  %19 = load ptr, ptr %3, align 8, !tbaa !9
  %20 = getelementptr inbounds %struct._RcsShape, ptr %19, i32 0, i32 4
  store i8 0, ptr %20, align 8, !tbaa !18
  %21 = load ptr, ptr %3, align 8, !tbaa !9
  %22 = getelementptr inbounds %struct._RcsShape, ptr %21, i32 0, i32 2
  %23 = getelementptr inbounds [3 x double], ptr %22, i64 0, i64 0
  store double 9.000000e-01, ptr %23, align 8, !tbaa !5
  %24 = load ptr, ptr %3, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct._RcsShape, ptr %24, i32 0, i32 2
  %26 = getelementptr inbounds [3 x double], ptr %25, i64 0, i64 1
  store double 9.000000e-01, ptr %26, align 8, !tbaa !5
  %27 = load ptr, ptr %3, align 8, !tbaa !9
  %28 = getelementptr inbounds %struct._RcsShape, ptr %27, i32 0, i32 2
  %29 = getelementptr inbounds [3 x double], ptr %28, i64 0, i64 2
  store double 9.000000e-01, ptr %29, align 8, !tbaa !5
  %30 = load ptr, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret ptr %30
}

declare void @HTr_setIdentity(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = !{!"double", !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 128}
!12 = !{!"_RcsShape", !13, i64 0, !14, i64 8, !7, i64 104, !6, i64 128, !15, i64 136, !7, i64 137, !10, i64 144, !10, i64 152, !10, i64 160, !10, i64 168, !10, i64 176}
!13 = !{!"int", !7, i64 0}
!14 = !{!"", !7, i64 0, !7, i64 24}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!12, !13, i64 0}
!17 = !{!12, !7, i64 137}
!18 = !{!12, !15, i64 136}


; 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"

@Rcs_calloc = external local_unnamed_addr global ptr, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @RcsShape_createFrameShape(double noundef %0) local_unnamed_addr #0 {
  %2 = load ptr, ptr @Rcs_calloc, align 8, !tbaa !5
  %3 = tail call ptr %2(i64 noundef 1, i64 noundef 184) #2
  %4 = getelementptr inbounds i8, ptr %3, i64 8
  tail call void @HTr_setIdentity(ptr noundef nonnull %4) #2
  %5 = getelementptr inbounds i8, ptr %3, i64 128
  store double %0, ptr %5, align 8, !tbaa !9
  store i32 6, ptr %3, align 8, !tbaa !15
  %6 = getelementptr inbounds i8, ptr %3, i64 137
  %7 = load i8, ptr %6, align 1, !tbaa !16
  %8 = or i8 %7, 4
  store i8 %8, ptr %6, align 1, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %3, i64 136
  store i8 0, ptr %9, align 8, !tbaa !17
  %10 = getelementptr inbounds i8, ptr %3, i64 104
  store <2 x double> <double 9.000000e-01, double 9.000000e-01>, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %3, i64 120
  store double 9.000000e-01, ptr %11, align 8, !tbaa !18
  ret ptr %3
}

declare void @HTr_setIdentity(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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !13, i64 128}
!10 = !{!"_RcsShape", !11, i64 0, !12, i64 8, !7, i64 104, !13, i64 128, !14, i64 136, !7, i64 137, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176}
!11 = !{!"int", !7, i64 0}
!12 = !{!"", !7, i64 0, !7, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_Bool", !7, i64 0}
!15 = !{!10, !11, i64 0}
!16 = !{!10, !7, i64 137}
!17 = !{!10, !14, i64 136}
!18 = !{!13, !13, i64 0}


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