; LLVM IR from specinfo-ua/UAPKI :: library/uapki/src/api (digest)

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

%"class.UapkiNS::ContentHasher" = type { i32, i32, ptr, i8, %"class.std::__cxx11::basic_string", ptr, i64, %"class.UapkiNS::SmartBA" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_digest(ptr noundef %0, ptr noundef %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca %"class.UapkiNS::ContentHasher", align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.UapkiNS::SmartBA", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 80, ptr %10) #5
  call void @_ZN7UapkiNS13ContentHasherC1Ev(ptr noundef nonnull align 8 dereferenceable(80) %10)
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = invoke ptr @json_object_get_string(ptr noundef %17, ptr noundef @.str)
          to label %19 unwind label %26

19:                                               ; preds = %2
  store ptr %18, ptr %7, align 8, !tbaa !5
  %20 = load ptr, ptr %7, align 8, !tbaa !5
  %21 = icmp ne ptr %20, null
  br i1 %21, label %30, label %22

22:                                               ; preds = %19
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = invoke ptr @json_object_get_string(ptr noundef %23, ptr noundef @.str.1)
          to label %25 unwind label %26

25:                                               ; preds = %22
  store ptr %24, ptr %8, align 8, !tbaa !5
  br label %30

26:                                               ; preds = %207, %204, %199, %193, %185, %119, %115, %109, %104, %101, %96, %90, %85, %82, %77, %71, %67, %56, %49, %37, %22, %2
  %27 = landingpad { ptr, i32 }
          cleanup
  %28 = extractvalue { ptr, i32 } %27, 0
  store ptr %28, ptr %11, align 8
  %29 = extractvalue { ptr, i32 } %27, 1
  store i32 %29, ptr %12, align 4
  br label %217

30:                                               ; preds = %25, %19
  %31 = load ptr, ptr %7, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %42, label %33

33:                                               ; preds = %30
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = icmp ne ptr %34, null
  br i1 %35, label %42, label %36

36:                                               ; preds = %33
  br label %37

37:                                               ; preds = %36
  store i32 4101, ptr %6, align 4, !tbaa !9
  %38 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.2, i64 noundef 59, i32 noundef %38, ptr noundef null)
          to label %39 unwind label %26

39:                                               ; preds = %37
  br label %213

40:                                               ; No predecessors!
  br label %41

41:                                               ; preds = %40
  br label %42

42:                                               ; preds = %41, %33, %30
  %43 = load ptr, ptr %7, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  br i1 %44, label %45, label %47

45:                                               ; preds = %42
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  br label %49

47:                                               ; preds = %42
  %48 = load ptr, ptr %8, align 8, !tbaa !5
  br label %49

49:                                               ; preds = %47, %45
  %50 = phi ptr [ %46, %45 ], [ %48, %47 ]
  %51 = invoke i32 @hash_from_oid(ptr noundef %50)
          to label %52 unwind label %26

52:                                               ; preds = %49
  store i32 %51, ptr %9, align 4, !tbaa !11
  %53 = load i32, ptr %9, align 4, !tbaa !11
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %61

55:                                               ; preds = %52
  br label %56

56:                                               ; preds = %55
  store i32 4110, ptr %6, align 4, !tbaa !9
  %57 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.2, i64 noundef 64, i32 noundef %57, ptr noundef null)
          to label %58 unwind label %26

58:                                               ; preds = %56
  br label %213

59:                                               ; No predecessors!
  br label %60

60:                                               ; preds = %59
  br label %61

61:                                               ; preds = %60, %52
  %62 = load ptr, ptr %5, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %65, label %67

65:                                               ; preds = %61
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  br label %71

67:                                               ; preds = %61
  %68 = load i32, ptr %9, align 4, !tbaa !11
  %69 = invoke ptr @hash_to_oid(i32 noundef %68)
          to label %70 unwind label %26

70:                                               ; preds = %67
  br label %71

71:                                               ; preds = %70, %65
  %72 = phi ptr [ %66, %65 ], [ %69, %70 ]
  %73 = invoke i32 @json_object_set_string(ptr noundef %62, ptr noundef @.str, ptr noundef %72)
          to label %74 unwind label %26

74:                                               ; preds = %71
  %75 = icmp ne i32 %73, 0
  br i1 %75, label %76, label %77

