; LLVM IR from caryll/otfcc :: lib/libcff (subr)

; 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_cff_Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.cff_SubrGraph = type { ptr, ptr, ptr, i32, i32, i8 }
%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.__cff_SubrRule = type { i8, i8, i32, i32, i32, i16, i32, i32, ptr, ptr }
%struct.__cff_SubrNode = type { ptr, ptr, ptr, ptr, i8, i8, i8 }
%struct.caryll_Buffer = type { i64, i64, i64, ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@cff_iIndex = external constant %struct.__caryll_elementinterface_cff_Index, 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 void @cff_ilGraphToBuffers(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.cff_SubrGraph, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  call void @cff_statHeight(ptr noundef %29, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = call i32 @cff_numberSubroutines(ptr noundef %30)
  store i32 %31, ptr %11, align 4, !tbaa !13
  %32 = load ptr, ptr %10, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.otfcc_Options, ptr %32, i32 0, i32 24
  %34 = load ptr, ptr %33, align 8, !tbaa !14
  %35 = getelementptr inbounds %struct.otfcc_ILogger, ptr %34, i32 0, i32 6
  %36 = load ptr, ptr %35, align 8, !tbaa !16
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.otfcc_Options, ptr %37, i32 0, i32 24
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = call ptr @sdsempty()
  %41 = load i32, ptr %11, align 4, !tbaa !13
  %42 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %40, ptr noundef @.str, i32 noundef %41)
  call void %36(ptr noundef %39, i8 noundef zeroext 10, i32 noundef 3, ptr noundef %42)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %43 = load i32, ptr %11, align 4, !tbaa !13
  store i32 %43, ptr %12, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !13
  %44 = load i32, ptr %12, align 4, !tbaa !13
  %45 = icmp ugt i32 %44, 65300
  br i1 %45, label %46, label %50

46:                                               ; preds = %5
  store i32 65300, ptr %12, align 4, !tbaa !13
  %47 = load i32, ptr %11, align 4, !tbaa !13
  %48 = load i32, ptr %12, align 4, !tbaa !13
  %49 = sub i32 %47, %48
  store i32 %49, ptr %13, align 4, !tbaa !13
  br label %50

50:                                               ; preds = %46, %5
  %51 = load i32, ptr %13, align 4, !tbaa !13
  %52 = icmp ugt i32 %51, 65300
  br i1 %52, label %53, label %54

53:                                               ; preds = %50
  store i32 65300, ptr %13, align 4, !tbaa !13
  br label %54

54:                                               ; preds = %53, %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %55 = load i32, ptr %12, align 4, !tbaa !13
  %56 = load i32, ptr %13, align 4, !tbaa !13
  %57 = add i32 %55, %56
  store i32 %57, ptr %14, align 4, !tbaa !13
  %58 = load i32, ptr %14, align 4, !tbaa !13
  %59 = udiv i32 %58, 2
  store i32 %59, ptr %12, align 4, !tbaa !13
  %60 = load i32, ptr %14, align 4, !tbaa !13
  %61 = load i32, ptr %12, align 4, !tbaa !13
  %62 = sub i32 %60, %61
  store i32 %62, ptr %13, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.cff_SubrGraph, ptr %63, i32 0, i32 4
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = add i32 %65, 1
  %67 = zext i32 %66 to i64
  %68 = mul i64 32, %67
  %69 = call ptr @__caryll_allocate_clean(i64 noundef %68, i64 noundef 608)
  store ptr %69, ptr %15, align 8, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !13
  %71 = add i32 %70, 1
  %72 = zext i32 %71 to i64
  %73 = mul i64 32, %72
  %74 = call ptr @__caryll_allocate_clean(i64 noundef %73, i64 noundef 609)
  store ptr %74, ptr %17, align 8, !tbaa !5
  %75 = load i32, ptr %13, align 4, !tbaa !13
  %76 = add i32 %75, 1
  %77 = zext i32 %76 to i64
  %78 = mul i64 32, %77
  %79 = call ptr @__caryll_allocate_clean(i64 noundef %78, i64 noundef 610)
  store ptr %79, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %80 = load ptr, ptr %6, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.cff_SubrGraph, ptr %80, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  store ptr %82, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  %83 = load ptr, ptr %19, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.__cff_SubrRule, ptr %83, i32 0, i32 8
  %85 = load ptr, ptr %84, align 8, !tbaa !19
  %86 = getelementptr inbounds %struct.__cff_SubrNode, ptr %85, i32 0, i32 2
  %87 = load ptr, ptr %86, align 8, !tbaa !22
  store ptr %87, ptr %20, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %123, %54
  %89 = load ptr, ptr %20, align 8, !tbaa !5
  %90 = load ptr, ptr %19, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.__cff_SubrRule, ptr %90, i32 0, i32 8
  %92 = load ptr, ptr %91, align 8, !tbaa !19
  %93 = icmp ne ptr %89, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  br label %127

95:                                               ; preds = %88
  %96 = load ptr, ptr %20, align 8, !tbaa !5
  %97 = load ptr, ptr %15, align 8, !tbaa !5
  %98 = load i32, ptr %18, align 4, !tbaa !13
  %99 = zext i32 %98 to i64
  %100 = getelementptr inbounds %struct.caryll_Buffer, ptr %97, i64 %99
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  %102 = load i32, ptr %13, align 4, !tbaa !13
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !13
  call void @serializeNodeToBuffer(ptr noundef %96, ptr noundef %100, ptr noundef %101, i32 noundef %102, ptr noundef %103, i32 noundef %104)
  %105 = load ptr, ptr %20, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.__cff_SubrNode, ptr %105, i32 0, i32 1
  %107 = load ptr, ptr %106, align 8, !tbaa !24
  %108 = icmp ne ptr %107, null
  br i1 %108, label %122, label %109

109:                                              ; preds = %95
  %110 = load ptr, ptr %20, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.__cff_SubrNode, ptr %110, i32 0, i32 3
  %112 = load ptr, ptr %111, align 8, !tbaa !25
  %113 = icmp ne ptr %112, null
  br i1 %113, label %114, label %122

114:                                              ; preds = %109
  %115 = load ptr, ptr %20, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.__cff_SubrNode, ptr %115, i32 0, i32 4
  %117 = load i8, ptr %116, align 8, !tbaa !26, !range !27, !noundef !28
  %118 = trunc i8 %117 to i1
  br i1 %118, label %119, label %122

119:                                              ; preds = %114
  %120 = load i32, ptr %18, align 4, !tbaa !13
  %121 = add i32 %120, 1
  store i32 %121, ptr %18, align 4, !tbaa !13
  br label %122

122:                                              ; preds = %119, %114, %109, %95
  br label %123

123:                                              ; preds = %122
  %124 = load ptr, ptr %20, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.__cff_SubrNode, ptr %124, i32 0, i32 2
  %126 = load ptr, ptr %125, align 8, !tbaa !22
  store ptr %126, ptr %20, align 8, !tbaa !5
  br label %88, !llvm.loop !29

127:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %128 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 11), align 8, !tbaa !31
  %129 = load ptr, ptr %15, align 8, !tbaa !5
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.cff_SubrGraph, ptr %130, i32 0, i32 4
  %132 = load i32, ptr %131, align 4, !tbaa !18
  %133 = call ptr %128(ptr noundef %129, i32 noundef %132, ptr noundef @from_array)
  store ptr %133, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %134 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 11), align 8, !tbaa !31
  %135 = load ptr, ptr %16, align 8, !tbaa !5
  %136 = load i32, ptr %13, align 4, !tbaa !13
  %137 = call ptr %134(ptr noundef %135, i32 noundef %136, ptr noundef @from_array)
  store ptr %137, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %138 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 11), align 8, !tbaa !31
  %139 = load ptr, ptr %17, align 8, !tbaa !5
  %140 = load i32, ptr %12, align 4, !tbaa !13
  %141 = call ptr %138(ptr noundef %139, i32 noundef %140, ptr noundef @from_array)
  store ptr %141, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !13
  br label %142

142:                                              ; preds = %161, %127
  %143 = load i32, ptr %24, align 4, !tbaa !13
  %144 = load ptr, ptr %6, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.cff_SubrGraph, ptr %144, i32 0, i32 4
  %146 = load i32, ptr %145, align 4, !tbaa !18
  %147 = icmp ult i32 %143, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %142
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %164

149:                                              ; preds = %142
  %150 = load ptr, ptr %15, align 8, !tbaa !5
  %151 = load i32, ptr %24, align 4, !tbaa !13
  %152 = zext i32 %151 to i64
  %153 = getelementptr inbounds %struct.caryll_Buffer, ptr %150, i64 %152
  %154 = getelementptr inbounds %struct.caryll_Buffer, ptr %153, i32 0, i32 3
  %155 = load ptr, ptr %154, align 8, !tbaa !33
  call void @free(ptr noundef %155) #5
  %156 = load ptr, ptr %15, align 8, !tbaa !5
  %157 = load i32, ptr %24, align 4, !tbaa !13
  %158 = zext i32 %157 to i64
  %159 = getelementptr inbounds %struct.caryll_Buffer, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.caryll_Buffer, ptr %159, i32 0, i32 3
  store ptr null, ptr %160, align 8, !tbaa !33
  br label %161

161:                                              ; preds = %149
  %162 = load i32, ptr %24, align 4, !tbaa !13
  %163 = add i32 %162, 1
  store i32 %163, ptr %24, align 4, !tbaa !13
  br label %142, !llvm.loop !36

164:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !13
  br label %165

165:                                              ; preds = %182, %164
  %166 = load i32, ptr %25, align 4, !tbaa !13
  %167 = load i32, ptr %13, align 4, !tbaa !13
  %168 = icmp ult i32 %166, %167
  br i1 %168, label %170, label %169

169:                                              ; preds = %165
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %185

170:                                              ; preds = %165
  %171 = load ptr, ptr %16, align 8, !tbaa !5
  %172 = load i32, ptr %25, align 4, !tbaa !13
  %173 = zext i32 %172 to i64
  %174 = getelementptr inbounds %struct.caryll_Buffer, ptr %171, i64 %173
  %175 = getelementptr inbounds %struct.caryll_Buffer, ptr %174, i32 0, i32 3
  %176 = load ptr, ptr %175, align 8, !tbaa !33
  call void @free(ptr noundef %176) #5
  %177 = load ptr, ptr %16, align 8, !tbaa !5
  %178 = load i32, ptr %25, align 4, !tbaa !13
  %179 = zext i32 %178 to i64
  %180 = getelementptr inbounds %struct.caryll_Buffer, ptr %177, i64 %179
  %181 = getelementptr inbounds %struct.caryll_Buffer, ptr %180, i32 0, i32 3
  store ptr null, ptr %181, align 8, !tbaa !33
  br label %182

182:                                              ; preds = %170
  %183 = load i32, ptr %25, align 4, !tbaa !13
  %184 = add i32 %183, 1
  store i32 %184, ptr %25, align 4, !tbaa !13
  br label %165, !llvm.loop !37

185:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 0, ptr %26, align 4, !tbaa !13
  br label %186

186:                                              ; preds = %203, %185
  %187 = load i32, ptr %26, align 4, !tbaa !13
  %188 = load i32, ptr %12, align 4, !tbaa !13
  %189 = icmp ult i32 %187, %188
  br i1 %189, label %191, label %190

190:                                              ; preds = %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %206

191:                                              ; preds = %186
  %192 = load ptr, ptr %17, align 8, !tbaa !5
  %193 = load i32, ptr %26, align 4, !tbaa !13
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds %struct.caryll_Buffer, ptr %192, i64 %194
  %196 = getelementptr inbounds %struct.caryll_Buffer, ptr %195, i32 0, i32 3
  %197 = load ptr, ptr %196, align 8, !tbaa !33
  call void @free(ptr noundef %197) #5
  %198 = load ptr, ptr %17, align 8, !tbaa !5
  %199 = load i32, ptr %26, align 4, !tbaa !13
  %200 = zext i32 %199 to i64
  %201 = getelementptr inbounds %struct.caryll_Buffer, ptr %198, i64 %200
  %202 = getelementptr inbounds %struct.caryll_Buffer, ptr %201, i32 0, i32 3
  store ptr null, ptr %202, align 8, !tbaa !33
  br label %203

203:                                              ; preds = %191
  %204 = load i32, ptr %26, align 4, !tbaa !13
  %205 = add i32 %204, 1
  store i32 %205, ptr %26, align 4, !tbaa !13
  br label %186, !llvm.loop !38

206:                                              ; preds = %190
  %207 = load ptr, ptr %15, align 8, !tbaa !5
  call void @free(ptr noundef %207) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  %208 = load ptr, ptr %16, align 8, !tbaa !5
  call void @free(ptr noundef %208) #5
  store ptr null, ptr %16, align 8, !tbaa !5
  %209 = load ptr, ptr %17, align 8, !tbaa !5
  call void @free(ptr noundef %209) #5
  store ptr null, ptr %17, align 8, !tbaa !5
  %210 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 12), align 8, !tbaa !39
  %211 = load ptr, ptr %21, align 8, !tbaa !5
  %212 = call ptr %210(ptr noundef %211)
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %212, ptr %213, align 8, !tbaa !5
  %214 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 12), align 8, !tbaa !39
  %215 = load ptr, ptr %22, align 8, !tbaa !5
  %216 = call ptr %214(ptr noundef %215)
  %217 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %216, ptr %217, align 8, !tbaa !5
  %218 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 12), align 8, !tbaa !39
  %219 = load ptr, ptr %23, align 8, !tbaa !5
  %220 = call ptr %218(ptr noundef %219)
  %221 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %220, ptr %221, align 8, !tbaa !5
  %222 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 7), align 8, !tbaa !40
  %223 = load ptr, ptr %21, align 8, !tbaa !5
  call void %222(ptr noundef %223)
  %224 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 7), align 8, !tbaa !40
  %225 = load ptr, ptr %22, align 8, !tbaa !5
  call void %224(ptr noundef %225)
  %226 = load ptr, ptr getelementptr inbounds (%struct.__caryll_elementinterface_cff_Index, ptr @cff_iIndex, i32 0, i32 7), align 8, !tbaa !40
  %227 = load ptr, ptr %23, align 8, !tbaa !5
  call void %226(ptr noundef %227)
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

; Function Attrs: nounwind uwtable
declare hidden void @cff_statHeight(ptr noundef, i32 noundef) #1

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

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

declare ptr @sdsempty() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @serializeNodeToBuffer(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, i32 noundef) #1

; Function Attrs: nounwind uwtable
declare hidden ptr @from_array(ptr noundef, i32 noundef) #1

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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 = { 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 #4 = { nounwind "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, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !11, i64 24, !11, i64 28, !12, i64 32}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !6, i64 32}
!15 = !{!"", !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}
!16 = !{!17, !6, i64 48}
!17 = !{!"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}
!18 = !{!10, !11, i64 28}
!19 = !{!20, !6, i64 32}
!20 = !{!"__cff_SubrRule", !12, i64 0, !12, i64 1, !11, i64 4, !11, i64 8, !11, i64 12, !21, i64 16, !11, i64 20, !11, i64 24, !6, i64 32, !6, i64 40}
!21 = !{!"short", !7, i64 0}
!22 = !{!23, !6, i64 16}
!23 = !{!"__cff_SubrNode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !12, i64 32, !12, i64 33, !12, i64 34}
!24 = !{!23, !6, i64 8}
!25 = !{!23, !6, i64 24}
!26 = !{!23, !12, i64 32}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !6, i64 88}
!32 = !{!"__caryll_elementinterface_cff_Index", !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}
!33 = !{!34, !6, i64 24}
!34 = !{!"caryll_Buffer", !35, i64 0, !35, i64 8, !35, i64 16, !6, i64 24}
!35 = !{!"long", !7, i64 0}
!36 = distinct !{!36, !30}
!37 = distinct !{!37, !30}
!38 = distinct !{!38, !30}
!39 = !{!32, !6, i64 96}
!40 = !{!32, !6, i64 56}


; 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_cff_Index = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.caryll_Buffer = type { i64, i64, i64, ptr }

@.str = external hidden unnamed_addr constant [41 x i8], align 1
@cff_iIndex = external local_unnamed_addr constant %struct.__caryll_elementinterface_cff_Index, align 8

; Function Attrs: nounwind uwtable
define dso_local void @cff_ilGraphToBuffers(ptr noundef %0, ptr nocapture noundef writeonly %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef readonly %4) local_unnamed_addr #0 {
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  tail call void @cff_statHeight(ptr noundef %6, i32 noundef 0)
  %7 = tail call i32 @cff_numberSubroutines(ptr noundef nonnull %0)
  %8 = getelementptr inbounds i8, ptr %4, i64 32
  %9 = load ptr, ptr %8, align 8, !tbaa !12
  %10 = getelementptr inbounds i8, ptr %9, i64 48
  %11 = load ptr, ptr %10, align 8, !tbaa !14
  %12 = tail call ptr @sdsempty() #5
  %13 = tail call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %12, ptr noundef nonnull @.str, i32 noundef %7) #5
  tail call void %11(ptr noundef %9, i8 noundef zeroext 10, i32 noundef 3, ptr noundef %13) #5
  %spec.select = tail call i32 @llvm.usub.sat.i32(i32 %7, i32 65300)
  %spec.select82 = tail call i32 @llvm.umin.i32(i32 %7, i32 65300)
  %spec.store.select = tail call i32 @llvm.umin.i32(i32 %spec.select, i32 65300)
  %14 = add nuw nsw i32 %spec.store.select, %spec.select82
  %15 = lshr i32 %14, 1
  %16 = sub nsw i32 %14, %15
  %17 = getelementptr inbounds i8, ptr %0, i64 28
  %18 = load i32, ptr %17, align 4, !tbaa !16
  %19 = add i32 %18, 1
  %20 = zext i32 %19 to i64
  %21 = shl nuw nsw i64 %20, 5
  %22 = tail call ptr @__caryll_allocate_clean(i64 noundef %21, i64 noundef 608)
  %23 = shl nuw nsw i32 %15, 5
  %24 = add nuw nsw i32 %23, 32
  %25 = zext nneg i32 %24 to i64
  %26 = tail call ptr @__caryll_allocate_clean(i64 noundef %25, i64 noundef 609)
  %27 = add nsw i32 %16, 1
  %28 = zext i32 %27 to i64
  %29 = shl nuw nsw i64 %28, 5
  %30 = tail call ptr @__caryll_allocate_clean(i64 noundef %29, i64 noundef 610)
  %31 = load ptr, ptr %0, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 32
  %33 = load ptr, ptr %32, align 8, !tbaa !17
  %.076.in85 = getelementptr inbounds i8, ptr %33, i64 16
  %.07686 = load ptr, ptr %.076.in85, align 8, !tbaa !20
  %.not87 = icmp eq ptr %.07686, %33
  br i1 %.not87, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %51, %5
  %34 = load ptr, ptr getelementptr inbounds (i8, ptr @cff_iIndex, i64 88), align 8, !tbaa !22
  %35 = load i32, ptr %17, align 4, !tbaa !16
  %36 = tail call ptr %34(ptr noundef %22, i32 noundef %35, ptr noundef nonnull @from_array) #5
  %37 = tail call ptr %34(ptr noundef %30, i32 noundef %16, ptr noundef nonnull @from_array) #5
  %38 = tail call ptr %34(ptr noundef %26, i32 noundef %15, ptr noundef nonnull @from_array) #5
  %39 = load i32, ptr %17, align 4, !tbaa !16
  %.not98 = icmp eq i32 %39, 0
  br i1 %.not98, label %.preheader84, label %.lr.ph92

.lr.ph:                                           ; preds = %5, %51
  %.07689 = phi ptr [ %.076, %51 ], [ %.07686, %5 ]
  %.07788 = phi i32 [ %.1, %51 ], [ 0, %5 ]
  %40 = zext i32 %.07788 to i64
  %41 = getelementptr inbounds %struct.caryll_Buffer, ptr %22, i64 %40
  tail call void @serializeNodeToBuffer(ptr noundef %.07689, ptr noundef %41, ptr noundef %30, i32 noundef %16, ptr noundef %26, i32 noundef %15)
  %42 = getelementptr inbounds i8, ptr %.07689, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !24
  %.not80 = icmp eq ptr %43, null
  br i1 %.not80, label %44, label %51

44:                                               ; preds = %.lr.ph
  %45 = getelementptr inbounds i8, ptr %.07689, i64 24
  %46 = load ptr, ptr %45, align 8, !tbaa !25
  %.not81 = icmp eq ptr %46, null
  br i1 %.not81, label %51, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %.07689, i64 32
  %49 = load i8, ptr %48, align 8, !tbaa !26, !range !27, !noundef !28
  %50 = zext nneg i8 %49 to i32
  %spec.select83 = add i32 %.07788, %50
  br label %51

51:                                               ; preds = %47, %.lr.ph, %44
  %.1 = phi i32 [ %.07788, %.lr.ph ], [ %.07788, %44 ], [ %spec.select83, %47 ]
  %.076.in = getelementptr inbounds i8, ptr %.07689, i64 16
  %.076 = load ptr, ptr %.076.in, align 8, !tbaa !20
  %52 = load ptr, ptr %32, align 8, !tbaa !17
  %.not = icmp eq ptr %.076, %52
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !29

.preheader84:                                     ; preds = %.lr.ph92, %._crit_edge
  %.not99 = icmp eq i32 %14, 0
  br i1 %.not99, label %._crit_edge97, label %.lr.ph94.preheader

.lr.ph94.preheader:                               ; preds = %.preheader84
  %umax = tail call i32 @llvm.umax.i32(i32 %16, i32 1)
  %wide.trip.count = zext i32 %umax to i64
  br label %.lr.ph94

.lr.ph92:                                         ; preds = %._crit_edge, %.lr.ph92
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph92 ], [ 0, %._crit_edge ]
  %53 = getelementptr inbounds %struct.caryll_Buffer, ptr %22, i64 %indvars.iv, i32 3
  %54 = load ptr, ptr %53, align 8, !tbaa !31
  tail call void @free(ptr noundef %54) #5
  store ptr null, ptr %53, align 8, !tbaa !31
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %55 = load i32, ptr %17, align 4, !tbaa !16
  %56 = zext i32 %55 to i64
  %57 = icmp ult i64 %indvars.iv.next, %56
  br i1 %57, label %.lr.ph92, label %.preheader84, !llvm.loop !34

.preheader:                                       ; preds = %.lr.ph94
  %.not100 = icmp eq i32 %14, 1
  br i1 %.not100, label %._crit_edge97, label %.lr.ph96.preheader

.lr.ph96.preheader:                               ; preds = %.preheader
  %umax108 = tail call i32 @llvm.umax.i32(i32 %15, i32 1)
  %wide.trip.count109 = zext nneg i32 %umax108 to i64
  br label %.lr.ph96

.lr.ph94:                                         ; preds = %.lr.ph94.preheader, %.lr.ph94
  %indvars.iv102 = phi i64 [ 0, %.lr.ph94.preheader ], [ %indvars.iv.next103, %.lr.ph94 ]
  %58 = getelementptr inbounds %struct.caryll_Buffer, ptr %30, i64 %indvars.iv102, i32 3
  %59 = load ptr, ptr %58, align 8, !tbaa !31
  tail call void @free(ptr noundef %59) #5
  store ptr null, ptr %58, align 8, !tbaa !31
  %indvars.iv.next103 = add nuw nsw i64 %indvars.iv102, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next103, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %.lr.ph94, !llvm.loop !35

._crit_edge97:                                    ; preds = %.lr.ph96, %.preheader84, %.preheader
  tail call void @free(ptr noundef %22) #5
  tail call void @free(ptr noundef %30) #5
  tail call void @free(ptr noundef %26) #5
  %60 = load ptr, ptr getelementptr inbounds (i8, ptr @cff_iIndex, i64 96), align 8, !tbaa !36
  %61 = tail call ptr %60(ptr noundef %36) #5
  store ptr %61, ptr %1, align 8, !tbaa !37
  %62 = tail call ptr %60(ptr noundef %37) #5
  store ptr %62, ptr %2, align 8, !tbaa !37
  %63 = tail call ptr %60(ptr noundef %38) #5
  store ptr %63, ptr %3, align 8, !tbaa !37
  %64 = load ptr, ptr getelementptr inbounds (i8, ptr @cff_iIndex, i64 56), align 8, !tbaa !38
  tail call void %64(ptr noundef %36) #5
  tail call void %64(ptr noundef %37) #5
  tail call void %64(ptr noundef %38) #5
  ret void

.lr.ph96:                                         ; preds = %.lr.ph96.preheader, %.lr.ph96
  %indvars.iv105 = phi i64 [ 0, %.lr.ph96.preheader ], [ %indvars.iv.next106, %.lr.ph96 ]
  %65 = getelementptr inbounds %struct.caryll_Buffer, ptr %26, i64 %indvars.iv105, i32 3
  %66 = load ptr, ptr %65, align 8, !tbaa !31
  tail call void @free(ptr noundef %66) #5
  store ptr null, ptr %65, align 8, !tbaa !31
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %exitcond110.not = icmp eq i64 %indvars.iv.next106, %wide.trip.count109
  br i1 %exitcond110.not, label %._crit_edge97, label %.lr.ph96, !llvm.loop !39
}

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

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

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 ptr @__caryll_allocate_clean(i64 noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden ptr @from_array(ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #3

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.umax.i32(i32, i32) #4

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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !11, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!13, !7, i64 32}
!13 = !{!"", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 9, !11, i64 10, !11, i64 11, !11, i64 12, !11, i64 13, !11, i64 14, !11, i64 15, !11, i64 16, !11, i64 17, !11, i64 18, !11, i64 19, !11, i64 20, !11, i64 21, !11, i64 22, !7, i64 24, !7, i64 32}
!14 = !{!15, !7, i64 48}
!15 = !{!"otfcc_ILogger", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88}
!16 = !{!6, !10, i64 28}
!17 = !{!18, !7, i64 32}
!18 = !{!"__cff_SubrRule", !11, i64 0, !11, i64 1, !10, i64 4, !10, i64 8, !10, i64 12, !19, i64 16, !10, i64 20, !10, i64 24, !7, i64 32, !7, i64 40}
!19 = !{!"short", !8, i64 0}
!20 = !{!21, !7, i64 16}
!21 = !{!"__cff_SubrNode", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !11, i64 33, !11, i64 34}
!22 = !{!23, !7, i64 88}
!23 = !{!"__caryll_elementinterface_cff_Index", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96}
!24 = !{!21, !7, i64 8}
!25 = !{!21, !7, i64 24}
!26 = !{!21, !11, i64 32}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !7, i64 24}
!32 = !{!"caryll_Buffer", !33, i64 0, !33, i64 8, !33, i64 16, !7, i64 24}
!33 = !{!"long", !8, i64 0}
!34 = distinct !{!34, !30}
!35 = distinct !{!35, !30}
!36 = !{!23, !7, i64 96}
!37 = !{!7, !7, i64 0}
!38 = !{!23, !7, i64 56}
!39 = distinct !{!39, !30}


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