; LLVM IR from buaazp/zimg :: deps/hiredis (net)

; 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.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.redisContext = type { i32, [128 x i8], i32, i32, ptr, ptr }

@.str.3 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [24 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

declare i32 @close(i32 noundef) #1

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

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

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

32:                                               ; preds = %4
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = call ptr @gai_strerror(i32 noundef %34) #6
  call void @__redisSetError(ptr noundef %33, i32 noundef 2, ptr noundef %35)
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %139

36:                                               ; preds = %4
  %37 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %37, ptr %15, align 8, !tbaa !5
  br label %38

38:                                               ; preds = %118, %36
  %39 = load ptr, ptr %15, align 8, !tbaa !5
  %40 = icmp ne ptr %39, null
  br i1 %40, label %41, label %122

41:                                               ; preds = %38
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.addrinfo, ptr %42, i32 0, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !13
  %45 = load ptr, ptr %15, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.addrinfo, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 8, !tbaa !15
  %48 = load ptr, ptr %15, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.addrinfo, ptr %48, i32 0, i32 3
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = call i32 @socket(i32 noundef %44, i32 noundef %47, i32 noundef %50) #6
  store i32 %51, ptr %10, align 4, !tbaa !9
  %52 = icmp eq i32 %51, -1
  br i1 %52, label %53, label %54

53:                                               ; preds = %41
  br label %118

54:                                               ; preds = %41
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load i32, ptr %10, align 4, !tbaa !9
  %57 = call i32 @redisSetBlocking(ptr noundef %55, i32 noundef %56, i32 noundef 0)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %60

59:                                               ; preds = %54
  br label %135

60:                                               ; preds = %54
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = load ptr, ptr %15, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.addrinfo, ptr %62, i32 0, i32 5
  %64 = load ptr, ptr %63, align 8, !tbaa !17
  %65 = load ptr, ptr %15, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.addrinfo, ptr %65, i32 0, i32 4
  %67 = load i32, ptr %66, align 8, !tbaa !18
  %68 = call i32 @connect(i32 noundef %61, ptr noundef %64, i32 noundef %67)
  %69 = icmp eq i32 %68, -1
  br i1 %69, label %70, label %95

70:                                               ; preds = %60
  %71 = call ptr @__errno_location() #7
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = icmp eq i32 %72, 113
  br i1 %73, label %74, label %77

74:                                               ; preds = %70
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = call i32 @close(i32 noundef %75)
  br label %118

77:                                               ; preds = %70
  %78 = call ptr @__errno_location() #7
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = icmp eq i32 %79, 115
  br i1 %80, label %81, label %85

81:                                               ; preds = %77
  %82 = load i32, ptr %16, align 4, !tbaa !9
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %85, label %84

84:                                               ; preds = %81
  br label %93

85:                                               ; preds = %81, %77
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = load i32, ptr %10, align 4, !tbaa !9
  %88 = load ptr, ptr %9, align 8, !tbaa !5
  %89 = call i32 @redisContextWaitReady(ptr noundef %86, i32 noundef %87, ptr noundef %88)
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %85
  br label %135

92:                                               ; preds = %85
  br label %93

93:                                               ; preds = %92, %84
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94, %60
  %96 = load i32, ptr %16, align 4, !tbaa !9
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %104

98:                                               ; preds = %95
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = call i32 @redisSetBlocking(ptr noundef %99, i32 noundef %100, i32 noundef 1)
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %98
  br label %135

104:                                              ; preds = %98, %95
  %105 = load ptr, ptr %6, align 8, !tbaa !5
  %106 = load i32, ptr %10, align 4, !tbaa !9
  %107 = call i32 @redisSetTcpNoDelay(ptr noundef %105, i32 noundef %106)
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %110

109:                                              ; preds = %104
  br label %135

110:                                              ; preds = %104
  %111 = load i32, ptr %10, align 4, !tbaa !9
  %112 = load ptr, ptr %6, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.redisContext, ptr %112, i32 0, i32 2
  store i32 %111, ptr %113, align 4, !tbaa !19
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.redisContext, ptr %114, i32 0, i32 3
  %116 = load i32, ptr %115, align 8, !tbaa !11
  %117 = or i32 %116, 2
  store i32 %117, ptr %115, align 8, !tbaa !11
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %136

118:                                              ; preds = %74, %53
  %119 = load ptr, ptr %15, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.addrinfo, ptr %119, i32 0, i32 7
  %121 = load ptr, ptr %120, align 8, !tbaa !20
  store ptr %121, ptr %15, align 8, !tbaa !5
  br label %38, !llvm.loop !21

122:                                              ; preds = %38
  %123 = load ptr, ptr %15, align 8, !tbaa !5
  %124 = icmp eq ptr %123, null
  br i1 %124, label %125, label %134

125:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 128, ptr %18) #6
  %126 = getelementptr inbounds [128 x i8], ptr %18, i64 0, i64 0
  %127 = call ptr @__errno_location() #7
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = call ptr @strerror(i32 noundef %128) #6
  %130 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %126, i64 noundef 128, ptr noundef @.str.4, ptr noundef %129) #6
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = getelementptr inbounds [128 x i8], ptr %18, i64 0, i64 0
  call void @__redisSetError(ptr noundef %131, i32 noundef 2, ptr noundef %132)
  store i32 5, ptr %17, align 4
  call void @llvm.lifetime.end.p0(i64 128, ptr %18) #6
  %133 = load i32, ptr %17, align 4
  switch i32 %133, label %139 [
    i32 5, label %135
  ]

134:                                              ; preds = %122
  br label %135

135:                                              ; preds = %134, %125, %109, %103, %91, %59
  store i32 -1, ptr %11, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %135, %110
  %137 = load ptr, ptr %14, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %137) #6
  %138 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %138, ptr %5, align 4
  store i32 1, ptr %17, align 4
  br label %139

139:                                              ; preds = %136, %125, %32
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 6, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  %140 = load i32, ptr %5, align 4
  ret i32 %140
}

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #4

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

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

declare void @__redisSetError(ptr noundef, i32 noundef, ptr noundef) #1

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

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

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

declare i32 @connect(i32 noundef, ptr noundef, i32 noundef) #1

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { 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 #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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!12, !10, i64 136}
!12 = !{!"redisContext", !10, i64 0, !7, i64 4, !10, i64 132, !10, i64 136, !6, i64 144, !6, i64 152}
!13 = !{!14, !10, i64 4}
!14 = !{!"addrinfo", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!15 = !{!14, !10, i64 8}
!16 = !{!14, !10, i64 12}
!17 = !{!14, !6, i64 24}
!18 = !{!14, !10, i64 16}
!19 = !{!12, !10, i64 132}
!20 = !{!14, !6, i64 40}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; 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.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

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

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

declare i32 @close(i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @redisContextConnectTcp(ptr noundef %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) local_unnamed_addr #3 {
  %5 = alloca [6 x i8], align 1
  %6 = alloca %struct.addrinfo, align 8
  %7 = alloca ptr, align 8
  %8 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 6, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %9 = getelementptr inbounds i8, ptr %0, i64 136
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %11 = and i32 %10, 1
  %12 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %5, i64 noundef 6, ptr noundef nonnull @.str.3, i32 noundef %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 48, i1 false)
  %13 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 2, ptr %13, align 4, !tbaa !11
  %14 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 1, ptr %14, align 8, !tbaa !13
  %15 = call i32 @getaddrinfo(ptr noundef %1, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7) #7
  %.not = icmp eq i32 %15, 0
  br i1 %.not, label %.preheader, label %16

.preheader:                                       ; preds = %4
  %.03349 = load ptr, ptr %7, align 8, !tbaa !14
  %.not3850 = icmp eq ptr %.03349, null
  br i1 %.not3850, label %._crit_edge, label %.lr.ph

16:                                               ; preds = %4
  %17 = call ptr @gai_strerror(i32 noundef %15) #7
  call void @__redisSetError(ptr noundef nonnull %0, i32 noundef 2, ptr noundef %17) #7
  br label %60

.lr.ph:                                           ; preds = %.preheader, %53
  %.03351 = phi ptr [ %.033, %53 ], [ %.03349, %.preheader ]
  %18 = getelementptr inbounds i8, ptr %.03351, i64 4
  %19 = load i32, ptr %18, align 4, !tbaa !11
  %20 = getelementptr inbounds i8, ptr %.03351, i64 8
  %21 = load i32, ptr %20, align 8, !tbaa !13
  %22 = getelementptr inbounds i8, ptr %.03351, i64 12
  %23 = load i32, ptr %22, align 4, !tbaa !15
  %24 = call i32 @socket(i32 noundef %19, i32 noundef %21, i32 noundef %23) #7
  %25 = icmp eq i32 %24, -1
  br i1 %25, label %53, label %26

26:                                               ; preds = %.lr.ph
  %27 = call i32 @redisSetBlocking(ptr noundef %0, i32 noundef %24, i32 noundef 0)
  %.not39 = icmp eq i32 %27, 0
  br i1 %.not39, label %28, label %.loopexit

28:                                               ; preds = %26
  %29 = getelementptr inbounds i8, ptr %.03351, i64 24
  %30 = load ptr, ptr %29, align 8, !tbaa !16
  %31 = getelementptr inbounds i8, ptr %.03351, i64 16
  %32 = load i32, ptr %31, align 8, !tbaa !17
  %33 = call i32 @connect(i32 noundef %24, ptr noundef %30, i32 noundef %32) #7
  %34 = icmp eq i32 %33, -1
  br i1 %34, label %35, label %.loopexit45

35:                                               ; preds = %28
  %36 = tail call ptr @__errno_location() #8
  %37 = load i32, ptr %36, align 4, !tbaa !18
  %38 = icmp eq i32 %37, 113
  br i1 %38, label %39, label %41

39:                                               ; preds = %35
  %40 = call i32 @close(i32 noundef %24) #7
  br label %53

41:                                               ; preds = %35
  %42 = icmp ne i32 %37, 115
  %43 = icmp ne i32 %11, 0
  %or.cond = select i1 %42, i1 true, i1 %43
  br i1 %or.cond, label %44, label %.thread

44:                                               ; preds = %41
  %45 = call i32 @redisContextWaitReady(ptr noundef %0, i32 noundef %24, ptr noundef %3)
  %.not40 = icmp eq i32 %45, 0
  br i1 %.not40, label %.loopexit45, label %.loopexit

.loopexit45:                                      ; preds = %28, %44
  %.not41 = icmp eq i32 %11, 0
  br i1 %.not41, label %.thread, label %46

46:                                               ; preds = %.loopexit45
  %47 = call i32 @redisSetBlocking(ptr noundef %0, i32 noundef %24, i32 noundef 1)
  %.not42 = icmp eq i32 %47, 0
  br i1 %.not42, label %.thread, label %.loopexit

.thread:                                          ; preds = %41, %46, %.loopexit45
  %48 = call i32 @redisSetTcpNoDelay(ptr noundef %0, i32 noundef %24)
  %.not43 = icmp eq i32 %48, 0
  br i1 %.not43, label %49, label %.loopexit

49:                                               ; preds = %.thread
  %50 = getelementptr inbounds i8, ptr %0, i64 132
  store i32 %24, ptr %50, align 4, !tbaa !19
  %51 = load i32, ptr %9, align 8, !tbaa !5
  %52 = or i32 %51, 2
  store i32 %52, ptr %9, align 8, !tbaa !5
  br label %.loopexit

53:                                               ; preds = %.lr.ph, %39
  %54 = getelementptr inbounds i8, ptr %.03351, i64 40
  %.033 = load ptr, ptr %54, align 8, !tbaa !14
  %.not38 = icmp eq ptr %.033, null
  br i1 %.not38, label %._crit_edge, label %.lr.ph, !llvm.loop !20

._crit_edge:                                      ; preds = %53, %.preheader
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %8) #7
  %55 = tail call ptr @__errno_location() #8
  %56 = load i32, ptr %55, align 4, !tbaa !18
  %57 = call ptr @strerror(i32 noundef %56) #7
  %58 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %8, i64 noundef 128, ptr noundef nonnull @.str.4, ptr noundef %57) #7
  call void @__redisSetError(ptr noundef %0, i32 noundef 2, ptr noundef nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %8) #7
  br label %.loopexit

.loopexit:                                        ; preds = %26, %44, %46, %.thread, %._crit_edge, %49
  %.034 = phi i32 [ 0, %49 ], [ -1, %._crit_edge ], [ -1, %.thread ], [ -1, %46 ], [ -1, %44 ], [ -1, %26 ]
  %59 = load ptr, ptr %7, align 8, !tbaa !14
  call void @freeaddrinfo(ptr noundef %59) #7
  br label %60

60:                                               ; preds = %.loopexit, %16
  %.0 = phi i32 [ -1, %16 ], [ %.034, %.loopexit ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 6, ptr nonnull %5) #7
  ret i32 %.0
}

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #4

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

declare i32 @getaddrinfo(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @__redisSetError(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare ptr @gai_strerror(i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #6

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

declare i32 @connect(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #6

; Function Attrs: nounwind
declare void @freeaddrinfo(ptr noundef) local_unnamed_addr #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #3 = { 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 #4 = { 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 #5 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { 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 #7 = { nounwind }
attributes #8 = { 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, !7, i64 136}
!6 = !{!"redisContext", !7, i64 0, !8, i64 4, !7, i64 132, !7, i64 136, !10, i64 144, !10, i64 152}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 4}
!12 = !{!"addrinfo", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!12, !7, i64 8}
!14 = !{!10, !10, i64 0}
!15 = !{!12, !7, i64 12}
!16 = !{!12, !10, i64 24}
!17 = !{!12, !7, i64 16}
!18 = !{!7, !7, i64 0}
!19 = !{!6, !7, i64 132}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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