76:                                               ; preds = %74
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %213

77:                                               ; preds = %74
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %78, ptr noundef @.str.3, i32 noundef 2)
          to label %80 unwind label %26

80:                                               ; preds = %77
  br i1 %79, label %81, label %96

81:                                               ; preds = %80
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = invoke ptr @json_object_get_base64(ptr noundef %83, ptr noundef @.str.3)
          to label %85 unwind label %26

85:                                               ; preds = %82
  %86 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPK12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef %84, i1 noundef zeroext true)
          to label %87 unwind label %26

87:                                               ; preds = %85
  store i32 %86, ptr %6, align 4, !tbaa !9
  %88 = load i32, ptr %6, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %93

90:                                               ; preds = %87
  %91 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.2, i64 noundef 69, i32 noundef %91)
          to label %92 unwind label %26

92:                                               ; preds = %90
  br label %213

93:                                               ; preds = %87
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  br label %192

96:                                               ; preds = %80
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %97, ptr noundef @.str.4, i32 noundef 2)
          to label %99 unwind label %26

99:                                               ; preds = %96
  br i1 %98, label %100, label %115

100:                                              ; preds = %99
  br label %101

101:                                              ; preds = %100
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = invoke ptr @json_object_get_string(ptr noundef %102, ptr noundef @.str.4)
          to label %104 unwind label %26

104:                                              ; preds = %101
  %105 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKc(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef %103)
          to label %106 unwind label %26

106:                                              ; preds = %104
  store i32 %105, ptr %6, align 4, !tbaa !9
  %107 = load i32, ptr %6, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %112

109:                                              ; preds = %106
  %110 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.2, i64 noundef 72, i32 noundef %110)
          to label %111 unwind label %26

111:                                              ; preds = %109
  br label %213

112:                                              ; preds = %106
  br label %113

113:                                              ; preds = %112
  br label %114

114:                                              ; preds = %113
  br label %191

115:                                              ; preds = %99
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %116, ptr noundef @.str.5, i32 noundef 2)
          to label %118 unwind label %26

118:                                              ; preds = %115
  br i1 %117, label %119, label %184

119:                                              ; preds = %118
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %120, ptr noundef @.str.6, i32 noundef 3)
          to label %122 unwind label %26

122:                                              ; preds = %119
  br i1 %121, label %123, label %184

123:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  invoke void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %124 unwind label %146

124:                                              ; preds = %123
  %125 = load ptr, ptr %4, align 8, !tbaa !5
  %126 = invoke ptr @json_object_get_hex(ptr noundef %125, ptr noundef @.str.5)
          to label %127 unwind label %150

127:                                              ; preds = %124
  %128 = invoke noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %126)
          to label %129 unwind label %150

129:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %130 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %131 unwind label %154

131:                                              ; preds = %129
  %132 = invoke noundef ptr @_ZN7UapkiNS13ContentHasher7baToPtrEPK12ByteArray_st(ptr noundef %130)
          to label %133 unwind label %154

133:                                              ; preds = %131
  store ptr %132, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store i64 0, ptr %15, align 8, !tbaa !13
  %134 = load ptr, ptr %14, align 8, !tbaa !5
  %135 = icmp ne ptr %134, null
  br i1 %135, label %136, label %142

136:                                              ; preds = %133
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  %138 = invoke double @json_object_get_number(ptr noundef %137, ptr noundef @.str.6)
          to label %139 unwind label %158

139:                                              ; preds = %136
  %140 = invoke noundef zeroext i1 @_ZN7UapkiNS13ContentHasher12numberToSizeEdRm(double noundef %138, ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %141 unwind label %158

141:                                              ; preds = %139
  br i1 %140, label %164, label %142

142:                                              ; preds = %141, %133
  br label %143

143:                                              ; preds = %142
  store i32 4101, ptr %6, align 4, !tbaa !9
  %144 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.2, i64 noundef 83, i32 noundef %144, ptr noundef null)
          to label %145 unwind label %158

145:                                              ; preds = %143
  store i32 4, ptr %16, align 4
  br label %178

