; LLVM IR from caryll/otfcc :: lib/table/otl/subtables/chaining (build)

; 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.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.subtable_chaining = type { i32, %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { i16, ptr, ptr, ptr, ptr }
%struct.otl_ChainingRule = type { i16, i16, i16, ptr, i16, ptr }
%struct.otl_ChainLookupApplication = type { i16, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }

@otl_iCoverage = external constant %struct.__otfcc_ICoverage, align 8

; 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 ptr @otfcc_build_chaining_coverage(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i16, align 2
  %6 = alloca i16, align 2
  %7 = alloca i16, align 2
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %14 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %14, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.subtable_chaining, ptr %15, i32 0, i32 1
  store ptr %16, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #4
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.otl_ChainingRule, ptr %17, i32 0, i32 1
  %19 = load i16, ptr %18, align 2, !tbaa !9
  store i16 %19, ptr %5, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %6) #4
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.otl_ChainingRule, ptr %20, i32 0, i32 2
  %22 = load i16, ptr %21, align 4, !tbaa !13
  %23 = zext i16 %22 to i32
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.otl_ChainingRule, ptr %24, i32 0, i32 1
  %26 = load i16, ptr %25, align 2, !tbaa !9
  %27 = zext i16 %26 to i32
  %28 = sub nsw i32 %23, %27
  %29 = trunc i32 %28 to i16
  store i16 %29, ptr %6, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.otl_ChainingRule, ptr %30, i32 0, i32 0
  %32 = load i16, ptr %31, align 8, !tbaa !14
  %33 = zext i16 %32 to i32
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.otl_ChainingRule, ptr %34, i32 0, i32 2
  %36 = load i16, ptr %35, align 4, !tbaa !13
  %37 = zext i16 %36 to i32
  %38 = sub nsw i32 %33, %37
  %39 = trunc i32 %38 to i16
  store i16 %39, ptr %7, align 2, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #4
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.otl_ChainingRule, ptr %40, i32 0, i32 4
  %42 = load i16, ptr %41, align 8, !tbaa !15
  store i16 %42, ptr %8, align 2, !tbaa !12
  %43 = load ptr, ptr %4, align 8, !tbaa !5
  call void @reverseBacktracks(ptr noundef %43)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %44 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 3, i32 noundef 0)
  store ptr %44, ptr %9, align 8, !tbaa !5
  %45 = load ptr, ptr %9, align 8, !tbaa !5
  %46 = load i16, ptr %5, align 2, !tbaa !12
  %47 = zext i16 %46 to i32
  %48 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %45, i32 noundef 2, i32 noundef %47, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  store i16 0, ptr %10, align 2, !tbaa !12
  br label %49

49:                                               ; preds = %71, %1
  %50 = load i16, ptr %10, align 2, !tbaa !12
  %51 = zext i16 %50 to i32
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.otl_ChainingRule, ptr %52, i32 0, i32 1
  %54 = load i16, ptr %53, align 2, !tbaa !9
  %55 = zext i16 %54 to i32
  %56 = icmp slt i32 %51, %55
  br i1 %56, label %58, label %57

57:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  br label %74

58:                                               ; preds = %49
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !16
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.otl_ChainingRule, ptr %61, i32 0, i32 3
  %63 = load ptr, ptr %62, align 8, !tbaa !18
  %64 = load i16, ptr %10, align 2, !tbaa !12
  %65 = zext i16 %64 to i64
  %66 = getelementptr inbounds ptr, ptr %63, i64 %65
  %67 = load ptr, ptr %66, align 8, !tbaa !5
  %68 = call ptr %60(ptr noundef %67)
  %69 = call ptr @bk_newBlockFromBuffer(ptr noundef %68)
  %70 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %59, i32 noundef 16, ptr noundef %69, i32 noundef 0)
  br label %71

71:                                               ; preds = %58
  %72 = load i16, ptr %10, align 2, !tbaa !12
  %73 = add i16 %72, 1
  store i16 %73, ptr %10, align 2, !tbaa !12
  br label %49, !llvm.loop !19

