; LLVM IR from Eclipse-SDV-Hackathon-Chapter-Two/challenge-threadx-and-beyond :: shared/lib/jsmn/src/example (simple)

; 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.jsmn_parser = type { i32, i32, i32 }
%struct.jsmntok = type { i32, i32, i32, i32 }

@JSON_STRING = external hidden global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @jsmn_parse(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @jsmn_init(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.jsmn_parser, align 4
  %5 = alloca [128 x %struct.jsmntok], align 16
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 2048, ptr %5) #4
  call void @jsmn_init(ptr noundef %4)
  %9 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %10 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %11 = call i64 @strlen(ptr noundef %10) #5
  %12 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 0
  %13 = call i32 @jsmn_parse(ptr noundef %4, ptr noundef %9, i64 noundef %11, ptr noundef %12, i32 noundef 128)
  store i32 %13, ptr %3, align 4, !tbaa !9
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = icmp slt i32 %14, 0
  br i1 %15, label %16, label %19

16:                                               ; preds = %0
  %17 = load i32, ptr %3, align 4, !tbaa !9
  %18 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %17)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %226

19:                                               ; preds = %0
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = icmp slt i32 %20, 1
  br i1 %21, label %27, label %22

22:                                               ; preds = %19
  %23 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 0
  %24 = getelementptr inbounds %struct.jsmntok, ptr %23, i32 0, i32 0
  %25 = load i32, ptr %24, align 16, !tbaa !11
  %26 = icmp ne i32 %25, 1
  br i1 %26, label %27, label %29

27:                                               ; preds = %22, %19
  %28 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 1, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %226

29:                                               ; preds = %22
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %222, %29
  %31 = load i32, ptr %2, align 4, !tbaa !9
  %32 = load i32, ptr %3, align 4, !tbaa !9
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %34, label %225

34:                                               ; preds = %30
  %35 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %36 = load i32, ptr %2, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %37
  %39 = call i32 @jsoneq(ptr noundef %35, ptr noundef %38, ptr noundef @.str.2)
  %40 = icmp eq i32 %39, 0
  br i1 %40, label %41, label %67

41:                                               ; preds = %34
  %42 = load i32, ptr %2, align 4, !tbaa !9
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %44
  %46 = getelementptr inbounds %struct.jsmntok, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !13
  %48 = load i32, ptr %2, align 4, !tbaa !9
  %49 = add nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %50
  %52 = getelementptr inbounds %struct.jsmntok, ptr %51, i32 0, i32 1
  %53 = load i32, ptr %52, align 4, !tbaa !14
  %54 = sub nsw i32 %47, %53
  %55 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %56 = load i32, ptr %2, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %58
  %60 = getelementptr inbounds %struct.jsmntok, ptr %59, i32 0, i32 1
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds i8, ptr %55, i64 %62
  %64 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %54, ptr noundef %63)
  %65 = load i32, ptr %2, align 4, !tbaa !9
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %2, align 4, !tbaa !9
  br label %221

67:                                               ; preds = %34
  %68 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %69 = load i32, ptr %2, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %70
  %72 = call i32 @jsoneq(ptr noundef %68, ptr noundef %71, ptr noundef @.str.4)
  %73 = icmp eq i32 %72, 0
  br i1 %73, label %74, label %100

74:                                               ; preds = %67
  %75 = load i32, ptr %2, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %77
  %79 = getelementptr inbounds %struct.jsmntok, ptr %78, i32 0, i32 2
  %80 = load i32, ptr %79, align 8, !tbaa !13
  %81 = load i32, ptr %2, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.jsmntok, ptr %84, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = sub nsw i32 %80, %86
  %88 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %89 = load i32, ptr %2, align 4, !tbaa !9
  %90 = add nsw i32 %89, 1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.jsmntok, ptr %92, i32 0, i32 1
  %94 = load i32, ptr %93, align 4, !tbaa !14
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %88, i64 %95
  %97 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %87, ptr noundef %96)
  %98 = load i32, ptr %2, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %2, align 4, !tbaa !9
  br label %220

100:                                              ; preds = %67
  %101 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %102 = load i32, ptr %2, align 4, !tbaa !9
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %103
  %105 = call i32 @jsoneq(ptr noundef %101, ptr noundef %104, ptr noundef @.str.6)
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %133

107:                                              ; preds = %100
  %108 = load i32, ptr %2, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %110
  %112 = getelementptr inbounds %struct.jsmntok, ptr %111, i32 0, i32 2
  %113 = load i32, ptr %112, align 8, !tbaa !13
  %114 = load i32, ptr %2, align 4, !tbaa !9
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %116
  %118 = getelementptr inbounds %struct.jsmntok, ptr %117, i32 0, i32 1
  %119 = load i32, ptr %118, align 4, !tbaa !14
  %120 = sub nsw i32 %113, %119
  %121 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %122 = load i32, ptr %2, align 4, !tbaa !9
  %123 = add nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %124
  %126 = getelementptr inbounds %struct.jsmntok, ptr %125, i32 0, i32 1
  %127 = load i32, ptr %126, align 4, !tbaa !14
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i8, ptr %121, i64 %128
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.7, i32 noundef %120, ptr noundef %129)
  %131 = load i32, ptr %2, align 4, !tbaa !9
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %2, align 4, !tbaa !9
  br label %219

133:                                              ; preds = %100
  %134 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %135 = load i32, ptr %2, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %136
  %138 = call i32 @jsoneq(ptr noundef %134, ptr noundef %137, ptr noundef @.str.8)
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %197

140:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %141 = call i32 (ptr, ...) @printf(ptr noundef @.str.9)
  %142 = load i32, ptr %2, align 4, !tbaa !9
  %143 = add nsw i32 %142, 1
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %144
  %146 = getelementptr inbounds %struct.jsmntok, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 16, !tbaa !11
  %148 = icmp ne i32 %147, 2
  br i1 %148, label %149, label %150

149:                                              ; preds = %140
  store i32 4, ptr %6, align 4
  br label %194

150:                                              ; preds = %140
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %151

151:                                              ; preds = %181, %150
  %152 = load i32, ptr %7, align 4, !tbaa !9
  %153 = load i32, ptr %2, align 4, !tbaa !9
  %154 = add nsw i32 %153, 1
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.jsmntok, ptr %156, i32 0, i32 3
  %158 = load i32, ptr %157, align 4, !tbaa !15
  %159 = icmp slt i32 %152, %158
  br i1 %159, label %160, label %184

160:                                              ; preds = %151
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  %161 = load i32, ptr %2, align 4, !tbaa !9
  %162 = load i32, ptr %7, align 4, !tbaa !9
  %163 = add nsw i32 %161, %162
  %164 = add nsw i32 %163, 2
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %165
  store ptr %166, ptr %8, align 8, !tbaa !5
  %167 = load ptr, ptr %8, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.jsmntok, ptr %167, i32 0, i32 2
  %169 = load i32, ptr %168, align 4, !tbaa !13
  %170 = load ptr, ptr %8, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.jsmntok, ptr %170, i32 0, i32 1
  %172 = load i32, ptr %171, align 4, !tbaa !14
  %173 = sub nsw i32 %169, %172
  %174 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %175 = load ptr, ptr %8, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.jsmntok, ptr %175, i32 0, i32 1
  %177 = load i32, ptr %176, align 4, !tbaa !14
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds i8, ptr %174, i64 %178
  %180 = call i32 (ptr, ...) @printf(ptr noundef @.str.10, i32 noundef %173, ptr noundef %179)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br label %181

181:                                              ; preds = %160
  %182 = load i32, ptr %7, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %7, align 4, !tbaa !9
  br label %151, !llvm.loop !16

184:                                              ; preds = %151
  %185 = load i32, ptr %2, align 4, !tbaa !9
  %186 = add nsw i32 %185, 1
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %187
  %189 = getelementptr inbounds %struct.jsmntok, ptr %188, i32 0, i32 3
  %190 = load i32, ptr %189, align 4, !tbaa !15
  %191 = add nsw i32 %190, 1
  %192 = load i32, ptr %2, align 4, !tbaa !9
  %193 = add nsw i32 %192, %191
  store i32 %193, ptr %2, align 4, !tbaa !9
  store i32 0, ptr %6, align 4
  br label %194

194:                                              ; preds = %184, %149
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  %195 = load i32, ptr %6, align 4
  switch i32 %195, label %228 [
    i32 0, label %196
    i32 4, label %222
  ]

196:                                              ; preds = %194
  br label %218

197:                                              ; preds = %133
  %198 = load i32, ptr %2, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %199
  %201 = getelementptr inbounds %struct.jsmntok, ptr %200, i32 0, i32 2
  %202 = load i32, ptr %201, align 8, !tbaa !13
  %203 = load i32, ptr %2, align 4, !tbaa !9
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %204
  %206 = getelementptr inbounds %struct.jsmntok, ptr %205, i32 0, i32 1
  %207 = load i32, ptr %206, align 4, !tbaa !14
  %208 = sub nsw i32 %202, %207
  %209 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %210 = load i32, ptr %2, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [128 x %struct.jsmntok], ptr %5, i64 0, i64 %211
  %213 = getelementptr inbounds %struct.jsmntok, ptr %212, i32 0, i32 1
  %214 = load i32, ptr %213, align 4, !tbaa !14
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds i8, ptr %209, i64 %215
  %217 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %208, ptr noundef %216)
  br label %218

218:                                              ; preds = %197, %196
  br label %219

219:                                              ; preds = %218, %107
  br label %220

220:                                              ; preds = %219, %74
  br label %221

221:                                              ; preds = %220, %41
  br label %222

222:                                              ; preds = %221, %194
  %223 = load i32, ptr %2, align 4, !tbaa !9
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %2, align 4, !tbaa !9
  br label %30, !llvm.loop !18

225:                                              ; preds = %30
  store i32 0, ptr %1, align 4
  store i32 1, ptr %6, align 4
  br label %226

226:                                              ; preds = %225, %27, %16
  call void @llvm.lifetime.end.p0(i64 2048, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  %227 = load i32, ptr %1, align 4
  ret i32 %227

228:                                              ; preds = %194
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #3

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"jsmntok", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !10, i64 12}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}


; 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.jsmn_parser = type { i32, i32, i32 }
%struct.jsmntok = type { i32, i32, i32, i32 }

@JSON_STRING = external hidden local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [22 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local i32 @jsmn_parse(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @jsmn_init(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.jsmn_parser, align 4
  %2 = alloca [128 x %struct.jsmntok], align 16
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %2) #4
  call void @jsmn_init(ptr noundef nonnull %1)
  %3 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %4 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %3) #5
  %5 = call i32 @jsmn_parse(ptr noundef nonnull %1, ptr noundef %3, i64 noundef %4, ptr noundef nonnull %2, i32 noundef 128)
  %6 = icmp slt i32 %5, 0
  br i1 %6, label %7, label %9

7:                                                ; preds = %0
  %8 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %5)
  br label %.loopexit

9:                                                ; preds = %0
  %10 = icmp eq i32 %5, 0
  %11 = load i32, ptr %2, align 16
  %12 = icmp ne i32 %11, 1
  %or.cond = select i1 %10, i1 true, i1 %12
  br i1 %or.cond, label %14, label %.preheader44

.preheader44:                                     ; preds = %9
  %13 = icmp ugt i32 %5, 1
  br i1 %13, label %.lr.ph47, label %.loopexit

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %.loopexit

.lr.ph47:                                         ; preds = %.preheader44, %110
  %.04046 = phi i32 [ %111, %110 ], [ 1, %.preheader44 ]
  %16 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %17 = sext i32 %.04046 to i64
  %18 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %17
  %19 = call i32 @jsoneq(ptr noundef %16, ptr noundef nonnull %18, ptr noundef nonnull @.str.2)
  %20 = icmp eq i32 %19, 0
  br i1 %20, label %21, label %34

21:                                               ; preds = %.lr.ph47
  %22 = add nsw i32 %.04046, 1
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 8
  %26 = load i32, ptr %25, align 8, !tbaa !9
  %27 = getelementptr inbounds i8, ptr %24, i64 4
  %28 = load i32, ptr %27, align 4, !tbaa !12
  %29 = sub nsw i32 %26, %28
  %30 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %31 = sext i32 %28 to i64
  %32 = getelementptr inbounds i8, ptr %30, i64 %31
  %33 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %29, ptr noundef %32)
  br label %110

34:                                               ; preds = %.lr.ph47
  %35 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %36 = call i32 @jsoneq(ptr noundef %35, ptr noundef nonnull %18, ptr noundef nonnull @.str.4)
  %37 = icmp eq i32 %36, 0
  br i1 %37, label %38, label %51

38:                                               ; preds = %34
  %39 = add nsw i32 %.04046, 1
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %40
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load i32, ptr %42, align 8, !tbaa !9
  %44 = getelementptr inbounds i8, ptr %41, i64 4
  %45 = load i32, ptr %44, align 4, !tbaa !12
  %46 = sub nsw i32 %43, %45
  %47 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %48 = sext i32 %45 to i64
  %49 = getelementptr inbounds i8, ptr %47, i64 %48
  %50 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %46, ptr noundef %49)
  br label %110

51:                                               ; preds = %34
  %52 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %53 = call i32 @jsoneq(ptr noundef %52, ptr noundef nonnull %18, ptr noundef nonnull @.str.6)
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %68

55:                                               ; preds = %51
  %56 = add nsw i32 %.04046, 1
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %57
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load i32, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds i8, ptr %58, i64 4
  %62 = load i32, ptr %61, align 4, !tbaa !12
  %63 = sub nsw i32 %60, %62
  %64 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %65 = sext i32 %62 to i64
  %66 = getelementptr inbounds i8, ptr %64, i64 %65
  %67 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.7, i32 noundef %63, ptr noundef %66)
  br label %110

68:                                               ; preds = %51
  %69 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %70 = call i32 @jsoneq(ptr noundef %69, ptr noundef nonnull %18, ptr noundef nonnull @.str.8)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %100

72:                                               ; preds = %68
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9)
  %74 = add nsw i32 %.04046, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %75
  %77 = load i32, ptr %76, align 16, !tbaa !13
  %.not = icmp eq i32 %77, 2
  br i1 %.not, label %.preheader, label %110

.preheader:                                       ; preds = %72
  %78 = getelementptr inbounds i8, ptr %76, i64 12
  %79 = load i32, ptr %78, align 4, !tbaa !14
  %80 = icmp sgt i32 %79, 0
  br i1 %80, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %81 = add i32 %.04046, 2
  br label %82

82:                                               ; preds = %.lr.ph, %82
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %82 ]
  %83 = trunc nuw nsw i64 %indvars.iv to i32
  %84 = add i32 %81, %83
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [128 x %struct.jsmntok], ptr %2, i64 0, i64 %85
  %87 = getelementptr inbounds i8, ptr %86, i64 8
  %88 = load i32, ptr %87, align 8, !tbaa !9
  %89 = getelementptr inbounds i8, ptr %86, i64 4
  %90 = load i32, ptr %89, align 4, !tbaa !12
  %91 = sub nsw i32 %88, %90
  %92 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %93 = sext i32 %90 to i64
  %94 = getelementptr inbounds i8, ptr %92, i64 %93
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10, i32 noundef %91, ptr noundef %94)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %96 = load i32, ptr %78, align 4, !tbaa !14
  %97 = sext i32 %96 to i64
  %98 = icmp slt i64 %indvars.iv.next, %97
  br i1 %98, label %82, label %._crit_edge, !llvm.loop !15

._crit_edge:                                      ; preds = %82, %.preheader
  %.lcssa = phi i32 [ %79, %.preheader ], [ %96, %82 ]
  %99 = add i32 %74, %.lcssa
  br label %110

100:                                              ; preds = %68
  %101 = getelementptr inbounds i8, ptr %18, i64 8
  %102 = load i32, ptr %101, align 8, !tbaa !9
  %103 = getelementptr inbounds i8, ptr %18, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !12
  %105 = sub nsw i32 %102, %104
  %106 = load ptr, ptr @JSON_STRING, align 8, !tbaa !5
  %107 = sext i32 %104 to i64
  %108 = getelementptr inbounds i8, ptr %106, i64 %107
  %109 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %105, ptr noundef %108)
  br label %110

110:                                              ; preds = %._crit_edge, %72, %21, %55, %100, %38
  %.2 = phi i32 [ %22, %21 ], [ %39, %38 ], [ %56, %55 ], [ %.04046, %100 ], [ %99, %._crit_edge ], [ %.04046, %72 ]
  %111 = add nsw i32 %.2, 1
  %112 = icmp slt i32 %111, %5
  br i1 %112, label %.lr.ph47, label %.loopexit, !llvm.loop !17

.loopexit:                                        ; preds = %110, %.preheader44, %14, %7
  %.0 = phi i32 [ 1, %7 ], [ 1, %14 ], [ 0, %.preheader44 ], [ 0, %110 ]
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %1) #4
  ret i32 %.0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { nofree 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 #4 = { nounwind }
attributes #5 = { nounwind willreturn memory(read) }

!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, !11, i64 8}
!10 = !{!"jsmntok", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!10, !11, i64 0}
!14 = !{!10, !11, i64 12}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass