; LLVM IR from OpenDiS/OpenDiS :: core/pydis/c/util (Util_subset)

; 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._node = type { i32, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, %struct._tag, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i32, ptr, ptr, i32 }
%struct._tag = type { i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local void @FreeNodeArms(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._node, ptr %3, i32 0, i32 20
  %5 = load i32, ptr %4, align 8, !tbaa !9
  %6 = icmp eq i32 %5, 0
  br i1 %6, label %7, label %8

7:                                                ; preds = %1
  br label %71

8:                                                ; preds = %1
  %9 = load ptr, ptr %2, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct._node, ptr %9, i32 0, i32 21
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  call void @free(ptr noundef %11) #2
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct._node, ptr %12, i32 0, i32 21
  store ptr null, ptr %13, align 8, !tbaa !14
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct._node, ptr %14, i32 0, i32 25
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  call void @free(ptr noundef %16) #2
  %17 = load ptr, ptr %2, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct._node, ptr %17, i32 0, i32 25
  store ptr null, ptr %18, align 8, !tbaa !15
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct._node, ptr %19, i32 0, i32 26
  %21 = load ptr, ptr %20, align 8, !tbaa !16
  call void @free(ptr noundef %21) #2
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._node, ptr %22, i32 0, i32 26
  store ptr null, ptr %23, align 8, !tbaa !16
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct._node, ptr %24, i32 0, i32 27
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  call void @free(ptr noundef %26) #2
  %27 = load ptr, ptr %2, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct._node, ptr %27, i32 0, i32 27
  store ptr null, ptr %28, align 8, !tbaa !17
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._node, ptr %29, i32 0, i32 22
  %31 = load ptr, ptr %30, align 8, !tbaa !18
  call void @free(ptr noundef %31) #2
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._node, ptr %32, i32 0, i32 22
  store ptr null, ptr %33, align 8, !tbaa !18
  %34 = load ptr, ptr %2, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct._node, ptr %34, i32 0, i32 23
  %36 = load ptr, ptr %35, align 8, !tbaa !19
  call void @free(ptr noundef %36) #2
  %37 = load ptr, ptr %2, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct._node, ptr %37, i32 0, i32 23
  store ptr null, ptr %38, align 8, !tbaa !19
  %39 = load ptr, ptr %2, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._node, ptr %39, i32 0, i32 24
  %41 = load ptr, ptr %40, align 8, !tbaa !20
  call void @free(ptr noundef %41) #2
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct._node, ptr %42, i32 0, i32 24
  store ptr null, ptr %43, align 8, !tbaa !20
  %44 = load ptr, ptr %2, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct._node, ptr %44, i32 0, i32 28
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  call void @free(ptr noundef %46) #2
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._node, ptr %47, i32 0, i32 28
  store ptr null, ptr %48, align 8, !tbaa !21
  %49 = load ptr, ptr %2, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._node, ptr %49, i32 0, i32 29
  %51 = load ptr, ptr %50, align 8, !tbaa !22
  call void @free(ptr noundef %51) #2
  %52 = load ptr, ptr %2, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct._node, ptr %52, i32 0, i32 29
  store ptr null, ptr %53, align 8, !tbaa !22
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct._node, ptr %54, i32 0, i32 30
  %56 = load ptr, ptr %55, align 8, !tbaa !23
  call void @free(ptr noundef %56) #2
  %57 = load ptr, ptr %2, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._node, ptr %57, i32 0, i32 30
  store ptr null, ptr %58, align 8, !tbaa !23
  %59 = load ptr, ptr %2, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct._node, ptr %59, i32 0, i32 31
  %61 = load ptr, ptr %60, align 8, !tbaa !24
  call void @free(ptr noundef %61) #2
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct._node, ptr %62, i32 0, i32 31
  store ptr null, ptr %63, align 8, !tbaa !24
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct._node, ptr %64, i32 0, i32 32
  %66 = load ptr, ptr %65, align 8, !tbaa !25
  call void @free(ptr noundef %66) #2
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct._node, ptr %67, i32 0, i32 32
  store ptr null, ptr %68, align 8, !tbaa !25
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct._node, ptr %69, i32 0, i32 20
  store i32 0, ptr %70, align 8, !tbaa !9
  br label %71

71:                                               ; preds = %8, %7
  ret void
}

; Function Attrs: nounwind
declare void @free(ptr noundef) #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 = { 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 = { 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 160}
!10 = !{!"_node", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32, !12, i64 40, !12, i64 48, !12, i64 56, !12, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !12, i64 112, !12, i64 120, !12, i64 128, !12, i64 136, !12, i64 144, !13, i64 152, !11, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !11, i64 272, !11, i64 276, !11, i64 280, !11, i64 284, !11, i64 288, !6, i64 296, !6, i64 304, !11, i64 312}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_tag", !11, i64 0, !11, i64 4}
!14 = !{!10, !6, i64 168}
!15 = !{!10, !6, i64 200}
!16 = !{!10, !6, i64 208}
!17 = !{!10, !6, i64 216}
!18 = !{!10, !6, i64 176}
!19 = !{!10, !6, i64 184}
!20 = !{!10, !6, i64 192}
!21 = !{!10, !6, i64 224}
!22 = !{!10, !6, i64 232}
!23 = !{!10, !6, i64 240}
!24 = !{!10, !6, i64 248}
!25 = !{!10, !6, i64 256}


; 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: mustprogress nounwind willreturn uwtable
define dso_local void @FreeNodeArms(ptr nocapture noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 160
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp eq i32 %3, 0
  br i1 %4, label %30, label %5

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 168
  %7 = load ptr, ptr %6, align 8, !tbaa !13
  tail call void @free(ptr noundef %7) #2
  store ptr null, ptr %6, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %0, i64 200
  %9 = load ptr, ptr %8, align 8, !tbaa !14
  tail call void @free(ptr noundef %9) #2
  store ptr null, ptr %8, align 8, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 208
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  tail call void @free(ptr noundef %11) #2
  store ptr null, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 216
  %13 = load ptr, ptr %12, align 8, !tbaa !16
  tail call void @free(ptr noundef %13) #2
  store ptr null, ptr %12, align 8, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 176
  %15 = load ptr, ptr %14, align 8, !tbaa !17
  tail call void @free(ptr noundef %15) #2
  store ptr null, ptr %14, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 184
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  tail call void @free(ptr noundef %17) #2
  store ptr null, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %0, i64 192
  %19 = load ptr, ptr %18, align 8, !tbaa !19
  tail call void @free(ptr noundef %19) #2
  store ptr null, ptr %18, align 8, !tbaa !19
  %20 = getelementptr inbounds i8, ptr %0, i64 224
  %21 = load ptr, ptr %20, align 8, !tbaa !20
  tail call void @free(ptr noundef %21) #2
  store ptr null, ptr %20, align 8, !tbaa !20
  %22 = getelementptr inbounds i8, ptr %0, i64 232
  %23 = load ptr, ptr %22, align 8, !tbaa !21
  tail call void @free(ptr noundef %23) #2
  store ptr null, ptr %22, align 8, !tbaa !21
  %24 = getelementptr inbounds i8, ptr %0, i64 240
  %25 = load ptr, ptr %24, align 8, !tbaa !22
  tail call void @free(ptr noundef %25) #2
  store ptr null, ptr %24, align 8, !tbaa !22
  %26 = getelementptr inbounds i8, ptr %0, i64 248
  %27 = load ptr, ptr %26, align 8, !tbaa !23
  tail call void @free(ptr noundef %27) #2
  store ptr null, ptr %26, align 8, !tbaa !23
  %28 = getelementptr inbounds i8, ptr %0, i64 256
  %29 = load ptr, ptr %28, align 8, !tbaa !24
  tail call void @free(ptr noundef %29) #2
  store ptr null, ptr %28, align 8, !tbaa !24
  store i32 0, ptr %2, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %1, %5
  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

attributes #0 = { mustprogress nounwind willreturn 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 = { 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 160}
!6 = !{!"_node", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !10, i64 112, !10, i64 120, !10, i64 128, !10, i64 136, !10, i64 144, !11, i64 152, !7, i64 160, !12, i64 168, !12, i64 176, !12, i64 184, !12, i64 192, !12, i64 200, !12, i64 208, !12, i64 216, !12, i64 224, !12, i64 232, !12, i64 240, !12, i64 248, !12, i64 256, !12, i64 264, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !7, i64 288, !12, i64 296, !12, i64 304, !7, i64 312}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"_tag", !7, i64 0, !7, i64 4}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !12, i64 168}
!14 = !{!6, !12, i64 200}
!15 = !{!6, !12, i64 208}
!16 = !{!6, !12, i64 216}
!17 = !{!6, !12, i64 176}
!18 = !{!6, !12, i64 184}
!19 = !{!6, !12, i64 192}
!20 = !{!6, !12, i64 224}
!21 = !{!6, !12, i64 232}
!22 = !{!6, !12, i64 240}
!23 = !{!6, !12, i64 248}
!24 = !{!6, !12, i64 256}


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