; LLVM IR from thalium/icebox :: third_party/virtualbox/src/VBox/Devices/EFI/Firmware/OptionRomPkg (E100bStatistics)

; 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.s_pxe_db_statistics = type { i64, [64 x i64] }
%struct.s_data_instance = type { i16, i16, i8, i8, i16, i16, i16, i16, i16, [32 x i8], [32 x i8], [32 x i8], [64 x i32], [128 x i32], i32, i32, i16, i16, i8, i8, i8, i8, i16, i16, i16, i16, i32, i32, i16, i16, [2 x i16], i8, i8, i16, i32, ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, i64, i64, [64 x i64], i16, i16, i16, i16, i8, i8, i8, i8, i8, [3 x i8], %struct.mc, i64, ptr, i64, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mc = type { [3 x i16], i16, [8 x [32 x i8]] }
%struct.speedo_stats = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @InByte(ptr noundef, i32 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @OutByte(ptr noundef, i8 noundef zeroext, i32 noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @DelayIt(ptr noundef, i16 noundef zeroext) #0

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @E100bStatistics(ptr noundef %0, i64 noundef %1, i16 noundef zeroext %2) #0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca i16, align 2
  %8 = alloca %struct.s_pxe_db_statistics, align 1
  %9 = alloca i32, align 4
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store i16 %2, ptr %7, align 2, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 520, ptr %8) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 10000, ptr %9, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #3
  store i16 2000, ptr %10, align 2, !tbaa !11
  br label %12

12:                                               ; preds = %28, %3
  %13 = load ptr, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.s_data_instance, ptr %14, i32 0, i32 14
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %17 = add i32 %16, 2
  %18 = call zeroext i8 @InByte(ptr noundef %13, i32 noundef %17)
  %19 = zext i8 %18 to i32
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %26

21:                                               ; preds = %12
  %22 = load i16, ptr %10, align 2, !tbaa !11
  %23 = add i16 %22, -1
  store i16 %23, ptr %10, align 2, !tbaa !11
  %24 = sext i16 %23 to i32
  %25 = icmp sge i32 %24, 0
  br label %26

26:                                               ; preds = %21, %12
  %27 = phi i1 [ false, %12 ], [ %25, %21 ]
  br i1 %27, label %28, label %30

28:                                               ; preds = %26
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %29, i16 noundef zeroext 10)
  br label %12, !llvm.loop !18

30:                                               ; preds = %26
  %31 = load i16, ptr %10, align 2, !tbaa !11
  %32 = sext i16 %31 to i32
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %30
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %35, i16 noundef zeroext 50)
  br label %36

36:                                               ; preds = %34, %30
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #3
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.s_data_instance, ptr %37, i32 0, i32 37
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = getelementptr inbounds %struct.speedo_stats, ptr %39, i32 0, i32 16
  store i32 0, ptr %40, align 1, !tbaa !21
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load i16, ptr %7, align 2, !tbaa !11
  %43 = zext i16 %42 to i32
  %44 = icmp ne i32 %43, 0
  %45 = zext i1 %44 to i64
  %46 = select i1 %44, i32 80, i32 112
  %47 = trunc i32 %46 to i8
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.s_data_instance, ptr %48, i32 0, i32 14
  %50 = load i32, ptr %49, align 8, !tbaa !15
  %51 = add i32 %50, 2
  call void @OutByte(ptr noundef %41, i8 noundef zeroext %47, i32 noundef %51)
  %52 = call ptr @ZeroMem(ptr noundef %8, i64 noundef 520)
  br label %53

53:                                               ; preds = %64, %36
  %54 = load i32, ptr %9, align 4, !tbaa !13
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %68

56:                                               ; preds = %53
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %57, i16 noundef zeroext 100)
  %58 = load ptr, ptr %5, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.s_data_instance, ptr %58, i32 0, i32 37
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds %struct.speedo_stats, ptr %60, i32 0, i32 16
  %62 = load i32, ptr %61, align 1, !tbaa !21
  switch i32 %62, label %64 [
    i32 40965, label %63
    i32 40967, label %63
  ]

63:                                               ; preds = %56, %56
  br label %67

64:                                               ; preds = %56
  %65 = load i32, ptr %9, align 4, !tbaa !13
  %66 = add i32 %65, -1
  store i32 %66, ptr %9, align 4, !tbaa !13
  br label %53, !llvm.loop !23

67:                                               ; preds = %63
  br label %68

68:                                               ; preds = %67, %53
  %69 = load i16, ptr %7, align 2, !tbaa !11
  %70 = zext i16 %69 to i32
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %68
  store i64 0, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %211

73:                                               ; preds = %68
  %74 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 0
  store i64 1068311, ptr %74, align 1, !tbaa !24
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.s_data_instance, ptr %75, i32 0, i32 37
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  %78 = getelementptr inbounds %struct.speedo_stats, ptr %77, i32 0, i32 9
  %79 = load i32, ptr %78, align 1, !tbaa !26
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %82 = getelementptr inbounds [64 x i64], ptr %81, i64 0, i64 1
  store i64 %80, ptr %82, align 1, !tbaa !9
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.s_data_instance, ptr %83, i32 0, i32 37
  %85 = load ptr, ptr %84, align 8, !tbaa !20
  %86 = getelementptr inbounds %struct.speedo_stats, ptr %85, i32 0, i32 15
  %87 = load i32, ptr %86, align 1, !tbaa !27
  %88 = zext i32 %87 to i64
  %89 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %90 = getelementptr inbounds [64 x i64], ptr %89, i64 0, i64 2
  store i64 %88, ptr %90, align 1, !tbaa !9
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.s_data_instance, ptr %91, i32 0, i32 37
  %93 = load ptr, ptr %92, align 8, !tbaa !20
  %94 = getelementptr inbounds %struct.speedo_stats, ptr %93, i32 0, i32 10
  %95 = load i32, ptr %94, align 1, !tbaa !28
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.s_data_instance, ptr %96, i32 0, i32 37
  %98 = load ptr, ptr %97, align 8, !tbaa !20
  %99 = getelementptr inbounds %struct.speedo_stats, ptr %98, i32 0, i32 11
  %100 = load i32, ptr %99, align 1, !tbaa !29
  %101 = add i32 %95, %100
  %102 = zext i32 %101 to i64
  %103 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %104 = getelementptr inbounds [64 x i64], ptr %103, i64 0, i64 8
  store i64 %102, ptr %104, align 1, !tbaa !9
  %105 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %106 = getelementptr inbounds [64 x i64], ptr %105, i64 0, i64 2
  %107 = load i64, ptr %106, align 1, !tbaa !9
  %108 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %109 = getelementptr inbounds [64 x i64], ptr %108, i64 0, i64 8
  %110 = load i64, ptr %109, align 1, !tbaa !9
  %111 = add i64 %107, %110
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.s_data_instance, ptr %112, i32 0, i32 37
  %114 = load ptr, ptr %113, align 8, !tbaa !20
  %115 = getelementptr inbounds %struct.speedo_stats, ptr %114, i32 0, i32 12
  %116 = load i32, ptr %115, align 1, !tbaa !30
  %117 = zext i32 %116 to i64
  %118 = add i64 %111, %117
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.s_data_instance, ptr %119, i32 0, i32 37
  %121 = load ptr, ptr %120, align 8, !tbaa !20
  %122 = getelementptr inbounds %struct.speedo_stats, ptr %121, i32 0, i32 13
  %123 = load i32, ptr %122, align 1, !tbaa !31
  %124 = zext i32 %123 to i64
  %125 = add i64 %118, %124
  %126 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %127 = getelementptr inbounds [64 x i64], ptr %126, i64 0, i64 4
  store i64 %125, ptr %127, align 1, !tbaa !9
  %128 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %129 = getelementptr inbounds [64 x i64], ptr %128, i64 0, i64 1
  %130 = load i64, ptr %129, align 1, !tbaa !9
  %131 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %132 = getelementptr inbounds [64 x i64], ptr %131, i64 0, i64 4
  %133 = load i64, ptr %132, align 1, !tbaa !9
  %134 = add i64 %130, %133
  %135 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %136 = getelementptr inbounds [64 x i64], ptr %135, i64 0, i64 0
  store i64 %134, ptr %136, align 1, !tbaa !9
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.s_data_instance, ptr %137, i32 0, i32 37
  %139 = load ptr, ptr %138, align 8, !tbaa !20
  %140 = getelementptr inbounds %struct.speedo_stats, ptr %139, i32 0, i32 0
  %141 = load i32, ptr %140, align 1, !tbaa !32
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %144 = getelementptr inbounds [64 x i64], ptr %143, i64 0, i64 11
  store i64 %142, ptr %144, align 1, !tbaa !9
  %145 = load ptr, ptr %5, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.s_data_instance, ptr %145, i32 0, i32 37
  %147 = load ptr, ptr %146, align 8, !tbaa !20
  %148 = getelementptr inbounds %struct.speedo_stats, ptr %147, i32 0, i32 1
  %149 = load i32, ptr %148, align 1, !tbaa !33
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.s_data_instance, ptr %150, i32 0, i32 37
  %152 = load ptr, ptr %151, align 8, !tbaa !20
  %153 = getelementptr inbounds %struct.speedo_stats, ptr %152, i32 0, i32 2
  %154 = load i32, ptr %153, align 1, !tbaa !34
  %155 = add i32 %149, %154
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.s_data_instance, ptr %156, i32 0, i32 37
  %158 = load ptr, ptr %157, align 8, !tbaa !20
  %159 = getelementptr inbounds %struct.speedo_stats, ptr %158, i32 0, i32 3
  %160 = load i32, ptr %159, align 1, !tbaa !35
  %161 = add i32 %155, %160
  %162 = load ptr, ptr %5, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.s_data_instance, ptr %162, i32 0, i32 37
  %164 = load ptr, ptr %163, align 8, !tbaa !20
  %165 = getelementptr inbounds %struct.speedo_stats, ptr %164, i32 0, i32 6
  %166 = load i32, ptr %165, align 1, !tbaa !36
  %167 = add i32 %161, %166
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.s_data_instance, ptr %168, i32 0, i32 37
  %170 = load ptr, ptr %169, align 8, !tbaa !20
  %171 = getelementptr inbounds %struct.speedo_stats, ptr %170, i32 0, i32 7
  %172 = load i32, ptr %171, align 1, !tbaa !37
  %173 = add i32 %167, %172
  %174 = zext i32 %173 to i64
  %175 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %176 = getelementptr inbounds [64 x i64], ptr %175, i64 0, i64 14
  store i64 %174, ptr %176, align 1, !tbaa !9
  %177 = load ptr, ptr %5, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.s_data_instance, ptr %177, i32 0, i32 37
  %179 = load ptr, ptr %178, align 8, !tbaa !20
  %180 = getelementptr inbounds %struct.speedo_stats, ptr %179, i32 0, i32 8
  %181 = load i32, ptr %180, align 1, !tbaa !38
  %182 = zext i32 %181 to i64
  %183 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %184 = getelementptr inbounds [64 x i64], ptr %183, i64 0, i64 20
  store i64 %182, ptr %184, align 1, !tbaa !9
  %185 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %186 = getelementptr inbounds [64 x i64], ptr %185, i64 0, i64 11
  %187 = load i64, ptr %186, align 1, !tbaa !9
  %188 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %189 = getelementptr inbounds [64 x i64], ptr %188, i64 0, i64 14
  %190 = load i64, ptr %189, align 1, !tbaa !9
  %191 = add i64 %187, %190
  %192 = load ptr, ptr %5, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.s_data_instance, ptr %192, i32 0, i32 37
  %194 = load ptr, ptr %193, align 8, !tbaa !20
  %195 = getelementptr inbounds %struct.speedo_stats, ptr %194, i32 0, i32 4
  %196 = load i32, ptr %195, align 1, !tbaa !39
  %197 = zext i32 %196 to i64
  %198 = add i64 %191, %197
  %199 = getelementptr inbounds %struct.s_pxe_db_statistics, ptr %8, i32 0, i32 1
  %200 = getelementptr inbounds [64 x i64], ptr %199, i64 0, i64 10
  store i64 %198, ptr %200, align 1, !tbaa !9
  %201 = load i16, ptr %7, align 2, !tbaa !11
  %202 = zext i16 %201 to i64
  %203 = icmp ugt i64 %202, 520
  br i1 %203, label %204, label %205