74:                                               ; preds = %57
  %75 = load ptr, ptr %9, align 8, !tbaa !5
  %76 = load i16, ptr %6, align 2, !tbaa !12
  %77 = zext i16 %76 to i32
  %78 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %75, i32 noundef 2, i32 noundef %77, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr %11) #4
  %79 = load ptr, ptr %4, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.otl_ChainingRule, ptr %79, i32 0, i32 1
  %81 = load i16, ptr %80, align 2, !tbaa !9
  store i16 %81, ptr %11, align 2, !tbaa !12
  br label %82

82:                                               ; preds = %104, %74
  %83 = load i16, ptr %11, align 2, !tbaa !12
  %84 = zext i16 %83 to i32
  %85 = load ptr, ptr %4, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.otl_ChainingRule, ptr %85, i32 0, i32 2
  %87 = load i16, ptr %86, align 4, !tbaa !13
  %88 = zext i16 %87 to i32
  %89 = icmp slt i32 %84, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 2, ptr %11) #4
  br label %107

91:                                               ; preds = %82
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !16
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.otl_ChainingRule, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !18
  %97 = load i16, ptr %11, align 2, !tbaa !12
  %98 = zext i16 %97 to i64
  %99 = getelementptr inbounds ptr, ptr %96, i64 %98
  %100 = load ptr, ptr %99, align 8, !tbaa !5
  %101 = call ptr %93(ptr noundef %100)
  %102 = call ptr @bk_newBlockFromBuffer(ptr noundef %101)
  %103 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %92, i32 noundef 16, ptr noundef %102, i32 noundef 0)
  br label %104

104:                                              ; preds = %91
  %105 = load i16, ptr %11, align 2, !tbaa !12
  %106 = add i16 %105, 1
  store i16 %106, ptr %11, align 2, !tbaa !12
  br label %82, !llvm.loop !21

107:                                              ; preds = %90
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = load i16, ptr %7, align 2, !tbaa !12
  %110 = zext i16 %109 to i32
  %111 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %108, i32 noundef 2, i32 noundef %110, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr %12) #4
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.otl_ChainingRule, ptr %112, i32 0, i32 2
  %114 = load i16, ptr %113, align 4, !tbaa !13
  store i16 %114, ptr %12, align 2, !tbaa !12
  br label %115

115:                                              ; preds = %137, %107
  %116 = load i16, ptr %12, align 2, !tbaa !12
  %117 = zext i16 %116 to i32
  %118 = load ptr, ptr %4, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.otl_ChainingRule, ptr %118, i32 0, i32 0
  %120 = load i16, ptr %119, align 8, !tbaa !14
  %121 = zext i16 %120 to i32
  %122 = icmp slt i32 %117, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 2, ptr %12) #4
  br label %140

124:                                              ; preds = %115
  %125 = load ptr, ptr %9, align 8, !tbaa !5
  %126 = load ptr, ptr getelementptr inbounds (%struct.__otfcc_ICoverage, ptr @otl_iCoverage, i32 0, i32 12), align 8, !tbaa !16
  %127 = load ptr, ptr %4, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.otl_ChainingRule, ptr %127, i32 0, i32 3
  %129 = load ptr, ptr %128, align 8, !tbaa !18
  %130 = load i16, ptr %12, align 2, !tbaa !12
  %131 = zext i16 %130 to i64
  %132 = getelementptr inbounds ptr, ptr %129, i64 %131
  %133 = load ptr, ptr %132, align 8, !tbaa !5
  %134 = call ptr %126(ptr noundef %133)
  %135 = call ptr @bk_newBlockFromBuffer(ptr noundef %134)
  %136 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %125, i32 noundef 16, ptr noundef %135, i32 noundef 0)
  br label %137

137:                                              ; preds = %124
  %138 = load i16, ptr %12, align 2, !tbaa !12
  %139 = add i16 %138, 1
  store i16 %139, ptr %12, align 2, !tbaa !12
  br label %115, !llvm.loop !22

140:                                              ; preds = %123
  %141 = load ptr, ptr %9, align 8, !tbaa !5
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.otl_ChainingRule, ptr %142, i32 0, i32 4
  %144 = load i16, ptr %143, align 8, !tbaa !15
  %145 = zext i16 %144 to i32
  %146 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %141, i32 noundef 2, i32 noundef %145, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  store i16 0, ptr %13, align 2, !tbaa !12
  br label %147

147:                                              ; preds = %179, %140
  %148 = load i16, ptr %13, align 2, !tbaa !12
  %149 = zext i16 %148 to i32
  %150 = load i16, ptr %8, align 2, !tbaa !12
  %151 = zext i16 %150 to i32
  %152 = icmp slt i32 %149, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  br label %182

154:                                              ; preds = %147
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.otl_ChainingRule, ptr %156, i32 0, i32 5
  %158 = load ptr, ptr %157, align 8, !tbaa !23
  %159 = load i16, ptr %13, align 2, !tbaa !12
  %160 = zext i16 %159 to i64
  %161 = getelementptr inbounds %struct.otl_ChainLookupApplication, ptr %158, i64 %160
  %162 = getelementptr inbounds %struct.otl_ChainLookupApplication, ptr %161, i32 0, i32 0
  %163 = load i16, ptr %162, align 8, !tbaa !24
  %164 = zext i16 %163 to i32
  %165 = load i16, ptr %5, align 2, !tbaa !12
  %166 = zext i16 %165 to i32
  %167 = sub nsw i32 %164, %166
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.otl_ChainingRule, ptr %168, i32 0, i32 5
  %170 = load ptr, ptr %169, align 8, !tbaa !23
  %171 = load i16, ptr %13, align 2, !tbaa !12
  %172 = zext i16 %171 to i64
  %173 = getelementptr inbounds %struct.otl_ChainLookupApplication, ptr %170, i64 %172
  %174 = getelementptr inbounds %struct.otl_ChainLookupApplication, ptr %173, i32 0, i32 1
  %175 = getelementptr inbounds %struct.otfcc_Handle, ptr %174, i32 0, i32 1
  %176 = load i16, ptr %175, align 4, !tbaa !28
  %177 = zext i16 %176 to i32
  %178 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %155, i32 noundef 2, i32 noundef %167, i32 noundef 2, i32 noundef %177, i32 noundef 0)
  br label %179

179:                                              ; preds = %154
  %180 = load i16, ptr %13, align 2, !tbaa !12
  %181 = add i16 %180, 1
  store i16 %181, ptr %13, align 2, !tbaa !12
  br label %147, !llvm.loop !29

182:                                              ; preds = %153
  %183 = load ptr, ptr %9, align 8, !tbaa !5
  %184 = call ptr @bk_build_Block(ptr noundef %183)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %184
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @reverseBacktracks(ptr noundef) #2

declare ptr @bk_new_Block(i32 noundef, ...) #3

declare ptr @bk_push(ptr noundef, i32 noundef, ...) #3

declare ptr @bk_newBlockFromBuffer(ptr noundef) #3

declare ptr @bk_build_Block(ptr noundef) #3

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 = { inlinehint 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 #3 = { "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 #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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 2}
!10 = !{!"", !11, i64 0, !11, i64 2, !11, i64 4, !6, i64 8, !11, i64 16, !6, i64 24}
!11 = !{!"short", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!10, !11, i64 0}
!15 = !{!10, !11, i64 16}
!16 = !{!17, !6, i64 96}
!17 = !{!"__otfcc_ICoverage", !6, i64 0, !6, i64 8, !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, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!18 = !{!10, !6, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}
!23 = !{!10, !6, i64 24}
!24 = !{!25, !11, i64 0}
!25 = !{!"", !11, i64 0, !26, i64 8}
!26 = !{!"otfcc_Handle", !27, i64 0, !11, i64 4, !6, i64 8}
!27 = !{!"int", !7, i64 0}
!28 = !{!25, !11, i64 12}
!29 = distinct !{!29, !20}


; 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.__otfcc_ICoverage = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otl_ChainLookupApplication = type { i16, %struct.otfcc_Handle }
%struct.otfcc_Handle = type { i32, i16, ptr }

@otl_iCoverage = external local_unnamed_addr constant %struct.__otfcc_ICoverage, align 8

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_build_chaining_coverage(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 8
  %3 = getelementptr inbounds i8, ptr %0, i64 10
  %4 = load i16, ptr %3, align 2, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 12
  %6 = load i16, ptr %5, align 4, !tbaa !11
  %7 = zext i16 %4 to i32
  %8 = sub i16 %6, %4
  %9 = load i16, ptr %2, align 8, !tbaa !12
  %10 = sub i16 %9, %6
  %11 = getelementptr inbounds i8, ptr %0, i64 24
  %12 = load i16, ptr %11, align 8, !tbaa !13
  tail call void @reverseBacktracks(ptr noundef nonnull %2)
  %13 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 3, i32 noundef 0) #3
  %14 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 2, i32 noundef %7, i32 noundef 0) #3
  %15 = load i16, ptr %3, align 2, !tbaa !5
  %.not = icmp eq i16 %15, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %16 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 96), align 8, !tbaa !14
  %17 = getelementptr inbounds i8, ptr %0, i64 16
  br label %26

._crit_edge:                                      ; preds = %26, %1
  %18 = zext i16 %8 to i32
  %19 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 2, i32 noundef %18, i32 noundef 0) #3
  %20 = load i16, ptr %3, align 2, !tbaa !5
  %21 = load i16, ptr %5, align 4, !tbaa !11
  %22 = icmp ult i16 %20, %21
  br i1 %22, label %.lr.ph52, label %._crit_edge53

.lr.ph52:                                         ; preds = %._crit_edge
  %23 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 96), align 8, !tbaa !14
  %24 = getelementptr inbounds i8, ptr %0, i64 16
  %25 = zext i16 %20 to i64
  br label %44

26:                                               ; preds = %.lr.ph, %26
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %26 ]
  %27 = load ptr, ptr %17, align 8, !tbaa !16
  %28 = getelementptr inbounds ptr, ptr %27, i64 %indvars.iv
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = tail call ptr %16(ptr noundef %29) #3
  %31 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %30) #3
  %32 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 16, ptr noundef %31, i32 noundef 0) #3
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %33 = load i16, ptr %3, align 2, !tbaa !5
  %34 = zext i16 %33 to i64
  %35 = icmp ult i64 %indvars.iv.next, %34
  br i1 %35, label %26, label %._crit_edge, !llvm.loop !18

._crit_edge53:                                    ; preds = %44, %._crit_edge
  %36 = zext i16 %10 to i32
  %37 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 2, i32 noundef %36, i32 noundef 0) #3
  %38 = load i16, ptr %5, align 4, !tbaa !11
  %39 = load i16, ptr %2, align 8, !tbaa !12
  %40 = icmp ult i16 %38, %39
  br i1 %40, label %.lr.ph56, label %._crit_edge57

.lr.ph56:                                         ; preds = %._crit_edge53
  %41 = load ptr, ptr getelementptr inbounds (i8, ptr @otl_iCoverage, i64 96), align 8, !tbaa !14
  %42 = getelementptr inbounds i8, ptr %0, i64 16
  %43 = zext i16 %38 to i64
  br label %58

44:                                               ; preds = %.lr.ph52, %44
  %indvars.iv64 = phi i64 [ %25, %.lr.ph52 ], [ %indvars.iv.next65, %44 ]
  %45 = load ptr, ptr %24, align 8, !tbaa !16
  %46 = getelementptr inbounds ptr, ptr %45, i64 %indvars.iv64
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  %48 = tail call ptr %23(ptr noundef %47) #3
  %49 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %48) #3
  %50 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 16, ptr noundef %49, i32 noundef 0) #3
  %indvars.iv.next65 = add nuw nsw i64 %indvars.iv64, 1
  %51 = load i16, ptr %5, align 4, !tbaa !11
  %52 = zext i16 %51 to i64
  %53 = icmp ult i64 %indvars.iv.next65, %52
  br i1 %53, label %44, label %._crit_edge53, !llvm.loop !20

._crit_edge57:                                    ; preds = %58, %._crit_edge53
  %54 = load i16, ptr %11, align 8, !tbaa !13
  %55 = zext i16 %54 to i32
  %56 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 2, i32 noundef %55, i32 noundef 0) #3
  %.not62 = icmp eq i16 %12, 0
  br i1 %.not62, label %._crit_edge61, label %.lr.ph60

.lr.ph60:                                         ; preds = %._crit_edge57
  %57 = getelementptr inbounds i8, ptr %0, i64 32
  %wide.trip.count = zext i16 %12 to i64
  br label %69

58:                                               ; preds = %.lr.ph56, %58
  %indvars.iv67 = phi i64 [ %43, %.lr.ph56 ], [ %indvars.iv.next68, %58 ]
  %59 = load ptr, ptr %42, align 8, !tbaa !16
  %60 = getelementptr inbounds ptr, ptr %59, i64 %indvars.iv67
  %61 = load ptr, ptr %60, align 8, !tbaa !17
  %62 = tail call ptr %41(ptr noundef %61) #3
  %63 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %62) #3
  %64 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 16, ptr noundef %63, i32 noundef 0) #3
  %indvars.iv.next68 = add nuw nsw i64 %indvars.iv67, 1
  %65 = load i16, ptr %2, align 8, !tbaa !12
  %66 = zext i16 %65 to i64
  %67 = icmp ult i64 %indvars.iv.next68, %66
  br i1 %67, label %58, label %._crit_edge57, !llvm.loop !21

._crit_edge61:                                    ; preds = %69, %._crit_edge57
  %68 = tail call ptr @bk_build_Block(ptr noundef %13) #3
  ret ptr %68

69:                                               ; preds = %.lr.ph60, %69
  %indvars.iv70 = phi i64 [ 0, %.lr.ph60 ], [ %indvars.iv.next71, %69 ]
  %70 = load ptr, ptr %57, align 8, !tbaa !22
  %71 = getelementptr inbounds %struct.otl_ChainLookupApplication, ptr %70, i64 %indvars.iv70
  %72 = load i16, ptr %71, align 8, !tbaa !23
  %73 = zext i16 %72 to i32
  %74 = sub nsw i32 %73, %7
  %75 = getelementptr inbounds i8, ptr %71, i64 12
  %76 = load i16, ptr %75, align 4, !tbaa !27
  %77 = zext i16 %76 to i32
  %78 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %13, i32 noundef 2, i32 noundef %74, i32 noundef 2, i32 noundef %77, i32 noundef 0) #3
  %indvars.iv.next71 = add nuw nsw i64 %indvars.iv70, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next71, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge61, label %69, !llvm.loop !28
}

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @reverseBacktracks(ptr noundef) local_unnamed_addr #1

declare ptr @bk_new_Block(i32 noundef, ...) local_unnamed_addr #2

declare ptr @bk_push(ptr noundef, i32 noundef, ...) local_unnamed_addr #2

declare ptr @bk_newBlockFromBuffer(ptr noundef) local_unnamed_addr #2

declare ptr @bk_build_Block(ptr noundef) local_unnamed_addr #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 = { inlinehint 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, !7, i64 2}
!6 = !{!"", !7, i64 0, !7, i64 2, !7, i64 4, !10, i64 8, !7, i64 16, !10, i64 24}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !7, i64 0}
!13 = !{!6, !7, i64 16}
!14 = !{!15, !10, i64 96}
!15 = !{!"__otfcc_ICoverage", !10, 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}
!16 = !{!6, !10, i64 8}
!17 = !{!10, !10, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = !{!6, !10, i64 24}
!23 = !{!24, !7, i64 0}
!24 = !{!"", !7, i64 0, !25, i64 8}
!25 = !{!"otfcc_Handle", !26, i64 0, !7, i64 4, !10, i64 8}
!26 = !{!"int", !8, i64 0}
!27 = !{!24, !7, i64 12}
!28 = distinct !{!28, !19}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass