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

; 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.__caryll_elementinterface_table_maxp = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Packet = type { i32, i16, i16, i16, i16, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }
%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 }
%struct.otfcc_ILogger = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.table_maxp = type { i32, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16, i16 }

@table_iMaxp = external dso_local constant %struct.__caryll_elementinterface_table_maxp, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readMaxp(ptr noundef byval(%struct.otfcc_Packet) align 8 %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %struct.otfcc_PacketPiece, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 1, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !9
  br label %14

14:                                               ; preds = %197, %2
  %15 = load i32, ptr %7, align 4, !tbaa !9
  %16 = icmp ne i32 %15, 0
  br i1 %16, label %17, label %26

17:                                               ; preds = %14
  %18 = load i32, ptr %5, align 4, !tbaa !9
  %19 = icmp ne i32 %18, 0
  br i1 %19, label %20, label %26

20:                                               ; preds = %17
  %21 = load i32, ptr %6, align 4, !tbaa !9
  %22 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 1
  %23 = load i16, ptr %22, align 4, !tbaa !11
  %24 = zext i16 %23 to i32
  %25 = icmp slt i32 %21, %24
  br label %26

26:                                               ; preds = %20, %17, %14
  %27 = phi i1 [ false, %17 ], [ false, %14 ], [ %25, %20 ]
  br i1 %27, label %29, label %28

28:                                               ; preds = %26
  store i32 2, ptr %8, align 4
  br label %204

29:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #5
  %30 = getelementptr inbounds %struct.otfcc_Packet, ptr %0, i32 0, i32 5
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = load i32, ptr %6, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %31, i64 %33
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %9, ptr align 8 %34, i64 24, i1 false), !tbaa.struct !15
  br label %35

35:                                               ; preds = %189, %29
  %36 = load i32, ptr %5, align 4, !tbaa !9
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %39, label %38

38:                                               ; preds = %35
  store i32 5, ptr %8, align 4
  br label %194

39:                                               ; preds = %35
  %40 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 0
  %41 = load i32, ptr %40, align 8, !tbaa !16
  %42 = icmp eq i32 %41, 1835104368
  br i1 %42, label %43, label %188

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 1, ptr %10, align 4, !tbaa !9
  br label %44

44:                                               ; preds = %184, %43
  %45 = load i32, ptr %10, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %48, label %47

47:                                               ; preds = %44
  store i32 8, ptr %8, align 4
  br label %185

48:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %49 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 4
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  store ptr %50, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %51 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %9, i32 0, i32 3
  %52 = load i32, ptr %51, align 4, !tbaa !19
  store i32 %52, ptr %12, align 4, !tbaa !9
  %53 = load i32, ptr %12, align 4, !tbaa !9
  %54 = icmp ne i32 %53, 32
  br i1 %54, label %55, label %69

55:                                               ; preds = %48
  %56 = load i32, ptr %12, align 4, !tbaa !9
  %57 = icmp ne i32 %56, 6
  br i1 %57, label %58, label %69

58:                                               ; preds = %55
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.otfcc_Options, ptr %59, i32 0, i32 24
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = getelementptr inbounds %struct.otfcc_ILogger, ptr %61, i32 0, i32 6
  %63 = load ptr, ptr %62, align 8, !tbaa !23
  %64 = load ptr, ptr %4, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.otfcc_Options, ptr %64, i32 0, i32 24
  %66 = load ptr, ptr %65, align 8, !tbaa !20
  %67 = call ptr @sdsempty()
  %68 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %67, ptr noundef @.str)
  call void %63(ptr noundef %66, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %68)
  br label %180

69:                                               ; preds = %55, %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %70 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_table_maxp, ptr @table_iMaxp, i32 0, i32 6), align 8, !tbaa !25
  %71 = call ptr (...) %70()
  store ptr %71, ptr %13, align 8, !tbaa !5
  %72 = load ptr, ptr %11, align 8, !tbaa !5
  %73 = call i32 @read_32s(ptr noundef %72)
  %74 = load ptr, ptr %13, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.table_maxp, ptr %74, i32 0, i32 0
  store i32 %73, ptr %75, align 4, !tbaa !27
  %76 = load ptr, ptr %11, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 4
  %78 = call zeroext i16 @read_16u(ptr noundef %77)
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.table_maxp, ptr %79, i32 0, i32 1
  store i16 %78, ptr %80, align 4, !tbaa !29
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.table_maxp, ptr %81, i32 0, i32 0
  %83 = load i32, ptr %82, align 4, !tbaa !27
  %84 = icmp eq i32 %83, 65536
  br i1 %84, label %85, label %151

85:                                               ; preds = %69
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 6
  %88 = call zeroext i16 @read_16u(ptr noundef %87)
  %89 = load ptr, ptr %13, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.table_maxp, ptr %89, i32 0, i32 2
  store i16 %88, ptr %90, align 2, !tbaa !30
  %91 = load ptr, ptr %11, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i64 8
  %93 = call zeroext i16 @read_16u(ptr noundef %92)
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.table_maxp, ptr %94, i32 0, i32 3
  store i16 %93, ptr %95, align 4, !tbaa !31
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds i8, ptr %96, i64 10
  %98 = call zeroext i16 @read_16u(ptr noundef %97)
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.table_maxp, ptr %99, i32 0, i32 4
  store i16 %98, ptr %100, align 2, !tbaa !32
  %101 = load ptr, ptr %11, align 8, !tbaa !5
  %102 = getelementptr inbounds i8, ptr %101, i64 12
  %103 = call zeroext i16 @read_16u(ptr noundef %102)
  %104 = load ptr, ptr %13, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.table_maxp, ptr %104, i32 0, i32 5
  store i16 %103, ptr %105, align 4, !tbaa !33
  %106 = load ptr, ptr %11, align 8, !tbaa !5
  %107 = getelementptr inbounds i8, ptr %106, i64 14
  %108 = call zeroext i16 @read_16u(ptr noundef %107)
  %109 = load ptr, ptr %13, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.table_maxp, ptr %109, i32 0, i32 6
  store i16 %108, ptr %110, align 2, !tbaa !34
  %111 = load ptr, ptr %11, align 8, !tbaa !5
  %112 = getelementptr inbounds i8, ptr %111, i64 16
  %113 = call zeroext i16 @read_16u(ptr noundef %112)
  %114 = load ptr, ptr %13, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.table_maxp, ptr %114, i32 0, i32 7
  store i16 %113, ptr %115, align 4, !tbaa !35
  %116 = load ptr, ptr %11, align 8, !tbaa !5
  %117 = getelementptr inbounds i8, ptr %116, i64 18
  %118 = call zeroext i16 @read_16u(ptr noundef %117)
  %119 = load ptr, ptr %13, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.table_maxp, ptr %119, i32 0, i32 8
  store i16 %118, ptr %120, align 2, !tbaa !36
  %121 = load ptr, ptr %11, align 8, !tbaa !5
  %122 = getelementptr inbounds i8, ptr %121, i64 20
  %123 = call zeroext i16 @read_16u(ptr noundef %122)
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.table_maxp, ptr %124, i32 0, i32 9
  store i16 %123, ptr %125, align 4, !tbaa !37
  %126 = load ptr, ptr %11, align 8, !tbaa !5
  %127 = getelementptr inbounds i8, ptr %126, i64 22
  %128 = call zeroext i16 @read_16u(ptr noundef %127)
  %129 = load ptr, ptr %13, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.table_maxp, ptr %129, i32 0, i32 10
  store i16 %128, ptr %130, align 2, !tbaa !38
  %131 = load ptr, ptr %11, align 8, !tbaa !5
  %132 = getelementptr inbounds i8, ptr %131, i64 24
  %133 = call zeroext i16 @read_16u(ptr noundef %132)
  %134 = load ptr, ptr %13, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.table_maxp, ptr %134, i32 0, i32 11
  store i16 %133, ptr %135, align 4, !tbaa !39
  %136 = load ptr, ptr %11, align 8, !tbaa !5
  %137 = getelementptr inbounds i8, ptr %136, i64 26
  %138 = call zeroext i16 @read_16u(ptr noundef %137)
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.table_maxp, ptr %139, i32 0, i32 12
  store i16 %138, ptr %140, align 2, !tbaa !40
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = getelementptr inbounds i8, ptr %141, i64 28
  %143 = call zeroext i16 @read_16u(ptr noundef %142)
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.table_maxp, ptr %144, i32 0, i32 13
  store i16 %143, ptr %145, align 4, !tbaa !41
  %146 = load ptr, ptr %11, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i64 30
  %148 = call zeroext i16 @read_16u(ptr noundef %147)
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.table_maxp, ptr %149, i32 0, i32 14
  store i16 %148, ptr %150, align 2, !tbaa !42
  br label %178

151:                                              ; preds = %69
  %152 = load ptr, ptr %13, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.table_maxp, ptr %152, i32 0, i32 2
  store i16 0, ptr %153, align 2, !tbaa !30
  %154 = load ptr, ptr %13, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.table_maxp, ptr %154, i32 0, i32 3
  store i16 0, ptr %155, align 4, !tbaa !31
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.table_maxp, ptr %156, i32 0, i32 4
  store i16 0, ptr %157, align 2, !tbaa !32
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = getelementptr inbounds %struct.table_maxp, ptr %158, i32 0, i32 5
  store i16 0, ptr %159, align 4, !tbaa !33
  %160 = load ptr, ptr %13, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.table_maxp, ptr %160, i32 0, i32 6
  store i16 0, ptr %161, align 2, !tbaa !34
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.table_maxp, ptr %162, i32 0, i32 7
  store i16 0, ptr %163, align 4, !tbaa !35
  %164 = load ptr, ptr %13, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.table_maxp, ptr %164, i32 0, i32 8
  store i16 0, ptr %165, align 2, !tbaa !36
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.table_maxp, ptr %166, i32 0, i32 9
  store i16 0, ptr %167, align 4, !tbaa !37
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.table_maxp, ptr %168, i32 0, i32 10
  store i16 0, ptr %169, align 2, !tbaa !38
  %170 = load ptr, ptr %13, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.table_maxp, ptr %170, i32 0, i32 11
  store i16 0, ptr %171, align 4, !tbaa !39
  %172 = load ptr, ptr %13, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.table_maxp, ptr %172, i32 0, i32 12
  store i16 0, ptr %173, align 2, !tbaa !40
  %174 = load ptr, ptr %13, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.table_maxp, ptr %174, i32 0, i32 13
  store i16 0, ptr %175, align 4, !tbaa !41
  %176 = load ptr, ptr %13, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.table_maxp, ptr %176, i32 0, i32 14
  store i16 0, ptr %177, align 2, !tbaa !42
  br label %178

178:                                              ; preds = %151, %85
  %179 = load ptr, ptr %13, align 8, !tbaa !5
  store ptr %179, ptr %3, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %181

180:                                              ; preds = %58
  store i32 0, ptr %8, align 4
  br label %181

181:                                              ; preds = %180, %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %182 = load i32, ptr %8, align 4
  switch i32 %182, label %185 [
    i32 0, label %183
  ]

183:                                              ; preds = %181
  br label %184

184:                                              ; preds = %183
  store i32 0, ptr %10, align 4, !tbaa !9
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %44, !llvm.loop !43

185:                                              ; preds = %181, %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  %186 = load i32, ptr %8, align 4
  switch i32 %186, label %194 [
    i32 8, label %187
  ]

187:                                              ; preds = %185
  br label %188

188:                                              ; preds = %187, %39
  br label %189

189:                                              ; preds = %188
  %190 = load i32, ptr %5, align 4, !tbaa !9
  %191 = icmp ne i32 %190, 0
  %192 = xor i1 %191, true
  %193 = zext i1 %192 to i32
  store i32 %193, ptr %5, align 4, !tbaa !9
  br label %35, !llvm.loop !45

194:                                              ; preds = %185, %38
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #5
  %195 = load i32, ptr %8, align 4
  switch i32 %195, label %204 [
    i32 5, label %196
  ]

196:                                              ; preds = %194
  br label %197

197:                                              ; preds = %196
  %198 = load i32, ptr %5, align 4, !tbaa !9
  %199 = icmp ne i32 %198, 0
  %200 = xor i1 %199, true
  %201 = zext i1 %200 to i32
  store i32 %201, ptr %5, align 4, !tbaa !9
  %202 = load i32, ptr %6, align 4, !tbaa !9
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %6, align 4, !tbaa !9
  br label %14, !llvm.loop !46

204:                                              ; preds = %194, %28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  %205 = load i32, ptr %8, align 4
  switch i32 %205, label %209 [
    i32 2, label %206
    i32 1, label %207
  ]

206:                                              ; preds = %204
  store ptr null, ptr %3, align 8
  br label %207

207:                                              ; preds = %206, %204
  %208 = load ptr, ptr %3, align 8
  ret ptr %208

209:                                              ; preds = %204
  unreachable
}

; 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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @sdsempty() #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @read_32s(ptr noundef) #4

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !13, i64 4}
!12 = !{!"", !10, i64 0, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !6, i64 16}
!13 = !{!"short", !7, i64 0}
!14 = !{!12, !6, i64 16}
!15 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9, i64 12, i64 4, !9, i64 16, i64 8, !5}
!16 = !{!17, !10, i64 0}
!17 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !6, i64 16}
!18 = !{!17, !6, i64 16}
!19 = !{!17, !10, i64 12}
!20 = !{!21, !6, i64 32}
!21 = !{!"", !22, i64 0, !22, i64 1, !22, i64 2, !22, i64 3, !22, i64 4, !22, i64 5, !22, i64 6, !22, i64 7, !22, i64 8, !22, i64 9, !22, i64 10, !22, i64 11, !22, i64 12, !22, i64 13, !22, i64 14, !22, i64 15, !22, i64 16, !22, i64 17, !22, i64 18, !22, i64 19, !22, i64 20, !22, i64 21, !22, i64 22, !6, i64 24, !6, i64 32}
!22 = !{!"_Bool", !7, i64 0}
!23 = !{!24, !6, i64 48}
!24 = !{!"otfcc_ILogger", !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}
!25 = !{!26, !6, i64 48}
!26 = !{!"__caryll_elementinterface_table_maxp", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56}
!27 = !{!28, !10, i64 0}
!28 = !{!"", !10, i64 0, !13, i64 4, !13, i64 6, !13, i64 8, !13, i64 10, !13, i64 12, !13, i64 14, !13, i64 16, !13, i64 18, !13, i64 20, !13, i64 22, !13, i64 24, !13, i64 26, !13, i64 28, !13, i64 30}
!29 = !{!28, !13, i64 4}
!30 = !{!28, !13, i64 6}
!31 = !{!28, !13, i64 8}
!32 = !{!28, !13, i64 10}
!33 = !{!28, !13, i64 12}
!34 = !{!28, !13, i64 14}
!35 = !{!28, !13, i64 16}
!36 = !{!28, !13, i64 18}
!37 = !{!28, !13, i64 20}
!38 = !{!28, !13, i64 22}
!39 = !{!28, !13, i64 24}
!40 = !{!28, !13, i64 26}
!41 = !{!28, !13, i64 28}
!42 = !{!28, !13, i64 30}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = distinct !{!45, !44}
!46 = distinct !{!46, !44}


; 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.__caryll_elementinterface_table_maxp = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.otfcc_Packet = type { i32, i16, i16, i16, i16, ptr }
%struct.otfcc_PacketPiece = type { i32, i32, i32, i32, ptr }

@table_iMaxp = external dso_local local_unnamed_addr constant %struct.__caryll_elementinterface_table_maxp, align 8
@.str = external hidden unnamed_addr constant [25 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_readMaxp(ptr nocapture noundef readonly byval(%struct.otfcc_Packet) align 8 %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 4
  %4 = load i16, ptr %3, align 4
  %5 = icmp eq i16 %4, 0
  br i1 %5, label %.critedge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @table_iMaxp, i64 48), align 8
  %9 = getelementptr inbounds i8, ptr %1, i64 32
  %10 = zext i16 %4 to i64
  br label %11

11:                                               ; preds = %.lr.ph, %.split120.us
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %.split120.us ]
  %12 = getelementptr inbounds %struct.otfcc_PacketPiece, ptr %7, i64 %indvars.iv
  %.sroa.0.0.copyload = load i32, ptr %12, align 8, !tbaa !12
  %13 = icmp eq i32 %.sroa.0.0.copyload, 1835104368
  br i1 %13, label %.split.us, label %.split120.us

.split.us:                                        ; preds = %11
  %.sroa.452.0..sroa_idx.le = getelementptr inbounds i8, ptr %12, i64 12
  %.sroa.452.0.copyload.le = load i32, ptr %.sroa.452.0..sroa_idx.le, align 4, !tbaa !12
  %.sroa.5.0..sroa_idx.le = getelementptr inbounds i8, ptr %12, i64 16
  %.sroa.5.0.copyload.le = load ptr, ptr %.sroa.5.0..sroa_idx.le, align 8, !tbaa !13
  %14 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 6
  %15 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 8
  %16 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 10
  %17 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 12
  %18 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 14
  %19 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 16
  %20 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 18
  %21 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 20
  %22 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 22
  %23 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 24
  %24 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 26
  %25 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 28
  %26 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 30
  switch i32 %.sroa.452.0.copyload.le, label %.preheader.us [
    i32 32, label %.preheader.us.us
    i32 6, label %.preheader.us.us
  ]

.preheader.us.us:                                 ; preds = %.split.us, %.split.us
  %27 = getelementptr inbounds i8, ptr %.sroa.5.0.copyload.le, i64 4
  %28 = tail call ptr (...) %8() #4
  %29 = tail call i32 @read_32s(ptr noundef %.sroa.5.0.copyload.le)
  store i32 %29, ptr %28, align 4, !tbaa !14
  %30 = tail call zeroext i16 @read_16u(ptr noundef nonnull %27)
  %31 = getelementptr inbounds i8, ptr %28, i64 4
  store i16 %30, ptr %31, align 4, !tbaa !16
  %32 = load i32, ptr %28, align 4, !tbaa !14
  %33 = icmp eq i32 %32, 65536
  br i1 %33, label %36, label %34

34:                                               ; preds = %.preheader.us.us
  %35 = getelementptr inbounds i8, ptr %28, i64 6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 2 dereferenceable(24) %35, i8 0, i64 24, i1 false)
  br label %62

36:                                               ; preds = %.preheader.us.us
  %37 = tail call zeroext i16 @read_16u(ptr noundef nonnull %14)
  %38 = getelementptr inbounds i8, ptr %28, i64 6
  store i16 %37, ptr %38, align 2, !tbaa !17
  %39 = tail call zeroext i16 @read_16u(ptr noundef nonnull %15)
  %40 = getelementptr inbounds i8, ptr %28, i64 8
  store i16 %39, ptr %40, align 4, !tbaa !18
  %41 = tail call zeroext i16 @read_16u(ptr noundef nonnull %16)
  %42 = getelementptr inbounds i8, ptr %28, i64 10
  store i16 %41, ptr %42, align 2, !tbaa !19
  %43 = tail call zeroext i16 @read_16u(ptr noundef nonnull %17)
  %44 = getelementptr inbounds i8, ptr %28, i64 12
  store i16 %43, ptr %44, align 4, !tbaa !20
  %45 = tail call zeroext i16 @read_16u(ptr noundef nonnull %18)
  %46 = getelementptr inbounds i8, ptr %28, i64 14
  store i16 %45, ptr %46, align 2, !tbaa !21
  %47 = tail call zeroext i16 @read_16u(ptr noundef nonnull %19)
  %48 = getelementptr inbounds i8, ptr %28, i64 16
  store i16 %47, ptr %48, align 4, !tbaa !22
  %49 = tail call zeroext i16 @read_16u(ptr noundef nonnull %20)
  %50 = getelementptr inbounds i8, ptr %28, i64 18
  store i16 %49, ptr %50, align 2, !tbaa !23
  %51 = tail call zeroext i16 @read_16u(ptr noundef nonnull %21)
  %52 = getelementptr inbounds i8, ptr %28, i64 20
  store i16 %51, ptr %52, align 4, !tbaa !24
  %53 = tail call zeroext i16 @read_16u(ptr noundef nonnull %22)
  %54 = getelementptr inbounds i8, ptr %28, i64 22
  store i16 %53, ptr %54, align 2, !tbaa !25
  %55 = tail call zeroext i16 @read_16u(ptr noundef nonnull %23)
  %56 = getelementptr inbounds i8, ptr %28, i64 24
  store i16 %55, ptr %56, align 4, !tbaa !26
  %57 = tail call zeroext i16 @read_16u(ptr noundef nonnull %24)
  %58 = getelementptr inbounds i8, ptr %28, i64 26
  store i16 %57, ptr %58, align 2, !tbaa !27
  %59 = tail call zeroext i16 @read_16u(ptr noundef nonnull %25)
  %60 = getelementptr inbounds i8, ptr %28, i64 28
  store i16 %59, ptr %60, align 4, !tbaa !28
  %61 = tail call zeroext i16 @read_16u(ptr noundef nonnull %26)
  br label %62

62:                                               ; preds = %36, %34
  %.sink = phi i16 [ %61, %36 ], [ 0, %34 ]
  %63 = getelementptr inbounds i8, ptr %28, i64 30
  store i16 %.sink, ptr %63, align 2
  switch i32 %.sroa.452.0.copyload.le, label %.split120.us.thread [
    i32 32, label %.critedge
    i32 6, label %.critedge
  ], !llvm.loop !29

.preheader.us:                                    ; preds = %.split.us
  %64 = load ptr, ptr %9, align 8, !tbaa !31
  %65 = getelementptr inbounds i8, ptr %64, i64 48
  %66 = load ptr, ptr %65, align 8, !tbaa !34
  %67 = tail call ptr @sdsempty() #4
  %68 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %67, ptr noundef nonnull @.str) #4
  tail call void %66(ptr noundef %64, i8 noundef zeroext 1, i32 noundef 1, ptr noundef %68) #4
  br label %.split120.us.thread

.split120.us.thread:                              ; preds = %62, %.preheader.us
  br label %.critedge

.split120.us:                                     ; preds = %11
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %.not = icmp ult i64 %indvars.iv.next, %10
  br i1 %.not, label %11, label %.critedge, !llvm.loop !36

.critedge:                                        ; preds = %.split120.us, %62, %62, %.split120.us.thread, %2
  %spec.select = phi ptr [ null, %2 ], [ %28, %62 ], [ %28, %62 ], [ null, %.split120.us.thread ], [ null, %.split120.us ]
  ret ptr %spec.select
}

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

declare ptr @sdsempty() local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @read_32s(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @read_16u(ptr noundef) local_unnamed_addr #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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, !11, i64 16}
!6 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"", !7, i64 0, !10, i64 4, !10, i64 6, !10, i64 8, !10, i64 10, !10, i64 12, !10, i64 14, !10, i64 16, !10, i64 18, !10, i64 20, !10, i64 22, !10, i64 24, !10, i64 26, !10, i64 28, !10, i64 30}
!16 = !{!15, !10, i64 4}
!17 = !{!15, !10, i64 6}
!18 = !{!15, !10, i64 8}
!19 = !{!15, !10, i64 10}
!20 = !{!15, !10, i64 12}
!21 = !{!15, !10, i64 14}
!22 = !{!15, !10, i64 16}
!23 = !{!15, !10, i64 18}
!24 = !{!15, !10, i64 20}
!25 = !{!15, !10, i64 22}
!26 = !{!15, !10, i64 24}
!27 = !{!15, !10, i64 26}
!28 = !{!15, !10, i64 28}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !11, i64 32}
!32 = !{!"", !33, i64 0, !33, i64 1, !33, i64 2, !33, i64 3, !33, i64 4, !33, i64 5, !33, i64 6, !33, i64 7, !33, i64 8, !33, i64 9, !33, i64 10, !33, i64 11, !33, i64 12, !33, i64 13, !33, i64 14, !33, i64 15, !33, i64 16, !33, i64 17, !33, i64 18, !33, i64 19, !33, i64 20, !33, i64 21, !33, i64 22, !11, i64 24, !11, i64 32}
!33 = !{!"_Bool", !8, i64 0}
!34 = !{!35, !11, i64 48}
!35 = !{!"otfcc_ILogger", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !11, i64 72, !11, i64 80, !11, i64 88}
!36 = distinct !{!36, !30}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass