; 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_i64(ptr noundef %0, ptr noundef %1, i64 noundef %2) #4 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %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
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store i64 0, ptr %8, align 8, !tbaa !9
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = icmp ne ptr %14, null
  br i1 %15, label %16, label %24

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

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

24:                                               ; preds = %21, %16, %3
  store i64 70017, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %179

25:                                               ; preds = %21
  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
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.iwjsreg, ptr %26, i32 0, i32 8
  %28 = load ptr, ptr %27, align 8, !tbaa !16
  %29 = load ptr, ptr %5, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.iwjsreg, ptr %29, i32 0, i32 10
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = call i64 %28(ptr noundef %31)
  %33 = icmp ne i64 %32, 0
  %34 = xor i1 %33, true
  %35 = xor i1 %34, true
  %36 = zext i1 %35 to i32
  %37 = sext i32 %36 to i64
  %38 = call i64 @llvm.expect.i64(i64 %37, i64 0)
  %39 = icmp ne i64 %38, 0
  br i1 %39, label %40, label %48

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

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

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

57:                                               ; preds = %54
  store i32 2, ptr %9, align 4
  br label %81

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

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

74:                                               ; preds = %63
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %75, ptr %10, align 8, !tbaa !5
  store i32 2, ptr %9, align 4
  br label %81

76:                                               ; preds = %63, %58
  br label %77

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

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

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

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

88:                                               ; preds = %85
  %89 = call ptr @__errno_location() #11
  %90 = load i32, ptr %89, align 4, !tbaa !25
  %91 = call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %90)
  store i64 %91, ptr %8, align 8, !tbaa !9
  br label %124

92:                                               ; preds = %85
  %93 = load ptr, ptr %10, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.jbl_node, ptr %93, i32 0, i32 8
  store i32 3, ptr %94, align 4, !tbaa !26
  %95 = load i64, ptr %7, align 8, !tbaa !9
  %96 = load ptr, ptr %10, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.jbl_node, ptr %96, i32 0, i32 9
  store i64 %95, ptr %97, align 8, !tbaa !27
  %98 = load ptr, ptr %6, align 8, !tbaa !5
  %99 = call noalias ptr @strdup(ptr noundef %98) #8
  store ptr %99, ptr %11, align 8, !tbaa !5
  %100 = icmp ne ptr %99, null
  br i1 %100, label %105, label %101

101:                                              ; preds = %92
  %102 = call ptr @__errno_location() #11
  %103 = load i32, ptr %102, align 4, !tbaa !25
  %104 = call i64 @iwrc_set_errno(i64 noundef 70013, i32 noundef %103)
  store i64 %104, ptr %8, align 8, !tbaa !9
  br label %124

105:                                              ; preds = %92
  br label %121

106:                                              ; preds = %82
  %107 = load ptr, ptr %10, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.jbl_node, ptr %107, i32 0, i32 8
  %109 = load i32, ptr %108, align 4, !tbaa !26
  %110 = icmp eq i32 %109, 5
  br i1 %110, label %111, label %115

111:                                              ; preds = %106
  %112 = load ptr, ptr %10, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.jbl_node, ptr %112, i32 0, i32 9
  %114 = load ptr, ptr %113, align 8, !tbaa !27
  call void @free(ptr noundef %114) #8
  br label %115

115:                                              ; preds = %111, %106
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.jbl_node, ptr %116, i32 0, i32 8
  store i32 3, ptr %117, align 4, !tbaa !26
  %118 = load i64, ptr %7, align 8, !tbaa !9
  %119 = load ptr, ptr %10, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.jbl_node, ptr %119, i32 0, i32 9
  store i64 %118, ptr %120, align 8, !tbaa !27
  br label %121

121:                                              ; preds = %115, %105
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.iwjsreg, ptr %122, i32 0, i32 12
  store i8 1, ptr %123, align 4, !tbaa !28
  br label %124

124:                                              ; preds = %121, %101, %88
  %125 = load i64, ptr %8, align 8, !tbaa !9
  %126 = icmp ne i64 %125, 0
  br i1 %126, label %127, label %129

127:                                              ; preds = %124
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %128) #8
  br label %146

129:                                              ; preds = %124
  %130 = load ptr, ptr %11, align 8, !tbaa !5
  %131 = icmp ne ptr %130, null
  br i1 %131, label %132, label %145

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

145:                                              ; preds = %132, %129
  br label %146

146:                                              ; preds = %145, %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  %147 = load ptr, ptr %5, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.iwjsreg, ptr %147, i32 0, i32 9
  %149 = load ptr, ptr %148, align 8, !tbaa !29
  %150 = load ptr, ptr %5, align 8, !tbaa !5
  %151 = getelementptr inbounds %struct.iwjsreg, ptr %150, i32 0, i32 10
  %152 = load ptr, ptr %151, align 8, !tbaa !17
  %153 = call i64 %149(ptr noundef %152)
  store i64 %153, ptr %13, align 8, !tbaa !9
  %154 = load i64, ptr %13, align 8, !tbaa !9
  %155 = icmp ne i64 %154, 0
  br i1 %155, label %156, label %164

156:                                              ; preds = %146
  %157 = load i64, ptr %8, align 8, !tbaa !9
  %158 = icmp ne i64 %157, 0
  br i1 %158, label %161, label %159

159:                                              ; preds = %156
  %160 = load i64, ptr %13, align 8, !tbaa !9
  store i64 %160, ptr %8, align 8, !tbaa !9
  br label %163

161:                                              ; preds = %156
  %162 = load i64, ptr %13, align 8, !tbaa !9
  call void @iwlog3(i32 noundef 0, i64 noundef %162, ptr noundef @.str.3, i32 noundef 580, ptr noundef @.str.4)
  br label %163

163:                                              ; preds = %161, %159
  br label %164

164:                                              ; preds = %163, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  %165 = load i64, ptr %8, align 8, !tbaa !9
  %166 = icmp ne i64 %165, 0
  br i1 %166, label %176, label %167

167:                                              ; preds = %164
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.iwjsreg, ptr %168, i32 0, i32 11
  %170 = load i32, ptr %169, align 8, !tbaa !30
  %171 = and i32 %170, 2
  %172 = icmp ne i32 %171, 0
  br i1 %172, label %173, label %176

173:                                              ; preds = %167
  %174 = load ptr, ptr %5, align 8, !tbaa !5
  %175 = call i64 @iwjsreg_sync(ptr noundef %174)
  store i64 %175, ptr %8, align 8, !tbaa !9
  br label %176

176:                                              ; preds = %173, %167, %164
  %177 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %177, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %178

178:                                              ; preds = %176, %40
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  br label %179

179:                                              ; preds = %178, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %180 = load i64, ptr %4, align 8
  ret i64 %180
}

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 = !{!"long", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"iwjsreg", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !13, i64 96, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !14, i64 152, !15, i64 156}
!13 = !{!"iwref_holder", !6, i64 0, !7, i64 8, !6, i64 16}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!12, !6, i64 128}
!17 = !{!12, !6, i64 144}
!18 = !{!19, !6, i64 40}
!19 = !{!"jbl_node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !14, i64 32, !14, i64 36, !6, i64 40, !14, i64 48, !14, i64 52, !7, i64 56}
!20 = !{!19, !6, i64 24}
!21 = !{!19, !14, i64 32}
!22 = !{!19, !6, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!14, !14, i64 0}
!26 = !{!19, !14, i64 52}
!27 = !{!7, !7, i64 0}
!28 = !{!12, !15, i64 156}
!29 = !{!12, !6, i64 136}
!30 = !{!12, !14, 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_i64(ptr noundef %0, ptr noundef readonly %1, i64 noundef %2) local_unnamed_addr #2 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %67, label %4

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

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

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

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

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

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

30:                                               ; preds = %.lr.ph, %24
  %.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 = %30, %19
  %31 = tail call noalias dereferenceable_or_null(64) ptr @calloc(i64 noundef 1, i64 noundef 64) #9
  %.not66 = icmp eq ptr %31, null
  br i1 %.not66, label %45, label %32

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

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

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

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

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

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

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

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

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

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

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

67:                                               ; preds = %15, %65, %61, %60, %3, %4
  %.1 = phi i64 [ 70017, %4 ], [ 70017, %3 ], [ %18, %15 ], [ %.152, %60 ], [ %66, %65 ], [ 0, %61 ]
  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