204:                                              ; preds = %73
  store i16 520, ptr %7, align 2, !tbaa !11
  br label %205

205:                                              ; preds = %204, %73
  %206 = load i64, ptr %6, align 8, !tbaa !9
  %207 = inttoptr i64 %206 to ptr
  %208 = load i16, ptr %7, align 2, !tbaa !11
  %209 = zext i16 %208 to i64
  %210 = call ptr @CopyMem(ptr noundef %207, ptr noundef %8, i64 noundef %209)
  store i64 0, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %211

211:                                              ; preds = %205, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 520, ptr %8) #3
  %212 = load i64, ptr %4, align 8
  ret i64 %212
}

declare ptr @ZeroMem(ptr noundef, i64 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"long long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"short", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !14, i64 880}
!16 = !{!"s_data_instance", !12, i64 0, !12, i64 2, !7, i64 4, !7, i64 5, !12, i64 6, !12, i64 8, !12, i64 10, !12, i64 12, !12, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !14, i64 880, !14, i64 884, !12, i64 888, !12, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !12, i64 896, !12, i64 898, !12, i64 900, !12, i64 902, !14, i64 904, !14, i64 908, !12, i64 912, !12, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !12, i64 922, !14, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !10, i64 976, !10, i64 984, !10, i64 992, !10, i64 1000, !10, i64 1008, !7, i64 1016, !12, i64 1528, !12, i64 1530, !12, i64 1532, !12, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !17, i64 1544, !10, i64 1808, !6, i64 1816, !10, i64 1824, !6, i64 1832, !6, i64 1840, !6, i64 1848, !6, i64 1856, !6, i64 1864, !6, i64 1872, !6, i64 1880, !6, i64 1888, !6, i64 1896, !6, i64 1904, !6, i64 1912}
!17 = !{!"mc", !7, i64 0, !12, i64 6, !7, i64 8}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = !{!16, !6, i64 944}
!21 = !{!22, !14, i64 64}
!22 = !{!"speedo_stats", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !14, i64 36, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !14, i64 60, !14, i64 64}
!23 = distinct !{!23, !19}
!24 = !{!25, !10, i64 0}
!25 = !{!"s_pxe_db_statistics", !10, i64 0, !7, i64 8}
!26 = !{!22, !14, i64 36}
!27 = !{!22, !14, i64 60}
!28 = !{!22, !14, i64 40}
!29 = !{!22, !14, i64 44}
!30 = !{!22, !14, i64 48}
!31 = !{!22, !14, i64 52}
!32 = !{!22, !14, i64 0}
!33 = !{!22, !14, i64 4}
!34 = !{!22, !14, i64 8}
!35 = !{!22, !14, i64 12}
!36 = !{!22, !14, i64 24}
!37 = !{!22, !14, i64 28}
!38 = !{!22, !14, i64 32}
!39 = !{!22, !14, i64 16}


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

%struct.s_pxe_db_statistics = type { i64, [64 x i64] }

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @OutByte(ptr noundef, i8 noundef zeroext, i32 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @DelayIt(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

declare ptr @CopyMem(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i64 @E100bStatistics(ptr noundef %0, i64 noundef %1, i16 noundef zeroext %2) local_unnamed_addr #0 {
  %4 = alloca %struct.s_pxe_db_statistics, align 8
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %4) #4
  %5 = getelementptr inbounds i8, ptr %0, i64 880
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %7 = add i32 %6, 2
  %8 = tail call zeroext i8 @InByte(ptr noundef %0, i32 noundef %7)
  %.not39 = icmp eq i8 %8, 0
  br i1 %.not39, label %.critedge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %3, %10
  %.040 = phi i16 [ %11, %10 ], [ 2000, %3 ]
  %9 = icmp sgt i16 %.040, 0
  br i1 %9, label %10, label %.critedge.thread

10:                                               ; preds = %.lr.ph
  %11 = add nsw i16 %.040, -1
  tail call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 10)
  %12 = load i32, ptr %5, align 8, !tbaa !5
  %13 = add i32 %12, 2
  %14 = tail call zeroext i8 @InByte(ptr noundef nonnull %0, i32 noundef %13)
  %.not = icmp eq i8 %14, 0
  br i1 %.not, label %.critedge, label %.lr.ph, !llvm.loop !14

.critedge:                                        ; preds = %10
  %15 = icmp eq i16 %11, 0
  br i1 %15, label %16, label %.critedge.thread

16:                                               ; preds = %.critedge
  tail call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 50)
  br label %.critedge.thread

.critedge.thread:                                 ; preds = %.lr.ph, %3, %16, %.critedge
  %17 = getelementptr inbounds i8, ptr %0, i64 944
  %18 = load ptr, ptr %17, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %18, i64 64
  store i32 0, ptr %19, align 1, !tbaa !17
  %.not34 = icmp eq i16 %2, 0
  %20 = select i1 %.not34, i8 112, i8 80
  %21 = load i32, ptr %5, align 8, !tbaa !5
  %22 = add i32 %21, 2
  tail call void @OutByte(ptr noundef nonnull %0, i8 noundef zeroext %20, i32 noundef %22)
  %23 = call ptr @ZeroMem(ptr noundef nonnull %4, i64 noundef 520) #4
  br label %24

24:                                               ; preds = %.critedge.thread, %28
  %.03241 = phi i32 [ 10000, %.critedge.thread ], [ %29, %28 ]
  call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 100)
  %25 = load ptr, ptr %17, align 8, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %25, i64 64
  %27 = load i32, ptr %26, align 1, !tbaa !17
  switch i32 %27, label %28 [
    i32 40965, label %30
    i32 40967, label %30
  ]

28:                                               ; preds = %24
  %29 = add nsw i32 %.03241, -1
  %.not35 = icmp eq i32 %29, 0
  br i1 %.not35, label %30, label %24, !llvm.loop !19

30:                                               ; preds = %24, %24, %28
  br i1 %.not34, label %91, label %31

31:                                               ; preds = %30
  store i64 1068311, ptr %4, align 8, !tbaa !20
  %32 = getelementptr inbounds i8, ptr %25, i64 36
  %33 = load i32, ptr %32, align 1, !tbaa !22
  %34 = zext i32 %33 to i64
  %35 = getelementptr inbounds i8, ptr %4, i64 8
  %36 = getelementptr inbounds i8, ptr %4, i64 16
  store i64 %34, ptr %36, align 8, !tbaa !23
  %37 = getelementptr inbounds i8, ptr %25, i64 60
  %38 = load i32, ptr %37, align 1, !tbaa !24
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds i8, ptr %4, i64 24
  store i64 %39, ptr %40, align 8, !tbaa !23
  %41 = getelementptr inbounds i8, ptr %25, i64 40
  %42 = load i32, ptr %41, align 1, !tbaa !25
  %43 = getelementptr inbounds i8, ptr %25, i64 44
  %44 = load i32, ptr %43, align 1, !tbaa !26
  %45 = add i32 %44, %42
  %46 = zext i32 %45 to i64
  %47 = getelementptr inbounds i8, ptr %4, i64 72
  store i64 %46, ptr %47, align 8, !tbaa !23
  %48 = add nuw nsw i64 %46, %39
  %49 = getelementptr inbounds i8, ptr %25, i64 48
  %50 = load i32, ptr %49, align 1, !tbaa !27
  %51 = zext i32 %50 to i64
  %52 = add nuw nsw i64 %48, %51
  %53 = getelementptr inbounds i8, ptr %25, i64 52
  %54 = load i32, ptr %53, align 1, !tbaa !28
  %55 = zext i32 %54 to i64
  %56 = add nuw nsw i64 %52, %55
  %57 = getelementptr inbounds i8, ptr %4, i64 40
  store i64 %56, ptr %57, align 8, !tbaa !23
  %58 = add nuw nsw i64 %56, %34
  store i64 %58, ptr %35, align 8, !tbaa !23
  %59 = load i32, ptr %25, align 1, !tbaa !29
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds i8, ptr %4, i64 96
  store i64 %60, ptr %61, align 8, !tbaa !23
  %62 = getelementptr inbounds i8, ptr %25, i64 4
  %63 = load i32, ptr %62, align 1, !tbaa !30
  %64 = getelementptr inbounds i8, ptr %25, i64 8
  %65 = load i32, ptr %64, align 1, !tbaa !31
  %66 = add i32 %65, %63
  %67 = getelementptr inbounds i8, ptr %25, i64 12
  %68 = load i32, ptr %67, align 1, !tbaa !32
  %69 = add i32 %66, %68
  %70 = getelementptr inbounds i8, ptr %25, i64 24
  %71 = load i32, ptr %70, align 1, !tbaa !33
  %72 = add i32 %69, %71
  %73 = getelementptr inbounds i8, ptr %25, i64 28
  %74 = load i32, ptr %73, align 1, !tbaa !34
  %75 = add i32 %72, %74
  %76 = zext i32 %75 to i64
  %77 = getelementptr inbounds i8, ptr %4, i64 120
  store i64 %76, ptr %77, align 8, !tbaa !23
  %78 = getelementptr inbounds i8, ptr %25, i64 32
  %79 = load i32, ptr %78, align 1, !tbaa !35
  %80 = zext i32 %79 to i64
  %81 = getelementptr inbounds i8, ptr %4, i64 168
  store i64 %80, ptr %81, align 8, !tbaa !23
  %82 = add nuw nsw i64 %76, %60
  %83 = getelementptr inbounds i8, ptr %25, i64 16
  %84 = load i32, ptr %83, align 1, !tbaa !36
  %85 = zext i32 %84 to i64
  %86 = add nuw nsw i64 %82, %85
  %87 = getelementptr inbounds i8, ptr %4, i64 88
  store i64 %86, ptr %87, align 8, !tbaa !23
  %spec.store.select = call i16 @llvm.umin.i16(i16 %2, i16 520)
  %88 = inttoptr i64 %1 to ptr
  %89 = zext nneg i16 %spec.store.select to i64
  %90 = call ptr @CopyMem(ptr noundef %88, ptr noundef nonnull %4, i64 noundef %89) #4
  br label %91

91:                                               ; preds = %30, %31
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %4) #4
  ret i64 0
}

declare ptr @ZeroMem(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i16 @llvm.umin.i16(i16, i16) #3

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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, !10, i64 880}
!6 = !{!"s_data_instance", !7, i64 0, !7, i64 2, !8, i64 4, !8, i64 5, !7, i64 6, !7, i64 8, !7, i64 10, !7, i64 12, !7, i64 14, !8, i64 16, !8, i64 48, !8, i64 80, !8, i64 112, !8, i64 368, !10, i64 880, !10, i64 884, !7, i64 888, !7, i64 890, !8, i64 892, !8, i64 893, !8, i64 894, !8, i64 895, !7, i64 896, !7, i64 898, !7, i64 900, !7, i64 902, !10, i64 904, !10, i64 908, !7, i64 912, !7, i64 914, !8, i64 916, !8, i64 920, !8, i64 921, !7, i64 922, !10, i64 924, !11, i64 928, !11, i64 936, !11, i64 944, !11, i64 952, !11, i64 960, !11, i64 968, !12, i64 976, !12, i64 984, !12, i64 992, !12, i64 1000, !12, i64 1008, !8, i64 1016, !7, i64 1528, !7, i64 1530, !7, i64 1532, !7, i64 1534, !8, i64 1536, !8, i64 1537, !8, i64 1538, !8, i64 1539, !8, i64 1540, !8, i64 1541, !13, i64 1544, !12, i64 1808, !11, i64 1816, !12, i64 1824, !11, i64 1832, !11, i64 1840, !11, i64 1848, !11, i64 1856, !11, i64 1864, !11, i64 1872, !11, i64 1880, !11, i64 1888, !11, i64 1896, !11, i64 1904, !11, i64 1912}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"long long", !8, i64 0}
!13 = !{!"mc", !8, i64 0, !7, i64 6, !8, i64 8}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!6, !11, i64 944}
!17 = !{!18, !10, i64 64}
!18 = !{!"speedo_stats", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64}
!19 = distinct !{!19, !15}
!20 = !{!21, !12, i64 0}
!21 = !{!"s_pxe_db_statistics", !12, i64 0, !8, i64 8}
!22 = !{!18, !10, i64 36}
!23 = !{!12, !12, i64 0}
!24 = !{!18, !10, i64 60}
!25 = !{!18, !10, i64 40}
!26 = !{!18, !10, i64 44}
!27 = !{!18, !10, i64 48}
!28 = !{!18, !10, i64 52}
!29 = !{!18, !10, i64 0}
!30 = !{!18, !10, i64 4}
!31 = !{!18, !10, i64 8}
!32 = !{!18, !10, i64 12}
!33 = !{!18, !10, i64 24}
!34 = !{!18, !10, i64 28}
!35 = !{!18, !10, i64 32}
!36 = !{!18, !10, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass