; LLVM IR from cjmcv/hpc :: coroutine/libco/libco/src/co_hook_sys_call.ll (Z16co_gethostbynamePKc)

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

%class.clsRoutineData_routine_hostbuf_wrap = type { i8 }
%struct.hostbuf_wrap = type { %struct.hostent, ptr, i64, i32 }
%struct.hostent = type { ptr, ptr, i32, i32, ptr }

@_ZL17__co_hostbuf_wrap = external hidden global %class.clsRoutineData_routine_hostbuf_wrap, 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 allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z16co_gethostbynamePKc(ptr noundef %0) #3 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = icmp ne ptr %9, null
  br i1 %10, label %12, label %11

11:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  br label %90

12:                                               ; preds = %1
  %13 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %14 = getelementptr inbounds %struct.hostbuf_wrap, ptr %13, i32 0, i32 1
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  %16 = icmp ne ptr %15, null
  br i1 %16, label %17, label %28

17:                                               ; preds = %12
  %18 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %19 = getelementptr inbounds %struct.hostbuf_wrap, ptr %18, i32 0, i32 2
  %20 = load i64, ptr %19, align 8, !tbaa !14
  %21 = icmp ugt i64 %20, 1024
  br i1 %21, label %22, label %28

22:                                               ; preds = %17
  %23 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %24 = getelementptr inbounds %struct.hostbuf_wrap, ptr %23, i32 0, i32 1
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  call void @free(ptr noundef %25) #6
  %26 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %27 = getelementptr inbounds %struct.hostbuf_wrap, ptr %26, i32 0, i32 1
  store ptr null, ptr %27, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %22, %17, %12
  %29 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %30 = getelementptr inbounds %struct.hostbuf_wrap, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = icmp ne ptr %31, null
  br i1 %32, label %39, label %33

33:                                               ; preds = %28
  %34 = call noalias ptr @malloc(i64 noundef 1024) #7
  %35 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %36 = getelementptr inbounds %struct.hostbuf_wrap, ptr %35, i32 0, i32 1
  store ptr %34, ptr %36, align 8, !tbaa !9
  %37 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %38 = getelementptr inbounds %struct.hostbuf_wrap, ptr %37, i32 0, i32 2
  store i64 1024, ptr %38, align 8, !tbaa !14
  br label %39

39:                                               ; preds = %33, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %40 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %41 = getelementptr inbounds %struct.hostbuf_wrap, ptr %40, i32 0, i32 0
  store ptr %41, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %42 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %43 = getelementptr inbounds %struct.hostbuf_wrap, ptr %42, i32 0, i32 3
  store ptr %43, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 -1, ptr %7, align 4, !tbaa !15
  br label %44

44:                                               ; preds = %63, %39
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %48 = getelementptr inbounds %struct.hostbuf_wrap, ptr %47, i32 0, i32 1
  %49 = load ptr, ptr %48, align 8, !tbaa !9
  %50 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %51 = getelementptr inbounds %struct.hostbuf_wrap, ptr %50, i32 0, i32 2
  %52 = load i64, ptr %51, align 8, !tbaa !14
  %53 = load ptr, ptr %6, align 8, !tbaa !5
  %54 = call i32 @gethostbyname_r(ptr noundef %45, ptr noundef %46, ptr noundef %49, i64 noundef %52, ptr noundef %5, ptr noundef %53)
  %55 = icmp eq i32 %54, 34
  br i1 %55, label %56, label %60

56:                                               ; preds = %44
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = load i32, ptr %57, align 4, !tbaa !15
  %59 = icmp eq i32 %58, -1
  br label %60

60:                                               ; preds = %56, %44
  %61 = phi i1 [ false, %44 ], [ %59, %56 ]
  %62 = zext i1 %61 to i32
  store i32 %62, ptr %7, align 4, !tbaa !15
  br i1 %61, label %63, label %79

63:                                               ; preds = %60
  %64 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %65 = getelementptr inbounds %struct.hostbuf_wrap, ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  call void @free(ptr noundef %66) #6
  %67 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %68 = getelementptr inbounds %struct.hostbuf_wrap, ptr %67, i32 0, i32 2
  %69 = load i64, ptr %68, align 8, !tbaa !14
  %70 = mul i64 %69, 2
  %71 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %72 = getelementptr inbounds %struct.hostbuf_wrap, ptr %71, i32 0, i32 2
  store i64 %70, ptr %72, align 8, !tbaa !14
  %73 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %74 = getelementptr inbounds %struct.hostbuf_wrap, ptr %73, i32 0, i32 2
  %75 = load i64, ptr %74, align 8, !tbaa !14
  %76 = call noalias ptr @malloc(i64 noundef %75) #7
  %77 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %78 = getelementptr inbounds %struct.hostbuf_wrap, ptr %77, i32 0, i32 1
  store ptr %76, ptr %78, align 8, !tbaa !9
  br label %44, !llvm.loop !16

79:                                               ; preds = %60
  %80 = load i32, ptr %7, align 4, !tbaa !15
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %82, label %88

82:                                               ; preds = %79
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = load ptr, ptr %5, align 8, !tbaa !5
  %85 = icmp eq ptr %83, %84
  br i1 %85, label %86, label %88

86:                                               ; preds = %82
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %87, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %89

88:                                               ; preds = %82, %79
  store ptr null, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %89

89:                                               ; preds = %88, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %90

90:                                               ; preds = %89, %11
  %91 = load ptr, ptr %2, align 8
  ret ptr %91
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #4 align 2

declare i32 @gethostbyname_r(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) #5

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

!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, !6, i64 32}
!10 = !{!"_ZTS12hostbuf_wrap", !11, i64 0, !6, i64 32, !13, i64 40, !12, i64 48}
!11 = !{!"_ZTS7hostent", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = !{!10, !13, i64 40}
!15 = !{!12, !12, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"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"

%class.clsRoutineData_routine_hostbuf_wrap = type { i8 }

@_ZL17__co_hostbuf_wrap = external hidden global %class.clsRoutineData_routine_hostbuf_wrap, align 1

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

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

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_Z16co_gethostbynamePKc(ptr noundef %0) local_unnamed_addr #3 {
  %2 = alloca ptr, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %68, label %3

3:                                                ; preds = %1
  %4 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %5 = getelementptr inbounds i8, ptr %4, i64 32
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not11 = icmp eq ptr %6, null
  br i1 %.not11, label %18, label %7

7:                                                ; preds = %3
  %8 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %9 = getelementptr inbounds i8, ptr %8, i64 40
  %10 = load i64, ptr %9, align 8, !tbaa !13
  %11 = icmp ugt i64 %10, 1024
  br i1 %11, label %12, label %18

12:                                               ; preds = %7
  %13 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %14 = getelementptr inbounds i8, ptr %13, i64 32
  %15 = load ptr, ptr %14, align 8, !tbaa !5
  tail call void @free(ptr noundef %15) #6
  %16 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %17 = getelementptr inbounds i8, ptr %16, i64 32
  store ptr null, ptr %17, align 8, !tbaa !5
  br label %18

18:                                               ; preds = %12, %7, %3
  %19 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %20 = getelementptr inbounds i8, ptr %19, i64 32
  %21 = load ptr, ptr %20, align 8, !tbaa !5
  %.not12 = icmp eq ptr %21, null
  br i1 %.not12, label %22, label %28

22:                                               ; preds = %18
  %23 = tail call noalias dereferenceable_or_null(1024) ptr @malloc(i64 noundef 1024) #7
  %24 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %25 = getelementptr inbounds i8, ptr %24, i64 32
  store ptr %23, ptr %25, align 8, !tbaa !5
  %26 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %27 = getelementptr inbounds i8, ptr %26, i64 40
  store i64 1024, ptr %27, align 8, !tbaa !13
  br label %28

28:                                               ; preds = %22, %18
  %29 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store ptr null, ptr %2, align 8, !tbaa !14
  %30 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %31 = getelementptr inbounds i8, ptr %30, i64 48
  %32 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %33 = getelementptr inbounds i8, ptr %32, i64 32
  %34 = load ptr, ptr %33, align 8, !tbaa !5
  %35 = tail call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %36 = getelementptr inbounds i8, ptr %35, i64 40
  %37 = load i64, ptr %36, align 8, !tbaa !13
  %38 = call i32 @gethostbyname_r(ptr noundef nonnull %0, ptr noundef %29, ptr noundef %34, i64 noundef %37, ptr noundef nonnull %2, ptr noundef nonnull %31)
  %39 = icmp eq i32 %38, 34
  br i1 %39, label %.lr.ph, label %.critedge

.lr.ph:                                           ; preds = %28, %42
  %40 = load i32, ptr %31, align 4, !tbaa !15
  %41 = icmp eq i32 %40, -1
  br i1 %41, label %42, label %.critedge

42:                                               ; preds = %.lr.ph
  %43 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %44 = getelementptr inbounds i8, ptr %43, i64 32
  %45 = load ptr, ptr %44, align 8, !tbaa !5
  call void @free(ptr noundef %45) #6
  %46 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %47 = getelementptr inbounds i8, ptr %46, i64 40
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = shl i64 %48, 1
  %50 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %51 = getelementptr inbounds i8, ptr %50, i64 40
  store i64 %49, ptr %51, align 8, !tbaa !13
  %52 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %53 = getelementptr inbounds i8, ptr %52, i64 40
  %54 = load i64, ptr %53, align 8, !tbaa !13
  %55 = call noalias ptr @malloc(i64 noundef %54) #7
  %56 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %57 = getelementptr inbounds i8, ptr %56, i64 32
  store ptr %55, ptr %57, align 8, !tbaa !5
  %58 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %59 = getelementptr inbounds i8, ptr %58, i64 32
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  %61 = call noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1) @_ZL17__co_hostbuf_wrap)
  %62 = getelementptr inbounds i8, ptr %61, i64 40
  %63 = load i64, ptr %62, align 8, !tbaa !13
  %64 = call i32 @gethostbyname_r(ptr noundef nonnull %0, ptr noundef %29, ptr noundef %60, i64 noundef %63, ptr noundef nonnull %2, ptr noundef nonnull %31)
  %65 = icmp eq i32 %64, 34
  br i1 %65, label %.lr.ph, label %.critedge, !llvm.loop !16

.critedge:                                        ; preds = %.lr.ph, %42, %28
  %66 = load ptr, ptr %2, align 8
  %67 = icmp eq ptr %29, %66
  %.08 = select i1 %67, ptr %29, ptr null
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %68

68:                                               ; preds = %1, %.critedge
  %.1 = phi ptr [ %.08, %.critedge ], [ null, %1 ]
  ret ptr %.1
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZN35clsRoutineData_routine_hostbuf_wrapI12hostbuf_wrapEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #4 align 2

declare i32 @gethostbyname_r(ptr noundef, ptr noundef, ptr noundef, i64 noundef, ptr noundef, ptr noundef) local_unnamed_addr #5

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

!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, !8, i64 32}
!6 = !{!"_ZTS12hostbuf_wrap", !7, i64 0, !8, i64 32, !12, i64 40, !11, i64 48}
!7 = !{!"_ZTS7hostent", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !8, i64 24}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"long", !9, i64 0}
!13 = !{!6, !12, i64 40}
!14 = !{!8, !8, i64 0}
!15 = !{!11, !11, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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