; LLVM IR from matz/streem :: src (time)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, 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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @strm_time_parse_time(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) #1 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.tm, align 8
  %17 = alloca i32, align 4
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %struct.tm, align 8
  %21 = alloca i64, align 8
  %22 = alloca double, align 8
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %25, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #7
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 56, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %26 = call i32 @time_localoffset(i32 noundef 1)
  store i32 %26, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %27 = load ptr, ptr %12, align 8, !tbaa !5
  %28 = load i32, ptr %8, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %27, i64 %29
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = sext i8 %31 to i32
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %48

34:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %35 = load i32, ptr %8, align 4, !tbaa !9
  %36 = add nsw i32 %35, 1
  %37 = sext i32 %36 to i64
  %38 = call noalias ptr @malloc(i64 noundef %37) #8
  store ptr %38, ptr %19, align 8, !tbaa !5
  %39 = load ptr, ptr %19, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i32, ptr %8, align 4, !tbaa !9
  %42 = sext i32 %41 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %39, ptr align 1 %40, i64 %42, i1 false)
  %43 = load ptr, ptr %19, align 8, !tbaa !5
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i8, ptr %43, i64 %45
  store i8 0, ptr %46, align 1, !tbaa !11
  %47 = load ptr, ptr %19, align 8, !tbaa !5
  store ptr %47, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %48

48:                                               ; preds = %34, %5
  %49 = load ptr, ptr %12, align 8, !tbaa !5
  %50 = load i32, ptr %8, align 4, !tbaa !9
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i8, ptr %49, i64 %51
  store ptr %52, ptr %15, align 8, !tbaa !5
  %53 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %53, align 8, !tbaa !12
  %54 = load ptr, ptr %12, align 8, !tbaa !5
  %55 = call ptr @strptime(ptr noundef %54, ptr noundef @.str, ptr noundef %16) #7
  store ptr %55, ptr %13, align 8, !tbaa !5
  %56 = load ptr, ptr %13, align 8, !tbaa !5
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %48
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  %60 = call ptr @strptime(ptr noundef %59, ptr noundef @.str.1, ptr noundef %16) #7
  store ptr %60, ptr %13, align 8, !tbaa !5
  br label %61

61:                                               ; preds = %58, %48
  %62 = load ptr, ptr %13, align 8, !tbaa !5
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %67

64:                                               ; preds = %61
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = call ptr @strptime(ptr noundef %65, ptr noundef @.str.2, ptr noundef %16) #7
  store ptr %66, ptr %13, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %64, %61
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  %69 = icmp eq ptr %68, null
  br i1 %69, label %70, label %89

70:                                               ; preds = %67
  %71 = load ptr, ptr %12, align 8, !tbaa !5
  %72 = call ptr @strptime(ptr noundef %71, ptr noundef @.str.3, ptr noundef %16) #7
  store ptr %72, ptr %13, align 8, !tbaa !5
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %88

75:                                               ; preds = %70
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds i8, ptr %76, i64 0
  %78 = load i8, ptr %77, align 1, !tbaa !11
  %79 = sext i8 %78 to i32
  %80 = icmp eq i32 %79, 84
  br i1 %80, label %88, label %81

81:                                               ; preds = %75
  %82 = load ptr, ptr %13, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %82, i64 0
  %84 = load i8, ptr %83, align 1, !tbaa !11
  %85 = sext i8 %84 to i32
  %86 = icmp eq i32 %85, 32
  br i1 %86, label %88, label %87

87:                                               ; preds = %81
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %88

88:                                               ; preds = %87, %81, %75, %70
  br label %89

89:                                               ; preds = %88, %67
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = icmp eq ptr %90, null
  br i1 %91, label %92, label %105

92:                                               ; preds = %89
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = call ptr @strptime(ptr noundef %93, ptr noundef @.str.4, ptr noundef %16) #7
  store ptr %94, ptr %13, align 8, !tbaa !5
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = icmp ne ptr %95, null
  br i1 %96, label %97, label %104

97:                                               ; preds = %92
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = getelementptr inbounds i8, ptr %98, i64 0
  %100 = load i8, ptr %99, align 1, !tbaa !11
  %101 = sext i8 %100 to i32
  %102 = icmp eq i32 %101, 58
  br i1 %102, label %103, label %104

103:                                              ; preds = %97
  store ptr null, ptr %13, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %103, %97, %92
  br label %105

105:                                              ; preds = %104, %89
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = icmp eq ptr %106, null
  br i1 %107, label %108, label %116

108:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 56, ptr %20) #7
  %109 = call i64 @time(ptr noundef null) #7
  store i64 %109, ptr %18, align 8, !tbaa !12
  %110 = call ptr @localtime_r(ptr noundef %18, ptr noundef %20) #7
  %111 = getelementptr inbounds %struct.tm, ptr %20, i32 0, i32 5
  %112 = load i32, ptr %111, align 4, !tbaa !14
  %113 = getelementptr inbounds %struct.tm, ptr %16, i32 0, i32 5
  store i32 %112, ptr %113, align 4, !tbaa !14
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = call ptr @strptime(ptr noundef %114, ptr noundef @.str.5, ptr noundef %16) #7
  store ptr %115, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 56, ptr %20) #7
  br label %116

116:                                              ; preds = %108, %105
  %117 = load ptr, ptr %13, align 8, !tbaa !5
  %118 = icmp eq ptr %117, null
  br i1 %118, label %119, label %120

119:                                              ; preds = %116
  br label %269

120:                                              ; preds = %116
  %121 = load ptr, ptr %13, align 8, !tbaa !5
  %122 = load ptr, ptr %15, align 8, !tbaa !5
  %123 = icmp eq ptr %121, %122
  br i1 %123, label %124, label %134

124:                                              ; preds = %120
  %125 = call i64 @mktime(ptr noundef %16) #7
  store i64 %125, ptr %18, align 8, !tbaa !12
  %126 = load i32, ptr %17, align 4, !tbaa !9
  %127 = sext i32 %126 to i64
  %128 = load i64, ptr %18, align 8, !tbaa !12
  %129 = add nsw i64 %128, %127
  store i64 %129, ptr %18, align 8, !tbaa !12
  %130 = load i64, ptr %18, align 8, !tbaa !12
  %131 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %130, ptr %131, align 8, !tbaa !12
  %132 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 0, ptr %132, align 8, !tbaa !12
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 50000, ptr %133, align 4, !tbaa !9
  br label %262

134:                                              ; preds = %120
  %135 = load ptr, ptr %13, align 8, !tbaa !5
  %136 = getelementptr inbounds i8, ptr %135, i32 1
  store ptr %136, ptr %13, align 8, !tbaa !5
  %137 = load i8, ptr %135, align 1, !tbaa !11
  %138 = sext i8 %137 to i32
  switch i32 %138, label %149 [
    i32 84, label %150
    i32 32, label %139
  ]

139:                                              ; preds = %134
  br label %140

140:                                              ; preds = %145, %139
  %141 = load ptr, ptr %13, align 8, !tbaa !5
  %142 = load i8, ptr %141, align 1, !tbaa !11
  %143 = sext i8 %142 to i32
  %144 = icmp eq i32 %143, 32
  br i1 %144, label %145, label %148

145:                                              ; preds = %140
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = getelementptr inbounds i8, ptr %146, i32 1
  store ptr %147, ptr %13, align 8, !tbaa !5
  br label %140, !llvm.loop !16

148:                                              ; preds = %140
  br label %150

149:                                              ; preds = %134
  br label %269

150:                                              ; preds = %148, %134
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  %152 = call ptr @strptime(ptr noundef %151, ptr noundef @.str.6, ptr noundef %16) #7
  store ptr %152, ptr %14, align 8, !tbaa !5
  %153 = load ptr, ptr %14, align 8, !tbaa !5
  %154 = icmp eq ptr %153, null
  br i1 %154, label %155, label %158

155:                                              ; preds = %150
  %156 = load ptr, ptr %13, align 8, !tbaa !5
  %157 = call ptr @strptime(ptr noundef %156, ptr noundef @.str.7, ptr noundef %16) #7
  store ptr %157, ptr %14, align 8, !tbaa !5
  br label %158

158:                                              ; preds = %155, %150
  %159 = load ptr, ptr %14, align 8, !tbaa !5
  %160 = icmp eq ptr %159, null
  br i1 %160, label %161, label %168

161:                                              ; preds = %158
  %162 = load ptr, ptr %13, align 8, !tbaa !5
  %163 = call ptr @strptime(ptr noundef %162, ptr noundef @.str.8, ptr noundef %16) #7
  store ptr %163, ptr %14, align 8, !tbaa !5
  %164 = load ptr, ptr %14, align 8, !tbaa !5
  %165 = icmp eq ptr %164, null
  br i1 %165, label %166, label %167

166:                                              ; preds = %161
  br label %269

167:                                              ; preds = %161
  br label %168

168:                                              ; preds = %167, %158
  %169 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %169, ptr %13, align 8, !tbaa !5
  %170 = call i64 @mktime(ptr noundef %16) #7
  store i64 %170, ptr %18, align 8, !tbaa !12
  %171 = load ptr, ptr %13, align 8, !tbaa !5
  %172 = getelementptr inbounds i8, ptr %171, i64 0
  %173 = load i8, ptr %172, align 1, !tbaa !11
  %174 = sext i8 %173 to i32
  %175 = icmp eq i32 %174, 46
  br i1 %175, label %176, label %206

176:                                              ; preds = %168
  %177 = load ptr, ptr %13, align 8, !tbaa !5
  %178 = getelementptr inbounds i8, ptr %177, i32 1
  store ptr %178, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %179 = load ptr, ptr %15, align 8, !tbaa !5
  %180 = call i32 @scan_num(ptr noundef %13, ptr noundef %179)
  %181 = sext i32 %180 to i64
  store i64 %181, ptr %21, align 8, !tbaa !12
  %182 = load i64, ptr %21, align 8, !tbaa !12
  %183 = icmp slt i64 %182, 0
  br i1 %183, label %184, label %185

184:                                              ; preds = %176
  store i32 2, ptr %23, align 4
  br label %203

185:                                              ; preds = %176
  %186 = load i64, ptr %21, align 8, !tbaa !12
  %187 = icmp sgt i64 %186, 0
  br i1 %187, label %188, label %202

188:                                              ; preds = %185
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %189 = load i64, ptr %21, align 8, !tbaa !12
  %190 = sitofp i64 %189 to double
  %191 = call double @log10(double noundef %190) #7
  %192 = call double @llvm.ceil.f64(double %191)
  store double %192, ptr %22, align 8, !tbaa !18
  %193 = load i64, ptr %21, align 8, !tbaa !12
  %194 = sitofp i64 %193 to double
  %195 = load double, ptr %22, align 8, !tbaa !18
  %196 = call double @pow(double noundef 1.000000e+01, double noundef %195) #7
  %197 = fdiv double %194, %196
  store double %197, ptr %22, align 8, !tbaa !18
  %198 = load double, ptr %22, align 8, !tbaa !18
  %199 = fmul double %198, 1.000000e+06
  %200 = fptosi double %199 to i64
  %201 = load ptr, ptr %10, align 8, !tbaa !5
  store i64 %200, ptr %201, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %202

202:                                              ; preds = %188, %185
  store i32 0, ptr %23, align 4
  br label %203

203:                                              ; preds = %202, %184
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  %204 = load i32, ptr %23, align 4
  switch i32 %204, label %276 [
    i32 0, label %205
    i32 2, label %269
  ]

205:                                              ; preds = %203
  br label %206

206:                                              ; preds = %205, %168
  %207 = load ptr, ptr %13, align 8, !tbaa !5
  %208 = getelementptr inbounds i8, ptr %207, i64 0
  %209 = load i8, ptr %208, align 1, !tbaa !11
  %210 = sext i8 %209 to i32
  %211 = icmp eq i32 %210, 90
  br i1 %211, label %212, label %218

212:                                              ; preds = %206
  %213 = load i32, ptr %17, align 4, !tbaa !9
  %214 = sext i32 %213 to i64
  %215 = load i64, ptr %18, align 8, !tbaa !12
  %216 = add nsw i64 %215, %214
  store i64 %216, ptr %18, align 8, !tbaa !12
  %217 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 0, ptr %217, align 4, !tbaa !9
  br label %259

218:                                              ; preds = %206
  %219 = load ptr, ptr %13, align 8, !tbaa !5
  %220 = load ptr, ptr %15, align 8, !tbaa !5
  %221 = icmp eq ptr %219, %220
  br i1 %221, label %222, label %225

222:                                              ; preds = %218
  %223 = load i32, ptr %17, align 4, !tbaa !9
  %224 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %223, ptr %224, align 4, !tbaa !9
  br label %258

225:                                              ; preds = %218
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %226 = load ptr, ptr %13, align 8, !tbaa !5
  %227 = getelementptr inbounds i8, ptr %226, i64 0
  %228 = load i8, ptr %227, align 1, !tbaa !11
  %229 = sext i8 %228 to i32
  switch i32 %229, label %253 [
    i32 43, label %230
    i32 45, label %230
  ]

230:                                              ; preds = %225, %225
  %231 = load ptr, ptr %13, align 8, !tbaa !5
  %232 = load ptr, ptr %15, align 8, !tbaa !5
  %233 = load ptr, ptr %13, align 8, !tbaa !5
  %234 = ptrtoint ptr %232 to i64
  %235 = ptrtoint ptr %233 to i64
  %236 = sub i64 %234, %235
  %237 = trunc i64 %236 to i32
  %238 = call i32 @parse_tz(ptr noundef %231, i32 noundef %237)
  store i32 %238, ptr %24, align 4, !tbaa !9
  %239 = load i32, ptr %24, align 4, !tbaa !9
  %240 = icmp eq i32 %239, 60000
  br i1 %240, label %241, label %242

241:                                              ; preds = %230
  store i32 2, ptr %23, align 4
  br label %255

242:                                              ; preds = %230
  %243 = load i32, ptr %17, align 4, !tbaa !9
  %244 = sext i32 %243 to i64
  %245 = load i64, ptr %18, align 8, !tbaa !12
  %246 = add nsw i64 %245, %244
  store i64 %246, ptr %18, align 8, !tbaa !12
  %247 = load i32, ptr %24, align 4, !tbaa !9
  %248 = sext i32 %247 to i64
  %249 = load i64, ptr %18, align 8, !tbaa !12
  %250 = sub nsw i64 %249, %248
  store i64 %250, ptr %18, align 8, !tbaa !12
  %251 = load i32, ptr %24, align 4, !tbaa !9
  %252 = load ptr, ptr %11, align 8, !tbaa !5
  store i32 %251, ptr %252, align 4, !tbaa !9
  br label %254

253:                                              ; preds = %225
  store i32 2, ptr %23, align 4
  br label %255

254:                                              ; preds = %242
  store i32 0, ptr %23, align 4
  br label %255

255:                                              ; preds = %254, %253, %241
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %256 = load i32, ptr %23, align 4
  switch i32 %256, label %276 [
    i32 0, label %257
    i32 2, label %269
  ]

257:                                              ; preds = %255
  br label %258

258:                                              ; preds = %257, %222
  br label %259

259:                                              ; preds = %258, %212
  %260 = load i64, ptr %18, align 8, !tbaa !12
  %261 = load ptr, ptr %9, align 8, !tbaa !5
  store i64 %260, ptr %261, align 8, !tbaa !12
  br label %262

262:                                              ; preds = %259, %124
  %263 = load ptr, ptr %12, align 8, !tbaa !5
  %264 = load ptr, ptr %7, align 8, !tbaa !5
  %265 = icmp ne ptr %263, %264
  br i1 %265, label %266, label %268

266:                                              ; preds = %262
  %267 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %267) #7
  br label %268

268:                                              ; preds = %266, %262
  store i32 0, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %276

269:                                              ; preds = %255, %203, %166, %149, %119
  %270 = load ptr, ptr %12, align 8, !tbaa !5
  %271 = load ptr, ptr %7, align 8, !tbaa !5
  %272 = icmp ne ptr %270, %271
  br i1 %272, label %273, label %275

273:                                              ; preds = %269
  %274 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %274) #7
  br label %275

275:                                              ; preds = %273, %269
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %23, align 4
  br label %276

276:                                              ; preds = %275, %268, %255, %203
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %277 = load i32, ptr %6, align 4
  ret i32 %277
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @time_localoffset(i32 noundef) #1

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind
declare ptr @strptime(ptr noundef, ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i64 @time(ptr noundef) #5

; Function Attrs: nounwind
declare ptr @localtime_r(ptr noundef, ptr noundef) #5

; Function Attrs: nounwind
declare i64 @mktime(ptr noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @scan_num(ptr noundef, ptr noundef) #1

; Function Attrs: nounwind
declare double @log10(double noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #6

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #5

; Function Attrs: nounwind uwtable
declare hidden i32 @parse_tz(ptr noundef, i32 noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { nounwind allocsize(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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { nounwind allocsize(0) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!15, !10, i64 20}
!15 = !{!"tm", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !6, i64 48}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = !{!19, !19, i64 0}
!19 = !{!"double", !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"

%struct.tm = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i64, 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 [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [6 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @strm_time_parse_time(ptr noundef %0, i32 noundef %1, ptr nocapture noundef writeonly %2, ptr nocapture noundef writeonly %3, ptr nocapture noundef writeonly %4) local_unnamed_addr #1 {
  %6 = alloca ptr, align 8
  %7 = alloca %struct.tm, align 8
  %8 = alloca i64, align 8
  %9 = alloca %struct.tm, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #10
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #10
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(56) %7, i8 0, i64 56, i1 false)
  %10 = tail call i32 @time_localoffset(i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #10
  %11 = sext i32 %1 to i64
  %12 = getelementptr inbounds i8, ptr %0, i64 %11
  %13 = load i8, ptr %12, align 1, !tbaa !5
  %.not = icmp eq i8 %13, 0
  br i1 %.not, label %19, label %14

14:                                               ; preds = %5
  %15 = add nsw i32 %1, 1
  %16 = sext i32 %15 to i64
  %17 = tail call noalias ptr @malloc(i64 noundef %16) #11
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %17, ptr nonnull align 1 %0, i64 %11, i1 false)
  %18 = getelementptr inbounds i8, ptr %17, i64 %11
  store i8 0, ptr %18, align 1, !tbaa !5
  br label %19

19:                                               ; preds = %14, %5
  %.057 = phi ptr [ %17, %14 ], [ %0, %5 ]
  %20 = getelementptr inbounds i8, ptr %.057, i64 %11
  store i64 0, ptr %3, align 8, !tbaa !8
  %21 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str, ptr noundef nonnull %7) #10
  %22 = icmp eq ptr %21, null
  br i1 %22, label %23, label %.thread89

23:                                               ; preds = %19
  %24 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str.1, ptr noundef nonnull %7) #10
  %25 = icmp eq ptr %24, null
  br i1 %25, label %26, label %.thread89

26:                                               ; preds = %23
  %27 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str.2, ptr noundef nonnull %7) #10
  %28 = icmp eq ptr %27, null
  br i1 %28, label %29, label %.thread89

29:                                               ; preds = %26
  %30 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str.3, ptr noundef nonnull %7) #10
  %.not70 = icmp eq ptr %30, null
  br i1 %.not70, label %33, label %31

31:                                               ; preds = %29
  %32 = load i8, ptr %30, align 1, !tbaa !5
  switch i8 %32, label %33 [
    i8 84, label %.thread89
    i8 32, label %.thread89
  ]

33:                                               ; preds = %31, %29
  %34 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str.4, ptr noundef nonnull %7) #10
  %.not71 = icmp eq ptr %34, null
  br i1 %.not71, label %.thread85, label %35

35:                                               ; preds = %33
  %36 = load i8, ptr %34, align 1, !tbaa !5
  %37 = icmp eq i8 %36, 58
  br i1 %37, label %38, label %.thread89

38:                                               ; preds = %35
  store ptr null, ptr %6, align 8, !tbaa !10
  br label %.thread85

.thread85:                                        ; preds = %38, %33
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #10
  %39 = call i64 @time(ptr noundef null) #10
  store i64 %39, ptr %8, align 8, !tbaa !8
  %40 = call ptr @localtime_r(ptr noundef nonnull %8, ptr noundef nonnull %9) #10
  %41 = getelementptr inbounds i8, ptr %9, i64 20
  %42 = load i32, ptr %41, align 4, !tbaa !12
  %43 = getelementptr inbounds i8, ptr %7, i64 20
  store i32 %42, ptr %43, align 4, !tbaa !12
  %44 = call ptr @strptime(ptr noundef nonnull %.057, ptr noundef nonnull @.str.5, ptr noundef nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #10
  %45 = icmp eq ptr %44, null
  br i1 %45, label %.thread97, label %.thread89

.thread89:                                        ; preds = %19, %35, %23, %31, %31, %26, %.thread85
  %46 = phi ptr [ %44, %.thread85 ], [ %30, %31 ], [ %30, %31 ], [ %27, %26 ], [ %21, %19 ], [ %34, %35 ], [ %24, %23 ]
  %47 = icmp eq ptr %46, %20
  br i1 %47, label %48, label %52

48:                                               ; preds = %.thread89
  %49 = call i64 @mktime(ptr noundef nonnull %7) #10
  %50 = sext i32 %10 to i64
  %51 = add nsw i64 %49, %50
  store i64 %51, ptr %2, align 8, !tbaa !8
  store i64 0, ptr %3, align 8, !tbaa !8
  store i32 50000, ptr %4, align 4, !tbaa !15
  br label %114

52:                                               ; preds = %.thread89
  %53 = getelementptr inbounds i8, ptr %46, i64 1
  store ptr %53, ptr %6, align 8, !tbaa !10
  %54 = load i8, ptr %46, align 1, !tbaa !5
  switch i8 %54, label %.thread97 [
    i8 84, label %.loopexit
    i8 32, label %.preheader
  ]

.preheader:                                       ; preds = %52
  %55 = load i8, ptr %53, align 1, !tbaa !5
  %56 = icmp eq i8 %55, 32
  br i1 %56, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader, %.lr.ph
  %57 = phi ptr [ %58, %.lr.ph ], [ %53, %.preheader ]
  %58 = getelementptr inbounds i8, ptr %57, i64 1
  store ptr %58, ptr %6, align 8, !tbaa !10
  %59 = load i8, ptr %58, align 1, !tbaa !5
  %60 = icmp eq i8 %59, 32
  br i1 %60, label %.lr.ph, label %.loopexit, !llvm.loop !16

.loopexit:                                        ; preds = %.lr.ph, %.preheader, %52
  %61 = phi ptr [ %53, %.preheader ], [ %53, %52 ], [ %58, %.lr.ph ]
  %62 = call ptr @strptime(ptr noundef nonnull %61, ptr noundef nonnull @.str.6, ptr noundef nonnull %7) #10
  %63 = icmp eq ptr %62, null
  br i1 %63, label %64, label %.thread90

64:                                               ; preds = %.loopexit
  %65 = load ptr, ptr %6, align 8, !tbaa !10
  %66 = call ptr @strptime(ptr noundef %65, ptr noundef nonnull @.str.7, ptr noundef nonnull %7) #10
  %67 = icmp eq ptr %66, null
  br i1 %67, label %68, label %.thread90

68:                                               ; preds = %64
  %69 = call ptr @strptime(ptr noundef %65, ptr noundef nonnull @.str.8, ptr noundef nonnull %7) #10
  %70 = icmp eq ptr %69, null
  br i1 %70, label %.thread97, label %.thread90

.thread90:                                        ; preds = %.loopexit, %68, %64
  %.159 = phi ptr [ %69, %68 ], [ %66, %64 ], [ %62, %.loopexit ]
  store ptr %.159, ptr %6, align 8, !tbaa !10
  %71 = call i64 @mktime(ptr noundef nonnull %7) #10
  store i64 %71, ptr %8, align 8, !tbaa !8
  %72 = load i8, ptr %.159, align 1, !tbaa !5
  %73 = icmp eq i8 %72, 46
  br i1 %73, label %74, label %.thread93

74:                                               ; preds = %.thread90
  %75 = getelementptr inbounds i8, ptr %.159, i64 1
  store ptr %75, ptr %6, align 8, !tbaa !10
  %76 = call i32 @scan_num(ptr noundef nonnull %6, ptr noundef %20)
  %77 = sext i32 %76 to i64
  %78 = icmp slt i32 %76, 0
  br i1 %78, label %.thread97, label %79

79:                                               ; preds = %74
  %.not72 = icmp eq i32 %76, 0
  br i1 %.not72, label %.thread93, label %80

80:                                               ; preds = %79
  %81 = uitofp nneg i64 %77 to double
  %82 = call double @log10(double noundef %81) #10
  %83 = call double @llvm.ceil.f64(double %82)
  %84 = call double @pow(double noundef 1.000000e+01, double noundef %83) #10
  %85 = fdiv double %81, %84
  %86 = fmul double %85, 1.000000e+06
  %87 = fptosi double %86 to i64
  store i64 %87, ptr %3, align 8, !tbaa !8
  br label %.thread93

.thread93:                                        ; preds = %79, %80, %.thread90
  %88 = load ptr, ptr %6, align 8, !tbaa !10
  %89 = load i8, ptr %88, align 1, !tbaa !5
  %90 = icmp eq i8 %89, 90
  br i1 %90, label %91, label %95

91:                                               ; preds = %.thread93
  %92 = sext i32 %10 to i64
  %93 = load i64, ptr %8, align 8, !tbaa !8
  %94 = add nsw i64 %93, %92
  store i32 0, ptr %4, align 4, !tbaa !15
  br label %112

95:                                               ; preds = %.thread93
  %96 = icmp eq ptr %88, %20
  br i1 %96, label %97, label %98

97:                                               ; preds = %95
  store i32 %10, ptr %4, align 4, !tbaa !15
  %.pre = load i64, ptr %8, align 8, !tbaa !8
  br label %112

98:                                               ; preds = %95
  switch i8 %89, label %.thread97 [
    i8 43, label %99
    i8 45, label %99
  ]

99:                                               ; preds = %98, %98
  %100 = ptrtoint ptr %20 to i64
  %101 = ptrtoint ptr %88 to i64
  %102 = sub i64 %100, %101
  %103 = trunc i64 %102 to i32
  %104 = call i32 @parse_tz(ptr noundef nonnull %88, i32 noundef %103)
  %105 = icmp eq i32 %104, 60000
  br i1 %105, label %.thread97, label %106

106:                                              ; preds = %99
  %107 = sext i32 %10 to i64
  %108 = load i64, ptr %8, align 8, !tbaa !8
  %109 = sext i32 %104 to i64
  %110 = sub nsw i64 %107, %109
  %111 = add i64 %110, %108
  store i32 %104, ptr %4, align 4, !tbaa !15
  br label %112

112:                                              ; preds = %106, %97, %91
  %113 = phi i64 [ %111, %106 ], [ %.pre, %97 ], [ %94, %91 ]
  store i64 %113, ptr %2, align 8, !tbaa !8
  br label %114

114:                                              ; preds = %112, %48
  %.not73 = icmp eq ptr %.057, %0
  br i1 %.not73, label %115, label %.sink.split

.thread97:                                        ; preds = %98, %99, %74, %68, %52, %.thread85
  %.not74 = icmp eq ptr %.057, %0
  br i1 %.not74, label %115, label %.sink.split

.sink.split:                                      ; preds = %.thread97, %114
  %.0.ph = phi i32 [ 0, %114 ], [ -1, %.thread97 ]
  call void @free(ptr noundef %.057) #10
  br label %115

115:                                              ; preds = %.sink.split, %.thread97, %114
  %.0 = phi i32 [ 0, %114 ], [ -1, %.thread97 ], [ %.0.ph, %.sink.split ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #10
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #10
  ret i32 %.0
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @time_localoffset(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #4

; Function Attrs: nounwind
declare ptr @strptime(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare i64 @time(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind
declare ptr @localtime_r(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nounwind willreturn
declare noundef i64 @mktime(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden i32 @scan_num(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.ceil.f64(double) #8

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
declare hidden i32 @parse_tz(ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long", !6, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !6, i64 0}
!12 = !{!13, !14, i64 20}
!13 = !{!"tm", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !14, i64 20, !14, i64 24, !14, i64 28, !14, i64 32, !9, i64 40, !11, i64 48}
!14 = !{!"int", !6, i64 0}
!15 = !{!14, !14, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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