; LLVM IR from Softmotions/iowow :: src/json (iwjsreg)

; 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.iwjsreg = type { ptr, ptr, ptr, ptr, ptr, %union.pthread_rwlock_t, %struct.iwref_holder, ptr, ptr, ptr, ptr, i32, i8 }
%union.pthread_rwlock_t = type { %struct.__pthread_rwlock_arch_t }
%struct.__pthread_rwlock_arch_t = type { i32, i32, i32, i32, i32, i32, i32, i32, i8, [7 x i8], i64, i32 }
%struct.iwref_holder = type { ptr, i64, ptr }
%struct.jbl_node = type { ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, %union.anon }
%union.anon = type { ptr }

@.str.3 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 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

declare i64 @iwrc_set_errno(i64 noundef, i32 noundef) #1

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

; 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
declare dso_local i64 @iwjsreg_sync(ptr noundef) #4

declare void @iwlog3(i32 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #5

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

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #7

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #6

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

declare void @jbn_add_item(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i64 @iwjsreg_set_bool(ptr noundef %0, ptr noundef %1, i1 noundef zeroext %2) #4 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i64, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %14 = zext i1 %2 to i8
  store i8 %14, ptr %7, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !11
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %25

17:                                               ; preds = %3
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.iwjsreg, ptr %18, i32 0, i32 1
  %20 = load ptr, ptr %19, align 8, !tbaa !13
  %21 = icmp ne ptr %20, null
  br i1 %21, label %22, label %25

22:                                               ; preds = %17
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %26, label %25

25:                                               ; preds = %22, %17, %3
  store i64 70017, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %184

26:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !5
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.iwjsreg, ptr %27, i32 0, i32 8
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.iwjsreg, ptr %30, i32 0, i32 10
  %32 = load ptr, ptr %31, align 8, !tbaa !18
  %33 = call i64 %29(ptr noundef %32)
  %34 = icmp ne i64 %33, 0
  %35 = xor i1 %34, true
  %36 = xor i1 %35, true
  %37 = zext i1 %36 to i32
  %38 = sext i32 %37 to i64
  %39 = call i64 @llvm.expect.i64(i64 %38, i64 0)
  %40 = icmp ne i64 %39, 0
  br i1 %40, label %41, label %49

41:                                               ; preds = %26
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.iwjsreg, ptr %42, i32 0, i32 8
  %44 = load ptr, ptr %43, align 8, !tbaa !17
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.iwjsreg, ptr %45, i32 0, i32 10
  %47 = load ptr, ptr %46, align 8, !tbaa !18
  %48 = call i64 %44(ptr noundef %47)
  store i64 %48, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %183

49:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %50 = load ptr, ptr %5, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.iwjsreg, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !13
  %53 = getelementptr inbounds %struct.jbl_node, ptr %52, i32 0, i32 6
  %54 = load ptr, ptr %53, align 8, !tbaa !19
  store ptr %54, ptr %12, align 8, !tbaa !5
  br label %55

55:                                               ; preds = %78, %49
  %56 = load ptr, ptr %12, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %59, label %58

58:                                               ; preds = %55
  store i32 2, ptr %9, align 4
  br label %82

59:                                               ; preds = %55
  %60 = load ptr, ptr %12, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.jbl_node, ptr %60, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !21
  %63 = icmp ne ptr %62, null
  br i1 %63, label %64, label %77

64:                                               ; preds = %59
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.jbl_node, ptr %65, i32 0, i32 3
  %67 = load ptr, ptr %66, align 8, !tbaa !21
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = load ptr, ptr %12, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.jbl_node, ptr %69, i32 0, i32 4
  %71 = load i32, ptr %70, align 8, !tbaa !22
  %72 = sext i32 %71 to i64
  %73 = call i32 @strncmp(ptr noundef %67, ptr noundef %68, i64 noundef %72) #9
  %74 = icmp eq i32 %73, 0
  br i1 %74, label %75, label %77

75:                                               ; preds = %64
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %76, ptr %10, align 8, !tbaa !5
  store i32 2, ptr %9, align 4
  br label %82

77:                                               ; preds = %64, %59
  br label %78

78:                                               ; preds = %77
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.jbl_node, ptr %79, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8, !tbaa !23
  store ptr %81, ptr %12, align 8, !tbaa !5
  br label %55, !llvm.loop !24

82:                                               ; preds = %75, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %83

83:                                               ; preds = %82
  %84 = load ptr, ptr %10, align 8, !tbaa !5
  %85 = icmp ne ptr %84, null
  br i1 %85, label %109, label %86

86:                                               ; preds = %83
  %87 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 64) #10
  store ptr %87, ptr %10, align 8, !tbaa !5
  %88 = icmp ne ptr %87, null
  br i1 %88, label %93, label %89

89:                                               ; preds = %86
  %90 = call ptr @__errno_location() #11
  %91 = load i32, ptr %90, align 4, !tbaa !26
  %92 = call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %91)
  store i64 %92, ptr %8, align 8, !tbaa !11
  br label %129

93:                                               ; preds = %86
  %94 = load ptr, ptr %10, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.jbl_node, ptr %94, i32 0, i32 8
  store i32 2, ptr %95, align 4, !tbaa !27
  %96 = load i8, ptr %7, align 1, !tbaa !9, !range !28, !noundef !29
  %97 = trunc i8 %96 to i1
  %98 = load ptr, ptr %10, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.jbl_node, ptr %98, i32 0, i32 9
  %100 = zext i1 %97 to i8
  store i8 %100, ptr %99, align 8, !tbaa !30
  %101 = load ptr, ptr %6, align 8, !tbaa !5
  %102 = call noalias ptr @strdup(ptr noundef %101) #8
  store ptr %102, ptr %11, align 8, !tbaa !5
  %103 = icmp ne ptr %102, null
  br i1 %103, label %108, label %104

104:                                              ; preds = %93
  %105 = call ptr @__errno_location() #11
  %106 = load i32, ptr %105, align 4, !tbaa !26
  %107 = call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %106)
  store i64 %107, ptr %8, align 8, !tbaa !11
  br label %129

108:                                              ; preds = %93
  br label %126

109:                                              ; preds = %83
  %110 = load ptr, ptr %10, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.jbl_node, ptr %110, i32 0, i32 8
  %112 = load i32, ptr %111, align 4, !tbaa !27
  %113 = icmp eq i32 %112, 5
  br i1 %113, label %114, label %118

114:                                              ; preds = %109
  %115 = load ptr, ptr %10, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.jbl_node, ptr %115, i32 0, i32 9
  %117 = load ptr, ptr %116, align 8, !tbaa !30
  call void @free(ptr noundef %117) #8
  br label %118

118:                                              ; preds = %114, %109
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.jbl_node, ptr %119, i32 0, i32 8
  store i32 2, ptr %120, align 4, !tbaa !27
  %121 = load i8, ptr %7, align 1, !tbaa !9, !range !28, !noundef !29
  %122 = trunc i8 %121 to i1
  %123 = load ptr, ptr %10, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.jbl_node, ptr %123, i32 0, i32 9
  %125 = zext i1 %122 to i8
  store i8 %125, ptr %124, align 8, !tbaa !30
  br label %126

126:                                              ; preds = %118, %108
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.iwjsreg, ptr %127, i32 0, i32 12
  store i8 1, ptr %128, align 4, !tbaa !31
  br label %129

129:                                              ; preds = %126, %104, %89
  %130 = load i64, ptr %8, align 8, !tbaa !11
  %131 = icmp ne i64 %130, 0
  br i1 %131, label %132, label %134

132:                                              ; preds = %129
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %133) #8
  br label %151

134:                                              ; preds = %129
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = icmp ne ptr %135, null
  br i1 %136, label %137, label %150

137:                                              ; preds = %134
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = load ptr, ptr %10, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.jbl_node, ptr %139, i32 0, i32 3
  store ptr %138, ptr %140, align 8, !tbaa !21
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = call i64 @strlen(ptr noundef %141) #9
  %143 = trunc i64 %142 to i32
  %144 = load ptr, ptr %10, align 8, !tbaa !5
  %145 = getelementptr inbounds %struct.jbl_node, ptr %144, i32 0, i32 4
  store i32 %143, ptr %145, align 8, !tbaa !22
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.iwjsreg, ptr %146, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !13
  %149 = load ptr, ptr %10, align 8, !tbaa !5
  call void @jbn_add_item(ptr noundef %148, ptr noundef %149)
  br label %150

150:                                              ; preds = %137, %134
  br label %151

151:                                              ; preds = %150, %132
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.iwjsreg, ptr %152, i32 0, i32 9
  %154 = load ptr, ptr %153, align 8, !tbaa !32
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.iwjsreg, ptr %155, i32 0, i32 10
  %157 = load ptr, ptr %156, align 8, !tbaa !18
  %158 = call i64 %154(ptr noundef %157)
  store i64 %158, ptr %13, align 8, !tbaa !11
  %159 = load i64, ptr %13, align 8, !tbaa !11
  %160 = icmp ne i64 %159, 0
  br i1 %160, label %161, label %169

161:                                              ; preds = %151
  %162 = load i64, ptr %8, align 8, !tbaa !11
  %163 = icmp ne i64 %162, 0
  br i1 %163, label %166, label %164

164:                                              ; preds = %161
  %165 = load i64, ptr %13, align 8, !tbaa !11
  store i64 %165, ptr %8, align 8, !tbaa !11
  br label %168

166:                                              ; preds = %161
  %167 = load i64, ptr %13, align 8, !tbaa !11
  call void @iwlog3(i32 noundef 0, i64 noundef %167, ptr noundef @.str.3, i32 noundef 679, ptr noundef @.str.4)
  br label %168

168:                                              ; preds = %166, %164
  br label %169

169:                                              ; preds = %168, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %170 = load i64, ptr %8, align 8, !tbaa !11
  %171 = icmp ne i64 %170, 0
  br i1 %171, label %181, label %172

172:                                              ; preds = %169
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.iwjsreg, ptr %173, i32 0, i32 11
  %175 = load i32, ptr %174, align 8, !tbaa !33
  %176 = and i32 %175, 2
  %177 = icmp ne i32 %176, 0
  br i1 %177, label %178, label %181

178:                                              ; preds = %172
  %179 = load ptr, ptr %5, align 8, !tbaa !5
  %180 = call i64 @iwjsreg_sync(ptr noundef %179)
  store i64 %180, ptr %8, align 8, !tbaa !11
  br label %181

181:                                              ; preds = %178, %172, %169
  %182 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %182, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %183

183:                                              ; preds = %181, %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %184

184:                                              ; preds = %183, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %185 = load i64, ptr %4, align 8
  ret i64 %185
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nounwind willreturn memory(none) "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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind allocsize(0,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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind allocsize(0,1) }
attributes #11 = { nounwind willreturn memory(none) }

!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 = !{!"_Bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"iwjsreg", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !15, i64 96, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !16, i64 152, !10, i64 156}
!15 = !{!"iwref_holder", !6, i64 0, !7, i64 8, !6, i64 16}
!16 = !{!"int", !7, i64 0}
!17 = !{!14, !6, i64 128}
!18 = !{!14, !6, i64 144}
!19 = !{!20, !6, i64 40}
!20 = !{!"jbl_node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !16, i64 32, !16, i64 36, !6, i64 40, !16, i64 48, !16, i64 52, !7, i64 56}
!21 = !{!20, !6, i64 24}
!22 = !{!20, !16, i64 32}
!23 = !{!20, !6, i64 0}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!16, !16, i64 0}
!27 = !{!20, !16, i64 52}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = !{!7, !7, i64 0}
!31 = !{!14, !10, i64 156}
!32 = !{!14, !6, i64 136}
!33 = !{!14, !16, i64 152}


; 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"

@.str.3 = external hidden unnamed_addr constant [70 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

declare i64 @iwrc_set_errno(i64 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @iwjsreg_sync(ptr noundef) local_unnamed_addr #2

declare void @iwlog3(i32 noundef, i64 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #6

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

declare void @jbn_add_item(ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local i64 @iwjsreg_set_bool(ptr noundef %0, ptr noundef readonly %1, i1 noundef zeroext %2) local_unnamed_addr #2 {
  %4 = zext i1 %2 to i8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %68, label %5

5:                                                ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  %8 = icmp ne ptr %7, null
  %9 = icmp ne ptr %1, null
  %or.cond = and i1 %9, %8
  br i1 %or.cond, label %10, label %68

10:                                               ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  %12 = load ptr, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %0, i64 144
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = tail call i64 %12(ptr noundef %14) #7
  %.not62 = icmp eq i64 %15, 0
  br i1 %.not62, label %20, label %16, !prof !15

16:                                               ; preds = %10
  %17 = load ptr, ptr %11, align 8, !tbaa !13
  %18 = load ptr, ptr %13, align 8, !tbaa !14
  %19 = tail call i64 %17(ptr noundef %18) #7
  br label %68

20:                                               ; preds = %10
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 40
  %.04698 = load ptr, ptr %22, align 8, !tbaa !16
  %.not6399 = icmp eq ptr %.04698, null
  br i1 %.not6399, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %20, %31
  %.046100 = phi ptr [ %.046, %31 ], [ %.04698, %20 ]
  %23 = getelementptr inbounds i8, ptr %.046100, i64 24
  %24 = load ptr, ptr %23, align 8, !tbaa !17
  %.not64 = icmp eq ptr %24, null
  br i1 %.not64, label %31, label %25

25:                                               ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %.046100, i64 32
  %27 = load i32, ptr %26, align 8, !tbaa !19
  %28 = sext i32 %27 to i64
  %29 = tail call i32 @strncmp(ptr noundef nonnull %24, ptr noundef nonnull %1, i64 noundef %28) #8
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %37, label %31

31:                                               ; preds = %.lr.ph, %25
  %.046 = load ptr, ptr %.046100, align 8, !tbaa !16
  %.not63 = icmp eq ptr %.046, null
  br i1 %.not63, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %31, %20
  %32 = tail call noalias dereferenceable_or_null(64) ptr @calloc(i64 noundef 1, i64 noundef 64) #9
  %.not66 = icmp eq ptr %32, null
  br i1 %.not66, label %46, label %33

33:                                               ; preds = %._crit_edge
  %34 = getelementptr inbounds i8, ptr %32, i64 52
  store i32 2, ptr %34, align 4, !tbaa !22
  %35 = getelementptr inbounds i8, ptr %32, i64 56
  store i8 %4, ptr %35, align 8, !tbaa !23
  %36 = tail call noalias ptr @strdup(ptr noundef nonnull %1) #7
  %.not67 = icmp eq ptr %36, null
  br i1 %.not67, label %46, label %50

37:                                               ; preds = %25
  %38 = getelementptr inbounds i8, ptr %.046100, i64 52
  %39 = load i32, ptr %38, align 4, !tbaa !22
  %40 = icmp eq i32 %39, 5
  br i1 %40, label %41, label %.thread92

41:                                               ; preds = %37
  %42 = getelementptr inbounds i8, ptr %.046100, i64 56
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  tail call void @free(ptr noundef %43) #7
  br label %.thread92

.thread92:                                        ; preds = %37, %41
  store i32 2, ptr %38, align 4, !tbaa !22
  %44 = getelementptr inbounds i8, ptr %.046100, i64 56
  store i8 %4, ptr %44, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %0, i64 156
  store i8 1, ptr %45, align 4, !tbaa !24
  br label %.thread86

46:                                               ; preds = %33, %._crit_edge
  %47 = tail call ptr @__errno_location() #10
  %48 = load i32, ptr %47, align 4, !tbaa !25
  %49 = tail call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %48) #7
  %.not68 = icmp eq i64 %49, 0
  br label %.thread86

50:                                               ; preds = %33
  %51 = getelementptr inbounds i8, ptr %0, i64 156
  store i8 1, ptr %51, align 4, !tbaa !24
  %52 = getelementptr inbounds i8, ptr %32, i64 24
  store ptr %36, ptr %52, align 8, !tbaa !17
  %53 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %36) #8
  %54 = trunc i64 %53 to i32
  %55 = getelementptr inbounds i8, ptr %32, i64 32
  store i32 %54, ptr %55, align 8, !tbaa !19
  tail call void @jbn_add_item(ptr noundef %21, ptr noundef nonnull %32) #7
  br label %.thread86

.thread86:                                        ; preds = %46, %.thread92, %50
  %.not6884 = phi i1 [ true, %50 ], [ true, %.thread92 ], [ %.not68, %46 ]
  %.05180 = phi i64 [ 0, %50 ], [ 0, %.thread92 ], [ %49, %46 ]
  %56 = getelementptr inbounds i8, ptr %0, i64 136
  %57 = load ptr, ptr %56, align 8, !tbaa !26
  %58 = load ptr, ptr %13, align 8, !tbaa !14
  %59 = tail call i64 %57(ptr noundef %58) #7
  %.not70 = icmp eq i64 %59, 0
  %brmerge = or i1 %.not6884, %.not70
  %.051.mux = select i1 %.not70, i64 %.05180, i64 %59
  br i1 %brmerge, label %61, label %60

60:                                               ; preds = %.thread86
  tail call void @iwlog3(i32 noundef 0, i64 noundef %59, ptr noundef nonnull @.str.3, i32 noundef 679, ptr noundef nonnull @.str.4) #7
  br label %61

61:                                               ; preds = %.thread86, %60
  %.152 = phi i64 [ %.05180, %60 ], [ %.051.mux, %.thread86 ]
  %.not71 = icmp eq i64 %.152, 0
  br i1 %.not71, label %62, label %68

62:                                               ; preds = %61
  %63 = getelementptr inbounds i8, ptr %0, i64 152
  %64 = load i32, ptr %63, align 8, !tbaa !27
  %65 = and i32 %64, 2
  %.not72 = icmp eq i32 %65, 0
  br i1 %.not72, label %68, label %66

66:                                               ; preds = %62
  %67 = tail call i64 @iwjsreg_sync(ptr noundef nonnull %0)
  br label %68

68:                                               ; preds = %16, %66, %62, %61, %3, %5
  %.1 = phi i64 [ 70017, %5 ], [ 70017, %3 ], [ %19, %16 ], [ %.152, %61 ], [ %67, %66 ], [ 0, %62 ]
  ret i64 %.1
}

attributes #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 nofree nosync nounwind willreturn memory(none) "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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress 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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind allocsize(0,1) }
attributes #10 = { nounwind willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"iwjsreg", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !8, i64 40, !10, i64 96, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !11, i64 152, !12, i64 156}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"iwref_holder", !7, i64 0, !8, i64 8, !7, i64 16}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_Bool", !8, i64 0}
!13 = !{!6, !7, i64 128}
!14 = !{!6, !7, i64 144}
!15 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!16 = !{!7, !7, i64 0}
!17 = !{!18, !7, i64 24}
!18 = !{!"jbl_node", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !11, i64 32, !11, i64 36, !7, i64 40, !11, i64 48, !11, i64 52, !8, i64 56}
!19 = !{!18, !11, i64 32}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = !{!18, !11, i64 52}
!23 = !{!8, !8, i64 0}
!24 = !{!6, !12, i64 156}
!25 = !{!11, !11, i64 0}
!26 = !{!6, !7, i64 136}
!27 = !{!6, !11, i64 152}


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