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

; 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::SmartBA" = type { ptr }
%"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] }

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @uapki_asn1_encode(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 ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca %"class.UapkiNS::SmartBA", align 8
  %15 = alloca %"class.std::__cxx11::basic_string", align 8
  %16 = alloca i8, align 1
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::__cxx11::basic_string", align 8
  %20 = alloca %"class.std::__cxx11::basic_string", align 8
  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) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = call ptr @json_object_get_array(ptr noundef %21, ptr noundef @.str)
  store ptr %22, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr null, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %23 = load ptr, ptr %7, align 8, !tbaa !5
  %24 = call i64 @json_array_get_count(ptr noundef %23)
  store i64 %24, ptr %10, align 8, !tbaa !11
  %25 = load i64, ptr %10, align 8, !tbaa !11
  %26 = icmp eq i64 %25, 0
  br i1 %26, label %27, label %32

27:                                               ; preds = %2
  br label %28

28:                                               ; preds = %27
  store i32 4101, ptr %6, align 4, !tbaa !9
  %29 = load i32, ptr %6, align 4, !tbaa !9
  call void @stacktrace_create(ptr noundef @.str.1, i64 noundef 261, i32 noundef %29, ptr noundef null)
  br label %227

30:                                               ; No predecessors!
  br label %31

31:                                               ; preds = %30
  br label %32

32:                                               ; preds = %31, %2
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call ptr @json_value_init_array()
  %35 = call i32 @json_object_set_value(ptr noundef %33, ptr noundef @.str.2, ptr noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %32
  store i32 4113, ptr %6, align 4, !tbaa !9
  br label %227

38:                                               ; preds = %32
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = call ptr @json_object_get_array(ptr noundef %39, ptr noundef @.str.2)
  store ptr %40, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  store i64 0, ptr %11, align 8, !tbaa !11
  br label %41

41:                                               ; preds = %220, %38
  %42 = load i64, ptr %11, align 8, !tbaa !11
  %43 = load i64, ptr %10, align 8, !tbaa !11
  %44 = icmp ult i64 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %12, align 4
  br label %224

46:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14)
  call void @llvm.lifetime.start.p0(i64 32, ptr %15) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #4
  store i8 0, ptr %16, align 1, !tbaa !13
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = invoke ptr @json_value_init_object()
          to label %49 unwind label %54

49:                                               ; preds = %46
  %50 = invoke i32 @json_array_append_value(ptr noundef %47, ptr noundef %48)
          to label %51 unwind label %54

51:                                               ; preds = %49
  %52 = icmp ne i32 %50, 0
  br i1 %52, label %53, label %58

53:                                               ; preds = %51
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %12, align 4
  br label %217

54:                                               ; preds = %212, %209, %206, %191, %181, %174, %169, %165, %158, %153, %149, %142, %137, %134, %127, %122, %120, %113, %108, %105, %98, %93, %90, %83, %78, %75, %69, %66, %62, %58, %49, %46
  %55 = landingpad { ptr, i32 }
          cleanup
  %56 = extractvalue { ptr, i32 } %55, 0
  store ptr %56, ptr %17, align 8
  %57 = extractvalue { ptr, i32 } %55, 1
  store i32 %57, ptr %18, align 4
  br label %223

58:                                               ; preds = %51
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  %60 = load i64, ptr %11, align 8, !tbaa !11
  %61 = invoke ptr @json_array_get_object(ptr noundef %59, i64 noundef %60)
          to label %62 unwind label %54

62:                                               ; preds = %58
  store ptr %61, ptr %9, align 8, !tbaa !5
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = load i64, ptr %11, align 8, !tbaa !11
  %65 = invoke ptr @json_array_get_object(ptr noundef %63, i64 noundef %64)
          to label %66 unwind label %54

66:                                               ; preds = %62
  store ptr %65, ptr %13, align 8, !tbaa !5
  %67 = load ptr, ptr %13, align 8, !tbaa !5
  %68 = invoke ptr @json_object_get_string(ptr noundef %67, ptr noundef @.str.3)
          to label %69 unwind label %54

69:                                               ; preds = %66
  %70 = invoke noundef zeroext i8 @_ZL23asn1_tagname_to_tagcodePKc(ptr noundef %68)
          to label %71 unwind label %54

71:                                               ; preds = %69
  store i8 %70, ptr %16, align 1, !tbaa !13
  %72 = load i8, ptr %16, align 1, !tbaa !13
  %73 = zext i8 %72 to i32
  switch i32 %73, label %180 [
    i32 1, label %74
    i32 2, label %89
    i32 4, label %104
    i32 5, label %119
    i32 6, label %133
    i32 12, label %148
    i32 19, label %148
    i32 22, label %148
    i32 23, label %164
    i32 24, label %164
  ]

74:                                               ; preds = %71
  br label %75

75:                                               ; preds = %74
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %78 unwind label %54

78:                                               ; preds = %75
  %79 = invoke noundef i32 @_ZL19asn1_encode_booleanP13json_object_tPP12ByteArray_st(ptr noundef %76, ptr noundef %77)
          to label %80 unwind label %54

80:                                               ; preds = %78
  store i32 %79, ptr %6, align 4, !tbaa !9
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 281, i32 noundef %84)
          to label %85 unwind label %54

85:                                               ; preds = %83
  store i32 4, ptr %12, align 4
  br label %217

86:                                               ; preds = %80
  br label %87

87:                                               ; preds = %86
  br label %88

88:                                               ; preds = %87
  br label %186

89:                                               ; preds = %71
  br label %90

90:                                               ; preds = %89
  %91 = load ptr, ptr %13, align 8, !tbaa !5
  %92 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %93 unwind label %54

93:                                               ; preds = %90
  %94 = invoke noundef i32 @_ZL19asn1_encode_integerP13json_object_tPP12ByteArray_st(ptr noundef %91, ptr noundef %92)
          to label %95 unwind label %54

95:                                               ; preds = %93
  store i32 %94, ptr %6, align 4, !tbaa !9
  %96 = load i32, ptr %6, align 4, !tbaa !9
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %95
  %99 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 284, i32 noundef %99)
          to label %100 unwind label %54

100:                                              ; preds = %98
  store i32 4, ptr %12, align 4
  br label %217

101:                                              ; preds = %95
  br label %102

102:                                              ; preds = %101
  br label %103

103:                                              ; preds = %102
  br label %186

104:                                              ; preds = %71
  br label %105

105:                                              ; preds = %104
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %108 unwind label %54

108:                                              ; preds = %105
  %109 = invoke noundef i32 @_ZL23asn1_encode_octetstringP13json_object_tPP12ByteArray_st(ptr noundef %106, ptr noundef %107)
          to label %110 unwind label %54

110:                                              ; preds = %108
  store i32 %109, ptr %6, align 4, !tbaa !9
  %111 = load i32, ptr %6, align 4, !tbaa !9
  %112 = icmp ne i32 %111, 0
  br i1 %112, label %113, label %116

113:                                              ; preds = %110
  %114 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 287, i32 noundef %114)
          to label %115 unwind label %54

115:                                              ; preds = %113
  store i32 4, ptr %12, align 4
  br label %217

116:                                              ; preds = %110
  br label %117

117:                                              ; preds = %116
  br label %118

118:                                              ; preds = %117
  br label %186

119:                                              ; preds = %71
  br label %120

120:                                              ; preds = %119
  %121 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %122 unwind label %54

122:                                              ; preds = %120
  %123 = invoke noundef i32 @_ZL16asn1_encode_nullPP12ByteArray_st(ptr noundef %121)
          to label %124 unwind label %54

124:                                              ; preds = %122
  store i32 %123, ptr %6, align 4, !tbaa !9
  %125 = load i32, ptr %6, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 0
  br i1 %126, label %127, label %130

127:                                              ; preds = %124
  %128 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 290, i32 noundef %128)
          to label %129 unwind label %54

129:                                              ; preds = %127
  store i32 4, ptr %12, align 4
  br label %217

130:                                              ; preds = %124
  br label %131

131:                                              ; preds = %130
  br label %132

132:                                              ; preds = %131
  br label %186

133:                                              ; preds = %71
  br label %134

134:                                              ; preds = %133
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %137 unwind label %54

137:                                              ; preds = %134
  %138 = invoke noundef i32 @_ZL15asn1_encode_oidP13json_object_tPP12ByteArray_st(ptr noundef %135, ptr noundef %136)
          to label %139 unwind label %54

139:                                              ; preds = %137
  store i32 %138, ptr %6, align 4, !tbaa !9
  %140 = load i32, ptr %6, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %145

142:                                              ; preds = %139
  %143 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 293, i32 noundef %143)
          to label %144 unwind label %54

144:                                              ; preds = %142
  store i32 4, ptr %12, align 4
  br label %217

145:                                              ; preds = %139
  br label %146

146:                                              ; preds = %145
  br label %147

147:                                              ; preds = %146
  br label %186

148:                                              ; preds = %71, %71, %71
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %13, align 8, !tbaa !5
  %151 = load i8, ptr %16, align 1, !tbaa !13
  %152 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %153 unwind label %54

153:                                              ; preds = %149
  %154 = invoke noundef i32 @_ZL18asn1_encode_stringP13json_object_thPP12ByteArray_st(ptr noundef %150, i8 noundef zeroext %151, ptr noundef %152)
          to label %155 unwind label %54

155:                                              ; preds = %153
  store i32 %154, ptr %6, align 4, !tbaa !9
  %156 = load i32, ptr %6, align 4, !tbaa !9
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %158, label %161

158:                                              ; preds = %155
  %159 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 298, i32 noundef %159)
          to label %160 unwind label %54

160:                                              ; preds = %158
  store i32 4, ptr %12, align 4
  br label %217

161:                                              ; preds = %155
  br label %162

162:                                              ; preds = %161
  br label %163

163:                                              ; preds = %162
  br label %186

164:                                              ; preds = %71, %71
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %13, align 8, !tbaa !5
  %167 = load i8, ptr %16, align 1, !tbaa !13
  %168 = invoke noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %169 unwind label %54

169:                                              ; preds = %165
  %170 = invoke noundef i32 @_ZL16asn1_encode_timeP13json_object_thPP12ByteArray_st(ptr noundef %166, i8 noundef zeroext %167, ptr noundef %168)
          to label %171 unwind label %54

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

174:                                              ; preds = %171
  %175 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_add(ptr noundef @.str.1, i64 noundef 302, i32 noundef %175)
          to label %176 unwind label %54

176:                                              ; preds = %174
  store i32 4, ptr %12, align 4
  br label %217

177:                                              ; preds = %171
  br label %178

178:                                              ; preds = %177
  br label %179

179:                                              ; preds = %178
  br label %186

180:                                              ; preds = %71
  br label %181

181:                                              ; preds = %180
  store i32 4118, ptr %6, align 4, !tbaa !9
  %182 = load i32, ptr %6, align 4, !tbaa !9
  invoke void @stacktrace_create(ptr noundef @.str.1, i64 noundef 305, i32 noundef %182, ptr noundef null)
          to label %183 unwind label %54

183:                                              ; preds = %181
  store i32 4, ptr %12, align 4
  br label %217

184:                                              ; No predecessors!
  br label %185

185:                                              ; preds = %184
  br label %186

186:                                              ; preds = %185, %179, %163, %147, %132, %118, %103, %88
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #4
  %187 = load ptr, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %20) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  invoke void @_ZN12ParsonHelper19jsonObjectGetStringEP13json_object_tPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8 %19, ptr noundef %187, ptr noundef @.str.4, ptr noundef nonnull align 8 dereferenceable(32) %20)
          to label %188 unwind label %198

188:                                              ; preds = %186
  %189 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %19) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  %190 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  br i1 %190, label %203, label %191

191:                                              ; preds = %188
  %192 = load ptr, ptr %9, align 8, !tbaa !5
  %193 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  %194 = invoke i32 @json_object_set_string(ptr noundef %192, ptr noundef @.str.4, ptr noundef %193)
          to label %195 unwind label %54

195:                                              ; preds = %191
  %196 = icmp ne i32 %194, 0
  br i1 %196, label %197, label %202

197:                                              ; preds = %195
  store i32 4113, ptr %6, align 4, !tbaa !9
  store i32 4, ptr %12, align 4
  br label %217

198:                                              ; preds = %186
  %199 = landingpad { ptr, i32 }
          cleanup
  %200 = extractvalue { ptr, i32 } %199, 0
  store ptr %200, ptr %17, align 8
  %201 = extractvalue { ptr, i32 } %199, 1
  store i32 %201, ptr %18, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #4
  br label %223

202:                                              ; preds = %195
  br label %203

203:                                              ; preds = %202, %188
  %204 = load i32, ptr %6, align 4, !tbaa !9
  %205 = icmp eq i32 %204, 0
  br i1 %205, label %206, label %212

206:                                              ; preds = %203
  %207 = load ptr, ptr %9, align 8, !tbaa !5
  %208 = invoke noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %209 unwind label %54

209:                                              ; preds = %206
  %210 = invoke i32 @json_object_set_base64(ptr noundef %207, ptr noundef @.str.5, ptr noundef %208)
          to label %211 unwind label %54

211:                                              ; preds = %209
  br label %216

212:                                              ; preds = %203
  %213 = load ptr, ptr %9, align 8, !tbaa !5
  %214 = invoke noundef i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef %213, ptr noundef @.str.6, i1 noundef zeroext true)
          to label %215 unwind label %54

215:                                              ; preds = %212
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %216

216:                                              ; preds = %215, %211
  store i32 0, ptr %12, align 4
  br label %217

217:                                              ; preds = %216, %197, %183, %176, %160, %144, %129, %115, %100, %85, %53
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  %218 = load i32, ptr %12, align 4
  switch i32 %218, label %224 [
    i32 0, label %219
  ]

219:                                              ; preds = %217
  br label %220

220:                                              ; preds = %219
  %221 = load i64, ptr %11, align 8, !tbaa !11
  %222 = add i64 %221, 1
  store i64 %222, ptr %11, align 8, !tbaa !11
  br label %41, !llvm.loop !14

223:                                              ; preds = %198, %54
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %15) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %15) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %231

224:                                              ; preds = %217, %45
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  %225 = load i32, ptr %12, align 4
  switch i32 %225, label %229 [
    i32 5, label %226
    i32 4, label %227
  ]

226:                                              ; preds = %224
  br label %227

227:                                              ; preds = %226, %224, %37, %28
  %228 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %228, ptr %3, align 4
  store i32 1, ptr %12, align 4
  br label %229

229:                                              ; preds = %227, %224
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  %230 = load i32, ptr %3, align 4
  ret i32 %230

231:                                              ; preds = %223
  %232 = load ptr, ptr %17, align 8
  %233 = load i32, ptr %18, align 4
  %234 = insertvalue { ptr, i32 } poison, ptr %232, 0
  %235 = insertvalue { ptr, i32 } %234, i32 %233, 1
  resume { ptr, i32 } %235
}

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

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

declare i64 @json_array_get_count(ptr noundef) #2

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

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

declare ptr @json_value_init_array() #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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

declare ptr @json_value_init_object() #2

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i8 @_ZL23asn1_tagname_to_tagcodePKc(ptr noundef) #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16asn1_encode_nullPP12ByteArray_st(ptr noundef) #0

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL18asn1_encode_stringP13json_object_thPP12ByteArray_st(ptr noundef, i8 noundef zeroext, ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16asn1_encode_timeP13json_object_thPP12ByteArray_st(ptr noundef, i8 noundef zeroext, ptr noundef) #0

declare void @_ZN12ParsonHelper19jsonObjectGetStringEP13json_object_tPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) #2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 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 noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) #3 align 2

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

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

declare i32 @json_object_set_base64(ptr noundef, ptr noundef, 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 i32 @_ZN12ParsonHelper20jsonObjectSetBooleanEP13json_object_tPKcb(ptr noundef, ptr noundef, i1 noundef zeroext) #2

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

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 }

