; LLVM IR from UBIC-repo/core :: CertStore/CertHelper.ll (ZN10CertHelper33calculateDSCExpirationDateForCertEP7x509_st)

; 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.Log = type { i8, i8, ptr, %"class.std::basic_filebuf" }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%struct.asn1_string_st = type { i32, i32, ptr, i64 }

@.str.80 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [12 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN10CertHelper20getCurrencyIdForCertEP7x509_st(ptr noundef) #0 align 2

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

declare void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256), i8 noundef zeroext) unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN10CertHelper33calculateDSCExpirationDateForCertEP7x509_st(ptr noundef %0) #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca i64, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i8, align 1
  %7 = alloca %class.Log, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca %class.Log, align 8
  %12 = alloca %class.Log, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca %class.Log, align 8
  %18 = alloca %class.Log, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = call ptr @X509_getm_notAfter(ptr noundef %23)
  store ptr %24, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = call ptr @X509_getm_notBefore(ptr noundef %25)
  store ptr %26, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %6) #5
  %27 = load ptr, ptr %3, align 8, !tbaa !5
  %28 = call noundef zeroext i8 @_ZN10CertHelper20getCurrencyIdForCertEP7x509_st(ptr noundef %27)
  store i8 %28, ptr %6, align 1, !tbaa !9
  %29 = load i8, ptr %6, align 1, !tbaa !9
  %30 = zext i8 %29 to i32
  %31 = icmp eq i32 %30, 0
  br i1 %31, label %32, label %43

32:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 256, ptr %7) #5
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %7, i8 noundef zeroext 0)
  %33 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %7, ptr noundef @.str.80)
          to label %34 unwind label %39

34:                                               ; preds = %32
  %35 = load i8, ptr %6, align 1, !tbaa !9
  %36 = zext i8 %35 to i32
  %37 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEi(ptr noundef nonnull align 8 dereferenceable(256) %33, i32 noundef %36)
          to label %38 unwind label %39

38:                                               ; preds = %34
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %7) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #5
  store i64 0, ptr %2, align 8
  store i32 1, ptr %10, align 4
  br label %265

39:                                               ; preds = %34, %32
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %8, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %9, align 4
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %7) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %7) #5
  br label %267

43:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 256, ptr %11) #5
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %11, i8 noundef zeroext 0)
  %44 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %11, ptr noundef @.str.81)
          to label %45 unwind label %191

45:                                               ; preds = %43
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.asn1_string_st, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !10
  %49 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256) %44, ptr noundef %48)
          to label %50 unwind label %191

50:                                               ; preds = %45
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %11) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr %12) #5
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %12, i8 noundef zeroext 0)
  %51 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %12, ptr noundef @.str.82)
          to label %52 unwind label %195

52:                                               ; preds = %50
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.asn1_string_st, ptr %53, i32 0, i32 2
  %55 = load ptr, ptr %54, align 8, !tbaa !10
  %56 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256) %51, ptr noundef %55)
          to label %57 unwind label %195

57:                                               ; preds = %52
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %12) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = call noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef %58)
  store i64 %59, ptr %13, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %60 = load ptr, ptr %5, align 8, !tbaa !5
  %61 = call noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef %60)
  store i64 %61, ptr %14, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %62 = load i64, ptr %13, align 8, !tbaa !14
  store i64 %62, ptr %15, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %63 = load i64, ptr %14, align 8, !tbaa !14
  store i64 %63, ptr %16, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 256, ptr %17) #5
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %17, i8 noundef zeroext 0)
  %64 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %17, ptr noundef @.str.81)
          to label %65 unwind label %199

65:                                               ; preds = %57
  %66 = load i64, ptr %15, align 8, !tbaa !14
  %67 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256) %64, i64 noundef %66)
          to label %68 unwind label %199

68:                                               ; preds = %65
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %17) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 256, ptr %18) #5
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %18, i8 noundef zeroext 0)
  %69 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %18, ptr noundef @.str.82)
          to label %70 unwind label %203

70:                                               ; preds = %68
  %71 = load i64, ptr %16, align 8, !tbaa !14
  %72 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256) %69, i64 noundef %71)
          to label %73 unwind label %203

73:                                               ; preds = %70
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %18) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 315360000, ptr %20, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 157680000, ptr %21, align 4, !tbaa !15
  %74 = load i8, ptr %6, align 1, !tbaa !9
  %75 = zext i8 %74 to i32
  %76 = icmp eq i32 %75, 3
  br i1 %76, label %189, label %77

77:                                               ; preds = %73
  %78 = load i8, ptr %6, align 1, !tbaa !9
  %79 = zext i8 %78 to i32
  %80 = icmp eq i32 %79, 2
  br i1 %80, label %189, label %81

81:                                               ; preds = %77
  %82 = load i8, ptr %6, align 1, !tbaa !9
  %83 = zext i8 %82 to i32
  %84 = icmp eq i32 %83, 8
  br i1 %84, label %189, label %85

85:                                               ; preds = %81
  %86 = load i8, ptr %6, align 1, !tbaa !9
  %87 = zext i8 %86 to i32
  %88 = icmp eq i32 %87, 4
  br i1 %88, label %189, label %89

89:                                               ; preds = %85
  %90 = load i8, ptr %6, align 1, !tbaa !9
  %91 = zext i8 %90 to i32
  %92 = icmp eq i32 %91, 7
  br i1 %92, label %189, label %93

93:                                               ; preds = %89
  %94 = load i8, ptr %6, align 1, !tbaa !9
  %95 = zext i8 %94 to i32
  %96 = icmp eq i32 %95, 5
  br i1 %96, label %189, label %97

97:                                               ; preds = %93
  %98 = load i8, ptr %6, align 1, !tbaa !9
  %99 = zext i8 %98 to i32
  %100 = icmp eq i32 %99, 14
  br i1 %100, label %189, label %101

101:                                              ; preds = %97
  %102 = load i8, ptr %6, align 1, !tbaa !9
  %103 = zext i8 %102 to i32
  %104 = icmp eq i32 %103, 20
  br i1 %104, label %189, label %105

105:                                              ; preds = %101
  %106 = load i8, ptr %6, align 1, !tbaa !9
  %107 = zext i8 %106 to i32
  %108 = icmp eq i32 %107, 11
  br i1 %108, label %189, label %109

109:                                              ; preds = %105
  %110 = load i8, ptr %6, align 1, !tbaa !9
  %111 = zext i8 %110 to i32
  %112 = icmp eq i32 %111, 15
  br i1 %112, label %189, label %113

113:                                              ; preds = %109
  %114 = load i8, ptr %6, align 1, !tbaa !9
  %115 = zext i8 %114 to i32
  %116 = icmp eq i32 %115, 6
  br i1 %116, label %189, label %117

117:                                              ; preds = %113
  %118 = load i8, ptr %6, align 1, !tbaa !9
  %119 = zext i8 %118 to i32
  %120 = icmp eq i32 %119, 12
  br i1 %120, label %189, label %121

121:                                              ; preds = %117
  %122 = load i8, ptr %6, align 1, !tbaa !9
  %123 = zext i8 %122 to i32
  %124 = icmp eq i32 %123, 19
  br i1 %124, label %189, label %125

125:                                              ; preds = %121
  %126 = load i8, ptr %6, align 1, !tbaa !9
  %127 = zext i8 %126 to i32
  %128 = icmp eq i32 %127, 25
  br i1 %128, label %189, label %129

129:                                              ; preds = %125
  %130 = load i8, ptr %6, align 1, !tbaa !9
  %131 = zext i8 %130 to i32
  %132 = icmp eq i32 %131, 1
  br i1 %132, label %189, label %133

133:                                              ; preds = %129
  %134 = load i8, ptr %6, align 1, !tbaa !9
  %135 = zext i8 %134 to i32
  %136 = icmp eq i32 %135, 28
  br i1 %136, label %189, label %137

137:                                              ; preds = %133
  %138 = load i8, ptr %6, align 1, !tbaa !9
  %139 = zext i8 %138 to i32
  %140 = icmp eq i32 %139, 27
  br i1 %140, label %189, label %141

141:                                              ; preds = %137
  %142 = load i8, ptr %6, align 1, !tbaa !9
  %143 = zext i8 %142 to i32
  %144 = icmp eq i32 %143, 26
  br i1 %144, label %189, label %145

145:                                              ; preds = %141
  %146 = load i8, ptr %6, align 1, !tbaa !9
  %147 = zext i8 %146 to i32
  %148 = icmp eq i32 %147, 33
  br i1 %148, label %189, label %149

149:                                              ; preds = %145
  %150 = load i8, ptr %6, align 1, !tbaa !9
  %151 = zext i8 %150 to i32
  %152 = icmp eq i32 %151, 32
  br i1 %152, label %189, label %153

153:                                              ; preds = %149
  %154 = load i8, ptr %6, align 1, !tbaa !9
  %155 = zext i8 %154 to i32
  %156 = icmp eq i32 %155, 30
  br i1 %156, label %189, label %157

157:                                              ; preds = %153
  %158 = load i8, ptr %6, align 1, !tbaa !9
  %159 = zext i8 %158 to i32
  %160 = icmp eq i32 %159, 35
  br i1 %160, label %189, label %161

161:                                              ; preds = %157
  %162 = load i8, ptr %6, align 1, !tbaa !9
  %163 = zext i8 %162 to i32
  %164 = icmp eq i32 %163, 29
  br i1 %164, label %189, label %165

165:                                              ; preds = %161
  %166 = load i8, ptr %6, align 1, !tbaa !9
  %167 = zext i8 %166 to i32
  %168 = icmp eq i32 %167, 34
  br i1 %168, label %189, label %169

169:                                              ; preds = %165
  %170 = load i8, ptr %6, align 1, !tbaa !9
  %171 = zext i8 %170 to i32
  %172 = icmp eq i32 %171, 36
  br i1 %172, label %189, label %173

173:                                              ; preds = %169
  %174 = load i8, ptr %6, align 1, !tbaa !9
  %175 = zext i8 %174 to i32
  %176 = icmp eq i32 %175, 37
  br i1 %176, label %189, label %177

177:                                              ; preds = %173
  %178 = load i8, ptr %6, align 1, !tbaa !9
  %179 = zext i8 %178 to i32
  %180 = icmp eq i32 %179, 38
  br i1 %180, label %189, label %181

181:                                              ; preds = %177
  %182 = load i8, ptr %6, align 1, !tbaa !9
  %183 = zext i8 %182 to i32
  %184 = icmp eq i32 %183, 39
  br i1 %184, label %189, label %185

185:                                              ; preds = %181
  %186 = load i8, ptr %6, align 1, !tbaa !9
  %187 = zext i8 %186 to i32
  %188 = icmp eq i32 %187, 10
  br i1 %188, label %189, label %207

189:                                              ; preds = %185, %181, %177, %173, %169, %165, %161, %157, %153, %149, %145, %141, %137, %133, %129, %125, %121, %117, %113, %109, %105, %101, %97, %93, %89, %85, %81, %77, %73
  %190 = load i32, ptr %20, align 4, !tbaa !15
  store i32 %190, ptr %19, align 4, !tbaa !15
  br label %207

191:                                              ; preds = %45, %43
  %192 = landingpad { ptr, i32 }
          cleanup
  %193 = extractvalue { ptr, i32 } %192, 0
  store ptr %193, ptr %8, align 8
  %194 = extractvalue { ptr, i32 } %192, 1
  store i32 %194, ptr %9, align 4
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %11) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %11) #5
  br label %267

195:                                              ; preds = %52, %50
  %196 = landingpad { ptr, i32 }
          cleanup
  %197 = extractvalue { ptr, i32 } %196, 0
  store ptr %197, ptr %8, align 8
  %198 = extractvalue { ptr, i32 } %196, 1
  store i32 %198, ptr %9, align 4
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %12) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %12) #5
  br label %267

199:                                              ; preds = %65, %57
  %200 = landingpad { ptr, i32 }
          cleanup
  %201 = extractvalue { ptr, i32 } %200, 0
  store ptr %201, ptr %8, align 8
  %202 = extractvalue { ptr, i32 } %200, 1
  store i32 %202, ptr %9, align 4
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %17) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %17) #5
  br label %264

203:                                              ; preds = %70, %68
  %204 = landingpad { ptr, i32 }
          cleanup
  %205 = extractvalue { ptr, i32 } %204, 0
  store ptr %205, ptr %8, align 8
  %206 = extractvalue { ptr, i32 } %204, 1
  store i32 %206, ptr %9, align 4
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %18) #5
  call void @llvm.lifetime.end.p0(i64 256, ptr %18) #5
  br label %264

207:                                              ; preds = %189, %185
  %208 = load i8, ptr %6, align 1, !tbaa !9
  %209 = zext i8 %208 to i32
  %210 = icmp eq i32 %209, 9
  br i1 %210, label %247, label %211

211:                                              ; preds = %207
  %212 = load i8, ptr %6, align 1, !tbaa !9
  %213 = zext i8 %212 to i32
  %214 = icmp eq i32 %213, 16
  br i1 %214, label %247, label %215

215:                                              ; preds = %211
  %216 = load i8, ptr %6, align 1, !tbaa !9
  %217 = zext i8 %216 to i32
  %218 = icmp eq i32 %217, 21
  br i1 %218, label %247, label %219

219:                                              ; preds = %215
  %220 = load i8, ptr %6, align 1, !tbaa !9
  %221 = zext i8 %220 to i32
  %222 = icmp eq i32 %221, 13
  br i1 %222, label %247, label %223

223:                                              ; preds = %219
  %224 = load i8, ptr %6, align 1, !tbaa !9
  %225 = zext i8 %224 to i32
  %226 = icmp eq i32 %225, 18
  br i1 %226, label %247, label %227

227:                                              ; preds = %223
  %228 = load i8, ptr %6, align 1, !tbaa !9
  %229 = zext i8 %228 to i32
  %230 = icmp eq i32 %229, 24
  br i1 %230, label %247, label %231

231:                                              ; preds = %227
  %232 = load i8, ptr %6, align 1, !tbaa !9
  %233 = zext i8 %232 to i32
  %234 = icmp eq i32 %233, 23
  br i1 %234, label %247, label %235

235:                                              ; preds = %231
  %236 = load i8, ptr %6, align 1, !tbaa !9
  %237 = zext i8 %236 to i32
  %238 = icmp eq i32 %237, 17
  br i1 %238, label %247, label %239

239:                                              ; preds = %235
  %240 = load i8, ptr %6, align 1, !tbaa !9
  %241 = zext i8 %240 to i32
  %242 = icmp eq i32 %241, 31
  br i1 %242, label %247, label %243

243:                                              ; preds = %239
  %244 = load i8, ptr %6, align 1, !tbaa !9
  %245 = zext i8 %244 to i32
  %246 = icmp eq i32 %245, 15
  br i1 %246, label %247, label %249

247:                                              ; preds = %243, %239, %235, %231, %227, %223, %219, %215, %211, %207
  %248 = load i32, ptr %21, align 4, !tbaa !15
  store i32 %248, ptr %19, align 4, !tbaa !15
  br label %249

249:                                              ; preds = %247, %243
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #5
  %250 = load i64, ptr %15, align 8, !tbaa !14
  store i64 %250, ptr %22, align 8, !tbaa !14
  %251 = load i64, ptr %16, align 8, !tbaa !14
  %252 = load i32, ptr %19, align 4, !tbaa !15
  %253 = zext i32 %252 to i64
  %254 = add i64 %251, %253
  %255 = load i64, ptr %22, align 8, !tbaa !14
  %256 = icmp ult i64 %254, %255
  br i1 %256, label %257, label %262

257:                                              ; preds = %249
  %258 = load i64, ptr %16, align 8, !tbaa !14
  %259 = load i32, ptr %19, align 4, !tbaa !15
  %260 = zext i32 %259 to i64
  %261 = add i64 %258, %260
  store i64 %261, ptr %22, align 8, !tbaa !14
  br label %262

262:                                              ; preds = %257, %249
  %263 = load i64, ptr %22, align 8, !tbaa !14
  store i64 %263, ptr %2, align 8
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %265

264:                                              ; preds = %203, %199
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %267

265:                                              ; preds = %262, %38
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  %266 = load i64, ptr %2, align 8
  ret i64 %266

267:                                              ; preds = %264, %195, %191, %39
  call void @llvm.lifetime.end.p0(i64 1, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  br label %268

268:                                              ; preds = %267
  %269 = load ptr, ptr %8, align 8
  %270 = load i32, ptr %9, align 4
  %271 = insertvalue { ptr, i32 } poison, ptr %269, 0
  %272 = insertvalue { ptr, i32 } %271, i32 %270, 1
  resume { ptr, i32 } %272
}

declare ptr @X509_getm_notAfter(ptr noundef) #2

declare ptr @X509_getm_notBefore(ptr noundef) #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef) #4 align 2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256), i64 noundef) #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 = { 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 #4 = { 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 #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 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 8}
!11 = !{!"_ZTS14asn1_string_st", !12, i64 0, !12, i64 4, !6, i64 8, !13, i64 16}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!12, !12, 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.Log = type { i8, i8, ptr, %"class.std::basic_filebuf" }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%"class.std::locale" = type { ptr }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }

@.str.80 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.81 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.82 = external hidden unnamed_addr constant [12 x i8], align 1
@switch.table._ZN10CertHelper33calculateDSCExpirationDateForCertEP7x509_st = private unnamed_addr constant [39 x i64] [i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 0, i64 315360000, i64 315360000, i64 315360000, i64 0, i64 315360000, i64 315360000, i64 0, i64 0, i64 0, i64 315360000, i64 315360000, i64 0, i64 0, i64 0, i64 0, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 0, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000, i64 315360000], align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN10CertHelper20getCurrencyIdForCertEP7x509_st(ptr noundef) local_unnamed_addr #0 align 2

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

declare void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256), i8 noundef zeroext) unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) local_unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #3

; 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 uwtable
define dso_local noundef i64 @_ZN10CertHelper33calculateDSCExpirationDateForCertEP7x509_st(ptr noundef %0) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %class.Log, align 8
  %3 = alloca %class.Log, align 8
  %4 = alloca %class.Log, align 8
  %5 = alloca %class.Log, align 8
  %6 = alloca %class.Log, align 8
  %7 = tail call ptr @X509_getm_notAfter(ptr noundef %0)
  %8 = tail call ptr @X509_getm_notBefore(ptr noundef %0)
  %9 = tail call noundef zeroext i8 @_ZN10CertHelper20getCurrencyIdForCertEP7x509_st(ptr noundef %0)
  %10 = icmp eq i8 %9, 0
  br i1 %10, label %11, label %18

11:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %2) #6
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %2, i8 noundef zeroext 0)
  %12 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef nonnull @.str.80)
          to label %13 unwind label %16

13:                                               ; preds = %11
  %14 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEi(ptr noundef nonnull align 8 dereferenceable(256) %12, i32 noundef 0)
          to label %15 unwind label %16

15:                                               ; preds = %13
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %2) #6
  br label %54

16:                                               ; preds = %13, %11
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %2) #6
  br label %55

18:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %3) #6
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %3, i8 noundef zeroext 0)
  %19 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %3, ptr noundef nonnull @.str.81)
          to label %20 unwind label %42

20:                                               ; preds = %18
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256) %19, ptr noundef %22)
          to label %24 unwind label %42

24:                                               ; preds = %20
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #6
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %4, i8 noundef zeroext 0)
  %25 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %4, ptr noundef nonnull @.str.82)
          to label %26 unwind label %44

26:                                               ; preds = %24
  %27 = getelementptr inbounds i8, ptr %8, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !5
  %29 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256) %25, ptr noundef %28)
          to label %30 unwind label %44

30:                                               ; preds = %26
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  %31 = call noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef nonnull %7)
  %32 = call noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef nonnull %8)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %5) #6
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %5, i8 noundef zeroext 0)
  %33 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %5, ptr noundef nonnull @.str.81)
          to label %34 unwind label %46

34:                                               ; preds = %30
  %35 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256) %33, i64 noundef %31)
          to label %36 unwind label %46

36:                                               ; preds = %34
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %5) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #6
  call void @_ZN3LogC1Eh(ptr noundef nonnull align 8 dereferenceable(256) %6, i8 noundef zeroext 0)
  %37 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKc(ptr noundef nonnull align 8 dereferenceable(256) %6, ptr noundef nonnull @.str.82)
          to label %38 unwind label %48

38:                                               ; preds = %36
  %39 = invoke noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256) %37, i64 noundef %32)
          to label %40 unwind label %48

40:                                               ; preds = %38
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %6) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #6
  %41 = icmp ult i8 %9, 40
  br i1 %41, label %switch.lookup, label %switch.lookup188

42:                                               ; preds = %20, %18
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %3) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %3) #6
  br label %55

44:                                               ; preds = %26, %24
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %4) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #6
  br label %55

46:                                               ; preds = %34, %30
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %5) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %5) #6
  br label %55

48:                                               ; preds = %38, %36
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3LogD1Ev(ptr noundef nonnull align 8 dereferenceable(256) %6) #6
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #6
  br label %55

switch.lookup:                                    ; preds = %40
  %switch.tableidx = add nsw i8 %9, -1
  %50 = sext i8 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [39 x i64], ptr @switch.table._ZN10CertHelper33calculateDSCExpirationDateForCertEP7x509_st, i64 0, i64 %50
  %switch.load = load i64, ptr %switch.gep, align 8
  br label %switch.lookup188

switch.lookup188:                                 ; preds = %switch.lookup, %40
  %.0175 = phi i64 [ 0, %40 ], [ %switch.load, %switch.lookup ]
  %switch.tableidx187 = add i8 %9, -9
  %51 = icmp ult i8 %switch.tableidx187, 23
  %switch.maskindex = zext nneg i8 %switch.tableidx187 to i32
  %switch.shifted = lshr i32 4248529, %switch.maskindex
  %switch.lobit = trunc i32 %switch.shifted to i1
  %52 = select i1 %51, i1 %switch.lobit, i1 false
  %.1176 = select i1 %52, i64 157680000, i64 %.0175
  %53 = add i64 %.1176, %32
  %spec.select = call i64 @llvm.umin.i64(i64 %53, i64 %31)
  br label %54

54:                                               ; preds = %switch.lookup188, %15
  %.0173 = phi i64 [ 0, %15 ], [ %spec.select, %switch.lookup188 ]
  ret i64 %.0173

55:                                               ; preds = %46, %48, %44, %42, %16
  %.pn184 = phi { ptr, i32 } [ %17, %16 ], [ %45, %44 ], [ %43, %42 ], [ %49, %48 ], [ %47, %46 ]
  resume { ptr, i32 } %.pn184
}

declare ptr @X509_getm_notAfter(ptr noundef) local_unnamed_addr #2

declare ptr @X509_getm_notBefore(ptr noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEi(ptr noundef nonnull align 8 dereferenceable(256), i32 noundef) local_unnamed_addr #2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEPKh(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZN10CertHelper13ASN1_GetTimeTEP14asn1_string_st(ptr noundef) local_unnamed_addr #4 align 2

declare noundef nonnull align 8 dereferenceable(256) ptr @_ZN3LoglsEm(ptr noundef nonnull align 8 dereferenceable(256), i64 noundef) local_unnamed_addr #2

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

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 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !10, i64 8}
!6 = !{!"_ZTS14asn1_string_st", !7, i64 0, !7, i64 4, !10, i64 8, !11, i64 16}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"long", !8, i64 0}


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