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

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

; 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 void @TimerInitDLBReset(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #2
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %4

4:                                                ; preds = %36, %1
  %5 = load i32, ptr %3, align 4, !tbaa !9
  %6 = icmp slt i32 %5, 35
  br i1 %6, label %7, label %39

7:                                                ; preds = %4
  %8 = load i32, ptr %3, align 4, !tbaa !9
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %13, label %10

10:                                               ; preds = %7
  %11 = load i32, ptr %3, align 4, !tbaa !9
  %12 = icmp eq i32 %11, 1
  br i1 %12, label %13, label %14

13:                                               ; preds = %10, %7
  br label %36

14:                                               ; preds = %10
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct._home, ptr %15, i32 0, i32 51
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load i32, ptr %3, align 4, !tbaa !9
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds %struct._timer, ptr %17, i64 %19
  %21 = getelementptr inbounds %struct._timer, ptr %20, i32 0, i32 1
  store double 0.000000e+00, ptr %21, align 8, !tbaa !17
  %22 = load ptr, ptr %2, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct._home, ptr %22, i32 0, i32 51
  %24 = load ptr, ptr %23, align 8, !tbaa !11
  %25 = load i32, ptr %3, align 4, !tbaa !9
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds %struct._timer, ptr %24, i64 %26
  %28 = getelementptr inbounds %struct._timer, ptr %27, i32 0, i32 2
  store double 0.000000e+00, ptr %28, align 8, !tbaa !19
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct._home, ptr %29, i32 0, i32 51
  %31 = load ptr, ptr %30, align 8, !tbaa !11
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct._timer, ptr %31, i64 %33
  %35 = getelementptr inbounds %struct._timer, ptr %34, i32 0, i32 3
  store double 0.000000e+00, ptr %35, align 8, !tbaa !20
  br label %36

36:                                               ; preds = %14, %13
  %37 = load i32, ptr %3, align 4, !tbaa !9
  %38 = add nsw i32 %37, 1
  store i32 %38, ptr %3, align 4, !tbaa !9
  br label %4, !llvm.loop !21

39:                                               ; preds = %4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #2
  ret void
}

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 = { 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, !6, i64 344}
!12 = !{!"_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, !13, i64 184, !13, i64 192, !13, i64 200, !13, i64 208, !13, i64 216, !13, 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, !14, i64 592, !10, i64 632, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !10, i64 656, !15, i64 664}
!13 = !{!"double", !7, i64 0}
!14 = !{!"", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!15 = !{!"timeval", !16, i64 0, !16, i64 8}
!16 = !{!"long", !7, i64 0}
!17 = !{!18, !13, i64 8}
!18 = !{!"_timer", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24, !10, i64 32, !6, i64 40}
!19 = !{!18, !13, i64 16}
!20 = !{!18, !13, i64 24}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; 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: nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) uwtable
define dso_local void @TimerInitDLBReset(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
.peel.next12:
  %1 = getelementptr inbounds i8, ptr %0, i64 344
  %2 = load ptr, ptr %1, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %2, i64 104
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %3, i8 0, i64 24, i1 false)
  %4 = load ptr, ptr %1, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 152
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %5, i8 0, i64 24, i1 false)
  %6 = load ptr, ptr %1, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %6, i64 200
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, i8 0, i64 24, i1 false)
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 248
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, i8 0, i64 24, i1 false)
  %10 = load ptr, ptr %1, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 296
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %11, i8 0, i64 24, i1 false)
  %12 = load ptr, ptr %1, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 344
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %13, i8 0, i64 24, i1 false)
  %14 = load ptr, ptr %1, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 392
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %15, i8 0, i64 24, i1 false)
  %16 = load ptr, ptr %1, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 440
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %17, i8 0, i64 24, i1 false)
  %18 = load ptr, ptr %1, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 488
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %19, i8 0, i64 24, i1 false)
  %20 = load ptr, ptr %1, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 536
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %21, i8 0, i64 24, i1 false)
  %22 = load ptr, ptr %1, align 8, !tbaa !5
  %23 = getelementptr inbounds i8, ptr %22, i64 584
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %23, i8 0, i64 24, i1 false)
  %24 = load ptr, ptr %1, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 632
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %25, i8 0, i64 24, i1 false)
  %26 = load ptr, ptr %1, align 8, !tbaa !5
  %27 = getelementptr inbounds i8, ptr %26, i64 680
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %27, i8 0, i64 24, i1 false)
  %28 = load ptr, ptr %1, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 728
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %29, i8 0, i64 24, i1 false)
  %30 = load ptr, ptr %1, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 776
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %31, i8 0, i64 24, i1 false)
  %32 = load ptr, ptr %1, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 824
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %33, i8 0, i64 24, i1 false)
  %34 = load ptr, ptr %1, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 872
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %35, i8 0, i64 24, i1 false)
  %36 = load ptr, ptr %1, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 920
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %37, i8 0, i64 24, i1 false)
  %38 = load ptr, ptr %1, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 968
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %39, i8 0, i64 24, i1 false)
  %40 = load ptr, ptr %1, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 1016
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %41, i8 0, i64 24, i1 false)
  %42 = load ptr, ptr %1, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 1064
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %43, i8 0, i64 24, i1 false)
  %44 = load ptr, ptr %1, align 8, !tbaa !5
  %45 = getelementptr inbounds i8, ptr %44, i64 1112
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %45, i8 0, i64 24, i1 false)
  %46 = load ptr, ptr %1, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 1160
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %47, i8 0, i64 24, i1 false)
  %48 = load ptr, ptr %1, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 1208
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %49, i8 0, i64 24, i1 false)
  %50 = load ptr, ptr %1, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 1256
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %51, i8 0, i64 24, i1 false)
  %52 = load ptr, ptr %1, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 1304
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %53, i8 0, i64 24, i1 false)
  %54 = load ptr, ptr %1, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 1352
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %55, i8 0, i64 24, i1 false)
  %56 = load ptr, ptr %1, align 8, !tbaa !5
  %57 = getelementptr inbounds i8, ptr %56, i64 1400
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %57, i8 0, i64 24, i1 false)
  %58 = load ptr, ptr %1, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 1448
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %59, i8 0, i64 24, i1 false)
  %60 = load ptr, ptr %1, align 8, !tbaa !5
  %61 = getelementptr inbounds i8, ptr %60, i64 1496
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %61, i8 0, i64 24, i1 false)
  %62 = load ptr, ptr %1, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 1544
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %63, i8 0, i64 24, i1 false)
  %64 = load ptr, ptr %1, align 8, !tbaa !5
  %65 = getelementptr inbounds i8, ptr %64, i64 1592
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %65, i8 0, i64 24, i1 false)
  %66 = load ptr, ptr %1, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 1640
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %67, i8 0, i64 24, i1 false)
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { nofree norecurse nosync nounwind memory(write, argmem: readwrite, inaccessiblemem: none) 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 nounwind willreturn memory(argmem: write) }

!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 344}
!6 = !{!"_home", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !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, !7, i64 96, !7, i64 100, !10, i64 104, !7, i64 112, !7, i64 116, !10, i64 120, !7, i64 128, !7, i64 132, !7, i64 136, !10, i64 144, !7, i64 152, !7, i64 156, !10, i64 160, !10, i64 168, !10, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !7, i64 232, !7, i64 236, !7, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !7, i64 272, !10, i64 280, !7, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !7, i64 320, !7, i64 324, !10, i64 328, !7, i64 336, !10, i64 344, !10, i64 352, !10, i64 360, !7, i64 368, !7, i64 372, !7, i64 376, !10, i64 384, !10, i64 392, !7, i64 400, !7, i64 404, !10, i64 408, !10, i64 416, !10, i64 424, !7, i64 432, !7, i64 436, !7, i64 440, !8, i64 448, !8, i64 520, !12, i64 592, !7, i64 632, !7, i64 636, !7, i64 640, !7, i64 644, !7, i64 648, !7, i64 652, !7, i64 656, !13, i64 664}
!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 = !{!"", !7, i64 0, !7, i64 4, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32}
!13 = !{!"timeval", !14, i64 0, !14, i64 8}
!14 = !{!"long", !8, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass