; LLVM IR from cornell-zhang/rosetta :: BNN/cpp/minizip (miniunz)

; 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_unz_s = type { i32, i32, i32, i32, i32, i32 }
%struct.unz_file_info64_s = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.tm_unz_s, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @change_file_date(ptr noundef, i64 noundef, ptr noundef byval(%struct.tm_unz_s) align 8) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_file_exists(ptr noundef) #0

declare noalias ptr @fopen64(ptr noundef, ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @makedir(ptr noundef) #0

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

declare i32 @printf(ptr noundef, ...) #2

; Function Attrs: nounwind
declare i32 @mkdir(ptr noundef, i32 noundef) #4

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

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

declare i32 @unzGetCurrentFileInfo64(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define dso_local i32 @do_extract_currentfile(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca %struct.unz_file_info64_s, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca [256 x i8], align 16
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i32, align 4
  %22 = alloca i8, align 1
  %23 = alloca [128 x i8], align 16
  %24 = alloca i8, align 1
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 152, ptr %10) #8
  call void @llvm.memset.p0.i64(ptr align 8 %10, i8 0, i64 152, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  store ptr null, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 8192, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  store i32 0, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 256, ptr %17) #8
  call void @llvm.memset.p0.i64(ptr align 16 %17, i8 0, i64 256, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store ptr null, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store ptr null, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store ptr null, ptr %20, align 8, !tbaa !5
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  %27 = call i32 @unzGetCurrentFileInfo64(ptr noundef %25, ptr noundef %10, ptr noundef %26, i64 noundef 256, ptr noundef null, i64 noundef 0, ptr noundef null, i64 noundef 0)
  store i32 %27, ptr %14, align 4, !tbaa !9
  %28 = load i32, ptr %14, align 4, !tbaa !9
  %29 = icmp ne i32 %28, 0
  br i1 %29, label %30, label %34

30:                                               ; preds = %4
  %31 = load i32, ptr %14, align 4, !tbaa !9
  %32 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, i32 noundef %31)
  %33 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %33, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %256

34:                                               ; preds = %4
  %35 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  store ptr %35, ptr %18, align 8, !tbaa !5
  store ptr %35, ptr %20, align 8, !tbaa !5
  br label %36

36:                                               ; preds = %54, %34
  %37 = load ptr, ptr %20, align 8, !tbaa !5
  %38 = load i8, ptr %37, align 1, !tbaa !11
  %39 = sext i8 %38 to i32
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %57

41:                                               ; preds = %36
  %42 = load ptr, ptr %20, align 8, !tbaa !5
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = sext i8 %43 to i32
  %45 = icmp eq i32 %44, 47
  br i1 %45, label %51, label %46

46:                                               ; preds = %41
  %47 = load ptr, ptr %20, align 8, !tbaa !5
  %48 = load i8, ptr %47, align 1, !tbaa !11
  %49 = sext i8 %48 to i32
  %50 = icmp eq i32 %49, 92
  br i1 %50, label %51, label %54

51:                                               ; preds = %46, %41
  %52 = load ptr, ptr %20, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  store ptr %53, ptr %18, align 8, !tbaa !5
  br label %54

54:                                               ; preds = %51, %46
  %55 = load ptr, ptr %20, align 8, !tbaa !5
  %56 = getelementptr inbounds i8, ptr %55, i32 1
  store ptr %56, ptr %20, align 8, !tbaa !5
  br label %36, !llvm.loop !12

57:                                               ; preds = %36
  %58 = load ptr, ptr %18, align 8, !tbaa !5
  %59 = load i8, ptr %58, align 1, !tbaa !11
  %60 = sext i8 %59 to i32
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %72

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !9
  %64 = icmp eq i32 %63, 0
  br i1 %64, label %65, label %70

65:                                               ; preds = %62
  %66 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  %67 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %66)
  %68 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  %69 = call i32 @mkdir(ptr noundef %68, i32 noundef 509) #8
  br label %70

70:                                               ; preds = %65, %62
  %71 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %71, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %256

72:                                               ; preds = %57
  %73 = load i32, ptr %13, align 4, !tbaa !9
  %74 = zext i32 %73 to i64
  %75 = call noalias ptr @malloc(i64 noundef %74) #9
  store ptr %75, ptr %12, align 8, !tbaa !5
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = icmp eq ptr %76, null
  br i1 %77, label %78, label %80

78:                                               ; preds = %72
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.1)
  store i32 -104, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %256

80:                                               ; preds = %72
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  %83 = call i32 @unzOpenCurrentFilePassword(ptr noundef %81, ptr noundef %82)
  store i32 %83, ptr %14, align 4, !tbaa !9
  %84 = load i32, ptr %14, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %89

86:                                               ; preds = %80
  %87 = load i32, ptr %14, align 4, !tbaa !9
  %88 = call i32 (ptr, ...) @printf(ptr noundef @.str.22, i32 noundef %87)
  br label %89

89:                                               ; preds = %86, %80
  %90 = load i32, ptr %7, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %92, label %94

92:                                               ; preds = %89
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  store ptr %93, ptr %19, align 8, !tbaa !5
  br label %96

94:                                               ; preds = %89
  %95 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  store ptr %95, ptr %19, align 8, !tbaa !5
  br label %96

96:                                               ; preds = %94, %92
  %97 = load i32, ptr %14, align 4, !tbaa !9
  %98 = icmp eq i32 %97, 0
  br i1 %98, label %99, label %157

99:                                               ; preds = %96
  %100 = load ptr, ptr %8, align 8, !tbaa !5
  %101 = load i32, ptr %100, align 4, !tbaa !9
  %102 = icmp eq i32 %101, 0
  br i1 %102, label %103, label %157

103:                                              ; preds = %99
  %104 = load ptr, ptr %19, align 8, !tbaa !5
  %105 = call i32 @check_file_exists(ptr noundef %104)
  %106 = icmp ne i32 %105, 0
  br i1 %106, label %107, label %157

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  store i8 0, ptr %22, align 1, !tbaa !11
  br label %108

108:                                              ; preds = %143, %107
  call void @llvm.lifetime.start.p0(i64 128, ptr %23) #8
  %109 = load ptr, ptr %19, align 8, !tbaa !5
  %110 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, ptr noundef %109)
  %111 = getelementptr inbounds [128 x i8], ptr %23, i64 0, i64 0
  %112 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.24, ptr noundef %111)
  %113 = icmp ne i32 %112, 1
  br i1 %113, label %114, label %115

114:                                              ; preds = %108
  call void @exit(i32 noundef 1) #10
  unreachable

115:                                              ; preds = %108
  %116 = getelementptr inbounds [128 x i8], ptr %23, i64 0, i64 0
  %117 = load i8, ptr %116, align 16, !tbaa !11
  store i8 %117, ptr %22, align 1, !tbaa !11
  %118 = load i8, ptr %22, align 1, !tbaa !11
  %119 = sext i8 %118 to i32
  %120 = icmp sge i32 %119, 97
  br i1 %120, label %121, label %130

121:                                              ; preds = %115
  %122 = load i8, ptr %22, align 1, !tbaa !11
  %123 = sext i8 %122 to i32
  %124 = icmp sle i32 %123, 122
  br i1 %124, label %125, label %130

125:                                              ; preds = %121
  %126 = load i8, ptr %22, align 1, !tbaa !11
  %127 = sext i8 %126 to i32
  %128 = sub nsw i32 %127, 32
  %129 = trunc i32 %128 to i8
  store i8 %129, ptr %22, align 1, !tbaa !11
  br label %130

130:                                              ; preds = %125, %121, %115
  call void @llvm.lifetime.end.p0(i64 128, ptr %23) #8
  br label %131

