; LLVM IR from openappsec/openappsec :: external/yajl/reformatter (json_reformat)

; 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.yajl_callbacks = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@main.fileData = external hidden global [65536 x i8], align 16
@callbacks = external hidden global %struct.yajl_callbacks, align 8
@s_streamReformat = external hidden global i32, align 4
@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@stdin = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@stdout = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca ptr, align 8
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  %16 = call ptr @yajl_gen_alloc(ptr noundef null)
  store ptr %16, ptr %7, align 8, !tbaa !9
  %17 = load ptr, ptr %7, align 8, !tbaa !9
  %18 = call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %17, i32 noundef 1, i32 noundef 1)
  %19 = load ptr, ptr %7, align 8, !tbaa !9
  %20 = call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %19, i32 noundef 8, i32 noundef 1)
  %21 = load ptr, ptr %7, align 8, !tbaa !9
  %22 = call ptr @yajl_alloc(ptr noundef @callbacks, ptr noundef null, ptr noundef %21)
  store ptr %22, ptr %6, align 8, !tbaa !9
  %23 = load ptr, ptr %6, align 8, !tbaa !9
  %24 = call i32 (ptr, i32, ...) @yajl_config(ptr noundef %23, i32 noundef 1, i32 noundef 1)
  br label %25

25:                                               ; preds = %103, %2
  %26 = load i32, ptr %11, align 4, !tbaa !5
  %27 = load i32, ptr %4, align 4, !tbaa !5
  %28 = icmp slt i32 %26, %27
  br i1 %28, label %29, label %47

29:                                               ; preds = %25
  %30 = load ptr, ptr %5, align 8, !tbaa !9
  %31 = load i32, ptr %11, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds ptr, ptr %30, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = getelementptr inbounds i8, ptr %34, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !11
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 45
  br i1 %38, label %39, label %47

39:                                               ; preds = %29
  %40 = load ptr, ptr %5, align 8, !tbaa !9
  %41 = load i32, ptr %11, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds ptr, ptr %40, i64 %42
  %44 = load ptr, ptr %43, align 8, !tbaa !9
  %45 = call i64 @strlen(ptr noundef %44) #6
  %46 = icmp ugt i64 %45, 1
  br label %47

47:                                               ; preds = %39, %29, %25
  %48 = phi i1 [ false, %29 ], [ false, %25 ], [ %46, %39 ]
  br i1 %48, label %49, label %106

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %100, %49
  %51 = load i32, ptr %12, align 4, !tbaa !5
  %52 = zext i32 %51 to i64
  %53 = load ptr, ptr %5, align 8, !tbaa !9
  %54 = load i32, ptr %11, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds ptr, ptr %53, i64 %55
  %57 = load ptr, ptr %56, align 8, !tbaa !9
  %58 = call i64 @strlen(ptr noundef %57) #6
  %59 = icmp ult i64 %52, %58
  br i1 %59, label %60, label %103

60:                                               ; preds = %50
  %61 = load ptr, ptr %5, align 8, !tbaa !9
  %62 = load i32, ptr %11, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %61, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = load i32, ptr %12, align 4, !tbaa !5
  %67 = zext i32 %66 to i64
  %68 = getelementptr inbounds i8, ptr %65, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = sext i8 %69 to i32
  switch i32 %70, label %83 [
    i32 109, label %71
    i32 115, label %74
    i32 117, label %77
    i32 101, label %80
  ]

71:                                               ; preds = %60
  %72 = load ptr, ptr %7, align 8, !tbaa !9
  %73 = call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %72, i32 noundef 1, i32 noundef 0)
  br label %99

74:                                               ; preds = %60
  %75 = load ptr, ptr %6, align 8, !tbaa !9
  %76 = call i32 (ptr, i32, ...) @yajl_config(ptr noundef %75, i32 noundef 8, i32 noundef 1)
  store i32 1, ptr @s_streamReformat, align 4, !tbaa !5
  br label %99

77:                                               ; preds = %60
  %78 = load ptr, ptr %6, align 8, !tbaa !9
  %79 = call i32 (ptr, i32, ...) @yajl_config(ptr noundef %78, i32 noundef 2, i32 noundef 1)
  br label %99

80:                                               ; preds = %60
  %81 = load ptr, ptr %7, align 8, !tbaa !9
  %82 = call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %81, i32 noundef 16, i32 noundef 1)
  br label %99

83:                                               ; preds = %60
  %84 = load ptr, ptr @stderr, align 8, !tbaa !9
  %85 = load ptr, ptr %5, align 8, !tbaa !9
  %86 = load i32, ptr %11, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds ptr, ptr %85, i64 %87
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !5
  %91 = zext i32 %90 to i64
  %92 = getelementptr inbounds i8, ptr %89, i64 %91
  %93 = load i8, ptr %92, align 1, !tbaa !11
  %94 = sext i8 %93 to i32
  %95 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %84, ptr noundef @.str, i32 noundef %94) #5
  %96 = load ptr, ptr %5, align 8, !tbaa !9
  %97 = getelementptr inbounds ptr, ptr %96, i64 0
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  call void @usage(ptr noundef %98)
  br label %99

99:                                               ; preds = %83, %80, %77, %74, %71
  br label %100

100:                                              ; preds = %99
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = add i32 %101, 1
  store i32 %102, ptr %12, align 4, !tbaa !5
  br label %50, !llvm.loop !12

103:                                              ; preds = %50
  %104 = load i32, ptr %11, align 4, !tbaa !5
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %25, !llvm.loop !14

106:                                              ; preds = %47
  %107 = load i32, ptr %11, align 4, !tbaa !5
  %108 = load i32, ptr %4, align 4, !tbaa !5
  %109 = icmp slt i32 %107, %108
  br i1 %109, label %110, label %114

110:                                              ; preds = %106
  %111 = load ptr, ptr %5, align 8, !tbaa !9
  %112 = getelementptr inbounds ptr, ptr %111, i64 0
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  call void @usage(ptr noundef %113)
  br label %114

114:                                              ; preds = %110, %106
  br label %115

115:                                              ; preds = %137, %114
  %116 = load ptr, ptr @stdin, align 8, !tbaa !9
  %117 = call i64 @fread(ptr noundef @main.fileData, i64 noundef 1, i64 noundef 65535, ptr noundef %116)
  store i64 %117, ptr %9, align 8, !tbaa !15
  %118 = load i64, ptr %9, align 8, !tbaa !15
  %119 = icmp eq i64 %118, 0
  br i1 %119, label %120, label %128

120:                                              ; preds = %115
  %121 = load ptr, ptr @stdin, align 8, !tbaa !9
  %122 = call i32 @feof(ptr noundef %121) #5
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %127, label %124

124:                                              ; preds = %120
  %125 = load ptr, ptr @stderr, align 8, !tbaa !9
  %126 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %125, ptr noundef @.str.1) #5
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %127

127:                                              ; preds = %124, %120
  br label %145

128:                                              ; preds = %115
  %129 = load i64, ptr %9, align 8, !tbaa !15
  %130 = getelementptr inbounds [65536 x i8], ptr @main.fileData, i64 0, i64 %129
  store i8 0, ptr %130, align 1, !tbaa !11
  %131 = load ptr, ptr %6, align 8, !tbaa !9
  %132 = load i64, ptr %9, align 8, !tbaa !15
  %133 = call i32 @yajl_parse(ptr noundef %131, ptr noundef @main.fileData, i64 noundef %132)
  store i32 %133, ptr %8, align 4, !tbaa !5
  %134 = load i32, ptr %8, align 4, !tbaa !5
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %137

136:                                              ; preds = %128
  br label %145

137:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %138 = load ptr, ptr %7, align 8, !tbaa !9
  %139 = call i32 @yajl_gen_get_buf(ptr noundef %138, ptr noundef %13, ptr noundef %14)
  %140 = load ptr, ptr %13, align 8, !tbaa !9
  %141 = load i64, ptr %14, align 8, !tbaa !15
  %142 = load ptr, ptr @stdout, align 8, !tbaa !9
  %143 = call i64 @fwrite(ptr noundef %140, i64 noundef 1, i64 noundef %141, ptr noundef %142)
  %144 = load ptr, ptr %7, align 8, !tbaa !9
  call void @yajl_gen_clear(ptr noundef %144)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %115

145:                                              ; preds = %136, %127
  %146 = load ptr, ptr %6, align 8, !tbaa !9
  %147 = call i32 @yajl_complete_parse(ptr noundef %146)
  store i32 %147, ptr %8, align 4, !tbaa !5
  %148 = load i32, ptr %8, align 4, !tbaa !5
  %149 = icmp ne i32 %148, 0
  br i1 %149, label %150, label %159

150:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %151 = load ptr, ptr %6, align 8, !tbaa !9
  %152 = load i64, ptr %9, align 8, !tbaa !15
  %153 = call ptr @yajl_get_error(ptr noundef %151, i32 noundef 1, ptr noundef @main.fileData, i64 noundef %152)
  store ptr %153, ptr %15, align 8, !tbaa !9
  %154 = load ptr, ptr @stderr, align 8, !tbaa !9
  %155 = load ptr, ptr %15, align 8, !tbaa !9
  %156 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %154, ptr noundef @.str.2, ptr noundef %155) #5
  %157 = load ptr, ptr %6, align 8, !tbaa !9
  %158 = load ptr, ptr %15, align 8, !tbaa !9
  call void @yajl_free_error(ptr noundef %157, ptr noundef %158)
  store i32 1, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %159

159:                                              ; preds = %150, %145
  %160 = load ptr, ptr %7, align 8, !tbaa !9
  call void @yajl_gen_free(ptr noundef %160)
  %161 = load ptr, ptr %6, align 8, !tbaa !9
  call void @yajl_free(ptr noundef %161)
  %162 = load i32, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  ret i32 %162
}

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

declare ptr @yajl_gen_alloc(ptr noundef) #2

declare i32 @yajl_gen_config(ptr noundef, i32 noundef, ...) #2

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

declare i32 @yajl_config(ptr noundef, i32 noundef, ...) #2

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #4

; Function Attrs: nounwind uwtable
declare hidden void @usage(ptr noundef) #0

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @feof(ptr noundef) #4

declare i32 @yajl_parse(ptr noundef, ptr noundef, i64 noundef) #2

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

declare i64 @fwrite(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #2

declare void @yajl_gen_clear(ptr noundef) #2

declare i32 @yajl_complete_parse(ptr noundef) #2

declare ptr @yajl_get_error(ptr noundef, i32 noundef, ptr noundef, i64 noundef) #2

declare void @yajl_free_error(ptr noundef, ptr noundef) #2

declare void @yajl_gen_free(ptr noundef) #2

declare void @yajl_free(ptr noundef) #2

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 = { "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 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 #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


; 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.yajl_callbacks = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@main.fileData = external hidden global [65536 x i8], align 16
@callbacks = external hidden global %struct.yajl_callbacks, align 8
@s_streamReformat = external hidden local_unnamed_addr global i32, align 4
@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [28 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [21 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i64, align 8
  %5 = tail call ptr @yajl_gen_alloc(ptr noundef null) #6
  %6 = tail call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %5, i32 noundef 1, i32 noundef 1) #6
  %7 = tail call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %5, i32 noundef 8, i32 noundef 1) #6
  %8 = tail call ptr @yajl_alloc(ptr noundef nonnull @callbacks, ptr noundef null, ptr noundef %5) #6
  %9 = tail call i32 (ptr, i32, ...) @yajl_config(ptr noundef %8, i32 noundef 1, i32 noundef 1) #6
  %10 = icmp sgt i32 %0, 1
  br i1 %10, label %.lr.ph56.preheader, label %.critedge51

.lr.ph56.preheader:                               ; preds = %2
  %wide.trip.count = zext nneg i32 %0 to i64
  br label %.lr.ph56

.lr.ph56:                                         ; preds = %.lr.ph56.preheader, %._crit_edge
  %indvars.iv = phi i64 [ 1, %.lr.ph56.preheader ], [ %indvars.iv.next, %._crit_edge ]
  %11 = getelementptr inbounds ptr, ptr %1, i64 %indvars.iv
  %12 = load ptr, ptr %11, align 8, !tbaa !5
  %13 = load i8, ptr %12, align 1, !tbaa !9
  %14 = icmp eq i8 %13, 45
  br i1 %14, label %15, label %.critedge

15:                                               ; preds = %.lr.ph56
  %16 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %12) #7
  %17 = icmp ugt i64 %16, 1
  br i1 %17, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %15, %37
  %18 = phi ptr [ %40, %37 ], [ %12, %15 ]
  %19 = phi i64 [ %39, %37 ], [ 1, %15 ]
  %.053 = phi i32 [ %38, %37 ], [ 1, %15 ]
  %20 = getelementptr inbounds i8, ptr %18, i64 %19
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %22 = sext i8 %21 to i32
  %23 = add nsw i32 %22, -101
  %24 = tail call i32 @llvm.fshl.i32(i32 %23, i32 %23, i32 31)
  switch i32 %24, label %33 [
    i32 4, label %25
    i32 7, label %27
    i32 8, label %29
    i32 0, label %31
  ]

25:                                               ; preds = %.lr.ph
  %26 = tail call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %5, i32 noundef 1, i32 noundef 0) #6
  br label %37

27:                                               ; preds = %.lr.ph
  %28 = tail call i32 (ptr, i32, ...) @yajl_config(ptr noundef %8, i32 noundef 8, i32 noundef 1) #6
  store i32 1, ptr @s_streamReformat, align 4, !tbaa !10
  br label %37

29:                                               ; preds = %.lr.ph
  %30 = tail call i32 (ptr, i32, ...) @yajl_config(ptr noundef %8, i32 noundef 2, i32 noundef 1) #6
  br label %37

31:                                               ; preds = %.lr.ph
  %32 = tail call i32 (ptr, i32, ...) @yajl_gen_config(ptr noundef %5, i32 noundef 16, i32 noundef 1) #6
  br label %37

33:                                               ; preds = %.lr.ph
  %34 = load ptr, ptr @stderr, align 8, !tbaa !5
  %35 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %34, ptr noundef nonnull @.str, i32 noundef %22) #8
  %36 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %36)
  br label %37

37:                                               ; preds = %25, %27, %29, %31, %33
  %38 = add i32 %.053, 1
  %39 = zext i32 %38 to i64
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %40) #7
  %42 = icmp ugt i64 %41, %39
  br i1 %42, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %37
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.critedge51, label %.lr.ph56, !llvm.loop !14

.critedge:                                        ; preds = %15, %.lr.ph56
  %43 = load ptr, ptr %1, align 8, !tbaa !5
  tail call void @usage(ptr noundef %43)
  br label %.critedge51

.critedge51:                                      ; preds = %._crit_edge, %2, %.critedge
  %44 = load ptr, ptr @stdin, align 8, !tbaa !5
  %45 = tail call i64 @fread(ptr noundef nonnull @main.fileData, i64 noundef 1, i64 noundef 65535, ptr noundef %44)
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %._crit_edge58, label %.lr.ph57

._crit_edge58:                                    ; preds = %55, %.critedge51
  %47 = load ptr, ptr @stdin, align 8, !tbaa !5
  %48 = call i32 @feof(ptr noundef %47) #6
  %.not49 = icmp eq i32 %48, 0
  br i1 %.not49, label %49, label %.loopexit

49:                                               ; preds = %._crit_edge58
  %50 = load ptr, ptr @stderr, align 8, !tbaa !5
  %51 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %50, ptr noundef nonnull @.str.1) #8
  br label %.loopexit

.lr.ph57:                                         ; preds = %.critedge51, %55
  %52 = phi i64 [ %62, %55 ], [ %45, %.critedge51 ]
  %53 = getelementptr inbounds [65536 x i8], ptr @main.fileData, i64 0, i64 %52
  store i8 0, ptr %53, align 1, !tbaa !9
  %54 = call i32 @yajl_parse(ptr noundef %8, ptr noundef nonnull @main.fileData, i64 noundef %52) #6
  %.not = icmp eq i32 %54, 0
  br i1 %.not, label %55, label %.loopexit

55:                                               ; preds = %.lr.ph57
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %56 = call i32 @yajl_gen_get_buf(ptr noundef %5, ptr noundef nonnull %3, ptr noundef nonnull %4) #6
  %57 = load ptr, ptr %3, align 8, !tbaa !5
  %58 = load i64, ptr %4, align 8, !tbaa !15
  %59 = load ptr, ptr @stdout, align 8, !tbaa !5
  %60 = call i64 @fwrite(ptr noundef %57, i64 noundef 1, i64 noundef %58, ptr noundef %59)
  call void @yajl_gen_clear(ptr noundef %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  %61 = load ptr, ptr @stdin, align 8, !tbaa !5
  %62 = call i64 @fread(ptr noundef nonnull @main.fileData, i64 noundef 1, i64 noundef 65535, ptr noundef %61)
  %63 = icmp eq i64 %62, 0
  br i1 %63, label %._crit_edge58, label %.lr.ph57

.loopexit:                                        ; preds = %.lr.ph57, %._crit_edge58, %49
  %64 = phi i64 [ 0, %._crit_edge58 ], [ 0, %49 ], [ %52, %.lr.ph57 ]
  %.046 = phi i32 [ 0, %._crit_edge58 ], [ 1, %49 ], [ 0, %.lr.ph57 ]
  %65 = call i32 @yajl_complete_parse(ptr noundef %8) #6
  %.not50 = icmp eq i32 %65, 0
  br i1 %.not50, label %70, label %66

66:                                               ; preds = %.loopexit
  %67 = call ptr @yajl_get_error(ptr noundef %8, i32 noundef 1, ptr noundef nonnull @main.fileData, i64 noundef %64) #6
  %68 = load ptr, ptr @stderr, align 8, !tbaa !5
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef nonnull @.str.2, ptr noundef %67) #8
  call void @yajl_free_error(ptr noundef %8, ptr noundef %67) #6
  br label %70

70:                                               ; preds = %66, %.loopexit
  %.1 = phi i32 [ 1, %66 ], [ %.046, %.loopexit ]
  call void @yajl_gen_free(ptr noundef %5) #6
  call void @yajl_free(ptr noundef %8) #6
  ret i32 %.1
}

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

declare ptr @yajl_gen_alloc(ptr noundef) local_unnamed_addr #2

declare i32 @yajl_gen_config(ptr noundef, i32 noundef, ...) local_unnamed_addr #2

declare ptr @yajl_alloc(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @yajl_config(ptr noundef, i32 noundef, ...) local_unnamed_addr #2

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

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

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

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @feof(ptr nocapture noundef) local_unnamed_addr #4

declare i32 @yajl_parse(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @yajl_gen_get_buf(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #4

declare void @yajl_gen_clear(ptr noundef) local_unnamed_addr #2

declare i32 @yajl_complete_parse(ptr noundef) local_unnamed_addr #2

declare ptr @yajl_get_error(ptr noundef, i32 noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare void @yajl_free_error(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @yajl_gen_free(ptr noundef) local_unnamed_addr #2

declare void @yajl_free(ptr noundef) local_unnamed_addr #2

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

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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { cold 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}


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