; LLVM IR from dynexcoin/Dynex :: external/miniupnpc (listdevices)

; 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.UPNPDev = type { ptr, ptr, ptr, ptr, i32, [0 x i8] }
%struct.upnp_dev_list = type { ptr, ptr, ptr, i64, i64 }

@stderr = external global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @add_device(ptr noundef, ptr noundef) #0

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #3

; 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 void @free_device(ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store ptr null, ptr %6, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store ptr null, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr null, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store ptr null, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %11) #7
  store i8 2, ptr %11, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store ptr null, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store ptr null, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %138, %2
  %20 = load i32, ptr %17, align 4, !tbaa !5
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = icmp slt i32 %20, %21
  br i1 %22, label %23, label %141

23:                                               ; preds = %19
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = load i32, ptr %17, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %24, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !9
  %29 = call i32 @strcmp(ptr noundef %28, ptr noundef @.str.3) #8
  %30 = icmp eq i32 %29, 0
  br i1 %30, label %31, label %32

31:                                               ; preds = %23
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %137

32:                                               ; preds = %23
  %33 = load ptr, ptr %5, align 8, !tbaa !9
  %34 = load i32, ptr %17, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds ptr, ptr %33, i64 %35
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = call i32 @strcmp(ptr noundef %37, ptr noundef @.str.4) #8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %54

40:                                               ; preds = %32
  %41 = load i32, ptr %17, align 4, !tbaa !5
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %17, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = icmp sge i32 %42, %43
  br i1 %44, label %45, label %48

45:                                               ; preds = %40
  %46 = load ptr, ptr @stderr, align 8, !tbaa !9
  %47 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %46, ptr noundef @.str.5, ptr noundef @.str.4) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

48:                                               ; preds = %40
  %49 = load ptr, ptr %5, align 8, !tbaa !9
  %50 = load i32, ptr %17, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  store ptr %53, ptr %6, align 8, !tbaa !9
  br label %136

54:                                               ; preds = %32
  %55 = load ptr, ptr %5, align 8, !tbaa !9
  %56 = load i32, ptr %17, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = call i32 @strcmp(ptr noundef %59, ptr noundef @.str.6) #8
  %61 = icmp eq i32 %60, 0
  br i1 %61, label %62, label %78

62:                                               ; preds = %54
  %63 = load i32, ptr %17, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr %17, align 4, !tbaa !5
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = icmp sge i32 %64, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %62
  %68 = load ptr, ptr @stderr, align 8, !tbaa !9
  %69 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %68, ptr noundef @.str.5, ptr noundef @.str.6) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

70:                                               ; preds = %62
  %71 = load ptr, ptr %5, align 8, !tbaa !9
  %72 = load i32, ptr %17, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds ptr, ptr %71, i64 %73
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = call i32 @atoi(ptr noundef %75) #8
  %77 = trunc i32 %76 to i8
  store i8 %77, ptr %11, align 1, !tbaa !11
  br label %135

78:                                               ; preds = %54
  %79 = load ptr, ptr %5, align 8, !tbaa !9
  %80 = load i32, ptr %17, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = call i32 @strcmp(ptr noundef %83, ptr noundef @.str.7) #8
  %85 = icmp eq i32 %84, 0
  br i1 %85, label %86, label %99

86:                                               ; preds = %78
  %87 = load i32, ptr %17, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr %17, align 4, !tbaa !5
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = icmp sge i32 %88, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = load ptr, ptr @stderr, align 8, !tbaa !9
  %93 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %92, ptr noundef @.str.8) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

94:                                               ; preds = %86
  %95 = load ptr, ptr %5, align 8, !tbaa !9
  %96 = load i32, ptr %17, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds ptr, ptr %95, i64 %97
  store ptr %98, ptr %7, align 8, !tbaa !9
  br label %141

99:                                               ; preds = %78
  %100 = load ptr, ptr %5, align 8, !tbaa !9
  %101 = load i32, ptr %17, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds ptr, ptr %100, i64 %102
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = call i32 @strcmp(ptr noundef %104, ptr noundef @.str.9) #8
  %106 = icmp eq i32 %105, 0
  br i1 %106, label %107, label %121

107:                                              ; preds = %99
  %108 = load i32, ptr %17, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %17, align 4, !tbaa !5
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = icmp sge i32 %109, %110
  br i1 %111, label %112, label %115

112:                                              ; preds = %107
  %113 = load ptr, ptr @stderr, align 8, !tbaa !9
  %114 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %113, ptr noundef @.str.10) #7
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

115:                                              ; preds = %107
  %116 = load ptr, ptr %5, align 8, !tbaa !9
  %117 = load i32, ptr %17, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds ptr, ptr %116, i64 %118
  %120 = load ptr, ptr %119, align 8, !tbaa !9
  store ptr %120, ptr %8, align 8, !tbaa !9
  br label %133

121:                                              ; preds = %99
  %122 = load ptr, ptr %5, align 8, !tbaa !9
  %123 = getelementptr inbounds ptr, ptr %122, i64 0
  %124 = load ptr, ptr %123, align 8, !tbaa !9
  %125 = call i32 (ptr, ...) @printf(ptr noundef @.str.11, ptr noundef %124)
  %126 = call i32 (ptr, ...) @printf(ptr noundef @.str.12)
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.13)
  %128 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %129 = call i32 (ptr, ...) @printf(ptr noundef @.str.15)
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.16)
  %131 = call i32 (ptr, ...) @printf(ptr noundef @.str.17)
  %132 = call i32 (ptr, ...) @printf(ptr noundef @.str.18)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

133:                                              ; preds = %115
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134, %70
  br label %136

136:                                              ; preds = %135, %48
  br label %137

137:                                              ; preds = %136, %31
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %17, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %17, align 4, !tbaa !5
  br label %19, !llvm.loop !12

141:                                              ; preds = %94, %19
  %142 = load ptr, ptr %6, align 8, !tbaa !9
  %143 = icmp ne ptr %142, null
  br i1 %143, label %144, label %153

144:                                              ; preds = %141
  %145 = load ptr, ptr %6, align 8, !tbaa !9
  %146 = call i32 (ptr, ...) @printf(ptr noundef @.str.19, ptr noundef %145)
  %147 = load ptr, ptr %6, align 8, !tbaa !9
  %148 = load ptr, ptr %8, align 8, !tbaa !9
  %149 = load ptr, ptr %9, align 8, !tbaa !9
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = load i8, ptr %11, align 1, !tbaa !11
  %152 = call ptr @upnpDiscoverDevice(ptr noundef %147, i32 noundef 2000, ptr noundef %148, ptr noundef %149, i32 noundef 0, i32 noundef %150, i8 noundef zeroext %151, ptr noundef %12)
  store ptr %152, ptr %13, align 8, !tbaa !9
  br label %190

153:                                              ; preds = %141
  %154 = load ptr, ptr %7, align 8, !tbaa !9
  %155 = icmp ne ptr %154, null
  br i1 %155, label %156, label %182

156:                                              ; preds = %153
  %157 = call i32 (ptr, ...) @printf(ptr noundef @.str.20)
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %172, %156
  %159 = load ptr, ptr %7, align 8, !tbaa !9
  %160 = load i32, ptr %17, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds ptr, ptr %159, i64 %161
  %163 = load ptr, ptr %162, align 8, !tbaa !9
  %164 = icmp ne ptr %163, null
  br i1 %164, label %165, label %175

165:                                              ; preds = %158
  %166 = load ptr, ptr %7, align 8, !tbaa !9
  %167 = load i32, ptr %17, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds ptr, ptr %166, i64 %168
  %170 = load ptr, ptr %169, align 8, !tbaa !9
  %171 = call i32 (ptr, ...) @printf(ptr noundef @.str.21, ptr noundef %170)
  br label %172

172:                                              ; preds = %165
  %173 = load i32, ptr %17, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %17, align 4, !tbaa !5
  br label %158, !llvm.loop !14

175:                                              ; preds = %158
  %176 = load ptr, ptr %7, align 8, !tbaa !9
  %177 = load ptr, ptr %8, align 8, !tbaa !9
  %178 = load ptr, ptr %9, align 8, !tbaa !9
  %179 = load i32, ptr %10, align 4, !tbaa !5
  %180 = load i8, ptr %11, align 1, !tbaa !11
  %181 = call ptr @upnpDiscoverDevices(ptr noundef %176, i32 noundef 2000, ptr noundef %177, ptr noundef %178, i32 noundef 0, i32 noundef %179, i8 noundef zeroext %180, ptr noundef %12, i32 noundef 1)
  store ptr %181, ptr %13, align 8, !tbaa !9
  br label %189

182:                                              ; preds = %153
  %183 = call i32 (ptr, ...) @printf(ptr noundef @.str.22)
  %184 = load ptr, ptr %8, align 8, !tbaa !9
  %185 = load ptr, ptr %9, align 8, !tbaa !9
  %186 = load i32, ptr %10, align 4, !tbaa !5
  %187 = load i8, ptr %11, align 1, !tbaa !11
  %188 = call ptr @upnpDiscoverAll(i32 noundef 2000, ptr noundef %184, ptr noundef %185, i32 noundef 0, i32 noundef %186, i8 noundef zeroext %187, ptr noundef %12)
  store ptr %188, ptr %13, align 8, !tbaa !9
  br label %189

189:                                              ; preds = %182, %175
  br label %190

190:                                              ; preds = %189, %144
  %191 = load ptr, ptr %13, align 8, !tbaa !9
  %192 = icmp ne ptr %191, null
  br i1 %192, label %193, label %281

193:                                              ; preds = %190
  %194 = load ptr, ptr %13, align 8, !tbaa !9
  store ptr %194, ptr %14, align 8, !tbaa !9
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %195

195:                                              ; preds = %213, %193
  %196 = load ptr, ptr %14, align 8, !tbaa !9
  %197 = icmp ne ptr %196, null
  br i1 %197, label %198, label %219

198:                                              ; preds = %195
  %199 = load i32, ptr %17, align 4, !tbaa !5
  %200 = load ptr, ptr %14, align 8, !tbaa !9
  %201 = getelementptr inbounds %struct.UPNPDev, ptr %200, i32 0, i32 2
  %202 = load ptr, ptr %201, align 8, !tbaa !15
  %203 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, i32 noundef %199, ptr noundef %202)
  %204 = load ptr, ptr %14, align 8, !tbaa !9
  %205 = getelementptr inbounds %struct.UPNPDev, ptr %204, i32 0, i32 1
  %206 = load ptr, ptr %205, align 8, !tbaa !17
  %207 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, ptr noundef %206)
  %208 = load ptr, ptr %14, align 8, !tbaa !9
  %209 = getelementptr inbounds %struct.UPNPDev, ptr %208, i32 0, i32 3
  %210 = load ptr, ptr %209, align 8, !tbaa !18
  %211 = call i32 (ptr, ...) @printf(ptr noundef @.str.24, ptr noundef %210)
  %212 = load ptr, ptr %14, align 8, !tbaa !9
  call void @add_device(ptr noundef %15, ptr noundef %212)
  br label %213

213:                                              ; preds = %198
  %214 = load ptr, ptr %14, align 8, !tbaa !9
  %215 = getelementptr inbounds %struct.UPNPDev, ptr %214, i32 0, i32 0
  %216 = load ptr, ptr %215, align 8, !tbaa !19
  store ptr %216, ptr %14, align 8, !tbaa !9
  %217 = load i32, ptr %17, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %17, align 4, !tbaa !5
  br label %195, !llvm.loop !20

219:                                              ; preds = %195
  %220 = call i32 @putchar(i32 noundef 10)
  %221 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %221, ptr %16, align 8, !tbaa !9
  br label %222

222:                                              ; preds = %265, %219
  %223 = load ptr, ptr %16, align 8, !tbaa !9
  %224 = icmp ne ptr %223, null
  br i1 %224, label %225, label %269

225:                                              ; preds = %222
  %226 = load ptr, ptr %16, align 8, !tbaa !9
  %227 = getelementptr inbounds %struct.upnp_dev_list, ptr %226, i32 0, i32 1
  %228 = load ptr, ptr %227, align 8, !tbaa !21
  %229 = call i32 (ptr, ...) @printf(ptr noundef @.str.25, ptr noundef %228)
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %260, %225
  %231 = load i32, ptr %17, align 4, !tbaa !5
  %232 = zext i32 %231 to i64
  %233 = load ptr, ptr %16, align 8, !tbaa !9
  %234 = getelementptr inbounds %struct.upnp_dev_list, ptr %233, i32 0, i32 3
  %235 = load i64, ptr %234, align 8, !tbaa !24
  %236 = icmp ult i64 %232, %235
  br i1 %236, label %237, label %263

237:                                              ; preds = %230
  %238 = load i32, ptr %17, align 4, !tbaa !5
  %239 = add nsw i32 %238, 1
  %240 = load ptr, ptr %16, align 8, !tbaa !9
  %241 = getelementptr inbounds %struct.upnp_dev_list, ptr %240, i32 0, i32 2
  %242 = load ptr, ptr %241, align 8, !tbaa !25
  %243 = load i32, ptr %17, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds ptr, ptr %242, i64 %244
  %246 = load ptr, ptr %245, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.UPNPDev, ptr %246, i32 0, i32 2
  %248 = load ptr, ptr %247, align 8, !tbaa !15
  %249 = call i32 (ptr, ...) @printf(ptr noundef @.str.26, i32 noundef %239, ptr noundef %248)
  %250 = load ptr, ptr %16, align 8, !tbaa !9
  %251 = getelementptr inbounds %struct.upnp_dev_list, ptr %250, i32 0, i32 2
  %252 = load ptr, ptr %251, align 8, !tbaa !25
  %253 = load i32, ptr %17, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds ptr, ptr %252, i64 %254
  %256 = load ptr, ptr %255, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.UPNPDev, ptr %256, i32 0, i32 3
  %258 = load ptr, ptr %257, align 8, !tbaa !18
  %259 = call i32 (ptr, ...) @printf(ptr noundef @.str.27, ptr noundef %258)
  br label %260

260:                                              ; preds = %237
  %261 = load i32, ptr %17, align 4, !tbaa !5
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %17, align 4, !tbaa !5
  br label %230, !llvm.loop !26

263:                                              ; preds = %230
  %264 = call i32 @putchar(i32 noundef 10)
  br label %265

265:                                              ; preds = %263
  %266 = load ptr, ptr %16, align 8, !tbaa !9
  %267 = getelementptr inbounds %struct.upnp_dev_list, ptr %266, i32 0, i32 0
  %268 = load ptr, ptr %267, align 8, !tbaa !27
  store ptr %268, ptr %16, align 8, !tbaa !9
  br label %222, !llvm.loop !28

269:                                              ; preds = %222
  %270 = load ptr, ptr %13, align 8, !tbaa !9
  call void @freeUPNPDevlist(ptr noundef %270)
  br label %271

271:                                              ; preds = %274, %269
  %272 = load ptr, ptr %15, align 8, !tbaa !9
  %273 = icmp ne ptr %272, null
  br i1 %273, label %274, label %280

274:                                              ; preds = %271
  %275 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %275, ptr %16, align 8, !tbaa !9
  %276 = load ptr, ptr %15, align 8, !tbaa !9
  %277 = getelementptr inbounds %struct.upnp_dev_list, ptr %276, i32 0, i32 0
  %278 = load ptr, ptr %277, align 8, !tbaa !27
  store ptr %278, ptr %15, align 8, !tbaa !9
  %279 = load ptr, ptr %16, align 8, !tbaa !9
  call void @free_device(ptr noundef %279)
  br label %271, !llvm.loop !29

280:                                              ; preds = %271
  br label %283

281:                                              ; preds = %190
  %282 = call i32 (ptr, ...) @printf(ptr noundef @.str.28)
  br label %283

283:                                              ; preds = %281, %280
  store i32 0, ptr %3, align 4
  store i32 1, ptr %18, align 4
  br label %284