!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 = !{!"long", !7, i64 0}
!13 = !{!7, !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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::SmartBA" = type { ptr }
%"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] }

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @uapki_asn1_encode(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %"class.UapkiNS::SmartBA", align 8
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = tail call ptr @json_object_get_array(ptr noundef %0, ptr noundef nonnull @.str)
  %8 = tail call i64 @json_array_get_count(ptr noundef %7)
  %9 = icmp eq i64 %8, 0
  br i1 %9, label %10, label %11

10:                                               ; preds = %2
  tail call void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 261, i32 noundef 4101, ptr noundef null)
  br label %.loopexit

11:                                               ; preds = %2
  %12 = tail call ptr @json_value_init_array()
  %13 = tail call i32 @json_object_set_value(ptr noundef %1, ptr noundef nonnull @.str.2, ptr noundef %12)
  %.not = icmp eq i32 %13, 0
  br i1 %.not, label %14, label %.loopexit

14:                                               ; preds = %11
  %15 = tail call ptr @json_object_get_array(ptr noundef %1, ptr noundef nonnull @.str.2)
  br label %16

16:                                               ; preds = %81, %14
  %.05180 = phi i64 [ 0, %14 ], [ %82, %81 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  call void @_ZN7UapkiNS7SmartBAC2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %17 = invoke ptr @json_value_init_object()
          to label %18 unwind label %21

18:                                               ; preds = %16
  %19 = invoke i32 @json_array_append_value(ptr noundef %15, ptr noundef %17)
          to label %20 unwind label %21

20:                                               ; preds = %18
  %.not70 = icmp eq i32 %19, 0
  br i1 %.not70, label %23, label %81

21:                                               ; preds = %78, %72, %67, %66, %62, %61, %57, %56, %52, %51, %47, %46, %42, %41, %37, %36, %32, %29, %27, %25, %23, %18, %16
  %22 = landingpad { ptr, i32 }
          cleanup
  br label %83

23:                                               ; preds = %20
  %24 = invoke ptr @json_array_get_object(ptr noundef %15, i64 noundef %.05180)
          to label %25 unwind label %21

25:                                               ; preds = %23
  %26 = invoke ptr @json_array_get_object(ptr noundef %7, i64 noundef %.05180)
          to label %27 unwind label %21

27:                                               ; preds = %25
  %28 = invoke ptr @json_object_get_string(ptr noundef %26, ptr noundef nonnull @.str.3)
          to label %29 unwind label %21

29:                                               ; preds = %27
  %30 = invoke noundef zeroext i8 @_ZL23asn1_tagname_to_tagcodePKc(ptr noundef %28)
          to label %31 unwind label %21

31:                                               ; preds = %29
  switch i8 %30, label %67 [
    i8 1, label %32
    i8 2, label %37
    i8 4, label %42
    i8 5, label %47
    i8 6, label %52
    i8 12, label %57
    i8 19, label %57
    i8 22, label %57
    i8 23, label %62
    i8 24, label %62
  ]

32:                                               ; preds = %31
  %33 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %34 = invoke noundef i32 @_ZL19asn1_encode_booleanP13json_object_tPP12ByteArray_st(ptr noundef %26, ptr noundef %33)
          to label %35 unwind label %21

35:                                               ; preds = %32
  %.not77 = icmp eq i32 %34, 0
  br i1 %.not77, label %68, label %36

36:                                               ; preds = %35
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 281, i32 noundef %34)
          to label %81 unwind label %21

37:                                               ; preds = %31
  %38 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %39 = invoke noundef i32 @_ZL19asn1_encode_integerP13json_object_tPP12ByteArray_st(ptr noundef %26, ptr noundef %38)
          to label %40 unwind label %21

40:                                               ; preds = %37
  %.not76 = icmp eq i32 %39, 0
  br i1 %.not76, label %68, label %41

41:                                               ; preds = %40
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 284, i32 noundef %39)
          to label %81 unwind label %21

42:                                               ; preds = %31
  %43 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %44 = invoke noundef i32 @_ZL23asn1_encode_octetstringP13json_object_tPP12ByteArray_st(ptr noundef %26, ptr noundef %43)
          to label %45 unwind label %21

45:                                               ; preds = %42
  %.not75 = icmp eq i32 %44, 0
  br i1 %.not75, label %68, label %46

46:                                               ; preds = %45
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 287, i32 noundef %44)
          to label %81 unwind label %21

47:                                               ; preds = %31
  %48 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %49 = invoke noundef i32 @_ZL16asn1_encode_nullPP12ByteArray_st(ptr noundef %48)
          to label %50 unwind label %21

50:                                               ; preds = %47
  %.not74 = icmp eq i32 %49, 0
  br i1 %.not74, label %68, label %51

51:                                               ; preds = %50
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 290, i32 noundef %49)
          to label %81 unwind label %21

52:                                               ; preds = %31
  %53 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %54 = invoke noundef i32 @_ZL15asn1_encode_oidP13json_object_tPP12ByteArray_st(ptr noundef %26, ptr noundef %53)
          to label %55 unwind label %21

55:                                               ; preds = %52
  %.not73 = icmp eq i32 %54, 0
  br i1 %.not73, label %68, label %56

56:                                               ; preds = %55
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 293, i32 noundef %54)
          to label %81 unwind label %21

57:                                               ; preds = %31, %31, %31
  %58 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %59 = invoke noundef i32 @_ZL18asn1_encode_stringP13json_object_thPP12ByteArray_st(ptr noundef %26, i8 noundef zeroext %30, ptr noundef %58)
          to label %60 unwind label %21

60:                                               ; preds = %57
  %.not72 = icmp eq i32 %59, 0
  br i1 %.not72, label %68, label %61

61:                                               ; preds = %60
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 298, i32 noundef %59)
          to label %81 unwind label %21

62:                                               ; preds = %31, %31
  %63 = call noundef ptr @_ZN7UapkiNS7SmartBAadEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %64 = invoke noundef i32 @_ZL16asn1_encode_timeP13json_object_thPP12ByteArray_st(ptr noundef %26, i8 noundef zeroext %30, ptr noundef %63)
          to label %65 unwind label %21

65:                                               ; preds = %62
  %.not71 = icmp eq i32 %64, 0
  br i1 %.not71, label %68, label %66

66:                                               ; preds = %65
  invoke void @stacktrace_add(ptr noundef nonnull @.str.1, i64 noundef 302, i32 noundef %64)
          to label %81 unwind label %21

67:                                               ; preds = %31
  invoke void @stacktrace_create(ptr noundef nonnull @.str.1, i64 noundef 305, i32 noundef 4118, ptr noundef null)
          to label %81 unwind label %21

68:                                               ; preds = %65, %60, %55, %50, %45, %40, %35
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %6) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  invoke void @_ZN12ParsonHelper19jsonObjectGetStringEP13json_object_tPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind nonnull writable sret(%"class.std::__cxx11::basic_string") align 8 %5, ptr noundef %26, ptr noundef nonnull @.str.4, ptr noundef nonnull align 8 dereferenceable(32) %6)
          to label %69 unwind label %76

69:                                               ; preds = %68
  %70 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEaSEOS4_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  %71 = call noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  br i1 %71, label %78, label %72

72:                                               ; preds = %69
  %73 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  %74 = invoke i32 @json_object_set_string(ptr noundef %24, ptr noundef nonnull @.str.4, ptr noundef %73)
          to label %75 unwind label %21

75:                                               ; preds = %72
  %.not78 = icmp eq i32 %74, 0
  br i1 %.not78, label %78, label %81

76:                                               ; preds = %68
  %77 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #4
  br label %83

78:                                               ; preds = %69, %75
  %79 = call noundef ptr @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8) %3)
  %80 = invoke i32 @json_object_set_base64(ptr noundef %24, ptr noundef nonnull @.str.5, ptr noundef %79)
          to label %81 unwind label %21

81:                                               ; preds = %78, %75, %67, %66, %61, %56, %51, %46, %41, %36, %20
  %.3 = phi i32 [ 4113, %20 ], [ %34, %36 ], [ %39, %41 ], [ %44, %46 ], [ %49, %51 ], [ %54, %56 ], [ %59, %61 ], [ %64, %66 ], [ 4118, %67 ], [ 4113, %75 ], [ 0, %78 ]
  %cond.not = phi i1 [ true, %20 ], [ true, %36 ], [ true, %41 ], [ true, %46 ], [ true, %51 ], [ true, %56 ], [ true, %61 ], [ true, %66 ], [ true, %67 ], [ true, %75 ], [ false, %78 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %82 = add nuw i64 %.05180, 1
  %exitcond.not = icmp eq i64 %82, %8
  %or.cond = select i1 %cond.not, i1 true, i1 %exitcond.not
  br i1 %or.cond, label %.loopexit, label %16, !llvm.loop !5

83:                                               ; preds = %76, %21
  %.pn = phi { ptr, i32 } [ %22, %21 ], [ %77, %76 ]
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #4
  call void @_ZN7UapkiNS7SmartBAD2Ev(ptr noundef nonnull align 8 dereferenceable(8) %3) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %81, %10, %11
  %.052 = phi i32 [ 4101, %10 ], [ 4113, %11 ], [ %.3, %81 ]
  ret i32 %.052
}

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

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

declare i64 @json_array_get_count(ptr noundef) local_unnamed_addr #2

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

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

declare ptr @json_value_init_array() 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 void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 2

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

declare ptr @json_value_init_object() local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

declare ptr @json_array_get_object(ptr noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare hidden noundef zeroext i8 @_ZL23asn1_tagname_to_tagcodePKc(ptr noundef) local_unnamed_addr #0

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16asn1_encode_nullPP12ByteArray_st(ptr noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL18asn1_encode_stringP13json_object_thPP12ByteArray_st(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZL16asn1_encode_timeP13json_object_thPP12ByteArray_st(ptr noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #0

declare void @_ZN12ParsonHelper19jsonObjectGetStringEP13json_object_tPKcRKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr dead_on_unwind writable sret(%"class.std::__cxx11::basic_string") align 8, ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #3 align 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 noundef zeroext i1 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #3 align 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 @_ZNK7UapkiNS7SmartBA3getEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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 }

!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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


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