146:                                              ; preds = %123
  %147 = landingpad { ptr, i32 }
          cleanup
  %148 = extractvalue { ptr, i32 } %147, 0
  store ptr %148, ptr %11, align 8
  %149 = extractvalue { ptr, i32 } %147, 1
  store i32 %149, ptr %12, align 4
  br label %183

150:                                              ; preds = %127, %124
  %151 = landingpad { ptr, i32 }
          cleanup
  %152 = extractvalue { ptr, i32 } %151, 0
  store ptr %152, ptr %11, align 8
  %153 = extractvalue { ptr, i32 } %151, 1
  store i32 %153, ptr %12, align 4
  br label %182

154:                                              ; preds = %131, %129
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %11, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %12, align 4
  br label %181

158:                                              ; preds = %172, %165, %143, %139, %136
  %159 = landingpad { ptr, i32 }
          cleanup
  %160 = extractvalue { ptr, i32 } %159, 0
  store ptr %160, ptr %11, align 8
  %161 = extractvalue { ptr, i32 } %159, 1
  store i32 %161, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %181

162:                                              ; No predecessors!
  br label %163

163:                                              ; preds = %162
  br label %164

164:                                              ; preds = %163, %141
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %14, align 8, !tbaa !5
  %167 = load i64, ptr %15, align 8, !tbaa !13
  %168 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKhm(ptr noundef nonnull align 8 dereferenceable(80) %10, ptr noundef %166, i64 noundef %167)
          to label %169 unwind label %158

169:                                              ; preds = %165
  store i32 %168, ptr %6, align 4, !tbaa !9
  %170 = load i32, ptr %6, align 4, !tbaa !9
  %171 = icmp ne i32 %170, 0
  br i1 %171, label %172, label %175

172:                                              ; preds = %169
  %173 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.2, i64 noundef 85, i32 noundef %173)
          to label %174 unwind label %158

174:                                              ; preds = %172
  store i32 4, ptr %16, align 4
  br label %178

175:                                              ; preds = %169
  br label %176

176:                                              ; preds = %175
  br label %177

177:                                              ; preds = %176
  store i32 0, ptr %16, align 4
  br label %178

178:                                              ; preds = %177, %174, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  %179 = load i32, ptr %16, align 4
  switch i32 %179, label %215 [
    i32 0, label %180
    i32 4, label %213
  ]

180:                                              ; preds = %178
  br label %190

181:                                              ; preds = %158, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %182

182:                                              ; preds = %181, %150
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #5
  br label %183

183:                                              ; preds = %182, %146
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %217

184:                                              ; preds = %122, %118
  br label %185

185:                                              ; preds = %184
  store i32 4101, ptr %6, align 4, !tbaa !9
  %186 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.2, i64 noundef 88, i32 noundef %186, ptr noundef null)
          to label %187 unwind label %26

187:                                              ; preds = %185
  br label %213

188:                                              ; No predecessors!
  br label %189

189:                                              ; preds = %188
  br label %190

190:                                              ; preds = %189, %180
  br label %191

191:                                              ; preds = %190, %114
  br label %192

192:                                              ; preds = %191, %95
  br label %193

193:                                              ; preds = %192
  %194 = load i32, ptr %9, align 4, !tbaa !11
  %195 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher6digestE7HashAlg(ptr noundef nonnull align 8 dereferenceable(80) %10, i32 noundef %194)
          to label %196 unwind label %26

196:                                              ; preds = %193
  store i32 %195, ptr %6, align 4, !tbaa !9
  %197 = load i32, ptr %6, align 4, !tbaa !9
  %198 = icmp ne i32 %197, 0
  br i1 %198, label %199, label %202

199:                                              ; preds = %196
  %200 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.2, i64 noundef 91, i32 noundef %200)
          to label %201 unwind label %26

201:                                              ; preds = %199
  br label %213

202:                                              ; preds = %196
  br label %203

203:                                              ; preds = %202
  br label %204

204:                                              ; preds = %203
  %205 = load ptr, ptr %5, align 8, !tbaa !5
  %206 = invoke noundef ptr @_ZNK7UapkiNS13ContentHasher12getHashValueEv(ptr noundef nonnull align 8 dereferenceable(80) %10)
          to label %207 unwind label %26

207:                                              ; preds = %204
  %208 = invoke i32 @json_object_set_base64(ptr noundef %205, ptr noundef @.str.3, ptr noundef %206)
          to label %209 unwind label %26

209:                                              ; preds = %207
  %210 = icmp ne i32 %208, 0
  br i1 %210, label %211, label %212

211:                                              ; preds = %209
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %213

212:                                              ; preds = %209
  br label %213

213:                                              ; preds = %212, %211, %201, %187, %178, %111, %92, %76, %58, %39
  %214 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %214, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %215

215:                                              ; preds = %213, %178
  call void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  %216 = load i32, ptr %3, align 4
  ret i32 %216

217:                                              ; preds = %183, %26
  call void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %10) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %218

218:                                              ; preds = %217
  %219 = load ptr, ptr %11, align 8
  %220 = load i32, ptr %12, align 4
  %221 = insertvalue { ptr, i32 } poison, ptr %219, 0
  %222 = insertvalue { ptr, i32 } %221, i32 %220, 1
  resume { ptr, i32 } %222
}

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

declare void @_ZN7UapkiNS13ContentHasherC1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

declare void @stacktrace_create(ptr noundef, i64 noundef, i32 noundef, ptr noundef) #2

declare i32 @hash_from_oid(ptr noundef) #2

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

declare ptr @hash_to_oid(i32 noundef) #2

declare noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef, ptr noundef, i32 noundef) #2

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPK12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i1 noundef zeroext) #2

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

declare void @stacktrace_add(ptr noundef, i64 noundef, i32 noundef) #2

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKc(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3 align 2

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

declare noundef ptr @_ZN7UapkiNS13ContentHasher7baToPtrEPK12ByteArray_st(ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

declare noundef zeroext i1 @_ZN7UapkiNS13ContentHasher12numberToSizeEdRm(double noundef, ptr noundef nonnull align 8 dereferenceable(8)) #2

declare double @json_object_get_number(ptr noundef, ptr noundef) #2

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKhm(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare noundef i32 @_ZN7UapkiNS13ContentHasher6digestE7HashAlg(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS13ContentHasher12getHashValueEv(ptr noundef nonnull align 8 dereferenceable(80)) #3 align 2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4

attributes #0 = { mustprogress 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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 }

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTS7HashAlg", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"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"

%"class.UapkiNS::ContentHasher" = type { i32, i32, ptr, i8, %"class.std::__cxx11::basic_string", ptr, i64, %"class.UapkiNS::SmartBA" }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.UapkiNS::SmartBA" = type { ptr }

@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [5 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_digest(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.UapkiNS::ContentHasher", align 8
  %4 = alloca %"class.UapkiNS::SmartBA", align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %3) #5
  call void @_ZN7UapkiNS13ContentHasherC1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %6 = invoke ptr @json_object_get_string(ptr noundef %0, ptr noundef nonnull @.str)
          to label %7 unwind label %10

7:                                                ; preds = %2
  %.not76 = icmp eq ptr %6, null
  br i1 %.not76, label %8, label %.thread

8:                                                ; preds = %7
  %9 = invoke ptr @json_object_get_string(ptr noundef %0, ptr noundef nonnull @.str.1)
          to label %12 unwind label %10

10:                                               ; preds = %.invoke, %80, %79, %76, %46, %43, %42, %39, %37, %34, %33, %30, %28, %25, %21, %19, %17, %.thread, %8, %2
  %11 = landingpad { ptr, i32 }
          cleanup
  br label %85

12:                                               ; preds = %8
  %.not77 = icmp eq ptr %9, null
  br i1 %.not77, label %.invoke, label %.thread

.thread:                                          ; preds = %7, %12
  %13 = phi ptr [ %9, %12 ], [ %6, %7 ]
  %14 = invoke i32 @hash_from_oid(ptr noundef nonnull %13)
          to label %15 unwind label %10

15:                                               ; preds = %.thread
  %16 = icmp eq i32 %14, 0
  br i1 %16, label %17, label %18

17:                                               ; preds = %15
  invoke void @stacktrace_create(ptr noundef nonnull @.str.2, i64 noundef 64, i32 noundef 4110, ptr noundef null)
          to label %84 unwind label %10

18:                                               ; preds = %15
  br i1 %.not76, label %19, label %21

19:                                               ; preds = %18
  %20 = invoke ptr @hash_to_oid(i32 noundef %14)
          to label %21 unwind label %10

21:                                               ; preds = %18, %19
  %22 = phi ptr [ %20, %19 ], [ %6, %18 ]
  %23 = invoke i32 @json_object_set_string(ptr noundef %1, ptr noundef nonnull @.str, ptr noundef %22)
          to label %24 unwind label %10

24:                                               ; preds = %21
  %.not = icmp eq i32 %23, 0
  br i1 %.not, label %25, label %84

25:                                               ; preds = %24
  %26 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.3, i32 noundef 2)
          to label %27 unwind label %10

27:                                               ; preds = %25
  br i1 %26, label %28, label %34

28:                                               ; preds = %27
  %29 = invoke ptr @json_object_get_base64(ptr noundef %0, ptr noundef nonnull @.str.3)
          to label %30 unwind label %10

30:                                               ; preds = %28
  %31 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPK12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef %29, i1 noundef zeroext true)
          to label %32 unwind label %10

32:                                               ; preds = %30
  %.not64 = icmp eq i32 %31, 0
  br i1 %.not64, label %76, label %33

33:                                               ; preds = %32
  invoke void @stacktrace_add(ptr noundef nonnull @.str.2, i64 noundef 69, i32 noundef %31)
          to label %84 unwind label %10

34:                                               ; preds = %27
  %35 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.4, i32 noundef 2)
          to label %36 unwind label %10

36:                                               ; preds = %34
  br i1 %35, label %37, label %43

37:                                               ; preds = %36
  %38 = invoke ptr @json_object_get_string(ptr noundef %0, ptr noundef nonnull @.str.4)
          to label %39 unwind label %10

39:                                               ; preds = %37
  %40 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKc(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef %38)
          to label %41 unwind label %10

41:                                               ; preds = %39
  %.not63 = icmp eq i32 %40, 0
  br i1 %.not63, label %76, label %42

42:                                               ; preds = %41
  invoke void @stacktrace_add(ptr noundef nonnull @.str.2, i64 noundef 72, i32 noundef %40)
          to label %84 unwind label %10

43:                                               ; preds = %36
  %44 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.5, i32 noundef 2)
          to label %45 unwind label %10

45:                                               ; preds = %43
  br i1 %44, label %46, label %.invoke

46:                                               ; preds = %45
  %47 = invoke noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef %0, ptr noundef nonnull @.str.6, i32 noundef 3)
          to label %48 unwind label %10

48:                                               ; preds = %46
  br i1 %47, label %49, label %.invoke

49:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %50 = invoke ptr @json_object_get_hex(ptr noundef %0, ptr noundef nonnull @.str.5)
          to label %51 unwind label %62

51:                                               ; preds = %49
  %52 = call noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef %50)
  %53 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %4)
  %54 = invoke noundef ptr @_ZN7UapkiNS13ContentHasher7baToPtrEPK12ByteArray_st(ptr noundef %53)
          to label %55 unwind label %64

55:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  store i64 0, ptr %5, align 8, !tbaa !5
  %.not59 = icmp eq ptr %54, null
  br i1 %.not59, label %61, label %56

56:                                               ; preds = %55
  %57 = invoke double @json_object_get_number(ptr noundef %0, ptr noundef nonnull @.str.6)
          to label %58 unwind label %66

58:                                               ; preds = %56
  %59 = invoke noundef zeroext i1 @_ZN7UapkiNS13ContentHasher12numberToSizeEdRm(double noundef %57, ptr noundef nonnull align 8 dereferenceable(8) %5)
          to label %60 unwind label %66

60:                                               ; preds = %58
  br i1 %59, label %68, label %61

61:                                               ; preds = %55, %60
  invoke void @stacktrace_create(ptr noundef nonnull @.str.2, i64 noundef 83, i32 noundef 4101, ptr noundef null)
          to label %.thread72 unwind label %66

62:                                               ; preds = %49
  %63 = landingpad { ptr, i32 }
          cleanup
  br label %74

64:                                               ; preds = %51
  %65 = landingpad { ptr, i32 }
          cleanup
  br label %74

66:                                               ; preds = %72, %68, %61, %58, %56
  %67 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br label %74

68:                                               ; preds = %60
  %69 = load i64, ptr %5, align 8, !tbaa !5
  %70 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKhm(ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull %54, i64 noundef %69)
          to label %71 unwind label %66

71:                                               ; preds = %68
  %.not60 = icmp eq i32 %70, 0
  br i1 %.not60, label %73, label %72

72:                                               ; preds = %71
  invoke void @stacktrace_add(ptr noundef nonnull @.str.2, i64 noundef 85, i32 noundef %70)
          to label %.thread72 unwind label %66

.thread72:                                        ; preds = %61, %72
  %.048.ph = phi i32 [ %70, %72 ], [ 4101, %61 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %84

73:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %76

74:                                               ; preds = %64, %66, %62
  %.pn.pn = phi { ptr, i32 } [ %63, %62 ], [ %67, %66 ], [ %65, %64 ]
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %85

.invoke:                                          ; preds = %48, %45, %12
  %75 = phi i64 [ 59, %12 ], [ 88, %45 ], [ 88, %48 ]
  invoke void @stacktrace_create(ptr noundef nonnull @.str.2, i64 noundef %75, i32 noundef 4101, ptr noundef null)
          to label %84 unwind label %10

76:                                               ; preds = %73, %32, %41
  %77 = invoke noundef i32 @_ZN7UapkiNS13ContentHasher6digestE7HashAlg(ptr noundef nonnull align 8 dereferenceable(80) %3, i32 noundef %14)
          to label %78 unwind label %10

78:                                               ; preds = %76
  %.not65 = icmp eq i32 %77, 0
  br i1 %.not65, label %80, label %79

79:                                               ; preds = %78
  invoke void @stacktrace_add(ptr noundef nonnull @.str.2, i64 noundef 91, i32 noundef %77)
          to label %84 unwind label %10

80:                                               ; preds = %78
  %81 = call noundef ptr @_ZNK7UapkiNS13ContentHasher12getHashValueEv(ptr noundef nonnull align 8 dereferenceable(80) %3)
  %82 = invoke i32 @json_object_set_base64(ptr noundef %1, ptr noundef nonnull @.str.3, ptr noundef %81)
          to label %83 unwind label %10

83:                                               ; preds = %80
  %.not66 = icmp eq i32 %82, 0
  %spec.select = select i1 %.not66, i32 0, i32 4113
  br label %84

84:                                               ; preds = %.invoke, %.thread72, %83, %17, %33, %42, %79, %24
  %.149 = phi i32 [ 4110, %17 ], [ %31, %33 ], [ %77, %79 ], [ %40, %42 ], [ 4113, %24 ], [ %spec.select, %83 ], [ %.048.ph, %.thread72 ], [ 4101, %.invoke ]
  call void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  ret i32 %.149

85:                                               ; preds = %74, %10
  %.pn67 = phi { ptr, i32 } [ %11, %10 ], [ %.pn.pn, %74 ]
  call void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80) %3) #5
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %3) #5
  resume { ptr, i32 } %.pn67
}

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

declare void @_ZN7UapkiNS13ContentHasherC1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

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

declare i32 @hash_from_oid(ptr noundef) local_unnamed_addr #2

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

declare ptr @hash_to_oid(i32 noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN12ParsonHelper18jsonObjectHasValueEP13json_object_tPKci(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPK12ByteArray_stb(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i1 noundef zeroext) local_unnamed_addr #2

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

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

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKc(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN7UapkiNS7SmartBA3setEP12ByteArray_st(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3 align 2

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

declare noundef ptr @_ZN7UapkiNS13ContentHasher7baToPtrEPK12ByteArray_st(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN7UapkiNS13ContentHasher12numberToSizeEdRm(double noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

declare double @json_object_get_number(ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN7UapkiNS13ContentHasher10setContentEPKhm(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef, i64 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

declare noundef i32 @_ZN7UapkiNS13ContentHasher6digestE7HashAlg(ptr noundef nonnull align 8 dereferenceable(80), i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK7UapkiNS13ContentHasher12getHashValueEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #3 align 2

; Function Attrs: nounwind
declare void @_ZN7UapkiNS13ContentHasherD1Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4

attributes #0 = { mustprogress 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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "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 }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SROAPass,SimplifyCFGPass