; LLVM IR from kevin2431/Traj-LO :: thirdparty/ros/ros_comm/utilities/xmlrpcpp/src (XmlRpcSocket)

; 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.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }
%struct.in_addr = type { i32 }
%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.sockaddr_in6 = type { i16, i16, i32, %struct.in6_addr, i32 }
%struct.in6_addr = type { %union.anon }
%union.anon = type { [4 x i32] }

@_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E = external dso_local global i8, align 1
@stderr = external global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1

declare void @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6XmlRpc12XmlRpcSocket7connectEiRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) #5 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %struct.sockaddr_storage, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca %struct.addrinfo, align 8
  %12 = alloca i32, align 4
  %13 = alloca i8, align 1
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca %struct.in_addr, align 4
  %17 = alloca ptr, align 8
  %18 = alloca [128 x i8], align 16
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 %0, ptr %5, align 4, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 128, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.memset.p0.i64(ptr align 8 %8, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %11) #8
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 48, i1 false)
  %21 = getelementptr inbounds %struct.addrinfo, ptr %11, i32 0, i32 1
  store i32 0, ptr %21, align 4, !tbaa !11
  %22 = load ptr, ptr %6, align 8, !tbaa !9
  %23 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %22) #8
  %24 = call i32 @getaddrinfo(ptr noundef %23, ptr noundef null, ptr noundef %11, ptr noundef %10)
  %25 = icmp ne i32 %24, 0
  br i1 %25, label %26, label %35

26:                                               ; preds = %3
  %27 = load ptr, ptr @stderr, align 8, !tbaa !9
  %28 = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !13, !range !15, !noundef !16
  %29 = trunc i8 %28 to i1
  %30 = zext i1 %29 to i64
  %31 = select i1 %29, ptr @.str.2, ptr @.str.3
  %32 = load ptr, ptr %6, align 8, !tbaa !9
  %33 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %32) #8
  %34 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %27, ptr noundef @.str.1, ptr noundef %31, ptr noundef %33) #8
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %148

35:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  store i8 0, ptr %13, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %36 = load ptr, ptr %10, align 8, !tbaa !9
  store ptr %36, ptr %14, align 8, !tbaa !9
  br label %37

37:                                               ; preds = %106, %35
  %38 = load ptr, ptr %14, align 8, !tbaa !9
  %39 = icmp ne ptr %38, null
  br i1 %39, label %40, label %110

40:                                               ; preds = %37
  %41 = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !13, !range !15, !noundef !16
  %42 = trunc i8 %41 to i1
  br i1 %42, label %73, label %43

43:                                               ; preds = %40
  %44 = load ptr, ptr %14, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.addrinfo, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !11
  %47 = icmp eq i32 %46, 2
  br i1 %47, label %48, label %73

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store ptr %8, ptr %15, align 8, !tbaa !9
  store i32 16, ptr %9, align 4, !tbaa !5
  %49 = load ptr, ptr %15, align 8, !tbaa !9
  %50 = load ptr, ptr %14, align 8, !tbaa !9
  %51 = getelementptr inbounds %struct.addrinfo, ptr %50, i32 0, i32 5
  %52 = load ptr, ptr %51, align 8, !tbaa !17
  %53 = load ptr, ptr %14, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.addrinfo, ptr %53, i32 0, i32 4
  %55 = load i32, ptr %54, align 8, !tbaa !18
  %56 = zext i32 %55 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %49, ptr align 2 %52, i64 %56, i1 false)
  %57 = load ptr, ptr %14, align 8, !tbaa !9
  %58 = getelementptr inbounds %struct.addrinfo, ptr %57, i32 0, i32 1
  %59 = load i32, ptr %58, align 4, !tbaa !11
  %60 = trunc i32 %59 to i16
  %61 = load ptr, ptr %15, align 8, !tbaa !9
  %62 = getelementptr inbounds %struct.sockaddr_in, ptr %61, i32 0, i32 0
  store i16 %60, ptr %62, align 4, !tbaa !19
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = trunc i32 %63 to i16
  %65 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext %64)
  %66 = load ptr, ptr %15, align 8, !tbaa !9
  %67 = getelementptr inbounds %struct.sockaddr_in, ptr %66, i32 0, i32 1
  store i16 %65, ptr %67, align 2, !tbaa !23
  %68 = load ptr, ptr %15, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.sockaddr_in, ptr %68, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %69, i64 4, i1 false), !tbaa.struct !24
  %70 = getelementptr inbounds %struct.in_addr, ptr %16, i32 0, i32 0
  %71 = load i32, ptr %70, align 4
  %72 = call ptr @inet_ntoa(i32 %71) #8
  call void (i32, ptr, ...) @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 noundef 5, ptr noundef @.str.4, ptr noundef %72)
  store i8 1, ptr %13, align 1, !tbaa !13
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %110

73:                                               ; preds = %43, %40
  %74 = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !13, !range !15, !noundef !16
  %75 = trunc i8 %74 to i1
  br i1 %75, label %76, label %105

76:                                               ; preds = %73
  %77 = load ptr, ptr %14, align 8, !tbaa !9
  %78 = getelementptr inbounds %struct.addrinfo, ptr %77, i32 0, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !11
  %80 = icmp eq i32 %79, 10
  br i1 %80, label %81, label %105

81:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store ptr %8, ptr %17, align 8, !tbaa !9
  store i32 28, ptr %9, align 4, !tbaa !5
  %82 = load ptr, ptr %17, align 8, !tbaa !9
  %83 = load ptr, ptr %14, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.addrinfo, ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !17
  %86 = load ptr, ptr %14, align 8, !tbaa !9
  %87 = getelementptr inbounds %struct.addrinfo, ptr %86, i32 0, i32 4
  %88 = load i32, ptr %87, align 8, !tbaa !18
  %89 = zext i32 %88 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %82, ptr align 2 %85, i64 %89, i1 false)
  %90 = load ptr, ptr %14, align 8, !tbaa !9
  %91 = getelementptr inbounds %struct.addrinfo, ptr %90, i32 0, i32 1
  %92 = load i32, ptr %91, align 4, !tbaa !11
  %93 = trunc i32 %92 to i16
  %94 = load ptr, ptr %17, align 8, !tbaa !9
  %95 = getelementptr inbounds %struct.sockaddr_in6, ptr %94, i32 0, i32 0
  store i16 %93, ptr %95, align 4, !tbaa !25
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = trunc i32 %96 to i16
  %98 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext %97)
  %99 = load ptr, ptr %17, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.sockaddr_in6, ptr %99, i32 0, i32 1
  store i16 %98, ptr %100, align 2, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 128, ptr %18) #8
  %101 = load ptr, ptr %17, align 8, !tbaa !9
  %102 = getelementptr inbounds %struct.sockaddr_in6, ptr %101, i32 0, i32 3
  %103 = getelementptr inbounds [128 x i8], ptr %18, i64 0, i64 0
  %104 = call ptr @inet_ntop(i32 noundef 10, ptr noundef %102, ptr noundef %103, i32 noundef 128) #8
  call void (i32, ptr, ...) @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 noundef 5, ptr noundef @.str.5, ptr noundef %104)
  store i8 1, ptr %13, align 1, !tbaa !13
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 128, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %110

105:                                              ; preds = %76, %73
  br label %106

106:                                              ; preds = %105
  %107 = load ptr, ptr %14, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.addrinfo, ptr %107, i32 0, i32 7
  %109 = load ptr, ptr %108, align 8, !tbaa !29
  store ptr %109, ptr %14, align 8, !tbaa !9
  br label %37, !llvm.loop !30

110:                                              ; preds = %81, %48, %37
  %111 = load i8, ptr %13, align 1, !tbaa !13, !range !15, !noundef !16
  %112 = trunc i8 %111 to i1
  br i1 %112, label %122, label %113

113:                                              ; preds = %110
  %114 = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !13, !range !15, !noundef !16
  %115 = trunc i8 %114 to i1
  %116 = zext i1 %115 to i64
  %117 = select i1 %115, ptr @.str.2, ptr @.str.3
  %118 = load ptr, ptr %6, align 8, !tbaa !9
  %119 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %118) #8
  %120 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef %117, ptr noundef %119)
  %121 = load ptr, ptr %10, align 8, !tbaa !9
  call void @freeaddrinfo(ptr noundef %121) #8
  store i1 false, ptr %4, align 1
  store i32 1, ptr %12, align 4
  br label %147

122:                                              ; preds = %110
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %123 = load i32, ptr %5, align 4, !tbaa !5
  %124 = load i32, ptr %9, align 4, !tbaa !5
  %125 = call i32 @connect(i32 noundef %123, ptr noundef %8, i32 noundef %124)
  store i32 %125, ptr %19, align 4, !tbaa !5
  %126 = load i32, ptr %19, align 4, !tbaa !5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %139

128:                                              ; preds = %122
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  %129 = call noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv()
  store i32 %129, ptr %20, align 4, !tbaa !5
  %130 = load i32, ptr %20, align 4, !tbaa !5
  %131 = icmp ne i32 %130, 115
  br i1 %131, label %132, label %138

132:                                              ; preds = %128
  %133 = load i32, ptr %20, align 4, !tbaa !5
  %134 = icmp ne i32 %133, 11
  br i1 %134, label %135, label %138

135:                                              ; preds = %132
  %136 = call noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv()
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.6, i32 noundef %136)
  br label %138

138:                                              ; preds = %135, %132, %128
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %139

139:                                              ; preds = %138, %122
  %140 = load ptr, ptr %10, align 8, !tbaa !9
  call void @freeaddrinfo(ptr noundef %140) #8
  %141 = load i32, ptr %19, align 4, !tbaa !5
  %142 = icmp eq i32 %141, 0
  br i1 %142, label %145, label %143

143:                                              ; preds = %139
  %144 = call noundef zeroext i1 @_ZL13nonFatalErrorv()
  br label %145

145:                                              ; preds = %143, %139
  %146 = phi i1 [ true, %139 ], [ %144, %143 ]
  store i1 %146, ptr %4, align 1
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %147

147:                                              ; preds = %145, %113
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  br label %148

148:                                              ; preds = %147, %26
  call void @llvm.lifetime.end.p0(i64 48, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr %8) #8
  %149 = load i1, ptr %4, align 1
  ret i1 %149
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) #6 align 2

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

; Function Attrs: nounwind
declare ptr @inet_ntoa(i32) #7

; Function Attrs: nounwind
declare ptr @inet_ntop(i32 noundef, ptr noundef, ptr noundef, i32 noundef) #7

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv() #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL13nonFatalErrorv() #4

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

!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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 4}
!12 = !{!"_ZTS8addrinfo", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !10, i64 24, !10, i64 32, !10, i64 40}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!12, !10, i64 24}
!18 = !{!12, !6, i64 16}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS11sockaddr_in", !21, i64 0, !21, i64 2, !22, i64 4, !7, i64 8}
!21 = !{!"short", !7, i64 0}
!22 = !{!"_ZTS7in_addr", !6, i64 0}
!23 = !{!20, !21, i64 2}
!24 = !{i64 0, i64 4, !5}
!25 = !{!26, !21, i64 0}
!26 = !{!"_ZTS12sockaddr_in6", !21, i64 0, !21, i64 2, !6, i64 4, !27, i64 8, !6, i64 24}
!27 = !{!"_ZTS8in6_addr", !7, i64 0}
!28 = !{!26, !21, i64 2}
!29 = !{!12, !10, i64 40}
!30 = distinct !{!30, !31}
!31 = !{!"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.sockaddr_storage = type { i16, [118 x i8], i64 }
%struct.addrinfo = type { i32, i32, i32, i32, i32, ptr, ptr, ptr }

@_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E = external dso_local local_unnamed_addr global i8, align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.1 = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1

declare void @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6XmlRpc12XmlRpcSocket7connectEiRNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEi(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1, i32 noundef %2) local_unnamed_addr #5 align 2 {
  %4 = alloca %struct.sockaddr_storage, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.addrinfo, align 8
  %7 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %4, i8 0, i64 128, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %6) #9
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 48, i1 false)
  %8 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %9 = call i32 @getaddrinfo(ptr noundef %8, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %5)
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.preheader, label %16

.preheader:                                       ; preds = %3
  %.03345 = load ptr, ptr %5, align 8, !tbaa !5
  %.not34.not46 = icmp eq ptr %.03345, null
  %.pre = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !9, !range !11
  %.pre52 = trunc nuw i8 %.pre to i1
  br i1 %.not34.not46, label %.preheader.._crit_edge_crit_edge, label %.lr.ph

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %10 = select i1 %.pre52, ptr @.str.2, ptr @.str.3
  br label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  br i1 %.pre52, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph, %14
  %.03347.us = phi ptr [ %.033.us, %14 ], [ %.03345, %.lr.ph ]
  %11 = getelementptr inbounds i8, ptr %.03347.us, i64 4
  %12 = load i32, ptr %11, align 4, !tbaa !12
  %13 = icmp eq i32 %12, 10
  br i1 %13, label %.split.us, label %14

14:                                               ; preds = %.lr.ph.split.us
  %15 = getelementptr inbounds i8, ptr %.03347.us, i64 40
  %.033.us = load ptr, ptr %15, align 8, !tbaa !5
  %.not34.not.us = icmp eq ptr %.033.us, null
  br i1 %.not34.not.us, label %._crit_edge, label %.lr.ph.split.us, !llvm.loop !15

16:                                               ; preds = %3
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = load i8, ptr @_ZN6XmlRpc12XmlRpcSocket11s_use_ipv6_E, align 1, !tbaa !9, !range !11, !noundef !17
  %19 = trunc nuw i8 %18 to i1
  %20 = select i1 %19, ptr @.str.2, ptr @.str.3
  %21 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.1, ptr noundef nonnull %20, ptr noundef %21) #10
  br label %70

.lr.ph.split:                                     ; preds = %.lr.ph, %53
  %.03347 = phi ptr [ %.033, %53 ], [ %.03345, %.lr.ph ]
  %23 = getelementptr inbounds i8, ptr %.03347, i64 4
  %24 = load i32, ptr %23, align 4, !tbaa !12
  %25 = icmp eq i32 %24, 2
  br i1 %25, label %26, label %53

26:                                               ; preds = %.lr.ph.split
  %27 = getelementptr inbounds i8, ptr %.03347, i64 4
  %28 = getelementptr inbounds i8, ptr %.03347, i64 24
  %29 = load ptr, ptr %28, align 8, !tbaa !18
  %30 = getelementptr inbounds i8, ptr %.03347, i64 16
  %31 = load i32, ptr %30, align 8, !tbaa !19
  %32 = zext i32 %31 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %4, ptr align 2 %29, i64 %32, i1 false)
  %33 = load i32, ptr %27, align 4, !tbaa !12
  %34 = trunc i32 %33 to i16
  store i16 %34, ptr %4, align 8, !tbaa !20
  %35 = trunc i32 %2 to i16
  %36 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext %35)
  %37 = getelementptr inbounds i8, ptr %4, i64 2
  store i16 %36, ptr %37, align 2, !tbaa !24
  %38 = getelementptr inbounds i8, ptr %4, i64 4
  %.sroa.0.0.copyload = load i32, ptr %38, align 4, !tbaa !25
  %39 = call ptr @inet_ntoa(i32 %.sroa.0.0.copyload) #9
  call void (i32, ptr, ...) @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 noundef 5, ptr noundef nonnull @.str.4, ptr noundef %39)
  br label %58

.split.us:                                        ; preds = %.lr.ph.split.us
  %40 = getelementptr inbounds i8, ptr %.03347.us, i64 4
  %41 = getelementptr inbounds i8, ptr %.03347.us, i64 24
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %43 = getelementptr inbounds i8, ptr %.03347.us, i64 16
  %44 = load i32, ptr %43, align 8, !tbaa !19
  %45 = zext i32 %44 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %4, ptr align 2 %42, i64 %45, i1 false)
  %46 = load i32, ptr %40, align 4, !tbaa !12
  %47 = trunc i32 %46 to i16
  store i16 %47, ptr %4, align 8, !tbaa !26
  %48 = trunc i32 %2 to i16
  %49 = call noundef zeroext i16 @_ZL10__bswap_16t(i16 noundef zeroext %48)
  %50 = getelementptr inbounds i8, ptr %4, i64 2
  store i16 %49, ptr %50, align 2, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %7) #9
  %51 = getelementptr inbounds i8, ptr %4, i64 8
  %52 = call ptr @inet_ntop(i32 noundef 10, ptr noundef nonnull %51, ptr noundef nonnull %7, i32 noundef 128) #9
  call void (i32, ptr, ...) @_ZN6XmlRpc10XmlRpcUtil3logEiPKcz(i32 noundef 5, ptr noundef nonnull @.str.5, ptr noundef %52)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %7) #9
  br label %58

53:                                               ; preds = %.lr.ph.split
  %54 = getelementptr inbounds i8, ptr %.03347, i64 40
  %.033 = load ptr, ptr %54, align 8, !tbaa !5
  %.not34.not = icmp eq ptr %.033, null
  br i1 %.not34.not, label %._crit_edge, label %.lr.ph.split, !llvm.loop !15

._crit_edge:                                      ; preds = %53, %14, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi ptr [ %10, %.preheader.._crit_edge_crit_edge ], [ @.str.2, %14 ], [ @.str.3, %53 ]
  %55 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #9
  %56 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull %.pre-phi, ptr noundef %55)
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %57) #9
  br label %70

58:                                               ; preds = %.split.us, %26
  %.031.ph = phi i32 [ 16, %26 ], [ 28, %.split.us ]
  %59 = call i32 @connect(i32 noundef %0, ptr noundef nonnull %4, i32 noundef %.031.ph)
  %.not35 = icmp eq i32 %59, 0
  br i1 %.not35, label %65, label %60

60:                                               ; preds = %58
  %61 = call noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv()
  switch i32 %61, label %62 [
    i32 115, label %67
    i32 11, label %67
  ]

62:                                               ; preds = %60
  %63 = call noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv()
  %64 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6, i32 noundef %63)
  br label %67

65:                                               ; preds = %58
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %66) #9
  br label %70

67:                                               ; preds = %62, %60, %60
  %68 = load ptr, ptr %5, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %68) #9
  %69 = call noundef zeroext i1 @_ZL13nonFatalErrorv()
  br label %70

70:                                               ; preds = %65, %._crit_edge, %67, %16
  %.1 = phi i1 [ false, %16 ], [ false, %._crit_edge ], [ true, %65 ], [ %69, %67 ]
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #9
  ret i1 %.1
}

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

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #6 align 2

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

; Function Attrs: nounwind
declare ptr @inet_ntoa(i32) local_unnamed_addr #8

; Function Attrs: nounwind
declare ptr @inet_ntop(i32 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #8

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6XmlRpc12XmlRpcSocket8getErrorEv() local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZL13nonFatalErrorv() local_unnamed_addr #4

attributes #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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { inlinehint mustprogress 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 #5 = { mustprogress 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 #6 = { mustprogress 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 = { 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 #8 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #9 = { nounwind }
attributes #10 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{!13, !14, i64 4}
!13 = !{!"_ZTS8addrinfo", !14, i64 0, !14, i64 4, !14, i64 8, !14, i64 12, !14, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{}
!18 = !{!13, !6, i64 24}
!19 = !{!13, !14, i64 16}
!20 = !{!21, !22, i64 0}
!21 = !{!"_ZTS11sockaddr_in", !22, i64 0, !22, i64 2, !23, i64 4, !7, i64 8}
!22 = !{!"short", !7, i64 0}
!23 = !{!"_ZTS7in_addr", !14, i64 0}
!24 = !{!21, !22, i64 2}
!25 = !{!14, !14, i64 0}
!26 = !{!27, !22, i64 0}
!27 = !{!"_ZTS12sockaddr_in6", !22, i64 0, !22, i64 2, !14, i64 4, !28, i64 8, !14, i64 24}
!28 = !{!"_ZTS8in6_addr", !7, i64 0}
!29 = !{!27, !22, i64 2}


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