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

; 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_markToSingle = type { i16, %struct.otl_MarkArray, %struct.otl_BaseArray }
%struct.otl_MarkArray = type { i64, i64, ptr }
%struct.otl_BaseArray = 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_BaseRecord = type { %struct.otfcc_Handle, ptr }

@.str = external hidden unnamed_addr constant [9 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 [6 x i8], align 1
@.str.5 = 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_markToSingle(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 i16, align 2
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #4
  %16 = load ptr, ptr %2, align 8, !tbaa !5
  store ptr %16, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #4
  %17 = call ptr @json_object_new(i64 noundef 3)
  store ptr %17, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #4
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %18, i32 0, i32 1
  %20 = getelementptr inbounds %struct.otl_MarkArray, ptr %19, i32 0, i32 0
  %21 = load i64, ptr %20, align 8, !tbaa !9
  %22 = call ptr @json_object_new(i64 noundef %21)
  store ptr %22, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %23, i32 0, i32 2
  %25 = getelementptr inbounds %struct.otl_BaseArray, ptr %24, i32 0, i32 0
  %26 = load i64, ptr %25, align 8, !tbaa !14
  %27 = call ptr @json_object_new(i64 noundef %26)
  store ptr %27, 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 %28

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

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

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

101:                                              ; preds = %37
  %102 = load i16, ptr %7, align 2, !tbaa !15
  %103 = add i16 %102, 1
  store i16 %103, ptr %7, align 2, !tbaa !15
  br label %28, !llvm.loop !27

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

105:                                              ; preds = %214, %104
  %106 = load i16, ptr %10, align 2, !tbaa !15
  %107 = zext i16 %106 to i64
  %108 = load ptr, ptr %3, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %108, i32 0, i32 2
  %110 = getelementptr inbounds %struct.otl_BaseArray, ptr %109, i32 0, i32 0
  %111 = load i64, ptr %110, align 8, !tbaa !14
  %112 = icmp ult i64 %107, %111
  br i1 %112, label %114, label %113

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

114:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %115 = load ptr, ptr %3, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %115, i32 0, i32 0
  %117 = load i16, ptr %116, align 8, !tbaa !29
  %118 = zext i16 %117 to i64
  %119 = call ptr @json_object_new(i64 noundef %118)
  store ptr %119, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %13) #4
  store i16 0, ptr %13, align 2, !tbaa !15
  br label %120

120:                                              ; preds = %196, %114
  %121 = load i16, ptr %13, align 2, !tbaa !15
  %122 = zext i16 %121 to i32
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %123, i32 0, i32 0
  %125 = load i16, ptr %124, align 8, !tbaa !29
  %126 = zext i16 %125 to i32
  %127 = icmp slt i32 %122, %126
  br i1 %127, label %129, label %128

128:                                              ; preds = %120
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %13) #4
  br label %199

129:                                              ; preds = %120
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %130, i32 0, i32 2
  %132 = getelementptr inbounds %struct.otl_BaseArray, ptr %131, i32 0, i32 2
  %133 = load ptr, ptr %132, align 8, !tbaa !30
  %134 = load i16, ptr %10, align 2, !tbaa !15
  %135 = zext i16 %134 to i64
  %136 = getelementptr inbounds %struct.otl_BaseRecord, ptr %133, i64 %135
  %137 = getelementptr inbounds %struct.otl_BaseRecord, ptr %136, i32 0, i32 1
  %138 = load ptr, ptr %137, align 8, !tbaa !31
  %139 = load i16, ptr %13, align 2, !tbaa !15
  %140 = zext i16 %139 to i64
  %141 = getelementptr inbounds %struct.otl_Anchor, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.otl_Anchor, ptr %141, i32 0, i32 0
  %143 = load i8, ptr %142, align 8, !tbaa !33, !range !34, !noundef !35
  %144 = trunc i8 %143 to i1
  br i1 %144, label %145, label %195

145:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  %146 = call ptr @json_object_new(i64 noundef 2)
  store ptr %146, ptr %14, align 8, !tbaa !5
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %148, i32 0, i32 2
  %150 = getelementptr inbounds %struct.otl_BaseArray, ptr %149, i32 0, i32 2
  %151 = load ptr, ptr %150, align 8, !tbaa !30
  %152 = load i16, ptr %10, align 2, !tbaa !15
  %153 = zext i16 %152 to i64
  %154 = getelementptr inbounds %struct.otl_BaseRecord, ptr %151, i64 %153
  %155 = getelementptr inbounds %struct.otl_BaseRecord, ptr %154, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !31
  %157 = load i16, ptr %13, align 2, !tbaa !15
  %158 = zext i16 %157 to i64
  %159 = getelementptr inbounds %struct.otl_Anchor, ptr %156, i64 %158
  %160 = getelementptr inbounds %struct.otl_Anchor, ptr %159, i32 0, i32 1
  %161 = load double, ptr %160, align 8, !tbaa !36
  %162 = fptosi double %161 to i64
  %163 = call ptr @json_integer_new(i64 noundef %162)
  %164 = call ptr @json_object_push(ptr noundef %147, ptr noundef @.str.2, ptr noundef %163)
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = load ptr, ptr %3, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %166, i32 0, i32 2
  %168 = getelementptr inbounds %struct.otl_BaseArray, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !30
  %170 = load i16, ptr %10, align 2, !tbaa !15
  %171 = zext i16 %170 to i64
  %172 = getelementptr inbounds %struct.otl_BaseRecord, ptr %169, i64 %171
  %173 = getelementptr inbounds %struct.otl_BaseRecord, ptr %172, i32 0, i32 1
  %174 = load ptr, ptr %173, align 8, !tbaa !31
  %175 = load i16, ptr %13, align 2, !tbaa !15
  %176 = zext i16 %175 to i64
  %177 = getelementptr inbounds %struct.otl_Anchor, ptr %174, i64 %176
  %178 = getelementptr inbounds %struct.otl_Anchor, ptr %177, i32 0, i32 2
  %179 = load double, ptr %178, align 8, !tbaa !37
  %180 = fptosi double %179 to i64
  %181 = call ptr @json_integer_new(i64 noundef %180)
  %182 = call ptr @json_object_push(ptr noundef %165, ptr noundef @.str.3, ptr noundef %181)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %183 = call ptr @sdsempty()
  %184 = load i16, ptr %13, align 2, !tbaa !15
  %185 = zext i16 %184 to i32
  %186 = call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %183, ptr noundef @.str, i32 noundef %185)
  store ptr %186, ptr %15, align 8, !tbaa !5
  %187 = load ptr, ptr %12, align 8, !tbaa !5
  %188 = load ptr, ptr %15, align 8, !tbaa !5
  %189 = call i64 @sdslen(ptr noundef %188)
  %190 = trunc i64 %189 to i32
  %191 = load ptr, ptr %15, align 8, !tbaa !5
  %192 = load ptr, ptr %14, align 8, !tbaa !5
  %193 = call ptr @json_object_push_length(ptr noundef %187, i32 noundef %190, ptr noundef %191, ptr noundef %192)
  %194 = load ptr, ptr %15, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %194)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %195

195:                                              ; preds = %145, %129
  br label %196

196:                                              ; preds = %195
  %197 = load i16, ptr %13, align 2, !tbaa !15
  %198 = add i16 %197, 1
  store i16 %198, ptr %13, align 2, !tbaa !15
  br label %120, !llvm.loop !38

199:                                              ; preds = %128
  %200 = load ptr, ptr %6, align 8, !tbaa !5
  %201 = load ptr, ptr %3, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.subtable_gpos_markToSingle, ptr %201, i32 0, i32 2
  %203 = getelementptr inbounds %struct.otl_BaseArray, ptr %202, i32 0, i32 2
  %204 = load ptr, ptr %203, align 8, !tbaa !30
  %205 = load i16, ptr %10, align 2, !tbaa !15
  %206 = zext i16 %205 to i64
  %207 = getelementptr inbounds %struct.otl_BaseRecord, ptr %204, i64 %206
  %208 = getelementptr inbounds %struct.otl_BaseRecord, ptr %207, i32 0, i32 0
  %209 = getelementptr inbounds %struct.otfcc_Handle, ptr %208, i32 0, i32 2
  %210 = load ptr, ptr %209, align 8, !tbaa !39
  %211 = load ptr, ptr %12, align 8, !tbaa !5
  %212 = call ptr @preserialize(ptr noundef %211)
  %213 = call ptr @json_object_push(ptr noundef %200, ptr noundef %210, ptr noundef %212)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %214

214:                                              ; preds = %199
  %215 = load i16, ptr %10, align 2, !tbaa !15
  %216 = add i16 %215, 1
  store i16 %216, ptr %10, align 2, !tbaa !15
  br label %105, !llvm.loop !40

217:                                              ; preds = %113
  %218 = load ptr, ptr %4, align 8, !tbaa !5
  %219 = load ptr, ptr %5, align 8, !tbaa !5
  %220 = call ptr @json_object_push(ptr noundef %218, ptr noundef @.str.4, ptr noundef %219)
  %221 = load ptr, ptr %4, align 8, !tbaa !5
  %222 = load ptr, ptr %6, align 8, !tbaa !5
  %223 = call ptr @json_object_push(ptr noundef %221, ptr noundef @.str.5, ptr noundef %222)
  %224 = 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 %224
}

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_object_push_length(ptr noundef, i32 noundef, 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, !11, i64 0}
!30 = !{!10, !6, i64 48}
!31 = !{!32, !6, i64 16}
!32 = !{!"", !19, i64 0, !6, i64 16}
!33 = !{!21, !22, i64 0}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!21, !23, i64 8}
!37 = !{!21, !23, i64 16}
!38 = distinct !{!38, !28}
!39 = !{!32, !6, i64 8}
!40 = distinct !{!40, !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_BaseRecord = type { %struct.otfcc_Handle, ptr }

@.str = external hidden unnamed_addr constant [9 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 [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @otl_gpos_dump_markToSingle(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
  %.not65 = icmp eq i64 %11, 0
  br i1 %.not65, label %._crit_edge64, label %.lr.ph63

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

13:                                               ; preds = %.lr.ph, %13
  %14 = phi i64 [ 0, %.lr.ph ], [ %44, %13 ]
  %.059 = 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 %.059, 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_edge64:                                    ; preds = %._crit_edge, %.preheader
  %47 = tail call ptr @json_object_push(ptr noundef %2, ptr noundef nonnull @.str.4, ptr noundef %5) #3
  %48 = tail call ptr @json_object_push(ptr noundef %2, ptr noundef nonnull @.str.5, ptr noundef %8) #3
  ret ptr %2

49:                                               ; preds = %.lr.ph63, %._crit_edge
  %50 = phi i64 [ 0, %.lr.ph63 ], [ %61, %._crit_edge ]
  %.05462 = phi i16 [ 0, %.lr.ph63 ], [ %60, %._crit_edge ]
  %51 = load i16, ptr %0, align 8, !tbaa !27
  %52 = zext i16 %51 to i64
  %53 = tail call ptr @json_object_new(i64 noundef %52) #3
  %54 = load i16, ptr %0, align 8, !tbaa !27
  %.not66 = icmp eq i16 %54, 0
  br i1 %.not66, label %._crit_edge, label %.lr.ph61

._crit_edge:                                      ; preds = %95, %49
  %55 = load ptr, ptr %12, align 8, !tbaa !28
  %56 = getelementptr inbounds %struct.otl_BaseRecord, ptr %55, i64 %50, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8, !tbaa !29
  %58 = tail call ptr @preserialize(ptr noundef %53)
  %59 = tail call ptr @json_object_push(ptr noundef %8, ptr noundef %57, ptr noundef %58) #3
  %60 = add i16 %.05462, 1
  %61 = zext i16 %60 to i64
  %62 = load i64, ptr %6, align 8, !tbaa !13
  %63 = icmp ugt i64 %62, %61
  br i1 %63, label %49, label %._crit_edge64, !llvm.loop !31

.lr.ph61:                                         ; preds = %49, %95
  %64 = phi i16 [ %96, %95 ], [ %54, %49 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %95 ], [ 0, %49 ]
  %65 = phi i32 [ %97, %95 ], [ 0, %49 ]
  %66 = load ptr, ptr %12, align 8, !tbaa !28
  %67 = getelementptr inbounds %struct.otl_BaseRecord, ptr %66, i64 %50, i32 1
  %68 = load ptr, ptr %67, align 8, !tbaa !32
  %69 = getelementptr inbounds %struct.otl_Anchor, ptr %68, i64 %indvars.iv
  %70 = load i8, ptr %69, align 8, !tbaa !33, !range !34, !noundef !35
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %72, label %95

72:                                               ; preds = %.lr.ph61
  %73 = tail call ptr @json_object_new(i64 noundef 2) #3
  %74 = load ptr, ptr %12, align 8, !tbaa !28
  %75 = getelementptr inbounds %struct.otl_BaseRecord, ptr %74, i64 %50, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !32
  %77 = getelementptr inbounds %struct.otl_Anchor, ptr %76, i64 %indvars.iv, i32 1
  %78 = load double, ptr %77, align 8, !tbaa !36
  %79 = fptosi double %78 to i64
  %80 = tail call ptr @json_integer_new(i64 noundef %79) #3
  %81 = tail call ptr @json_object_push(ptr noundef %73, ptr noundef nonnull @.str.2, ptr noundef %80) #3
  %82 = load ptr, ptr %12, align 8, !tbaa !28
  %83 = getelementptr inbounds %struct.otl_BaseRecord, ptr %82, i64 %50, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !32
  %85 = getelementptr inbounds %struct.otl_Anchor, ptr %84, i64 %indvars.iv, i32 2
  %86 = load double, ptr %85, align 8, !tbaa !37
  %87 = fptosi double %86 to i64
  %88 = tail call ptr @json_integer_new(i64 noundef %87) #3
  %89 = tail call ptr @json_object_push(ptr noundef %73, ptr noundef nonnull @.str.3, ptr noundef %88) #3
  %90 = tail call ptr @sdsempty() #3
  %91 = tail call ptr (ptr, ptr, ...) @sdscatfmt(ptr noundef %90, ptr noundef nonnull @.str, i32 noundef %65) #3
  %92 = tail call i64 @sdslen(ptr noundef %91)
  %93 = trunc i64 %92 to i32
  %94 = tail call ptr @json_object_push_length(ptr noundef %53, i32 noundef %93, ptr noundef %91, ptr noundef %73) #3
  tail call void @sdsfree(ptr noundef %91) #3
  %.pre = load i16, ptr %0, align 8, !tbaa !27
  br label %95

95:                                               ; preds = %.lr.ph61, %72
  %96 = phi i16 [ %64, %.lr.ph61 ], [ %.pre, %72 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %97 = trunc nuw i64 %indvars.iv.next to i32
  %98 = zext i16 %96 to i64
  %99 = icmp ult i64 %indvars.iv.next, %98
  br i1 %99, label %.lr.ph61, label %._crit_edge, !llvm.loop !38
}

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_object_push_length(ptr noundef, i32 noundef, 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, !12, i64 8}
!30 = !{!"", !17, i64 0, !12, i64 16}
!31 = distinct !{!31, !26}
!32 = !{!30, !12, i64 16}
!33 = !{!19, !20, i64 0}
!34 = !{i8 0, i8 2}
!35 = !{}
!36 = !{!19, !21, i64 8}
!37 = !{!19, !21, i64 16}
!38 = distinct !{!38, !26}


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