; LLVM IR from caryll/otfcc :: lib/table (cmap)

; 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.table_cmap = type { ptr, ptr }
%struct.cmap_UVS_Entry = type { %struct.UT_hash_handle, %struct.cmap_UVS_key, %struct.otfcc_Handle }
%struct.UT_hash_handle = type { ptr, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.cmap_UVS_key = type { i32, i32 }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.UT_hash_table = type { ptr, i32, i32, i32, ptr, i64, i32, i32, i32, i32, i32 }
%struct.cmap_Entry = type { %struct.UT_hash_handle, i32, %struct.otfcc_Handle }
%struct.otfcc_Options = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, 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 ptr @otfcc_buildCmap(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca i8, align 1
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %21

16:                                               ; preds = %2
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.table_cmap, ptr %17, i32 0, i32 0
  %19 = load ptr, ptr %18, align 8, !tbaa !9
  %20 = icmp ne ptr %19, null
  br i1 %20, label %22, label %21

21:                                               ; preds = %16, %2
  store ptr null, ptr %3, align 8
  br label %159

22:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #3
  store i8 0, ptr %7, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.table_cmap, ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %45

27:                                               ; preds = %22
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.table_cmap, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !13
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %41

32:                                               ; preds = %27
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.table_cmap, ptr %33, i32 0, i32 1
  %35 = load ptr, ptr %34, align 8, !tbaa !13
  %36 = getelementptr inbounds %struct.cmap_UVS_Entry, ptr %35, i32 0, i32 0
  %37 = getelementptr inbounds %struct.UT_hash_handle, ptr %36, i32 0, i32 0
  %38 = load ptr, ptr %37, align 8, !tbaa !14
  %39 = getelementptr inbounds %struct.UT_hash_table, ptr %38, i32 0, i32 3
  %40 = load i32, ptr %39, align 8, !tbaa !21
  br label %42

41:                                               ; preds = %27
  br label %42

42:                                               ; preds = %41, %32
  %43 = phi i32 [ %40, %32 ], [ 0, %41 ]
  %44 = icmp ugt i32 %43, 0
  br label %45

45:                                               ; preds = %42, %22
  %46 = phi i1 [ false, %22 ], [ %44, %42 ]
  %47 = zext i1 %46 to i8
  store i8 %47, ptr %8, align 1, !tbaa !11
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.table_cmap, ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !9
  store ptr %50, ptr %6, align 8, !tbaa !5
  br label %51

51:                                               ; preds = %61, %45
  %52 = load ptr, ptr %6, align 8, !tbaa !5
  %53 = icmp ne ptr %52, null
  br i1 %53, label %54, label %66

54:                                               ; preds = %51
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.cmap_Entry, ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 8, !tbaa !24
  %58 = icmp sgt i32 %57, 65535
  br i1 %58, label %59, label %60

59:                                               ; preds = %54
  store i8 1, ptr %7, align 1, !tbaa !11
  br label %60

60:                                               ; preds = %59, %54
  br label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.cmap_Entry, ptr %62, i32 0, i32 0
  %64 = getelementptr inbounds %struct.UT_hash_handle, ptr %63, i32 0, i32 2
  %65 = load ptr, ptr %64, align 8, !tbaa !26
  store ptr %65, ptr %6, align 8, !tbaa !5
  br label %51, !llvm.loop !27

66:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  store ptr null, ptr %9, align 8, !tbaa !5
  %67 = load i8, ptr %7, align 1, !tbaa !11, !range !29, !noundef !30
  %68 = trunc i8 %67 to i1
  br i1 %68, label %69, label %74

69:                                               ; preds = %66
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.otfcc_Options, ptr %70, i32 0, i32 19
  %72 = load i8, ptr %71, align 1, !tbaa !31, !range !29, !noundef !30
  %73 = trunc i8 %72 to i1
  br i1 %73, label %81, label %74

74:                                               ; preds = %69, %66
  %75 = load ptr, ptr %4, align 8, !tbaa !5
  %76 = call ptr @otfcc_tryBuildCmap_format4(ptr noundef %75)
  store ptr %76, ptr %9, align 8, !tbaa !5
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %74
  store i8 1, ptr %7, align 1, !tbaa !11
  br label %80

80:                                               ; preds = %79, %74
  br label %81

81:                                               ; preds = %80, %69
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #3
  %82 = load i8, ptr %7, align 1, !tbaa !11, !range !29, !noundef !30
  %83 = trunc i8 %82 to i1
  %84 = zext i1 %83 to i64
  %85 = select i1 %83, i32 4, i32 2
  %86 = trunc i32 %85 to i8
  store i8 %86, ptr %10, align 1, !tbaa !33
  %87 = load i8, ptr %8, align 1, !tbaa !11, !range !29, !noundef !30
  %88 = trunc i8 %87 to i1
  br i1 %88, label %89, label %94

89:                                               ; preds = %81
  %90 = load i8, ptr %10, align 1, !tbaa !33
  %91 = zext i8 %90 to i32
  %92 = add nsw i32 %91, 1
  %93 = trunc i32 %92 to i8
  store i8 %93, ptr %10, align 1, !tbaa !33
  br label %94

94:                                               ; preds = %89, %81
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %115, label %97

97:                                               ; preds = %94
  %98 = call ptr (...) @bufnew()
  store ptr %98, ptr %9, align 8, !tbaa !5
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %99, i16 noundef zeroext 4)
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %100, i16 noundef zeroext 32)
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %101, i16 noundef zeroext 0)
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %102, i16 noundef zeroext 4)
  %103 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %103, i16 noundef zeroext 4)
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %104, i16 noundef zeroext 1)
  %105 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %105, i16 noundef zeroext 0)
  %106 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %106, i16 noundef zeroext 0)
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %107, i16 noundef zeroext -1)
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %108, i16 noundef zeroext 0)
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %109, i16 noundef zeroext 0)
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %110, i16 noundef zeroext -1)
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %111, i16 noundef zeroext 0)
  %112 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %112, i16 noundef zeroext 1)
  %113 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %113, i16 noundef zeroext 0)
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %114, i16 noundef zeroext 0)
  br label %115

