; LLVM IR from chrr/libECP :: src (type2)

; 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._Type2 = type { i32, ptr, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i32, ptr, ptr, i32, ptr, ptr, ptr, i32, i32, i32, i32, ptr, i32, ptr, double, double, double, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @Type2_free(ptr noundef %0) #0 {
  %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._Type2, ptr %3, i32 0, i32 34
  %5 = load i32, ptr %4, align 8, !tbaa !9
  %6 = icmp eq i32 1, %5
  br i1 %6, label %7, label %35

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

35:                                               ; preds = %7, %1
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._Type2, ptr %36, i32 0, i32 28
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  call void @GCIntegrationTable_free(ptr noundef %38)
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  call void @free(ptr noundef %39) #3
  ret void
}

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

declare void @GCIntegrationTable_free(ptr noundef) #2

declare void @freeBesselFunction(ptr noundef) #2

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 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 232}
!10 = !{!"_Type2", !11, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !11, i64 84, !11, i64 88, !6, i64 96, !6, i64 104, !11, i64 112, !6, i64 120, !6, i64 128, !11, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !6, i64 184, !11, i64 192, !6, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !11, i64 232}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!10, !6, i64 144}
!14 = !{!10, !6, i64 152}
!15 = !{!10, !6, i64 96}
!16 = !{!10, !6, i64 104}
!17 = !{!10, !6, i64 120}
!18 = !{!10, !6, i64 128}
!19 = !{!10, !6, i64 200}
!20 = !{!10, !6, i64 160}
!21 = !{!10, !6, i64 184}


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

; Function Attrs: nounwind uwtable
define dso_local void @Type2_free(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 232
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp eq i32 %3, 1
  br i1 %4, label %5, label %23

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 144
  %7 = load ptr, ptr %6, align 8, !tbaa !12
  tail call void @free(ptr noundef %7) #3
  %8 = getelementptr inbounds i8, ptr %0, i64 152
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  tail call void @free(ptr noundef %9) #3
  %10 = getelementptr inbounds i8, ptr %0, i64 96
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  tail call void @free(ptr noundef %11) #3
  %12 = getelementptr inbounds i8, ptr %0, i64 104
  %13 = load ptr, ptr %12, align 8, !tbaa !15
  tail call void @free(ptr noundef %13) #3
  %14 = getelementptr inbounds i8, ptr %0, i64 120
  %15 = load ptr, ptr %14, align 8, !tbaa !16
  tail call void @free(ptr noundef %15) #3
  %16 = getelementptr inbounds i8, ptr %0, i64 128
  %17 = load ptr, ptr %16, align 8, !tbaa !17
  tail call void @free(ptr noundef %17) #3
  %18 = getelementptr inbounds i8, ptr %0, i64 200
  %19 = load ptr, ptr %18, align 8, !tbaa !18
  tail call void @GCIntegrationTable_free(ptr noundef %19) #3
  %20 = getelementptr inbounds i8, ptr %0, i64 160
  %21 = load ptr, ptr %20, align 8, !tbaa !19
  tail call void @freeBesselFunction(ptr noundef %21) #3
  %22 = load ptr, ptr %20, align 8, !tbaa !19
  tail call void @free(ptr noundef %22) #3
  br label %23

23:                                               ; preds = %5, %1
  %24 = getelementptr inbounds i8, ptr %0, i64 184
  %25 = load ptr, ptr %24, align 8, !tbaa !20
  tail call void @GCIntegrationTable_free(ptr noundef %25) #3
  tail call void @free(ptr noundef nonnull %0) #3
  ret void
}

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

declare void @GCIntegrationTable_free(ptr noundef) local_unnamed_addr #2

declare void @freeBesselFunction(ptr noundef) local_unnamed_addr #2

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 = { 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 #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, !7, i64 232}
!6 = !{!"_Type2", !7, i64 0, !10, i64 8, !10, i64 16, !7, i64 24, !7, i64 28, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !7, i64 72, !7, i64 76, !7, i64 80, !7, i64 84, !7, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !10, i64 120, !10, i64 128, !7, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !7, i64 172, !7, i64 176, !7, i64 180, !10, i64 184, !7, i64 192, !10, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !7, i64 232}
!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, !10, i64 144}
!13 = !{!6, !10, i64 152}
!14 = !{!6, !10, i64 96}
!15 = !{!6, !10, i64 104}
!16 = !{!6, !10, i64 120}
!17 = !{!6, !10, i64 128}
!18 = !{!6, !10, i64 200}
!19 = !{!6, !10, i64 160}
!20 = !{!6, !10, i64 184}


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