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

; 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_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.s_TxCB = type { %struct.CB_Header, i32, i16, i8, i8, [64 x i8], [16 x %struct.TBD], i32, i32, ptr, ptr, i64 }
%struct.CB_Header = type { i16, i16, i32 }
%struct.TBD = type { i32, i32 }

@basic_config_cmd = external dso_local global [22 x i8], align 16
@.str = external hidden unnamed_addr constant [137 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; 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 @DelayIt(ptr noundef, i16 noundef zeroext) #0

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

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

; Function Attrs: nounwind uwtable
define dso_local zeroext i8 @Configure(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca i8, align 1
  %7 = alloca i16, align 2
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #3
  %8 = load ptr, ptr %2, align 8, !tbaa !5
  %9 = call ptr @GetFreeCB(ptr noundef %8)
  store ptr %9, ptr %3, align 8, !tbaa !5
  br label %10

10:                                               ; preds = %1
  %11 = call zeroext i8 @DebugAssertEnabled()
  %12 = icmp ne i8 %11, 0
  br i1 %12, label %13, label %18

13:                                               ; preds = %10
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %13
  call void @DebugAssert(ptr noundef @.str, i64 noundef 520, ptr noundef @.str.1)
  br label %17

17:                                               ; preds = %16, %13
  br label %18

18:                                               ; preds = %17, %10
  br label %19

19:                                               ; preds = %18
  br label %20

20:                                               ; preds = %19
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  store ptr %22, ptr %4, align 8, !tbaa !5
  store volatile i16 0, ptr %5, align 2, !tbaa !9
  br label %23

23:                                               ; preds = %36, %20
  %24 = load volatile i16, ptr %5, align 2, !tbaa !9
  %25 = sext i16 %24 to i64
  %26 = icmp ult i64 %25, 22
  br i1 %26, label %27, label %39

27:                                               ; preds = %23
  %28 = load volatile i16, ptr %5, align 2, !tbaa !9
  %29 = sext i16 %28 to i64
  %30 = getelementptr inbounds [22 x i8], ptr @basic_config_cmd, i64 0, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = load volatile i16, ptr %5, align 2, !tbaa !9
  %34 = sext i16 %33 to i64
  %35 = getelementptr inbounds i8, ptr %32, i64 %34
  store i8 %31, ptr %35, align 1, !tbaa !11
  br label %36

36:                                               ; preds = %27
  %37 = load volatile i16, ptr %5, align 2, !tbaa !9
  %38 = add i16 %37, 1
  store volatile i16 %38, ptr %5, align 2, !tbaa !9
  br label %23, !llvm.loop !12

39:                                               ; preds = %23
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.s_data_instance, ptr %40, i32 0, i32 54
  %42 = load i8, ptr %41, align 1, !tbaa !14
  %43 = zext i8 %42 to i32
  %44 = and i32 %43, 8
  %45 = icmp ne i32 %44, 0
  %46 = zext i1 %45 to i64
  %47 = select i1 %45, i32 1, i32 0
  %48 = trunc i32 %47 to i8
  store i8 %48, ptr %6, align 1, !tbaa !11
  %49 = load i8, ptr %6, align 1, !tbaa !11
  %50 = zext i8 %49 to i32
  %51 = load ptr, ptr %2, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.s_data_instance, ptr %51, i32 0, i32 54
  %53 = load i8, ptr %52, align 1, !tbaa !14
  %54 = zext i8 %53 to i32
  %55 = and i32 %54, 2
  %56 = icmp ne i32 %55, 0
  %57 = zext i1 %56 to i64
  %58 = select i1 %56, i32 0, i32 2
  %59 = or i32 %50, %58
  %60 = trunc i32 %59 to i8
  store i8 %60, ptr %6, align 1, !tbaa !11
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds i8, ptr %61, i64 15
  %63 = load i8, ptr %62, align 1, !tbaa !11
  %64 = zext i8 %63 to i32
  %65 = load i8, ptr %6, align 1, !tbaa !11
  %66 = zext i8 %65 to i32
  %67 = or i32 %64, %66
  %68 = trunc i32 %67 to i8
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %69, i64 15
  store i8 %68, ptr %70, align 1, !tbaa !11
  %71 = load ptr, ptr %2, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.s_data_instance, ptr %71, i32 0, i32 19
  %73 = load i8, ptr %72, align 1, !tbaa !19
  %74 = zext i8 %73 to i32
  %75 = icmp ne i32 %74, 0
  %76 = zext i1 %75 to i64
  %77 = select i1 %75, i32 192, i32 128
  %78 = trunc i32 %77 to i8
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds i8, ptr %79, i64 19
  store i8 %78, ptr %80, align 1, !tbaa !11
  %81 = load ptr, ptr %2, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.s_data_instance, ptr %81, i32 0, i32 54
  %83 = load i8, ptr %82, align 1, !tbaa !14
  %84 = zext i8 %83 to i32
  %85 = and i32 %84, 16
  %86 = icmp ne i32 %85, 0
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 13, i32 5
  %89 = trunc i32 %88 to i8
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds i8, ptr %90, i64 21
  store i8 %89, ptr %91, align 1, !tbaa !11
  %92 = load ptr, ptr %2, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.s_data_instance, ptr %92, i32 0, i32 30
  %94 = getelementptr inbounds [2 x i16], ptr %93, i64 0, i64 0
  %95 = load i16, ptr %94, align 4, !tbaa !9
  %96 = zext i16 %95 to i32
  %97 = and i32 %96, 32768
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %108

99:                                               ; preds = %39
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds i8, ptr %100, i64 15
  %102 = load i8, ptr %101, align 1, !tbaa !11
  %103 = zext i8 %102 to i32
  %104 = or i32 %103, 128
  %105 = trunc i32 %104 to i8
  store i8 %105, ptr %101, align 1, !tbaa !11
  %106 = load ptr, ptr %4, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 8
  store i8 0, ptr %107, align 1, !tbaa !11
  br label %108

108:                                              ; preds = %99, %39
  %109 = load ptr, ptr %2, align 8, !tbaa !5
  call void @BlockIt(ptr noundef %109, i32 noundef 1)
  %110 = load ptr, ptr %3, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.s_TxCB, ptr %110, i32 0, i32 0
  %112 = getelementptr inbounds %struct.CB_Header, ptr %111, i32 0, i32 1
  store i16 16386, ptr %112, align 1, !tbaa !20
  %113 = load ptr, ptr %2, align 8, !tbaa !5
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = call zeroext i8 @IssueCB(ptr noundef %113, ptr noundef %114)
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #3
  store i16 2000, ptr %7, align 2, !tbaa !9
  br label %116

116:                                              ; preds = %132, %108
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = load ptr, ptr %2, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.s_data_instance, ptr %118, i32 0, i32 14
  %120 = load i32, ptr %119, align 8, !tbaa !23
  %121 = add i32 %120, 2
  %122 = call zeroext i8 @InByte(ptr noundef %117, i32 noundef %121)
  %123 = zext i8 %122 to i32
  %124 = icmp ne i32 %123, 0
  br i1 %124, label %125, label %130

125:                                              ; preds = %116
  %126 = load i16, ptr %7, align 2, !tbaa !9
  %127 = add i16 %126, -1
  store i16 %127, ptr %7, align 2, !tbaa !9
  %128 = sext i16 %127 to i32
  %129 = icmp sge i32 %128, 0
  br label %130

130:                                              ; preds = %125, %116
  %131 = phi i1 [ false, %116 ], [ %129, %125 ]
  br i1 %131, label %132, label %134

132:                                              ; preds = %130
  %133 = load ptr, ptr %2, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %133, i16 noundef zeroext 10)
  br label %116, !llvm.loop !24

134:                                              ; preds = %130
  %135 = load i16, ptr %7, align 2, !tbaa !9
  %136 = sext i16 %135 to i32
  %137 = icmp eq i32 %136, 0
  br i1 %137, label %138, label %140

138:                                              ; preds = %134
  %139 = load ptr, ptr %2, align 8, !tbaa !5
  call void @DelayIt(ptr noundef %139, i16 noundef zeroext 50)
  br label %140

140:                                              ; preds = %138, %134
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #3
  %141 = load ptr, ptr %2, align 8, !tbaa !5
  call void @BlockIt(ptr noundef %141, i32 noundef 0)
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = load ptr, ptr %2, align 8, !tbaa !5
  %144 = call signext i8 @CommandWaitForCompletion(ptr noundef %142, ptr noundef %143)
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.s_TxCB, ptr %145, i32 0, i32 7
  %147 = load i32, ptr %146, align 1, !tbaa !25
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.s_TxCB, ptr %148, i32 0, i32 1
  store i32 %147, ptr %149, align 1, !tbaa !26
  %150 = load ptr, ptr %3, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.s_TxCB, ptr %150, i32 0, i32 4
  store i8 0, ptr %151, align 1, !tbaa !27
  %152 = load ptr, ptr %3, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.s_TxCB, ptr %152, i32 0, i32 3
  store i8 0, ptr %153, align 1, !tbaa !28
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.s_TxCB, ptr %154, i32 0, i32 2
  store i16 0, ptr %155, align 1, !tbaa !29
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  call void @SetFreeCB(ptr noundef %156, ptr noundef %157)
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #3
  ret i8 0
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetFreeCB(ptr noundef) #0

declare zeroext i8 @DebugAssertEnabled() #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @CommandWaitForCompletion(ptr noundef, ptr noundef) #0

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

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 = !{!"short", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !7, i64 1539}
!15 = !{!"s_data_instance", !10, i64 0, !10, i64 2, !7, i64 4, !7, i64 5, !10, i64 6, !10, i64 8, !10, i64 10, !10, i64 12, !10, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !16, i64 880, !16, i64 884, !10, i64 888, !10, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !10, i64 896, !10, i64 898, !10, i64 900, !10, i64 902, !16, i64 904, !16, i64 908, !10, i64 912, !10, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !10, i64 922, !16, i64 924, !6, i64 928, !6, i64 936, !6, i64 944, !6, i64 952, !6, i64 960, !6, i64 968, !17, i64 976, !17, i64 984, !17, i64 992, !17, i64 1000, !17, i64 1008, !7, i64 1016, !10, i64 1528, !10, i64 1530, !10, i64 1532, !10, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !18, i64 1544, !17, i64 1808, !6, i64 1816, !17, 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}
!16 = !{!"int", !7, i64 0}
!17 = !{!"long long", !7, i64 0}
!18 = !{!"mc", !7, i64 0, !10, i64 6, !7, i64 8}
!19 = !{!15, !7, i64 893}
!20 = !{!21, !10, i64 2}
!21 = !{!"s_TxCB", !22, i64 0, !16, i64 8, !10, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 80, !16, i64 208, !16, i64 212, !6, i64 216, !6, i64 224, !17, i64 232}
!22 = !{!"CB_Header", !10, i64 0, !10, i64 2, !16, i64 4}
!23 = !{!15, !16, i64 880}
!24 = distinct !{!24, !13}
!25 = !{!21, !16, i64 208}
!26 = !{!21, !16, i64 8}
!27 = !{!21, !7, i64 15}
!28 = !{!21, !7, i64 14}
!29 = !{!21, !10, i64 12}


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

@basic_config_cmd = external dso_local local_unnamed_addr global [22 x i8], align 16
@.str = external hidden unnamed_addr constant [137 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1

; 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 @DelayIt(ptr noundef, i16 noundef zeroext) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i8 @Configure(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca i16, align 2
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %2)
  %3 = tail call ptr @GetFreeCB(ptr noundef %0)
  %4 = tail call zeroext i8 @DebugAssertEnabled() #3
  %5 = icmp eq i8 %4, 0
  %6 = icmp ne ptr %3, null
  %or.cond = select i1 %5, i1 true, i1 %6
  br i1 %or.cond, label %8, label %7

7:                                                ; preds = %1
  tail call void @DebugAssert(ptr noundef nonnull @.str, i64 noundef 520, ptr noundef nonnull @.str.1) #3
  br label %8

8:                                                ; preds = %7, %1
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  store volatile i16 0, ptr %2, align 2, !tbaa !5
  %.0..0..0..0.46 = load volatile i16, ptr %2, align 2, !tbaa !5
  %10 = icmp ult i16 %.0..0..0..0.46, 22
  br i1 %10, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.0..0..0..0.5 = load volatile i16, ptr %2, align 2, !tbaa !5
  %11 = sext i16 %.0..0..0..0.5 to i64
  %12 = getelementptr inbounds [22 x i8], ptr @basic_config_cmd, i64 0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %.0..0..0..0.6 = load volatile i16, ptr %2, align 2, !tbaa !5
  %14 = sext i16 %.0..0..0..0.6 to i64
  %15 = getelementptr inbounds i8, ptr %9, i64 %14
  store i8 %13, ptr %15, align 1, !tbaa !9
  %.0..0..0..0.7 = load volatile i16, ptr %2, align 2, !tbaa !5
  %16 = add i16 %.0..0..0..0.7, 1
  store volatile i16 %16, ptr %2, align 2, !tbaa !5
  %.0..0..0..0. = load volatile i16, ptr %2, align 2, !tbaa !5
  %17 = icmp ult i16 %.0..0..0..0., 22
  br i1 %17, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %8
  %18 = getelementptr inbounds i8, ptr %0, i64 1539
  %19 = load i8, ptr %18, align 1, !tbaa !12
  %20 = lshr i8 %19, 3
  %.lobit = and i8 %20, 1
  %21 = and i8 %19, 2
  %22 = or disjoint i8 %.lobit, %21
  %23 = xor i8 %22, 2
  %24 = getelementptr inbounds i8, ptr %3, i64 23
  %25 = load i8, ptr %24, align 1, !tbaa !9
  %26 = or i8 %23, %25
  store i8 %26, ptr %24, align 1, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %0, i64 893
  %28 = load i8, ptr %27, align 1, !tbaa !18
  %.not = icmp eq i8 %28, 0
  %29 = select i1 %.not, i8 -128, i8 -64
  %30 = getelementptr inbounds i8, ptr %3, i64 27
  store i8 %29, ptr %30, align 1, !tbaa !9
  %31 = load i8, ptr %18, align 1, !tbaa !12
  %32 = and i8 %31, 16
  %.not41 = icmp eq i8 %32, 0
  %33 = select i1 %.not41, i8 5, i8 13
  %34 = getelementptr inbounds i8, ptr %3, i64 29
  store i8 %33, ptr %34, align 1, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %0, i64 916
  %36 = load i16, ptr %35, align 4, !tbaa !5
  %.not42 = icmp sgt i16 %36, -1
  br i1 %.not42, label %40, label %37

37:                                               ; preds = %._crit_edge
  %38 = or i8 %26, -128
  store i8 %38, ptr %24, align 1, !tbaa !9
  %39 = getelementptr inbounds i8, ptr %3, i64 16
  store i8 0, ptr %39, align 1, !tbaa !9
  br label %40

40:                                               ; preds = %37, %._crit_edge
  tail call void @BlockIt(ptr noundef nonnull %0, i32 noundef 1)
  %41 = getelementptr inbounds i8, ptr %3, i64 2
  store i16 16386, ptr %41, align 1, !tbaa !19
  %42 = tail call zeroext i8 @IssueCB(ptr noundef nonnull %0, ptr noundef nonnull %3)
  %43 = getelementptr inbounds i8, ptr %0, i64 880
  %44 = load i32, ptr %43, align 8, !tbaa !22
  %45 = add i32 %44, 2
  %46 = tail call zeroext i8 @InByte(ptr noundef nonnull %0, i32 noundef %45)
  %.not4347 = icmp eq i8 %46, 0
  br i1 %.not4347, label %.critedge.thread, label %.lr.ph50

.lr.ph50:                                         ; preds = %40, %48
  %.048 = phi i16 [ %49, %48 ], [ 2000, %40 ]
  %47 = icmp sgt i16 %.048, 0
  br i1 %47, label %48, label %.critedge.thread

48:                                               ; preds = %.lr.ph50
  %49 = add nsw i16 %.048, -1
  tail call void @DelayIt(ptr noundef nonnull %0, i16 noundef zeroext 10)
  %50 = load i32, ptr %43, align 8, !tbaa !22
  %51 = add i32 %50, 2
  %52 = tail call zeroext i8 @InByte(ptr noundef nonnull %0, i32 noundef %51)
  %.not43 = icmp eq i8 %52, 0
  br i1 %.not43, label %.critedge, label %.lr.ph50, !llvm.loop !23

.critedge:                                        ; preds = %48
  %53 = icmp eq i16 %49, 0
  br i1 %53, label %54, label %.critedge.thread

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

.critedge.thread:                                 ; preds = %.lr.ph50, %40, %54, %.critedge
  tail call void @BlockIt(ptr noundef nonnull %0, i32 noundef 0)
  %55 = tail call signext i8 @CommandWaitForCompletion(ptr noundef %3, ptr noundef nonnull %0)
  %56 = getelementptr inbounds i8, ptr %3, i64 208
  %57 = load i32, ptr %56, align 1, !tbaa !24
  store i32 %57, ptr %9, align 1, !tbaa !25
  %58 = getelementptr inbounds i8, ptr %3, i64 15
  store i8 0, ptr %58, align 1, !tbaa !26
  %59 = getelementptr inbounds i8, ptr %3, i64 14
  store i8 0, ptr %59, align 1, !tbaa !27
  %60 = getelementptr inbounds i8, ptr %3, i64 12
  store i16 0, ptr %60, align 1, !tbaa !28
  tail call void @SetFreeCB(ptr noundef nonnull %0, ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %2)
  ret i8 0
}

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

declare zeroext i8 @DebugAssertEnabled() local_unnamed_addr #2

declare void @DebugAssert(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local signext i8 @CommandWaitForCompletion(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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 = { 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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !7, i64 1539}
!13 = !{!"s_data_instance", !6, i64 0, !6, i64 2, !7, i64 4, !7, i64 5, !6, i64 6, !6, i64 8, !6, i64 10, !6, i64 12, !6, i64 14, !7, i64 16, !7, i64 48, !7, i64 80, !7, i64 112, !7, i64 368, !14, i64 880, !14, i64 884, !6, i64 888, !6, i64 890, !7, i64 892, !7, i64 893, !7, i64 894, !7, i64 895, !6, i64 896, !6, i64 898, !6, i64 900, !6, i64 902, !14, i64 904, !14, i64 908, !6, i64 912, !6, i64 914, !7, i64 916, !7, i64 920, !7, i64 921, !6, i64 922, !14, i64 924, !15, i64 928, !15, i64 936, !15, i64 944, !15, i64 952, !15, i64 960, !15, i64 968, !16, i64 976, !16, i64 984, !16, i64 992, !16, i64 1000, !16, i64 1008, !7, i64 1016, !6, i64 1528, !6, i64 1530, !6, i64 1532, !6, i64 1534, !7, i64 1536, !7, i64 1537, !7, i64 1538, !7, i64 1539, !7, i64 1540, !7, i64 1541, !17, i64 1544, !16, i64 1808, !15, i64 1816, !16, i64 1824, !15, i64 1832, !15, i64 1840, !15, i64 1848, !15, i64 1856, !15, i64 1864, !15, i64 1872, !15, i64 1880, !15, i64 1888, !15, i64 1896, !15, i64 1904, !15, i64 1912}
!14 = !{!"int", !7, i64 0}
!15 = !{!"any pointer", !7, i64 0}
!16 = !{!"long long", !7, i64 0}
!17 = !{!"mc", !7, i64 0, !6, i64 6, !7, i64 8}
!18 = !{!13, !7, i64 893}
!19 = !{!20, !6, i64 2}
!20 = !{!"s_TxCB", !21, i64 0, !14, i64 8, !6, i64 12, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 80, !14, i64 208, !14, i64 212, !15, i64 216, !15, i64 224, !16, i64 232}
!21 = !{!"CB_Header", !6, i64 0, !6, i64 2, !14, i64 4}
!22 = !{!13, !14, i64 880}
!23 = distinct !{!23, !11}
!24 = !{!20, !14, i64 208}
!25 = !{!20, !14, i64 8}
!26 = !{!20, !7, i64 15}
!27 = !{!20, !7, i64 14}
!28 = !{!20, !6, i64 12}


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