284:                                              ; preds = %283, %121, %112, %91, %67, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, 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 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %285 = load i32, ptr %3, align 4
  ret i32 %285
}

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

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

declare ptr @upnpDiscoverDevice(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #5

declare ptr @upnpDiscoverDevices(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef, i32 noundef) #5

declare ptr @upnpDiscoverAll(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) #5

; Function Attrs: inlinehint nounwind uwtable
declare i32 @putchar(i32 noundef) #6

declare void @freeUPNPDevlist(ptr noundef) #5

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 = { nounwind willreturn memory(read) "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 = { inlinehint nounwind willreturn memory(read) 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 = { "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 = { inlinehint 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }

!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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = !{!16, !10, i64 16}
!16 = !{!"UPNPDev", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !7, i64 36}
!17 = !{!16, !10, i64 8}
!18 = !{!16, !10, i64 24}
!19 = !{!16, !10, i64 0}
!20 = distinct !{!20, !13}
!21 = !{!22, !10, i64 8}
!22 = !{!"upnp_dev_list", !10, i64 0, !10, i64 8, !10, i64 16, !23, i64 24, !23, i64 32}
!23 = !{!"long", !7, i64 0}
!24 = !{!22, !23, i64 24}
!25 = !{!22, !10, i64 16}
!26 = distinct !{!26, !13}
!27 = !{!22, !10, i64 0}
!28 = distinct !{!28, !13}
!29 = distinct !{!29, !13}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [51 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [63 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [61 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [19 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.26 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @add_device(ptr noundef, ptr noundef) 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 nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_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: nounwind uwtable
declare dso_local void @free_device(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @main(i32 noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  store ptr null, ptr %4, align 8, !tbaa !9
  %5 = icmp sgt i32 %0, 1
  br i1 %5, label %.lr.ph, label %.thread108

.lr.ph:                                           ; preds = %2, %67
  %.0147 = phi i32 [ %68, %67 ], [ 1, %2 ]
  %.078146 = phi i8 [ %.179, %67 ], [ 2, %2 ]
  %.080145 = phi i32 [ %.181, %67 ], [ 0, %2 ]
  %.083144 = phi ptr [ %.184, %67 ], [ null, %2 ]
  %.086143 = phi ptr [ %.187, %67 ], [ null, %2 ]
  %6 = sext i32 %.0147 to i64
  %7 = getelementptr inbounds ptr, ptr %1, i64 %6
  %8 = load ptr, ptr %7, align 8, !tbaa !9
  %9 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.3) #8
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %67, label %11

11:                                               ; preds = %.lr.ph
  %12 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.4) #8
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %23

14:                                               ; preds = %11
  %15 = add nsw i32 %.0147, 1
  %.not104 = icmp slt i32 %15, %0
  br i1 %.not104, label %19, label %16

16:                                               ; preds = %14
  %17 = load ptr, ptr @stderr, align 8, !tbaa !9
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.4) #9
  br label %.loopexit

19:                                               ; preds = %14
  %20 = sext i32 %15 to i64
  %21 = getelementptr inbounds ptr, ptr %1, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !9
  br label %67

23:                                               ; preds = %11
  %24 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.6) #8
  %25 = icmp eq i32 %24, 0
  br i1 %25, label %26, label %37

26:                                               ; preds = %23
  %27 = add nsw i32 %.0147, 1
  %.not103 = icmp slt i32 %27, %0
  br i1 %.not103, label %31, label %28

28:                                               ; preds = %26
  %29 = load ptr, ptr @stderr, align 8, !tbaa !9
  %30 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %29, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6) #9
  br label %.loopexit

31:                                               ; preds = %26
  %32 = sext i32 %27 to i64
  %33 = getelementptr inbounds ptr, ptr %1, i64 %32
  %34 = load ptr, ptr %33, align 8, !tbaa !9
  %35 = tail call i32 @atoi(ptr nocapture noundef %34) #8
  %36 = trunc i32 %35 to i8
  br label %67

37:                                               ; preds = %23
  %38 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.7) #8
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %40, label %45

40:                                               ; preds = %37
  %41 = add nsw i32 %.0147, 1
  %.not95 = icmp slt i32 %41, %0
  br i1 %.not95, label %70, label %42

42:                                               ; preds = %40
  %43 = load ptr, ptr @stderr, align 8, !tbaa !9
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.8) #9
  br label %.loopexit

45:                                               ; preds = %37
  %46 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.9) #8
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %57

48:                                               ; preds = %45
  %49 = add nsw i32 %.0147, 1
  %.not = icmp slt i32 %49, %0
  br i1 %.not, label %53, label %50

50:                                               ; preds = %48
  %51 = load ptr, ptr @stderr, align 8, !tbaa !9
  %52 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %51, ptr noundef nonnull @.str.10) #9
  br label %.loopexit

53:                                               ; preds = %48
  %54 = sext i32 %49 to i64
  %55 = getelementptr inbounds ptr, ptr %1, i64 %54
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  br label %67

57:                                               ; preds = %45
  %58 = load ptr, ptr %1, align 8, !tbaa !9
  %59 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.11, ptr noundef %58)
  %60 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.12)
  %61 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.13)
  %62 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %63 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.15)
  %64 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.16)
  %65 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.17)
  %66 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.18)
  br label %.loopexit

67:                                               ; preds = %.lr.ph, %31, %53, %19
  %.187 = phi ptr [ %22, %19 ], [ %.086143, %31 ], [ %.086143, %53 ], [ %.086143, %.lr.ph ]
  %.184 = phi ptr [ %.083144, %19 ], [ %.083144, %31 ], [ %56, %53 ], [ %.083144, %.lr.ph ]
  %.181 = phi i32 [ %.080145, %19 ], [ %.080145, %31 ], [ %.080145, %53 ], [ 1, %.lr.ph ]
  %.179 = phi i8 [ %.078146, %19 ], [ %36, %31 ], [ %.078146, %53 ], [ %.078146, %.lr.ph ]
  %.1 = phi i32 [ %15, %19 ], [ %27, %31 ], [ %49, %53 ], [ %.0147, %.lr.ph ]
  %68 = add nsw i32 %.1, 1
  %69 = icmp slt i32 %68, %0
  br i1 %69, label %.lr.ph, label %.thread, !llvm.loop !11

70:                                               ; preds = %40
  %71 = sext i32 %41 to i64
  %72 = getelementptr inbounds ptr, ptr %1, i64 %71
  %.not96 = icmp eq ptr %.086143, null
  br i1 %.not96, label %76, label %73

.thread:                                          ; preds = %67
  %.not96106 = icmp eq ptr %.187, null
  br i1 %.not96106, label %.thread108, label %73

73:                                               ; preds = %.thread, %70
  %.086142 = phi ptr [ %.187, %.thread ], [ %.086143, %70 ]
  %.083136 = phi ptr [ %.184, %.thread ], [ %.083144, %70 ]
  %.080129 = phi i32 [ %.181, %.thread ], [ %.080145, %70 ]
  %.078122 = phi i8 [ %.179, %.thread ], [ %.078146, %70 ]
  %74 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef nonnull %.086142)
  %75 = call ptr @upnpDiscoverDevice(ptr noundef nonnull %.086142, i32 noundef 2000, ptr noundef %.083136, ptr noundef null, i32 noundef 0, i32 noundef %.080129, i8 noundef zeroext %.078122, ptr noundef nonnull %3) #7
  br label %86

76:                                               ; preds = %70
  %77 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.20)
  %78 = load ptr, ptr %72, align 8, !tbaa !9
  %.not98151 = icmp eq ptr %78, null
  br i1 %.not98151, label %._crit_edge, label %.lr.ph153

.lr.ph153:                                        ; preds = %76, %.lr.ph153
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph153 ], [ 0, %76 ]
  %79 = phi ptr [ %82, %.lr.ph153 ], [ %78, %76 ]
  %80 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef nonnull %79)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %81 = getelementptr inbounds ptr, ptr %72, i64 %indvars.iv.next
  %82 = load ptr, ptr %81, align 8, !tbaa !9
  %.not98 = icmp eq ptr %82, null
  br i1 %.not98, label %._crit_edge, label %.lr.ph153, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph153, %76
  %83 = call ptr @upnpDiscoverDevices(ptr noundef nonnull %72, i32 noundef 2000, ptr noundef %.083144, ptr noundef null, i32 noundef 0, i32 noundef %.080145, i8 noundef zeroext %.078146, ptr noundef nonnull %3, i32 noundef 1) #7
  br label %86

.thread108:                                       ; preds = %2, %.thread
  %.083135 = phi ptr [ %.184, %.thread ], [ null, %2 ]
  %.080128 = phi i32 [ %.181, %.thread ], [ 0, %2 ]
  %.078121 = phi i8 [ %.179, %.thread ], [ 2, %2 ]
  %84 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.22)
  %85 = call ptr @upnpDiscoverAll(i32 noundef 2000, ptr noundef %.083135, ptr noundef null, i32 noundef 0, i32 noundef %.080128, i8 noundef zeroext %.078121, ptr noundef nonnull %3) #7
  br label %86

86:                                               ; preds = %._crit_edge, %.thread108, %73
  %.077 = phi ptr [ %75, %73 ], [ %83, %._crit_edge ], [ %85, %.thread108 ]
  %.not99 = icmp eq ptr %.077, null
  br i1 %.not99, label %127, label %.preheader

.preheader:                                       ; preds = %86, %.preheader
  %.3155 = phi i32 [ %97, %.preheader ], [ 1, %86 ]
  %.076154 = phi ptr [ %96, %.preheader ], [ %.077, %86 ]
  %87 = getelementptr inbounds i8, ptr %.076154, i64 16
  %88 = load ptr, ptr %87, align 8, !tbaa !14
  %89 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, i32 noundef %.3155, ptr noundef %88)
  %90 = getelementptr inbounds i8, ptr %.076154, i64 8
  %91 = load ptr, ptr %90, align 8, !tbaa !16
  %92 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef %91)
  %93 = getelementptr inbounds i8, ptr %.076154, i64 24
  %94 = load ptr, ptr %93, align 8, !tbaa !17
  %95 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef %94)
  call void @add_device(ptr noundef nonnull %4, ptr noundef nonnull %.076154)
  %96 = load ptr, ptr %.076154, align 8, !tbaa !18
  %97 = add nuw nsw i32 %.3155, 1
  %.not100 = icmp eq ptr %96, null
  br i1 %.not100, label %98, label %.preheader, !llvm.loop !19

98:                                               ; preds = %.preheader
  %99 = call i32 @putchar(i32 noundef 10)
  %.075160 = load ptr, ptr %4, align 8, !tbaa !9
  %.not101161 = icmp eq ptr %.075160, null
  br i1 %.not101161, label %._crit_edge165, label %.lr.ph164

.lr.ph164:                                        ; preds = %98, %._crit_edge159
  %.075162 = phi ptr [ %.075, %._crit_edge159 ], [ %.075160, %98 ]
  %100 = getelementptr inbounds i8, ptr %.075162, i64 8
  %101 = load ptr, ptr %100, align 8, !tbaa !20
  %102 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.25, ptr noundef %101)
  %103 = getelementptr inbounds i8, ptr %.075162, i64 24
  %104 = load i64, ptr %103, align 8, !tbaa !23
  %.not169 = icmp eq i64 %104, 0
  br i1 %.not169, label %._crit_edge159, label %.lr.ph158

.lr.ph158:                                        ; preds = %.lr.ph164
  %105 = getelementptr inbounds i8, ptr %.075162, i64 16
  br label %106

106:                                              ; preds = %.lr.ph158, %106
  %indvars.iv196 = phi i64 [ 0, %.lr.ph158 ], [ %indvars.iv.next197, %106 ]
  %indvars.iv.next197 = add nuw nsw i64 %indvars.iv196, 1
  %107 = load ptr, ptr %105, align 8, !tbaa !24
  %108 = getelementptr inbounds ptr, ptr %107, i64 %indvars.iv196
  %109 = load ptr, ptr %108, align 8, !tbaa !9
  %110 = getelementptr inbounds i8, ptr %109, i64 16
  %111 = load ptr, ptr %110, align 8, !tbaa !14
  %112 = trunc nuw nsw i64 %indvars.iv.next197 to i32
  %113 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.26, i32 noundef %112, ptr noundef %111)
  %114 = load ptr, ptr %105, align 8, !tbaa !24
  %115 = getelementptr inbounds ptr, ptr %114, i64 %indvars.iv196
  %116 = load ptr, ptr %115, align 8, !tbaa !9
  %117 = getelementptr inbounds i8, ptr %116, i64 24
  %118 = load ptr, ptr %117, align 8, !tbaa !17
  %119 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27, ptr noundef %118)
  %120 = load i64, ptr %103, align 8, !tbaa !23
  %121 = icmp ugt i64 %120, %indvars.iv.next197
  br i1 %121, label %106, label %._crit_edge159, !llvm.loop !25

._crit_edge159:                                   ; preds = %106, %.lr.ph164
  %122 = call i32 @putchar(i32 noundef 10)
  %.075 = load ptr, ptr %.075162, align 8, !tbaa !9
  %.not101 = icmp eq ptr %.075, null
  br i1 %.not101, label %._crit_edge165, label %.lr.ph164, !llvm.loop !26

._crit_edge165:                                   ; preds = %._crit_edge159, %98
  call void @freeUPNPDevlist(ptr noundef nonnull %.077) #7
  %123 = load ptr, ptr %4, align 8, !tbaa !9
  %.not102166 = icmp eq ptr %123, null
  br i1 %.not102166, label %.loopexit, label %.lr.ph168

.lr.ph168:                                        ; preds = %._crit_edge165, %.lr.ph168
  %124 = phi ptr [ %126, %.lr.ph168 ], [ %123, %._crit_edge165 ]
  %125 = load ptr, ptr %124, align 8, !tbaa !27
  store ptr %125, ptr %4, align 8, !tbaa !9
  call void @free_device(ptr noundef nonnull %124)
  %126 = load ptr, ptr %4, align 8, !tbaa !9
  %.not102 = icmp eq ptr %126, null
  br i1 %.not102, label %.loopexit, label %.lr.ph168, !llvm.loop !28

127:                                              ; preds = %86
  %128 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.28)
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph168, %._crit_edge165, %127, %57, %50, %42, %28, %16
  %.082 = phi i32 [ 1, %16 ], [ 1, %28 ], [ 1, %42 ], [ 1, %50 ], [ 1, %57 ], [ 0, %127 ], [ 0, %._crit_edge165 ], [ 0, %.lr.ph168 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  ret i32 %.082
}

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #4

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

declare ptr @upnpDiscoverDevice(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #5

declare ptr @upnpDiscoverDevices(ptr noundef, i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef, i32 noundef) local_unnamed_addr #5

declare ptr @upnpDiscoverAll(i32 noundef, ptr noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint nofree nounwind uwtable
declare noundef i32 @putchar(i32 noundef) local_unnamed_addr #6

declare void @freeUPNPDevlist(ptr noundef) local_unnamed_addr #5

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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { 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 #4 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 = { "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 = { inlinehint nofree 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 #7 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { cold 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !10, i64 16}
!15 = !{!"UPNPDev", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !6, i64 32, !7, i64 36}
!16 = !{!15, !10, i64 8}
!17 = !{!15, !10, i64 24}
!18 = !{!15, !10, i64 0}
!19 = distinct !{!19, !12}
!20 = !{!21, !10, i64 8}
!21 = !{!"upnp_dev_list", !10, i64 0, !10, i64 8, !10, i64 16, !22, i64 24, !22, i64 32}
!22 = !{!"long", !7, i64 0}
!23 = !{!21, !22, i64 24}
!24 = !{!21, !10, i64 16}
!25 = distinct !{!25, !12}
!26 = distinct !{!26, !12}
!27 = !{!21, !10, i64 0}
!28 = distinct !{!28, !12}


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