115:                                              ; preds = %97, %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = call ptr @otfcc_buildCmap_format12(ptr noundef %116)
  store ptr %117, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %118 = load i8, ptr %10, align 1, !tbaa !33
  %119 = zext i8 %118 to i32
  %120 = call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef %119, i32 noundef 0)
  store ptr %120, ptr %12, align 8, !tbaa !5
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = load ptr, ptr %9, align 8, !tbaa !5
  %123 = call ptr @bk_newBlockFromBufferCopy(ptr noundef %122)
  %124 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %121, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 3, i32 noundef 17, ptr noundef %123, i32 noundef 0)
  %125 = load i8, ptr %7, align 1, !tbaa !11, !range !29, !noundef !30
  %126 = trunc i8 %125 to i1
  br i1 %126, label %127, label %132

127:                                              ; preds = %115
  %128 = load ptr, ptr %12, align 8, !tbaa !5
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = call ptr @bk_newBlockFromBufferCopy(ptr noundef %129)
  %131 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %128, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 4, i32 noundef 17, ptr noundef %130, i32 noundef 0)
  br label %132

132:                                              ; preds = %127, %115
  %133 = load i8, ptr %8, align 1, !tbaa !11, !range !29, !noundef !30
  %134 = trunc i8 %133 to i1
  br i1 %134, label %135, label %142

135:                                              ; preds = %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = call ptr @otfcc_buildCmap_format14(ptr noundef %136)
  store ptr %137, ptr %13, align 8, !tbaa !5
  %138 = load ptr, ptr %12, align 8, !tbaa !5
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = call ptr @bk_newBlockFromBuffer(ptr noundef %139)
  %141 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %138, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 5, i32 noundef 17, ptr noundef %140, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %142

142:                                              ; preds = %135, %132
  %143 = load ptr, ptr %12, align 8, !tbaa !5
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  %145 = call ptr @bk_newBlockFromBufferCopy(ptr noundef %144)
  %146 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %143, i32 noundef 2, i32 noundef 3, i32 noundef 2, i32 noundef 1, i32 noundef 17, ptr noundef %145, i32 noundef 0)
  %147 = load i8, ptr %7, align 1, !tbaa !11, !range !29, !noundef !30
  %148 = trunc i8 %147 to i1
  br i1 %148, label %149, label %154

149:                                              ; preds = %142
  %150 = load ptr, ptr %12, align 8, !tbaa !5
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = call ptr @bk_newBlockFromBufferCopy(ptr noundef %151)
  %153 = call ptr (ptr, i32, ...) @bk_push(ptr noundef %150, i32 noundef 2, i32 noundef 3, i32 noundef 2, i32 noundef 10, i32 noundef 17, ptr noundef %152, i32 noundef 0)
  br label %154

154:                                              ; preds = %149, %142
  %155 = load ptr, ptr %9, align 8, !tbaa !5
  call void @buffree(ptr noundef %155)
  %156 = load ptr, ptr %11, align 8, !tbaa !5
  call void @buffree(ptr noundef %156)
  %157 = load ptr, ptr %12, align 8, !tbaa !5
  %158 = call ptr @bk_build_Block(ptr noundef %157)
  store ptr %158, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %159

159:                                              ; preds = %154, %21
  %160 = load ptr, ptr %3, align 8
  ret ptr %160
}

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_tryBuildCmap_format4(ptr noundef) #1

declare ptr @bufnew(...) #2

declare void @bufwrite16b(ptr noundef, i16 noundef zeroext) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_buildCmap_format12(ptr noundef) #1

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

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

declare ptr @bk_newBlockFromBufferCopy(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_buildCmap_format14(ptr noundef) #1

declare ptr @bk_newBlockFromBuffer(ptr noundef) #2

declare void @buffree(ptr noundef) #2

declare ptr @bk_build_Block(ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 8}
!11 = !{!12, !12, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!10, !6, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"", !16, i64 0, !18, i64 56, !19, i64 64}
!16 = !{!"UT_hash_handle", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !17, i64 48, !17, i64 52}
!17 = !{!"int", !7, i64 0}
!18 = !{!"", !17, i64 0, !17, i64 4}
!19 = !{!"otfcc_Handle", !17, i64 0, !20, i64 4, !6, i64 8}
!20 = !{!"short", !7, i64 0}
!21 = !{!22, !17, i64 16}
!22 = !{!"UT_hash_table", !6, i64 0, !17, i64 8, !17, i64 12, !17, i64 16, !6, i64 24, !23, i64 32, !17, i64 40, !17, i64 44, !17, i64 48, !17, i64 52, !17, i64 56}
!23 = !{!"long", !7, i64 0}
!24 = !{!25, !17, i64 56}
!25 = !{!"", !16, i64 0, !17, i64 56, !19, i64 64}
!26 = !{!25, !6, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!32, !12, i64 19}
!32 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !12, i64 22, !6, i64 24, !6, i64 32}
!33 = !{!7, !7, i64 0}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_buildCmap(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %54, label %3

3:                                                ; preds = %2
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %.not61 = icmp eq ptr %4, null
  br i1 %.not61, label %54, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !9
  %.not62 = icmp eq ptr %7, null
  br i1 %.not62, label %.lr.ph.preheader, label %8

8:                                                ; preds = %5
  %9 = load ptr, ptr %7, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %9, i64 16
  %11 = load i32, ptr %10, align 8, !tbaa !18
  %12 = icmp ne i32 %11, 0
  br label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %5, %8
  %13 = phi i1 [ false, %5 ], [ %12, %8 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.05278 = phi ptr [ %.052, %.lr.ph ], [ %4, %.lr.ph.preheader ]
  %.05377 = phi i8 [ %spec.select, %.lr.ph ], [ 0, %.lr.ph.preheader ]
  %14 = getelementptr inbounds i8, ptr %.05278, i64 56
  %15 = load i32, ptr %14, align 8, !tbaa !21
  %16 = icmp sgt i32 %15, 65535
  %spec.select = select i1 %16, i8 1, i8 %.05377
  %17 = getelementptr inbounds i8, ptr %.05278, i64 16
  %.052 = load ptr, ptr %17, align 8, !tbaa !5
  %.not63 = icmp eq ptr %.052, null
  br i1 %.not63, label %._crit_edge, label %.lr.ph, !llvm.loop !23

._crit_edge:                                      ; preds = %.lr.ph
  %18 = trunc nuw i8 %spec.select to i1
  br i1 %18, label %19, label %24

19:                                               ; preds = %._crit_edge
  %20 = getelementptr inbounds i8, ptr %1, i64 19
  %21 = load i8, ptr %20, align 1, !tbaa !25, !range !28, !noundef !29
  %22 = trunc nuw i8 %21 to i1
  br i1 %22, label %.thread, label %24

.thread:                                          ; preds = %19
  %23 = zext i1 %13 to i8
  %spec.select6871 = or disjoint i8 %23, 4
  br label %29

24:                                               ; preds = %._crit_edge, %19
  %25 = tail call ptr @otfcc_tryBuildCmap_format4(ptr noundef nonnull %0)
  %.not64 = icmp eq ptr %25, null
  %26 = or i1 %.not64, %18
  %27 = select i1 %26, i8 4, i8 2
  %28 = zext i1 %13 to i8
  %spec.select68 = or disjoint i8 %27, %28
  br i1 %.not64, label %29, label %31

29:                                               ; preds = %.thread, %24
  %spec.select6874 = phi i8 [ %spec.select6871, %.thread ], [ %spec.select68, %24 ]
  %30 = tail call ptr (...) @bufnew() #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 4) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 32) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 4) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 4) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 1) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext -1) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext -1) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 1) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  tail call void @bufwrite16b(ptr noundef %30, i16 noundef zeroext 0) #2
  br label %31

31:                                               ; preds = %29, %24
  %spec.select6873 = phi i8 [ %spec.select68, %24 ], [ %spec.select6874, %29 ]
  %32 = phi i1 [ %26, %24 ], [ true, %29 ]
  %.156 = phi ptr [ %25, %24 ], [ %30, %29 ]
  %33 = tail call ptr @otfcc_buildCmap_format12(ptr noundef nonnull %0)
  %34 = zext nneg i8 %spec.select6873 to i32
  %35 = tail call ptr (i32, ...) @bk_new_Block(i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef %34, i32 noundef 0) #2
  %36 = tail call ptr @bk_newBlockFromBufferCopy(ptr noundef %.156) #2
  %37 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %35, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 3, i32 noundef 17, ptr noundef %36, i32 noundef 0) #2
  br i1 %32, label %38, label %41

38:                                               ; preds = %31
  %39 = tail call ptr @bk_newBlockFromBufferCopy(ptr noundef %33) #2
  %40 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %35, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 4, i32 noundef 17, ptr noundef %39, i32 noundef 0) #2
  br label %41

41:                                               ; preds = %38, %31
  br i1 %13, label %42, label %46

42:                                               ; preds = %41
  %43 = tail call ptr @otfcc_buildCmap_format14(ptr noundef nonnull %0)
  %44 = tail call ptr @bk_newBlockFromBuffer(ptr noundef %43) #2
  %45 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %35, i32 noundef 2, i32 noundef 0, i32 noundef 2, i32 noundef 5, i32 noundef 17, ptr noundef %44, i32 noundef 0) #2
  br label %46

46:                                               ; preds = %42, %41
  %47 = tail call ptr @bk_newBlockFromBufferCopy(ptr noundef %.156) #2
  %48 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %35, i32 noundef 2, i32 noundef 3, i32 noundef 2, i32 noundef 1, i32 noundef 17, ptr noundef %47, i32 noundef 0) #2
  br i1 %32, label %49, label %52

49:                                               ; preds = %46
  %50 = tail call ptr @bk_newBlockFromBufferCopy(ptr noundef %33) #2
  %51 = tail call ptr (ptr, i32, ...) @bk_push(ptr noundef %35, i32 noundef 2, i32 noundef 3, i32 noundef 2, i32 noundef 10, i32 noundef 17, ptr noundef %50, i32 noundef 0) #2
  br label %52

52:                                               ; preds = %49, %46
  tail call void @buffree(ptr noundef %.156) #2
  tail call void @buffree(ptr noundef %33) #2
  %53 = tail call ptr @bk_build_Block(ptr noundef %35) #2
  br label %54

54:                                               ; preds = %2, %3, %52
  %.0 = phi ptr [ %53, %52 ], [ null, %3 ], [ null, %2 ]
  ret ptr %.0
}

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_tryBuildCmap_format4(ptr noundef) local_unnamed_addr #0

declare ptr @bufnew(...) local_unnamed_addr #1

declare void @bufwrite16b(ptr noundef, i16 noundef zeroext) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_buildCmap_format12(ptr noundef) local_unnamed_addr #0

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

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

declare ptr @bk_newBlockFromBufferCopy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden ptr @otfcc_buildCmap_format14(ptr noundef) local_unnamed_addr #0

declare ptr @bk_newBlockFromBuffer(ptr noundef) local_unnamed_addr #1

declare void @buffree(ptr noundef) local_unnamed_addr #1

declare ptr @bk_build_Block(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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, !6, i64 8}
!10 = !{!"", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 0}
!12 = !{!"", !13, i64 0, !15, i64 56, !16, i64 64}
!13 = !{!"UT_hash_handle", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !14, i64 48, !14, i64 52}
!14 = !{!"int", !7, i64 0}
!15 = !{!"", !14, i64 0, !14, i64 4}
!16 = !{!"otfcc_Handle", !14, i64 0, !17, i64 4, !6, i64 8}
!17 = !{!"short", !7, i64 0}
!18 = !{!19, !14, i64 16}
!19 = !{!"UT_hash_table", !6, i64 0, !14, i64 8, !14, i64 12, !14, i64 16, !6, i64 24, !20, i64 32, !14, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56}
!20 = !{!"long", !7, i64 0}
!21 = !{!22, !14, i64 56}
!22 = !{!"", !13, i64 0, !14, i64 56, !16, i64 64}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!26, !27, i64 19}
!26 = !{!"", !27, i64 0, !27, i64 1, !27, i64 2, !27, i64 3, !27, i64 4, !27, i64 5, !27, i64 6, !27, i64 7, !27, i64 8, !27, i64 9, !27, i64 10, !27, i64 11, !27, i64 12, !27, i64 13, !27, i64 14, !27, i64 15, !27, i64 16, !27, i64 17, !27, i64 18, !27, i64 19, !27, i64 20, !27, i64 21, !27, i64 22, !6, i64 24, !6, i64 32}
!27 = !{!"_Bool", !7, i64 0}
!28 = !{i8 0, i8 2}
!29 = !{}


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