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

; 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] }

@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 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 ptr @upnpDiscoverDevices(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i32 noundef %8) #1 {
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca ptr, align 8
  store ptr %0, ptr %11, align 8, !tbaa !5
  store i32 %1, ptr %12, align 4, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !5
  store ptr %3, ptr %14, align 8, !tbaa !5
  store i32 %4, ptr %15, align 4, !tbaa !9
  store i32 %5, ptr %16, align 4, !tbaa !9
  store i8 %6, ptr %17, align 1, !tbaa !11
  store ptr %7, ptr %18, align 8, !tbaa !5
  store i32 %8, ptr %19, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store ptr null, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %27 = load ptr, ptr %18, align 8, !tbaa !5
  %28 = icmp ne ptr %27, null
  br i1 %28, label %29, label %31

29:                                               ; preds = %9
  %30 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 -1, ptr %30, align 4, !tbaa !9
  br label %31

31:                                               ; preds = %29, %9
  %32 = load ptr, ptr %14, align 8, !tbaa !5
  %33 = icmp ne ptr %32, null
  br i1 %33, label %35, label %34

34:                                               ; preds = %31
  store ptr @.str.1, ptr %14, align 8, !tbaa !5
  br label %35

35:                                               ; preds = %34, %31
  %36 = load ptr, ptr %14, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 0
  %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 %105

41:                                               ; preds = %35
  store i32 0, ptr %22, align 4, !tbaa !9
  br label %42

42:                                               ; preds = %101, %41
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = load i32, ptr %22, align 4, !tbaa !9
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  %48 = icmp ne ptr %47, null
  br i1 %48, label %49, label %104

49:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #4
  store i32 1, ptr %24, align 4, !tbaa !9
  %50 = load ptr, ptr %11, align 8, !tbaa !5
  %51 = load i32, ptr %22, align 4, !tbaa !9
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %50, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !5
  %55 = load ptr, ptr %14, align 8, !tbaa !5
  %56 = call ptr @getDevicesFromMiniSSDPD(ptr noundef %54, ptr noundef %55, ptr noundef null)
  store ptr %56, ptr %23, align 8, !tbaa !5
  %57 = load ptr, ptr %23, align 8, !tbaa !5
  %58 = icmp ne ptr %57, null
  br i1 %58, label %59, label %97

59:                                               ; preds = %49
  %60 = load ptr, ptr %23, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.UPNPDev, ptr %60, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !12
  %63 = call ptr @strstr(ptr noundef %62, ptr noundef @.str.2) #5
  %64 = icmp ne ptr %63, null
  br i1 %64, label %66, label %65

65:                                               ; preds = %59
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %66

66:                                               ; preds = %65, %59
  %67 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %67, ptr %20, align 8, !tbaa !5
  br label %68

68:                                               ; preds = %81, %66
  %69 = load ptr, ptr %20, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.UPNPDev, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !14
  %72 = icmp ne ptr %71, null
  br i1 %72, label %73, label %85

73:                                               ; preds = %68
  %74 = load ptr, ptr %20, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.UPNPDev, ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !12
  %77 = call ptr @strstr(ptr noundef %76, ptr noundef @.str.2) #5
  %78 = icmp ne ptr %77, null
  br i1 %78, label %80, label %79

79:                                               ; preds = %73
  store i32 0, ptr %24, align 4, !tbaa !9
  br label %80

80:                                               ; preds = %79, %73
  br label %81

81:                                               ; preds = %80
  %82 = load ptr, ptr %20, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.UPNPDev, ptr %82, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !14
  store ptr %84, ptr %20, align 8, !tbaa !5
  br label %68, !llvm.loop !15

85:                                               ; preds = %68
  %86 = load ptr, ptr %21, align 8, !tbaa !5
  %87 = load ptr, ptr %20, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.UPNPDev, ptr %87, i32 0, i32 0
  store ptr %86, ptr %88, align 8, !tbaa !14
  %89 = load ptr, ptr %23, align 8, !tbaa !5
  store ptr %89, ptr %21, align 8, !tbaa !5
  %90 = load i32, ptr %19, align 4, !tbaa !9
  %91 = icmp ne i32 %90, 0
  br i1 %91, label %96, label %92

92:                                               ; preds = %85
  %93 = load i32, ptr %24, align 4, !tbaa !9
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %96, label %95

95:                                               ; preds = %92
  store i32 2, ptr %25, align 4
  br label %98

96:                                               ; preds = %92, %85
  br label %97

97:                                               ; preds = %96, %49
  store i32 0, ptr %25, align 4
  br label %98

98:                                               ; preds = %97, %95
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  %99 = load i32, ptr %25, align 4
  switch i32 %99, label %162 [
    i32 0, label %100
    i32 2, label %104
  ]

100:                                              ; preds = %98
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %22, align 4, !tbaa !9
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %22, align 4, !tbaa !9
  br label %42, !llvm.loop !17

104:                                              ; preds = %98, %42
  br label %105

105:                                              ; preds = %104, %35
  %106 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %106, ptr %20, align 8, !tbaa !5
  br label %107

107:                                              ; preds = %124, %105
  %108 = load ptr, ptr %20, align 8, !tbaa !5
  %109 = icmp ne ptr %108, null
  br i1 %109, label %110, label %128

110:                                              ; preds = %107
  %111 = load ptr, ptr %20, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.UPNPDev, ptr %111, i32 0, i32 2
  %113 = load ptr, ptr %112, align 8, !tbaa !12
  %114 = call ptr @strstr(ptr noundef %113, ptr noundef @.str.2) #5
  %115 = icmp ne ptr %114, null
  br i1 %115, label %123, label %116

116:                                              ; preds = %110
  %117 = load ptr, ptr %18, align 8, !tbaa !5
  %118 = icmp ne ptr %117, null
  br i1 %118, label %119, label %121

119:                                              ; preds = %116
  %120 = load ptr, ptr %18, align 8, !tbaa !5
  store i32 0, ptr %120, align 4, !tbaa !9
  br label %121

121:                                              ; preds = %119, %116
  %122 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %122, ptr %10, align 8
  store i32 1, ptr %25, align 4
  br label %160

123:                                              ; preds = %110
  br label %124

124:                                              ; preds = %123
  %125 = load ptr, ptr %20, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.UPNPDev, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !14
  store ptr %127, ptr %20, align 8, !tbaa !5
  br label %107, !llvm.loop !18

128:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %129 = load ptr, ptr %11, align 8, !tbaa !5
  %130 = load i32, ptr %12, align 4, !tbaa !9
  %131 = load ptr, ptr %13, align 8, !tbaa !5
  %132 = load i32, ptr %15, align 4, !tbaa !9
  %133 = load i32, ptr %16, align 4, !tbaa !9
  %134 = load i8, ptr %17, align 1, !tbaa !11
  %135 = load ptr, ptr %18, align 8, !tbaa !5
  %136 = load i32, ptr %19, align 4, !tbaa !9
  %137 = call ptr @ssdpDiscoverDevices(ptr noundef %129, i32 noundef %130, ptr noundef %131, i32 noundef %132, i32 noundef %133, i8 noundef zeroext %134, ptr noundef %135, i32 noundef %136)
  store ptr %137, ptr %26, align 8, !tbaa !5
  %138 = load ptr, ptr %21, align 8, !tbaa !5
  %139 = icmp eq ptr %138, null
  br i1 %139, label %140, label %142

140:                                              ; preds = %128
  %141 = load ptr, ptr %26, align 8, !tbaa !5
  store ptr %141, ptr %21, align 8, !tbaa !5
  br label %158

142:                                              ; preds = %128
  %143 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %143, ptr %20, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %150, %142
  %145 = load ptr, ptr %20, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.UPNPDev, ptr %145, i32 0, i32 0
  %147 = load ptr, ptr %146, align 8, !tbaa !14
  %148 = icmp ne ptr %147, null
  br i1 %148, label %149, label %154

149:                                              ; preds = %144
  br label %150

150:                                              ; preds = %149
  %151 = load ptr, ptr %20, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.UPNPDev, ptr %151, i32 0, i32 0
  %153 = load ptr, ptr %152, align 8, !tbaa !14
  store ptr %153, ptr %20, align 8, !tbaa !5
  br label %144, !llvm.loop !19

154:                                              ; preds = %144
  %155 = load ptr, ptr %26, align 8, !tbaa !5
  %156 = load ptr, ptr %20, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.UPNPDev, ptr %156, i32 0, i32 0
  store ptr %155, ptr %157, align 8, !tbaa !14
  br label %158

158:                                              ; preds = %154, %140
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  %159 = load ptr, ptr %21, align 8, !tbaa !5
  store ptr %159, ptr %10, align 8
  store i32 1, ptr %25, align 4
  br label %160

160:                                              ; preds = %158, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  %161 = load ptr, ptr %10, align 8
  ret ptr %161

162:                                              ; preds = %98
  unreachable
}

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

; Function Attrs: nounwind willreturn memory(read)
declare ptr @strstr(ptr noundef, ptr noundef) #3

declare ptr @ssdpDiscoverDevices(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef, i32 noundef) #2

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 = { "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 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 #4 = { nounwind }
attributes #5 = { 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 = !{!"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, !6, i64 16}
!13 = !{!"UPNPDev", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32, !7, i64 36}
!14 = !{!13, !6, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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

@.str.1 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @upnpDiscoverDevices(ptr noundef %0, i32 noundef %1, ptr noundef %2, ptr noundef %3, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i32 noundef %8) local_unnamed_addr #0 {
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %11, label %10

10:                                               ; preds = %9
  store i32 -1, ptr %7, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %10, %9
  %.not60 = icmp eq ptr %3, null
  %spec.store.select = select i1 %.not60, ptr @.str.1, ptr %3
  %12 = load i8, ptr %spec.store.select, align 1, !tbaa !9
  %.not61 = icmp eq i8 %12, 0
  br i1 %.not61, label %._crit_edge92.thread, label %.preheader76

.preheader76:                                     ; preds = %11
  %13 = load ptr, ptr %0, align 8, !tbaa !10
  %.not6281 = icmp eq ptr %13, null
  br i1 %.not6281, label %._crit_edge92.thread, label %.lr.ph84

.lr.ph84:                                         ; preds = %.preheader76
  %.not93 = icmp eq i32 %8, 0
  br i1 %.not93, label %.lr.ph84.split, label %.lr.ph84.split.us

.lr.ph84.split.us:                                ; preds = %.lr.ph84, %select.unfold.us
  %indvars.iv = phi i64 [ %indvars.iv.next, %select.unfold.us ], [ 0, %.lr.ph84 ]
  %14 = phi ptr [ %21, %select.unfold.us ], [ %13, %.lr.ph84 ]
  %.04982.us = phi ptr [ %.251.ph.us, %select.unfold.us ], [ null, %.lr.ph84 ]
  %15 = tail call ptr @getDevicesFromMiniSSDPD(ptr noundef nonnull %14, ptr noundef nonnull %spec.store.select, ptr noundef null) #3
  %.not63.us = icmp eq ptr %15, null
  br i1 %.not63.us, label %select.unfold.us, label %16

16:                                               ; preds = %.lr.ph84.split.us
  %17 = load ptr, ptr %15, align 8, !tbaa !12
  %.not6577.us = icmp eq ptr %17, null
  br i1 %.not6577.us, label %._crit_edge.us, label %.lr.ph.us

.lr.ph.us:                                        ; preds = %16, %.lr.ph.us
  %18 = phi ptr [ %19, %.lr.ph.us ], [ %17, %16 ]
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %.not65.us = icmp eq ptr %19, null
  br i1 %.not65.us, label %._crit_edge.us, label %.lr.ph.us, !llvm.loop !14

._crit_edge.us:                                   ; preds = %.lr.ph.us, %16
  %.052.lcssa.us = phi ptr [ %15, %16 ], [ %18, %.lr.ph.us ]
  store ptr %.04982.us, ptr %.052.lcssa.us, align 8, !tbaa !12
  br label %select.unfold.us

select.unfold.us:                                 ; preds = %._crit_edge.us, %.lr.ph84.split.us
  %.251.ph.us = phi ptr [ %.04982.us, %.lr.ph84.split.us ], [ %15, %._crit_edge.us ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next
  %21 = load ptr, ptr %20, align 8, !tbaa !10
  %.not62.us = icmp eq ptr %21, null
  br i1 %.not62.us, label %.loopexit, label %.lr.ph84.split.us, !llvm.loop !16

.lr.ph84.split:                                   ; preds = %.lr.ph84, %select.unfold
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %select.unfold ], [ 0, %.lr.ph84 ]
  %22 = phi ptr [ %35, %select.unfold ], [ %13, %.lr.ph84 ]
  %.04982 = phi ptr [ %.251.ph, %select.unfold ], [ null, %.lr.ph84 ]
  %23 = tail call ptr @getDevicesFromMiniSSDPD(ptr noundef nonnull %22, ptr noundef nonnull %spec.store.select, ptr noundef null) #3
  %.not63 = icmp eq ptr %23, null
  br i1 %.not63, label %select.unfold, label %24

24:                                               ; preds = %.lr.ph84.split
  %25 = getelementptr inbounds i8, ptr %23, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !17
  %27 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %26, ptr noundef nonnull dereferenceable(1) @.str.2) #4
  %.not64 = icmp ne ptr %27, null
  %spec.select = zext i1 %.not64 to i32
  %28 = load ptr, ptr %23, align 8, !tbaa !12
  %.not6577 = icmp eq ptr %28, null
  br i1 %.not6577, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24, %.lr.ph
  %29 = phi ptr [ %33, %.lr.ph ], [ %28, %24 ]
  %.179 = phi i32 [ %spec.select70, %.lr.ph ], [ %spec.select, %24 ]
  %.05278 = phi ptr [ %29, %.lr.ph ], [ %23, %24 ]
  %30 = getelementptr inbounds i8, ptr %.05278, i64 16
  %31 = load ptr, ptr %30, align 8, !tbaa !17
  %32 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %31, ptr noundef nonnull dereferenceable(1) @.str.2) #4
  %.not69 = icmp eq ptr %32, null
  %spec.select70 = select i1 %.not69, i32 0, i32 %.179
  %33 = load ptr, ptr %29, align 8, !tbaa !12
  %.not65 = icmp eq ptr %33, null
  br i1 %.not65, label %._crit_edge, label %.lr.ph, !llvm.loop !14

._crit_edge:                                      ; preds = %.lr.ph, %24
  %.052.lcssa = phi ptr [ %23, %24 ], [ %29, %.lr.ph ]
  %.1.lcssa = phi i32 [ %spec.select, %24 ], [ %spec.select70, %.lr.ph ]
  store ptr %.04982, ptr %.052.lcssa, align 8, !tbaa !12
  %.not94 = icmp eq i32 %.1.lcssa, 0
  br i1 %.not94, label %.loopexit, label %select.unfold

select.unfold:                                    ; preds = %._crit_edge, %.lr.ph84.split
  %.251.ph = phi ptr [ %.04982, %.lr.ph84.split ], [ %23, %._crit_edge ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %34 = getelementptr inbounds ptr, ptr %0, i64 %indvars.iv.next99
  %35 = load ptr, ptr %34, align 8, !tbaa !10
  %.not62 = icmp eq ptr %35, null
  br i1 %.not62, label %.loopexit, label %.lr.ph84.split, !llvm.loop !16

.loopexit:                                        ; preds = %select.unfold.us, %select.unfold, %._crit_edge
  %.3 = phi ptr [ %.251.ph, %select.unfold ], [ %23, %._crit_edge ], [ %.251.ph.us, %select.unfold.us ]
  %.not6688 = icmp eq ptr %.3, null
  br i1 %.not6688, label %._crit_edge92.thread, label %.lr.ph91

.lr.ph91:                                         ; preds = %.loopexit, %41
  %.15389 = phi ptr [ %42, %41 ], [ %.3, %.loopexit ]
  %36 = getelementptr inbounds i8, ptr %.15389, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !17
  %38 = tail call ptr @strstr(ptr noundef nonnull dereferenceable(1) %37, ptr noundef nonnull dereferenceable(1) @.str.2) #4
  %.not68 = icmp eq ptr %38, null
  br i1 %.not68, label %39, label %41

39:                                               ; preds = %.lr.ph91
  br i1 %.not, label %47, label %40

40:                                               ; preds = %39
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %47

41:                                               ; preds = %.lr.ph91
  %42 = load ptr, ptr %.15389, align 8, !tbaa !12
  %.not66 = icmp eq ptr %42, null
  br i1 %.not66, label %._crit_edge92, label %.lr.ph91, !llvm.loop !18

._crit_edge92.thread:                             ; preds = %.loopexit, %11, %.preheader76
  %43 = tail call ptr @ssdpDiscoverDevices(ptr noundef %0, i32 noundef %1, ptr noundef %2, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i32 noundef %8) #3
  br label %47

._crit_edge92:                                    ; preds = %41
  %44 = tail call ptr @ssdpDiscoverDevices(ptr noundef nonnull %0, i32 noundef %1, ptr noundef %2, i32 noundef %4, i32 noundef %5, i8 noundef zeroext %6, ptr noundef %7, i32 noundef %8) #3
  br i1 %.not6688, label %47, label %.preheader

.preheader:                                       ; preds = %._crit_edge92, %.preheader
  %.254 = phi ptr [ %45, %.preheader ], [ %.3, %._crit_edge92 ]
  %45 = load ptr, ptr %.254, align 8, !tbaa !12
  %.not67 = icmp eq ptr %45, null
  br i1 %.not67, label %46, label %.preheader, !llvm.loop !19

46:                                               ; preds = %.preheader
  store ptr %44, ptr %.254, align 8, !tbaa !12
  br label %47

47:                                               ; preds = %._crit_edge92.thread, %46, %._crit_edge92, %39, %40
  %.0 = phi ptr [ %.3, %40 ], [ %.3, %39 ], [ %.3, %46 ], [ %44, %._crit_edge92 ], [ %43, %._crit_edge92.thread ]
  ret ptr %.0
}

declare ptr @getDevicesFromMiniSSDPD(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare ptr @strstr(ptr noundef, ptr nocapture noundef) local_unnamed_addr #2

declare ptr @ssdpDiscoverDevices(ptr noundef, i32 noundef, ptr noundef, i32 noundef, i32 noundef, i8 noundef zeroext, ptr noundef, i32 noundef) local_unnamed_addr #1

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 = { "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 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 = { nounwind }
attributes #4 = { 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 = !{!7, !7, i64 0}
!10 = !{!11, !11, i64 0}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !11, i64 0}
!13 = !{!"UPNPDev", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !6, i64 32, !7, i64 36}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = !{!13, !11, i64 16}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}


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