; 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._tag = type { i32, i32 }
%struct._home = type { i32, i32, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, ptr, i32, i32, i32, ptr, i32, i32, ptr, ptr, ptr, double, double, double, double, double, double, i32, i32, i32, ptr, ptr, ptr, i32, ptr, i32, ptr, ptr, ptr, i32, i32, ptr, i32, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, i32, i32, ptr, ptr, ptr, i32, i32, i32, [3 x [3 x double]], [3 x [3 x double]], %struct.BurgInfo_t, i32, i32, i32, i32, i32, i32, i32, %struct.timeval }
%struct.BurgInfo_t = type { i32, i32, ptr, ptr, ptr, ptr }
%struct.timeval = type { i64, i64 }
%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 }

@.str.13 = external hidden unnamed_addr constant [34 x i8], align 1

; 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
declare dso_local void @Fatal(ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @RequestNodeTag(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local ptr @RequestNewNativeNodeTag(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = call ptr @PopFreeNodeQ(ptr noundef %7)
  store ptr %8, ptr %6, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = call i32 @RequestNodeTag(ptr noundef %9, ptr noundef %10)
  store i32 %11, ptr %5, align 4, !tbaa !9
  %12 = load i32, ptr %5, align 4, !tbaa !9
  %13 = icmp slt i32 %12, 0
  br i1 %13, label %14, label %21

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._tag, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 4, !tbaa !11
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct._tag, ptr %18, i32 0, i32 1
  %20 = load i32, ptr %19, align 4, !tbaa !13
  call void (ptr, ...) @Fatal(ptr noundef @.str.13, i32 noundef %17, i32 noundef %20)
  br label %21

21:                                               ; preds = %14, %2
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct._home, ptr %23, i32 0, i32 13
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = load i32, ptr %5, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds ptr, ptr %25, i64 %27
  store ptr %22, ptr %28, align 8, !tbaa !5
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._home, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !20
  %32 = load ptr, ptr %6, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct._node, ptr %32, i32 0, i32 19
  %34 = getelementptr inbounds %struct._tag, ptr %33, i32 0, i32 0
  store i32 %31, ptr %34, align 8, !tbaa !21
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct._node, ptr %36, i32 0, i32 19
  %38 = getelementptr inbounds %struct._tag, ptr %37, i32 0, i32 1
  store i32 %35, ptr %38, align 4, !tbaa !23
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct._node, ptr %39, i32 0, i32 35
  store i32 -1, ptr %40, align 4, !tbaa !24
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct._node, ptr %41, i32 0, i32 36
  store i32 -1, ptr %42, align 8, !tbaa !25
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct._node, ptr %43, i32 0, i32 37
  store i32 -1, ptr %44, align 4, !tbaa !26
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct._node, ptr %45, i32 0, i32 7
  store double 0.000000e+00, ptr %46, align 8, !tbaa !27
  %47 = load ptr, ptr %6, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct._node, ptr %47, i32 0, i32 8
  store double 0.000000e+00, ptr %48, align 8, !tbaa !28
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct._node, ptr %49, i32 0, i32 9
  store double 0.000000e+00, ptr %50, align 8, !tbaa !29
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct._node, ptr %51, i32 0, i32 13
  store double 0.000000e+00, ptr %52, align 8, !tbaa !30
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct._node, ptr %53, i32 0, i32 14
  store double 0.000000e+00, ptr %54, align 8, !tbaa !31
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct._node, ptr %55, i32 0, i32 15
  store double 0.000000e+00, ptr %56, align 8, !tbaa !32
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct._node, ptr %57, i32 0, i32 0
  store i32 0, ptr %58, align 8, !tbaa !33
  %59 = load ptr, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  ret ptr %59
}

declare ptr @PopFreeNodeQ(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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"_tag", !10, i64 0, !10, i64 4}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !6, i64 88}
!15 = !{!"_home", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !6, i64 104, !10, i64 112, !10, i64 116, !6, i64 120, !10, i64 128, !10, i64 132, !10, i64 136, !6, i64 144, !10, i64 152, !10, i64 156, !6, i64 160, !6, i64 168, !6, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !16, i64 224, !10, i64 232, !10, i64 236, !10, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !10, i64 272, !6, i64 280, !10, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !10, i64 320, !10, i64 324, !6, i64 328, !10, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !10, i64 368, !10, i64 372, !10, i64 376, !6, i64 384, !6, i64 392, !10, i64 400, !10, i64 404, !6, i64 408, !6, i64 416, !6, i64 424, !10, i64 432, !10, i64 436, !10, i64 440, !7, i64 448, !7, i64 520, !17, i64 592, !10, i64 632, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !10, i64 656, !18, i64 664}
!16 = !{!"double", !7, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!"timeval", !19, i64 0, !19, i64 8}
!19 = !{!"long", !7, i64 0}
!20 = !{!15, !10, i64 0}
!21 = !{!22, !10, i64 152}
!22 = !{!"_node", !10, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !16, i64 80, !16, i64 88, !16, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !12, i64 152, !10, 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, !10, i64 272, !10, i64 276, !10, i64 280, !10, i64 284, !10, i64 288, !6, i64 296, !6, i64 304, !10, i64 312}
!23 = !{!22, !10, i64 156}
!24 = !{!22, !10, i64 276}
!25 = !{!22, !10, i64 280}
!26 = !{!22, !10, i64 284}
!27 = !{!22, !16, i64 56}
!28 = !{!22, !16, i64 64}
!29 = !{!22, !16, i64 72}
!30 = !{!22, !16, i64 104}
!31 = !{!22, !16, i64 112}
!32 = !{!22, !16, i64 120}
!33 = !{!22, !10, 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.13 = external hidden unnamed_addr constant [34 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @Fatal(ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i32 @RequestNodeTag(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @RequestNewNativeNodeTag(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = tail call ptr @PopFreeNodeQ(ptr noundef %0) #3
  %4 = tail call i32 @RequestNodeTag(ptr noundef %0, ptr noundef %1)
  %5 = icmp slt i32 %4, 0
  br i1 %5, label %6, label %10

6:                                                ; preds = %2
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %1, i64 4
  %9 = load i32, ptr %8, align 4, !tbaa !10
  tail call void (ptr, ...) @Fatal(ptr noundef nonnull @.str.13, i32 noundef %7, i32 noundef %9)
  br label %10

10:                                               ; preds = %6, %2
  %11 = getelementptr inbounds i8, ptr %0, i64 88
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = sext i32 %4 to i64
  %14 = getelementptr inbounds ptr, ptr %12, i64 %13
  store ptr %3, ptr %14, align 8, !tbaa !18
  %15 = load i32, ptr %0, align 8, !tbaa !19
  %16 = getelementptr inbounds i8, ptr %3, i64 152
  store i32 %15, ptr %16, align 8, !tbaa !20
  %17 = getelementptr inbounds i8, ptr %3, i64 156
  store i32 %4, ptr %17, align 4, !tbaa !22
  %18 = getelementptr inbounds i8, ptr %3, i64 276
  store i32 -1, ptr %18, align 4, !tbaa !23
  %19 = getelementptr inbounds i8, ptr %3, i64 280
  store i32 -1, ptr %19, align 8, !tbaa !24
  %20 = getelementptr inbounds i8, ptr %3, i64 284
  store i32 -1, ptr %20, align 4, !tbaa !25
  %21 = getelementptr inbounds i8, ptr %3, i64 56
  %22 = getelementptr inbounds i8, ptr %3, i64 104
  store i32 0, ptr %3, align 8, !tbaa !26
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %21, i8 0, i64 24, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %22, i8 0, i64 24, i1 false)
  ret ptr %3
}

declare ptr @PopFreeNodeQ(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 0}
!6 = !{!"_tag", !7, i64 0, !7, i64 4}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!12, !13, i64 88}
!12 = !{!"_home", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !13, i64 16, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !13, i64 72, !13, i64 80, !13, i64 88, !7, i64 96, !7, i64 100, !13, i64 104, !7, i64 112, !7, i64 116, !13, i64 120, !7, i64 128, !7, i64 132, !7, i64 136, !13, i64 144, !7, i64 152, !7, i64 156, !13, i64 160, !13, i64 168, !13, i64 176, !14, i64 184, !14, i64 192, !14, i64 200, !14, i64 208, !14, i64 216, !14, i64 224, !7, i64 232, !7, i64 236, !7, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !7, i64 272, !13, i64 280, !7, i64 288, !13, i64 296, !13, i64 304, !13, i64 312, !7, i64 320, !7, i64 324, !13, i64 328, !7, i64 336, !13, i64 344, !13, i64 352, !13, i64 360, !7, i64 368, !7, i64 372, !7, i64 376, !13, i64 384, !13, i64 392, !7, i64 400, !7, i64 404, !13, i64 408, !13, i64 416, !13, i64 424, !7, i64 432, !7, i64 436, !7, i64 440, !8, i64 448, !8, i64 520, !15, i64 592, !7, i64 632, !7, i64 636, !7, i64 640, !7, i64 644, !7, i64 648, !7, i64 652, !7, i64 656, !16, i64 664}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!"double", !8, i64 0}
!15 = !{!"", !7, i64 0, !7, i64 4, !13, i64 8, !13, i64 16, !13, i64 24, !13, i64 32}
!16 = !{!"timeval", !17, i64 0, !17, i64 8}
!17 = !{!"long", !8, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!12, !7, i64 0}
!20 = !{!21, !7, i64 152}
!21 = !{!"_node", !7, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !14, i64 48, !14, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !14, i64 112, !14, i64 120, !14, i64 128, !14, i64 136, !14, i64 144, !6, i64 152, !7, i64 160, !13, i64 168, !13, i64 176, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, i64 224, !13, i64 232, !13, i64 240, !13, i64 248, !13, i64 256, !13, i64 264, !7, i64 272, !7, i64 276, !7, i64 280, !7, i64 284, !7, i64 288, !13, i64 296, !13, i64 304, !7, i64 312}
!22 = !{!21, !7, i64 156}
!23 = !{!21, !7, i64 276}
!24 = !{!21, !7, i64 280}
!25 = !{!21, !7, i64 284}
!26 = !{!21, !7, i64 0}


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