131:                                              ; preds = %130
  %132 = load i8, ptr %22, align 1, !tbaa !11
  %133 = sext i8 %132 to i32
  %134 = icmp ne i32 %133, 89
  br i1 %134, label %135, label %143

135:                                              ; preds = %131
  %136 = load i8, ptr %22, align 1, !tbaa !11
  %137 = sext i8 %136 to i32
  %138 = icmp ne i32 %137, 78
  br i1 %138, label %139, label %143

139:                                              ; preds = %135
  %140 = load i8, ptr %22, align 1, !tbaa !11
  %141 = sext i8 %140 to i32
  %142 = icmp ne i32 %141, 65
  br label %143

143:                                              ; preds = %139, %135, %131
  %144 = phi i1 [ false, %135 ], [ false, %131 ], [ %142, %139 ]
  br i1 %144, label %108, label %145, !llvm.loop !14

145:                                              ; preds = %143
  %146 = load i8, ptr %22, align 1, !tbaa !11
  %147 = sext i8 %146 to i32
  %148 = icmp eq i32 %147, 78
  br i1 %148, label %149, label %150

149:                                              ; preds = %145
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %150

150:                                              ; preds = %149, %145
  %151 = load i8, ptr %22, align 1, !tbaa !11
  %152 = sext i8 %151 to i32
  %153 = icmp eq i32 %152, 65
  br i1 %153, label %154, label %156

154:                                              ; preds = %150
  %155 = load ptr, ptr %8, align 8, !tbaa !5
  store i32 1, ptr %155, align 4, !tbaa !9
  br label %156

156:                                              ; preds = %154, %150
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  br label %157

157:                                              ; preds = %156, %103, %99, %96
  %158 = load i32, ptr %16, align 4, !tbaa !9
  %159 = icmp eq i32 %158, 0
  br i1 %159, label %160, label %195

160:                                              ; preds = %157
  %161 = load i32, ptr %14, align 4, !tbaa !9
  %162 = icmp eq i32 %161, 0
  br i1 %162, label %163, label %195

163:                                              ; preds = %160
  %164 = load ptr, ptr %19, align 8, !tbaa !5
  %165 = call noalias ptr @fopen64(ptr noundef %164, ptr noundef @.str.25)
  store ptr %165, ptr %11, align 8, !tbaa !5
  %166 = load ptr, ptr %11, align 8, !tbaa !5
  %167 = icmp eq ptr %166, null
  br i1 %167, label %168, label %188

168:                                              ; preds = %163
  %169 = load i32, ptr %7, align 4, !tbaa !9
  %170 = icmp eq i32 %169, 0
  br i1 %170, label %171, label %188

171:                                              ; preds = %168
  %172 = load ptr, ptr %18, align 8, !tbaa !5
  %173 = getelementptr inbounds [256 x i8], ptr %17, i64 0, i64 0
  %174 = icmp ne ptr %172, %173
  br i1 %174, label %175, label %188

175:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #8
  %176 = load ptr, ptr %18, align 8, !tbaa !5
  %177 = getelementptr inbounds i8, ptr %176, i64 -1
  %178 = load i8, ptr %177, align 1, !tbaa !11
  store i8 %178, ptr %24, align 1, !tbaa !11
  %179 = load ptr, ptr %18, align 8, !tbaa !5
  %180 = getelementptr inbounds i8, ptr %179, i64 -1
  store i8 0, ptr %180, align 1, !tbaa !11
  %181 = load ptr, ptr %19, align 8, !tbaa !5
  %182 = call i32 @makedir(ptr noundef %181)
  %183 = load i8, ptr %24, align 1, !tbaa !11
  %184 = load ptr, ptr %18, align 8, !tbaa !5
  %185 = getelementptr inbounds i8, ptr %184, i64 -1
  store i8 %183, ptr %185, align 1, !tbaa !11
  %186 = load ptr, ptr %19, align 8, !tbaa !5
  %187 = call noalias ptr @fopen64(ptr noundef %186, ptr noundef @.str.25)
  store ptr %187, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #8
  br label %188

188:                                              ; preds = %175, %171, %168, %163
  %189 = load ptr, ptr %11, align 8, !tbaa !5
  %190 = icmp eq ptr %189, null
  br i1 %190, label %191, label %194

191:                                              ; preds = %188
  %192 = load ptr, ptr %19, align 8, !tbaa !5
  %193 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, ptr noundef %192)
  br label %194

194:                                              ; preds = %191, %188
  br label %195

195:                                              ; preds = %194, %160, %157
  %196 = load ptr, ptr %11, align 8, !tbaa !5
  %197 = icmp ne ptr %196, null
  br i1 %197, label %198, label %245

198:                                              ; preds = %195
  %199 = load ptr, ptr %19, align 8, !tbaa !5
  %200 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef %199)
  br label %201

201:                                              ; preds = %227, %198
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = load ptr, ptr %12, align 8, !tbaa !5
  %204 = load i32, ptr %13, align 4, !tbaa !9
  %205 = call i32 @unzReadCurrentFile(ptr noundef %202, ptr noundef %203, i32 noundef %204)
  store i32 %205, ptr %14, align 4, !tbaa !9
  %206 = load i32, ptr %14, align 4, !tbaa !9
  %207 = icmp slt i32 %206, 0
  br i1 %207, label %208, label %211

208:                                              ; preds = %201
  %209 = load i32, ptr %14, align 4, !tbaa !9
  %210 = call i32 (ptr, ...) @printf(ptr noundef @.str.28, i32 noundef %209)
  br label %230

211:                                              ; preds = %201
  %212 = load i32, ptr %14, align 4, !tbaa !9
  %213 = icmp eq i32 %212, 0
  br i1 %213, label %214, label %215

214:                                              ; preds = %211
  br label %230

215:                                              ; preds = %211
  %216 = load ptr, ptr %12, align 8, !tbaa !5
  %217 = load i32, ptr %14, align 4, !tbaa !9
  %218 = sext i32 %217 to i64
  %219 = load ptr, ptr %11, align 8, !tbaa !5
  %220 = call i64 @fwrite(ptr noundef %216, i64 noundef %218, i64 noundef 1, ptr noundef %219)
  %221 = icmp ne i64 %220, 1
  br i1 %221, label %222, label %226

222:                                              ; preds = %215
  %223 = call ptr @__errno_location() #11
  %224 = load i32, ptr %223, align 4, !tbaa !9
  %225 = call i32 (ptr, ...) @printf(ptr noundef @.str.29, i32 noundef %224)
  store i32 -1, ptr %14, align 4, !tbaa !9
  br label %230

226:                                              ; preds = %215
  br label %227

227:                                              ; preds = %226
  %228 = load i32, ptr %14, align 4, !tbaa !9
  %229 = icmp sgt i32 %228, 0
  br i1 %229, label %201, label %230, !llvm.loop !15

230:                                              ; preds = %227, %222, %214, %208
  %231 = load ptr, ptr %11, align 8, !tbaa !5
  %232 = icmp ne ptr %231, null
  br i1 %232, label %233, label %236

233:                                              ; preds = %230
  %234 = load ptr, ptr %11, align 8, !tbaa !5
  %235 = call i32 @fclose(ptr noundef %234)
  br label %236

236:                                              ; preds = %233, %230
  %237 = load i32, ptr %14, align 4, !tbaa !9
  %238 = icmp eq i32 %237, 0
  br i1 %238, label %239, label %244

239:                                              ; preds = %236
  %240 = load ptr, ptr %19, align 8, !tbaa !5
  %241 = getelementptr inbounds %struct.unz_file_info64_s, ptr %10, i32 0, i32 4
  %242 = load i64, ptr %241, align 8, !tbaa !16
  %243 = getelementptr inbounds %struct.unz_file_info64_s, ptr %10, i32 0, i32 14
  call void @change_file_date(ptr noundef %240, i64 noundef %242, ptr noundef byval(%struct.tm_unz_s) align 8 %243)
  br label %244

