; LLVM IR from caryll/otfcc :: lib/table/otl/subtables (gpos-mark-to-ligature)

; 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.subtable_gpos_markToLigature = type { i16, %struct.otl_MarkArray, %struct.otl_LigatureArray }
%struct.otl_MarkArray = type { i64, i64, ptr }
%struct.otl_LigatureArray = type { i64, i64, ptr }
%struct.otl_MarkRecord = type { %struct.otfcc_Handle, i16, %struct.otl_Anchor }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_Anchor = type { i8, double, double }
%struct.otl_LigatureBaseRecord = type { %struct.otfcc_Handle, i16, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; 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 @otl_gpos_dump_markToLigature(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i16, align 2
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i16, align 2
  %15 = alloca ptr, align 8
  %16 = alloca i16, align 2
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %19, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %20 = call ptr @json_object_new(i64 noundef 3)
  store ptr %20, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %21, i32 0, i32 1
  %23 = getelementptr inbounds %struct.otl_MarkArray, ptr %22, i32 0, i32 0
  %24 = load i64, ptr %23, align 8, !tbaa !9
  %25 = call ptr @json_object_new(i64 noundef %24)
  store ptr %25, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %26 = load ptr, ptr %3, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %26, i32 0, i32 2
  %28 = getelementptr inbounds %struct.otl_LigatureArray, ptr %27, i32 0, i32 0
  %29 = load i64, ptr %28, align 8, !tbaa !14
  %30 = call ptr @json_object_new(i64 noundef %29)
  store ptr %30, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #4
  store i16 0, ptr %7, align 2, !tbaa !15
  br label %31

31:                                               ; preds = %104, %1
  %32 = load i16, ptr %7, align 2, !tbaa !15
  %33 = zext i16 %32 to i64
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %34, i32 0, i32 1
  %36 = getelementptr inbounds %struct.otl_MarkArray, ptr %35, i32 0, i32 0
  %37 = load i64, ptr %36, align 8, !tbaa !9
  %38 = icmp ult i64 %33, %37
  br i1 %38, label %40, label %39

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

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %41 = call ptr @json_object_new(i64 noundef 3)
  store ptr %41, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %42 = call ptr @sdsempty()
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %43, i32 0, i32 1
  %45 = getelementptr inbounds %struct.otl_MarkArray, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !16
  %47 = load i16, ptr %7, align 2, !tbaa !15
  %48 = zext i16 %47 to i64
  %49 = getelementptr inbounds %struct.otl_MarkRecord, ptr %46, i64 %48
  %50 = getelementptr inbounds %struct.otl_MarkRecord, ptr %49, i32 0, i32 1
  %51 = load i16, ptr %50, align 8, !tbaa !17
  %52 = zext i16 %51 to i32
  %53 = call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %42, ptr noundef @.str, i32 noundef %52)
  store ptr %53, ptr %9, align 8, !tbaa !5
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call i64 @sdslen(ptr noundef %55)
  %57 = trunc i64 %56 to i32
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call ptr @json_string_new_length(i32 noundef %57, ptr noundef %58)
  %60 = call ptr @json_object_push(ptr noundef %54, ptr noundef @.str.1, ptr noundef %59)
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %61)
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %struct.otl_MarkArray, ptr %64, i32 0, i32 2
  %66 = load ptr, ptr %65, align 8, !tbaa !16
  %67 = load i16, ptr %7, align 2, !tbaa !15
  %68 = zext i16 %67 to i64
  %69 = getelementptr inbounds %struct.otl_MarkRecord, ptr %66, i64 %68
  %70 = getelementptr inbounds %struct.otl_MarkRecord, ptr %69, i32 0, i32 2
  %71 = getelementptr inbounds %struct.otl_Anchor, ptr %70, i32 0, i32 1
  %72 = load double, ptr %71, align 8, !tbaa !24
  %73 = fptosi double %72 to i64
  %74 = call ptr @json_integer_new(i64 noundef %73)
  %75 = call ptr @json_object_push(ptr noundef %62, ptr noundef @.str.2, ptr noundef %74)
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %77, i32 0, i32 1
  %79 = getelementptr inbounds %struct.otl_MarkArray, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  %81 = load i16, ptr %7, align 2, !tbaa !15
  %82 = zext i16 %81 to i64
  %83 = getelementptr inbounds %struct.otl_MarkRecord, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.otl_MarkRecord, ptr %83, i32 0, i32 2
  %85 = getelementptr inbounds %struct.otl_Anchor, ptr %84, i32 0, i32 2
  %86 = load double, ptr %85, align 8, !tbaa !25
  %87 = fptosi double %86 to i64
  %88 = call ptr @json_integer_new(i64 noundef %87)
  %89 = call ptr @json_object_push(ptr noundef %76, ptr noundef @.str.3, ptr noundef %88)
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %91, i32 0, i32 1
  %93 = getelementptr inbounds %struct.otl_MarkArray, ptr %92, i32 0, i32 2
  %94 = load ptr, ptr %93, align 8, !tbaa !16
  %95 = load i16, ptr %7, align 2, !tbaa !15
  %96 = zext i16 %95 to i64
  %97 = getelementptr inbounds %struct.otl_MarkRecord, ptr %94, i64 %96
  %98 = getelementptr inbounds %struct.otl_MarkRecord, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.otfcc_Handle, ptr %98, i32 0, i32 2
  %100 = load ptr, ptr %99, align 8, !tbaa !26
  %101 = load ptr, ptr %8, align 8, !tbaa !5
  %102 = call ptr @preserialize(ptr noundef %101)
  %103 = call ptr @json_object_push(ptr noundef %90, ptr noundef %100, ptr noundef %102)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %104

104:                                              ; preds = %40
  %105 = load i16, ptr %7, align 2, !tbaa !15
  %106 = add i16 %105, 1
  store i16 %106, ptr %7, align 2, !tbaa !15
  br label %31, !llvm.loop !27

107:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 2, ptr %10) #4
  store i16 0, ptr %10, align 2, !tbaa !15
  br label %108

108:                                              ; preds = %234, %107
  %109 = load i16, ptr %10, align 2, !tbaa !15
  %110 = zext i16 %109 to i64
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %111, i32 0, i32 2
  %113 = getelementptr inbounds %struct.otl_LigatureArray, ptr %112, i32 0, i32 0
  %114 = load i64, ptr %113, align 8, !tbaa !14
  %115 = icmp ult i64 %110, %114
  br i1 %115, label %117, label %116

116:                                              ; preds = %108
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %10) #4
  br label %237

117:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %118, i32 0, i32 2
  %120 = getelementptr inbounds %struct.otl_LigatureArray, ptr %119, i32 0, i32 2
  %121 = load ptr, ptr %120, align 8, !tbaa !29
  %122 = load i16, ptr %10, align 2, !tbaa !15
  %123 = zext i16 %122 to i64
  %124 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %121, i64 %123
  store ptr %124, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %125 = load ptr, ptr %12, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %125, i32 0, i32 1
  %127 = load i16, ptr %126, align 8, !tbaa !30
  %128 = zext i16 %127 to i64
  %129 = call ptr @json_array_new(i64 noundef %128)
  store ptr %129, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %14) #4
  store i16 0, ptr %14, align 2, !tbaa !15
  br label %130

130:                                              ; preds = %222, %117
  %131 = load i16, ptr %14, align 2, !tbaa !15
  %132 = zext i16 %131 to i32
  %133 = load ptr, ptr %12, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %133, i32 0, i32 1
  %135 = load i16, ptr %134, align 8, !tbaa !30
  %136 = zext i16 %135 to i32
  %137 = icmp slt i32 %132, %136
  br i1 %137, label %139, label %138

138:                                              ; preds = %130
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %14) #4
  br label %225

139:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %140 = load ptr, ptr %3, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %140, i32 0, i32 0
  %142 = load i16, ptr %141, align 8, !tbaa !32
  %143 = zext i16 %142 to i64
  %144 = call ptr @json_object_new(i64 noundef %143)
  store ptr %144, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %16) #4
  store i16 0, ptr %16, align 2, !tbaa !15
  br label %145

145:                                              ; preds = %215, %139
  %146 = load i16, ptr %16, align 2, !tbaa !15
  %147 = zext i16 %146 to i32
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %148, i32 0, i32 0
  %150 = load i16, ptr %149, align 8, !tbaa !32
  %151 = zext i16 %150 to i32
  %152 = icmp slt i32 %147, %151
  br i1 %152, label %154, label %153

153:                                              ; preds = %145
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %16) #4
  br label %218

154:                                              ; preds = %145
  %155 = load ptr, ptr %12, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %155, i32 0, i32 2
  %157 = load ptr, ptr %156, align 8, !tbaa !33
  %158 = load i16, ptr %14, align 2, !tbaa !15
  %159 = zext i16 %158 to i64
  %160 = getelementptr inbounds ptr, ptr %157, i64 %159
  %161 = load ptr, ptr %160, align 8, !tbaa !5
  %162 = load i16, ptr %16, align 2, !tbaa !15
  %163 = zext i16 %162 to i64
  %164 = getelementptr inbounds %struct.otl_Anchor, ptr %161, i64 %163
  %165 = getelementptr inbounds %struct.otl_Anchor, ptr %164, i32 0, i32 0
  %166 = load i8, ptr %165, align 8, !tbaa !34, !range !35, !noundef !36
  %167 = trunc i8 %166 to i1
  br i1 %167, label %168, label %214

168:                                              ; preds = %154
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %169 = call ptr @json_object_new(i64 noundef 2)
  store ptr %169, ptr %17, align 8, !tbaa !5
  %170 = load ptr, ptr %17, align 8, !tbaa !5
  %171 = load ptr, ptr %12, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %171, i32 0, i32 2
  %173 = load ptr, ptr %172, align 8, !tbaa !33
  %174 = load i16, ptr %14, align 2, !tbaa !15
  %175 = zext i16 %174 to i64
  %176 = getelementptr inbounds ptr, ptr %173, i64 %175
  %177 = load ptr, ptr %176, align 8, !tbaa !5
  %178 = load i16, ptr %16, align 2, !tbaa !15
  %179 = zext i16 %178 to i64
  %180 = getelementptr inbounds %struct.otl_Anchor, ptr %177, i64 %179
  %181 = getelementptr inbounds %struct.otl_Anchor, ptr %180, i32 0, i32 1
  %182 = load double, ptr %181, align 8, !tbaa !37
  %183 = fptosi double %182 to i64
  %184 = call ptr @json_integer_new(i64 noundef %183)
  %185 = call ptr @json_object_push(ptr noundef %170, ptr noundef @.str.2, ptr noundef %184)
  %186 = load ptr, ptr %17, align 8, !tbaa !5
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %187, i32 0, i32 2
  %189 = load ptr, ptr %188, align 8, !tbaa !33
  %190 = load i16, ptr %14, align 2, !tbaa !15
  %191 = zext i16 %190 to i64
  %192 = getelementptr inbounds ptr, ptr %189, i64 %191
  %193 = load ptr, ptr %192, align 8, !tbaa !5
  %194 = load i16, ptr %16, align 2, !tbaa !15
  %195 = zext i16 %194 to i64
  %196 = getelementptr inbounds %struct.otl_Anchor, ptr %193, i64 %195
  %197 = getelementptr inbounds %struct.otl_Anchor, ptr %196, i32 0, i32 2
  %198 = load double, ptr %197, align 8, !tbaa !38
  %199 = fptosi double %198 to i64
  %200 = call ptr @json_integer_new(i64 noundef %199)
  %201 = call ptr @json_object_push(ptr noundef %186, ptr noundef @.str.3, ptr noundef %200)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %202 = call ptr @sdsempty()
  %203 = load i16, ptr %16, align 2, !tbaa !15
  %204 = zext i16 %203 to i32
  %205 = call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %202, ptr noundef @.str, i32 noundef %204)
  store ptr %205, ptr %18, align 8, !tbaa !5
  %206 = load ptr, ptr %15, align 8, !tbaa !5
  %207 = load ptr, ptr %18, align 8, !tbaa !5
  %208 = call i64 @sdslen(ptr noundef %207)
  %209 = trunc i64 %208 to i32
  %210 = load ptr, ptr %18, align 8, !tbaa !5
  %211 = load ptr, ptr %17, align 8, !tbaa !5
  %212 = call ptr @json_object_push_length(ptr noundef %206, i32 noundef %209, ptr noundef %210, ptr noundef %211)
  %213 = load ptr, ptr %18, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %213)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %214

214:                                              ; preds = %168, %154
  br label %215

215:                                              ; preds = %214
  %216 = load i16, ptr %16, align 2, !tbaa !15
  %217 = add i16 %216, 1
  store i16 %217, ptr %16, align 2, !tbaa !15
  br label %145, !llvm.loop !39

218:                                              ; preds = %153
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  %220 = load ptr, ptr %15, align 8, !tbaa !5
  %221 = call ptr @json_array_push(ptr noundef %219, ptr noundef %220)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  br label %222

222:                                              ; preds = %218
  %223 = load i16, ptr %14, align 2, !tbaa !15
  %224 = add i16 %223, 1
  store i16 %224, ptr %14, align 2, !tbaa !15
  br label %130, !llvm.loop !40

225:                                              ; preds = %138
  %226 = load ptr, ptr %6, align 8, !tbaa !5
  %227 = load ptr, ptr %12, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %227, i32 0, i32 0
  %229 = getelementptr inbounds %struct.otfcc_Handle, ptr %228, i32 0, i32 2
  %230 = load ptr, ptr %229, align 8, !tbaa !41
  %231 = load ptr, ptr %13, align 8, !tbaa !5
  %232 = call ptr @preserialize(ptr noundef %231)
  %233 = call ptr @json_object_push(ptr noundef %226, ptr noundef %230, ptr noundef %232)
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %234

234:                                              ; preds = %225
  %235 = load i16, ptr %10, align 2, !tbaa !15
  %236 = add i16 %235, 1
  store i16 %236, ptr %10, align 2, !tbaa !15
  br label %108, !llvm.loop !42

237:                                              ; preds = %116
  %238 = load ptr, ptr %4, align 8, !tbaa !5
  %239 = load ptr, ptr %3, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.subtable_gpos_markToLigature, ptr %239, i32 0, i32 0
  %241 = load i16, ptr %240, align 8, !tbaa !32
  %242 = zext i16 %241 to i64
  %243 = call ptr @json_integer_new(i64 noundef %242)
  %244 = call ptr @json_object_push(ptr noundef %238, ptr noundef @.str.4, ptr noundef %243)
  %245 = load ptr, ptr %4, align 8, !tbaa !5
  %246 = load ptr, ptr %5, align 8, !tbaa !5
  %247 = call ptr @json_object_push(ptr noundef %245, ptr noundef @.str.5, ptr noundef %246)
  %248 = load ptr, ptr %4, align 8, !tbaa !5
  %249 = load ptr, ptr %6, align 8, !tbaa !5
  %250 = call ptr @json_object_push(ptr noundef %248, ptr noundef @.str.6, ptr noundef %249)
  %251 = load ptr, ptr %4, align 8, !tbaa !5
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #4
  ret ptr %251
}

declare ptr @json_object_new(i64 noundef) #2

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

declare ptr @sdsempty() #2

declare ptr @json_object_push(ptr noundef, ptr noundef, ptr noundef) #2

declare ptr @json_string_new_length(i32 noundef, ptr noundef) #2

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

declare void @sdsfree(ptr noundef) #2

declare ptr @json_integer_new(i64 noundef) #2

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

declare ptr @json_array_new(i64 noundef) #2

declare ptr @json_object_push_length(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare ptr @json_array_push(ptr noundef, 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 = { 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 }

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


; 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.otl_MarkRecord = type { %struct.otfcc_Handle, i16, %struct.otl_Anchor }
%struct.otfcc_Handle = type { i32, i16, ptr }
%struct.otl_Anchor = type { i8, double, double }
%struct.otl_LigatureBaseRecord = type { %struct.otfcc_Handle, i16, ptr }

@.str = external hidden unnamed_addr constant [6 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_gpos_dump_markToLigature(ptr nocapture noundef readonly %0) local_unnamed_addr #0 {
  %2 = tail call ptr @json_object_new(i64 noundef 3) #3
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i64, ptr %3, align 8, !tbaa !5
  %5 = tail call ptr @json_object_new(i64 noundef %4) #3
  %6 = getelementptr inbounds i8, ptr %0, i64 32
  %7 = load i64, ptr %6, align 8, !tbaa !13
  %8 = tail call ptr @json_object_new(i64 noundef %7) #3
  %9 = load i64, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.lr.ph:                                           ; preds = %1
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  br label %13

.preheader:                                       ; preds = %13, %1
  %11 = load i64, ptr %6, align 8, !tbaa !13
  %.not79 = icmp eq i64 %11, 0
  br i1 %.not79, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %.preheader
  %12 = getelementptr inbounds i8, ptr %0, i64 48
  br label %53

13:                                               ; preds = %.lr.ph, %13
  %14 = phi i64 [ 0, %.lr.ph ], [ %44, %13 ]
  %.069 = phi i16 [ 0, %.lr.ph ], [ %43, %13 ]
  %15 = tail call ptr @json_object_new(i64 noundef 3) #3
  %16 = tail call ptr @sdsempty() #3
  %17 = load ptr, ptr %10, align 8, !tbaa !14
  %18 = getelementptr inbounds %struct.otl_MarkRecord, ptr %17, i64 %14, i32 1
  %19 = load i16, ptr %18, align 8, !tbaa !15
  %20 = zext i16 %19 to i32
  %21 = tail call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %16, ptr noundef nonnull @.str, i32 noundef %20) #3
  %22 = tail call i64 @sdslen(ptr noundef %21)
  %23 = trunc i64 %22 to i32
  %24 = tail call ptr @json_string_new_length(i32 noundef %23, ptr noundef %21) #3
  %25 = tail call ptr @json_object_push(ptr noundef %15, ptr noundef nonnull @.str.1, ptr noundef %24) #3
  tail call void @sdsfree(ptr noundef %21) #3
  %26 = load ptr, ptr %10, align 8, !tbaa !14
  %27 = getelementptr inbounds %struct.otl_MarkRecord, ptr %26, i64 %14, i32 2, i32 1
  %28 = load double, ptr %27, align 8, !tbaa !22
  %29 = fptosi double %28 to i64
  %30 = tail call ptr @json_integer_new(i64 noundef %29) #3
  %31 = tail call ptr @json_object_push(ptr noundef %15, ptr noundef nonnull @.str.2, ptr noundef %30) #3
  %32 = load ptr, ptr %10, align 8, !tbaa !14
  %33 = getelementptr inbounds %struct.otl_MarkRecord, ptr %32, i64 %14, i32 2, i32 2
  %34 = load double, ptr %33, align 8, !tbaa !23
  %35 = fptosi double %34 to i64
  %36 = tail call ptr @json_integer_new(i64 noundef %35) #3
  %37 = tail call ptr @json_object_push(ptr noundef %15, ptr noundef nonnull @.str.3, ptr noundef %36) #3
  %38 = load ptr, ptr %10, align 8, !tbaa !14
  %39 = getelementptr inbounds %struct.otl_MarkRecord, ptr %38, i64 %14, i32 0, i32 2
  %40 = load ptr, ptr %39, align 8, !tbaa !24
  %41 = tail call ptr @preserialize(ptr noundef %15)
  %42 = tail call ptr @json_object_push(ptr noundef %5, ptr noundef %40, ptr noundef %41) #3
  %43 = add i16 %.069, 1
  %44 = zext i16 %43 to i64
  %45 = load i64, ptr %3, align 8, !tbaa !5
  %46 = icmp ugt i64 %45, %44
  br i1 %46, label %13, label %.preheader, !llvm.loop !25

._crit_edge78:                                    ; preds = %._crit_edge75, %.preheader
  %47 = load i16, ptr %0, align 8, !tbaa !27
  %48 = zext i16 %47 to i64
  %49 = tail call ptr @json_integer_new(i64 noundef %48) #3
  %50 = tail call ptr @json_object_push(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef %49) #3
  %51 = tail call ptr @json_object_push(ptr noundef %2, ptr noundef nonnull @.str.5, ptr noundef %5) #3
  %52 = tail call ptr @json_object_push(ptr noundef %2, ptr noundef nonnull @.str.6, ptr noundef %8) #3
  ret ptr %2

53:                                               ; preds = %.lr.ph77, %._crit_edge75
  %54 = phi i64 [ 0, %.lr.ph77 ], [ %68, %._crit_edge75 ]
  %.06376 = phi i16 [ 0, %.lr.ph77 ], [ %67, %._crit_edge75 ]
  %55 = load ptr, ptr %12, align 8, !tbaa !28
  %56 = getelementptr inbounds %struct.otl_LigatureBaseRecord, ptr %55, i64 %54
  %57 = getelementptr inbounds i8, ptr %56, i64 16
  %58 = load i16, ptr %57, align 8, !tbaa !29
  %59 = zext i16 %58 to i64
  %60 = tail call ptr @json_array_new(i64 noundef %59) #3
  %61 = load i16, ptr %57, align 8, !tbaa !29
  %.not80 = icmp eq i16 %61, 0
  br i1 %.not80, label %._crit_edge75, label %.lr.ph74

.lr.ph74:                                         ; preds = %53
  %62 = getelementptr inbounds i8, ptr %56, i64 24
  br label %71

._crit_edge75:                                    ; preds = %._crit_edge, %53
  %63 = getelementptr inbounds i8, ptr %56, i64 8
  %64 = load ptr, ptr %63, align 8, !tbaa !31
  %65 = tail call ptr @preserialize(ptr noundef %60)
  %66 = tail call ptr @json_object_push(ptr noundef %8, ptr noundef %64, ptr noundef %65) #3
  %67 = add i16 %.06376, 1
  %68 = zext i16 %67 to i64
  %69 = load i64, ptr %6, align 8, !tbaa !13
  %70 = icmp ugt i64 %69, %68
  br i1 %70, label %53, label %._crit_edge78, !llvm.loop !32

71:                                               ; preds = %.lr.ph74, %._crit_edge
  %indvars.iv82 = phi i64 [ 0, %.lr.ph74 ], [ %indvars.iv.next83, %._crit_edge ]
  %72 = load i16, ptr %0, align 8, !tbaa !27
  %73 = zext i16 %72 to i64
  %74 = tail call ptr @json_object_new(i64 noundef %73) #3
  %75 = load i16, ptr %0, align 8, !tbaa !27
  %.not81 = icmp eq i16 %75, 0
  br i1 %.not81, label %._crit_edge, label %.lr.ph71

._crit_edge:                                      ; preds = %111, %71
  %76 = tail call ptr @json_array_push(ptr noundef %60, ptr noundef %74) #3
  %indvars.iv.next83 = add nuw nsw i64 %indvars.iv82, 1
  %77 = load i16, ptr %57, align 8, !tbaa !29
  %78 = zext i16 %77 to i64
  %79 = icmp ult i64 %indvars.iv.next83, %78
  br i1 %79, label %71, label %._crit_edge75, !llvm.loop !33

.lr.ph71:                                         ; preds = %71, %111
  %80 = phi i16 [ %112, %111 ], [ %75, %71 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %111 ], [ 0, %71 ]
  %81 = phi i32 [ %113, %111 ], [ 0, %71 ]
  %82 = load ptr, ptr %62, align 8, !tbaa !34
  %83 = getelementptr inbounds ptr, ptr %82, i64 %indvars.iv82
  %84 = load ptr, ptr %83, align 8, !tbaa !35
  %85 = getelementptr inbounds %struct.otl_Anchor, ptr %84, i64 %indvars.iv
  %86 = load i8, ptr %85, align 8, !tbaa !36, !range !37, !noundef !38
  %87 = trunc nuw i8 %86 to i1
  br i1 %87, label %88, label %111

88:                                               ; preds = %.lr.ph71
  %89 = tail call ptr @json_object_new(i64 noundef 2) #3
  %90 = load ptr, ptr %62, align 8, !tbaa !34
  %91 = getelementptr inbounds ptr, ptr %90, i64 %indvars.iv82
  %92 = load ptr, ptr %91, align 8, !tbaa !35
  %93 = getelementptr inbounds %struct.otl_Anchor, ptr %92, i64 %indvars.iv, i32 1
  %94 = load double, ptr %93, align 8, !tbaa !39
  %95 = fptosi double %94 to i64
  %96 = tail call ptr @json_integer_new(i64 noundef %95) #3
  %97 = tail call ptr @json_object_push(ptr noundef %89, ptr noundef nonnull @.str.2, ptr noundef %96) #3
  %98 = load ptr, ptr %62, align 8, !tbaa !34
  %99 = getelementptr inbounds ptr, ptr %98, i64 %indvars.iv82
  %100 = load ptr, ptr %99, align 8, !tbaa !35
  %101 = getelementptr inbounds %struct.otl_Anchor, ptr %100, i64 %indvars.iv, i32 2
  %102 = load double, ptr %101, align 8, !tbaa !40
  %103 = fptosi double %102 to i64
  %104 = tail call ptr @json_integer_new(i64 noundef %103) #3
  %105 = tail call ptr @json_object_push(ptr noundef %89, ptr noundef nonnull @.str.3, ptr noundef %104) #3
  %106 = tail call ptr @sdsempty() #3
  %107 = tail call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %106, ptr noundef nonnull @.str, i32 noundef %81) #3
  %108 = tail call i64 @sdslen(ptr noundef %107)
  %109 = trunc i64 %108 to i32
  %110 = tail call ptr @json_object_push_length(ptr noundef %74, i32 noundef %109, ptr noundef %107, ptr noundef %89) #3
  tail call void @sdsfree(ptr noundef %107) #3
  %.pre = load i16, ptr %0, align 8, !tbaa !27
  br label %111

111:                                              ; preds = %.lr.ph71, %88
  %112 = phi i16 [ %80, %.lr.ph71 ], [ %.pre, %88 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %113 = trunc nuw i64 %indvars.iv.next to i32
  %114 = zext i16 %112 to i64
  %115 = icmp ult i64 %indvars.iv.next, %114
  br i1 %115, label %.lr.ph71, label %._crit_edge, !llvm.loop !41
}

declare ptr @json_object_new(i64 noundef) local_unnamed_addr #1

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

declare ptr @sdsempty() local_unnamed_addr #1

declare ptr @json_object_push(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @json_string_new_length(i32 noundef, ptr noundef) local_unnamed_addr #1

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

declare void @sdsfree(ptr noundef) local_unnamed_addr #1

declare ptr @json_integer_new(i64 noundef) local_unnamed_addr #1

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

declare ptr @json_array_new(i64 noundef) local_unnamed_addr #1

declare ptr @json_object_push_length(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @json_array_push(ptr noundef, 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 = { 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 = { 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 8}
!6 = !{!"", !7, i64 0, !10, i64 8, !10, i64 32}
!7 = !{!"short", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 8, !12, i64 16}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !11, i64 32}
!14 = !{!6, !12, i64 24}
!15 = !{!16, !7, i64 16}
!16 = !{!"", !17, i64 0, !7, i64 16, !19, i64 24}
!17 = !{!"otfcc_Handle", !18, i64 0, !7, i64 4, !12, i64 8}
!18 = !{!"int", !8, i64 0}
!19 = !{!"", !20, i64 0, !21, i64 8, !21, i64 16}
!20 = !{!"_Bool", !8, i64 0}
!21 = !{!"double", !8, i64 0}
!22 = !{!16, !21, i64 32}
!23 = !{!16, !21, i64 40}
!24 = !{!16, !12, i64 8}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!6, !7, i64 0}
!28 = !{!6, !12, i64 48}
!29 = !{!30, !7, i64 16}
!30 = !{!"", !17, i64 0, !7, i64 16, !12, i64 24}
!31 = !{!30, !12, i64 8}
!32 = distinct !{!32, !26}
!33 = distinct !{!33, !26}
!34 = !{!30, !12, i64 24}
!35 = !{!12, !12, i64 0}
!36 = !{!19, !20, i64 0}
!37 = !{i8 0, i8 2}
!38 = !{}
!39 = !{!19, !21, i64 8}
!40 = !{!19, !21, i64 16}
!41 = distinct !{!41, !26}


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