244:                                              ; preds = %239, %236
  br label %245

245:                                              ; preds = %244, %195
  %246 = load ptr, ptr %6, align 8, !tbaa !5
  %247 = call i32 @unzCloseCurrentFile(ptr noundef %246)
  store i32 %247, ptr %15, align 4, !tbaa !9
  %248 = load i32, ptr %15, align 4, !tbaa !9
  %249 = icmp ne i32 %248, 0
  br i1 %249, label %250, label %253

250:                                              ; preds = %245
  %251 = load i32, ptr %15, align 4, !tbaa !9
  %252 = call i32 (ptr, ...) @printf(ptr noundef @.str.30, i32 noundef %251)
  br label %253

253:                                              ; preds = %250, %245
  %254 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %254) #8
  %255 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %255, ptr %5, align 4
  store i32 1, ptr %21, align 4
  br label %256

256:                                              ; preds = %253, %78, %70, %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 152, ptr %10) #8
  %257 = load i32, ptr %5, align 4
  ret i32 %257
}

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #7

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

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

declare i32 @unzCloseCurrentFile(ptr noundef) #2

attributes #0 = { 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 #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 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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind willreturn memory(none) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn 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 #8 = { nounwind }
attributes #9 = { nounwind allocsize(0) }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind willreturn memory(none) }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}
!16 = !{!17, !18, i64 32}
!17 = !{!"unz_file_info64_s", !18, i64 0, !18, i64 8, !18, i64 16, !18, i64 24, !18, i64 32, !18, i64 40, !19, i64 48, !19, i64 56, !18, i64 64, !18, i64 72, !18, i64 80, !18, i64 88, !18, i64 96, !18, i64 104, !20, i64 112, !19, i64 136, !18, i64 144}
!18 = !{!"long", !7, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = !{!"tm_unz_s", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20}


; 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_unz_s = type { i32, i32, i32, i32, i32, i32 }
%struct.unz_file_info64_s = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.tm_unz_s, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.29 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.30 = external hidden unnamed_addr constant [46 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @change_file_date(ptr noundef, i64 noundef, ptr noundef byval(%struct.tm_unz_s) align 8) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @check_file_exists(ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen64(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local i32 @makedir(ptr noundef) local_unnamed_addr #0

; 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: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @mkdir(ptr nocapture noundef readonly, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #5

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

declare i32 @unzGetCurrentFileInfo64(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: nounwind uwtable
define dso_local i32 @do_extract_currentfile(ptr noundef %0, i32 noundef %1, ptr nocapture noundef %2, ptr noundef %3) local_unnamed_addr #0 {
  %5 = alloca %struct.unz_file_info64_s, align 8
  %6 = alloca [256 x i8], align 16
  %7 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 152, ptr nonnull %5) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(152) %5, i8 0, i64 152, i1 false)
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(256) %6, i8 0, i64 256, i1 false)
  %8 = call i32 @unzGetCurrentFileInfo64(ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %6, i64 noundef 256, ptr noundef null, i64 noundef 0, ptr noundef null, i64 noundef 0) #9
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %.preheader129, label %9

9:                                                ; preds = %4
  %10 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, i32 noundef %8)
  br label %83

.preheader129:                                    ; preds = %4, %14
  %.086 = phi ptr [ %.1, %14 ], [ %6, %4 ]
  %.084 = phi ptr [ %15, %14 ], [ %6, %4 ]
  %11 = load i8, ptr %.084, align 1, !tbaa !5
  switch i8 %11, label %14 [
    i8 0, label %16
    i8 47, label %12
    i8 92, label %12
  ]

12:                                               ; preds = %.preheader129, %.preheader129
  %13 = getelementptr inbounds i8, ptr %.084, i64 1
  br label %14

14:                                               ; preds = %.preheader129, %12
  %.1 = phi ptr [ %13, %12 ], [ %.086, %.preheader129 ]
  %15 = getelementptr inbounds i8, ptr %.084, i64 1
  br label %.preheader129, !llvm.loop !8

16:                                               ; preds = %.preheader129
  %17 = load i8, ptr %.086, align 1, !tbaa !5
  %18 = icmp eq i8 %17, 0
  br i1 %18, label %19, label %24

19:                                               ; preds = %16
  %20 = icmp eq i32 %1, 0
  br i1 %20, label %21, label %83

21:                                               ; preds = %19
  %22 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef nonnull %6)
  %23 = call i32 @mkdir(ptr noundef nonnull %6, i32 noundef 509) #9
  br label %83

24:                                               ; preds = %16
  %25 = call noalias dereferenceable_or_null(8192) ptr @malloc(i64 noundef 8192) #10
  %26 = icmp eq ptr %25, null
  br i1 %26, label %27, label %29

27:                                               ; preds = %24
  %28 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1)
  br label %83

29:                                               ; preds = %24
  %30 = call i32 @unzOpenCurrentFilePassword(ptr noundef %0, ptr noundef %3) #9
  %.not103 = icmp eq i32 %30, 0
  br i1 %.not103, label %32, label %.thread116

.thread116:                                       ; preds = %29
  %31 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22, i32 noundef %30)
  br label %.thread122

32:                                               ; preds = %29
  %.not104110 = icmp eq i32 %1, 0
  %..086111 = select i1 %.not104110, ptr %6, ptr %.086
  %33 = load i32, ptr %2, align 4, !tbaa !10
  %34 = icmp eq i32 %33, 0
  br i1 %34, label %35, label %.thread

35:                                               ; preds = %32
  %36 = call i32 @check_file_exists(ptr noundef nonnull %..086111)
  %.not105 = icmp eq i32 %36, 0
  br i1 %.not105, label %.thread, label %.preheader

.preheader:                                       ; preds = %35, %40
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #9
  %37 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef nonnull %..086111)
  %38 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.24, ptr noundef nonnull %7)
  %.not106 = icmp eq i32 %38, 1
  br i1 %.not106, label %40, label %39

39:                                               ; preds = %.preheader
  call void @exit(i32 noundef 1) #11
  unreachable

40:                                               ; preds = %.preheader
  %41 = load i8, ptr %7, align 16, !tbaa !5
  %42 = add i8 %41, -97
  %or.cond = icmp ult i8 %42, 26
  %43 = add nsw i8 %41, -32
  %spec.select = select i1 %or.cond, i8 %43, i8 %41
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #9
  switch i8 %spec.select, label %.preheader [
    i8 65, label %44
    i8 78, label %.thread122
    i8 89, label %.thread
  ]

44:                                               ; preds = %40
  store i32 1, ptr %2, align 4, !tbaa !10
  br label %.thread

.thread:                                          ; preds = %40, %44, %32, %35
  %45 = call noalias ptr @fopen64(ptr noundef nonnull %..086111, ptr noundef nonnull @.str.25)
  %46 = icmp eq ptr %45, null
  %or.cond9 = and i1 %.not104110, %46
  %47 = icmp ne ptr %.086, %6
  %or.cond12 = select i1 %or.cond9, i1 %47, i1 false
  br i1 %or.cond12, label %48, label %53

48:                                               ; preds = %.thread
  %49 = getelementptr inbounds i8, ptr %.086, i64 -1
  %50 = load i8, ptr %49, align 1, !tbaa !5
  store i8 0, ptr %49, align 1, !tbaa !5
  %51 = call i32 @makedir(ptr noundef nonnull %6)
  store i8 %50, ptr %49, align 1, !tbaa !5
  %52 = call noalias ptr @fopen64(ptr noundef nonnull %6, ptr noundef nonnull @.str.25)
  br label %53

53:                                               ; preds = %48, %.thread
  %.091 = phi ptr [ %52, %48 ], [ %45, %.thread ]
  %54 = icmp eq ptr %.091, null
  br i1 %54, label %55, label %57

55:                                               ; preds = %53
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, ptr noundef nonnull %..086111)
  br label %.thread122

57:                                               ; preds = %53
  %58 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef nonnull %..086111)
  br label %59

59:                                               ; preds = %66, %57
  %60 = call i32 @unzReadCurrentFile(ptr noundef %0, ptr noundef nonnull %25, i32 noundef 8192) #9
  %61 = icmp slt i32 %60, 0
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28, i32 noundef %60)
  br label %.thread127

64:                                               ; preds = %59
  %65 = icmp eq i32 %60, 0
  br i1 %65, label %74, label %66

66:                                               ; preds = %64
  %67 = zext nneg i32 %60 to i64
  %68 = call i64 @fwrite(ptr noundef nonnull %25, i64 noundef %67, i64 noundef 1, ptr noundef nonnull %.091)
  %.not108 = icmp eq i64 %68, 1
  br i1 %.not108, label %59, label %69

69:                                               ; preds = %66
  %70 = tail call ptr @__errno_location() #12
  %71 = load i32, ptr %70, align 4, !tbaa !10
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.29, i32 noundef %71)
  br label %.thread127

.thread127:                                       ; preds = %62, %69
  %.089.ph = phi i32 [ -1, %69 ], [ %60, %62 ]
  %73 = call i32 @fclose(ptr noundef nonnull %.091)
  br label %.thread122

74:                                               ; preds = %64
  %75 = call i32 @fclose(ptr noundef nonnull %.091)
  %76 = getelementptr inbounds i8, ptr %5, i64 32
  %77 = load i64, ptr %76, align 8, !tbaa !12
  %78 = getelementptr inbounds i8, ptr %5, i64 112
  call void @change_file_date(ptr noundef nonnull %..086111, i64 noundef %77, ptr noundef nonnull byval(%struct.tm_unz_s) align 8 %78)
  br label %.thread122

.thread122:                                       ; preds = %40, %.thread116, %55, %.thread127, %74
  %.190 = phi i32 [ 0, %74 ], [ %.089.ph, %.thread127 ], [ 0, %55 ], [ %30, %.thread116 ], [ 0, %40 ]
  %79 = call i32 @unzCloseCurrentFile(ptr noundef %0) #9
  %.not109 = icmp eq i32 %79, 0
  br i1 %.not109, label %82, label %80

80:                                               ; preds = %.thread122
  %81 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.30, i32 noundef %79)
  br label %82

82:                                               ; preds = %80, %.thread122
  call void @free(ptr noundef %25) #9
  br label %83

83:                                               ; preds = %19, %21, %82, %27, %9
  %.0 = phi i32 [ %8, %9 ], [ -104, %27 ], [ %.190, %82 ], [ 0, %21 ], [ 0, %19 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 152, ptr nonnull %5) #9
  ret i32 %.0
}

declare i32 @unzOpenCurrentFilePassword(ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #8

declare i32 @unzReadCurrentFile(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i64 @fwrite(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #2

declare i32 @unzCloseCurrentFile(ptr noundef) local_unnamed_addr #7

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!13, !14, i64 32}
!13 = !{!"unz_file_info64_s", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !14, i64 40, !15, i64 48, !15, i64 56, !14, i64 64, !14, i64 72, !14, i64 80, !14, i64 88, !14, i64 96, !14, i64 104, !16, i64 112, !15, i64 136, !14, i64 144}
!14 = !{!"long", !6, i64 0}
!15 = !{!"long long", !6, i64 0}
!16 = !{!"tm_unz_s", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20}


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