; LLVM IR from godzilla-foundation/godzilla-community :: core/deps/nanomsg-1.1.5/src/transports/utils (dns)

; 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.nn_dns = type { %struct.nn_fsm, i32, ptr, %struct.nn_fsm_event }
%struct.nn_fsm = type { ptr, ptr, i32, i32, ptr, ptr, ptr, %struct.nn_fsm_event }
%struct.nn_fsm_event = type { ptr, i32, ptr, i32, %struct.nn_queue_item }
%struct.nn_queue_item = type { ptr }
%struct.nn_dns_result = type { i32, %struct.sockaddr_storage, i64 }
%struct.sockaddr_storage = type { i16, [118 x i8], i64 }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 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: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #1

declare void @nn_backtrace_print() #2

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

declare i32 @fflush(ptr noundef) #2

; Function Attrs: noreturn
declare void @nn_err_abort() #4

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

16:                                               ; preds = %5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.nn_dns, ptr %17, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !13
  %20 = icmp ne i32 %19, 1
  %21 = zext i1 %20 to i32
  %22 = sext i32 %21 to i64
  %23 = call i64 @llvm.expect.i64(i64 %22, i64 0)
  %24 = icmp ne i64 %23, 0
  br i1 %24, label %25, label %33

25:                                               ; preds = %16
  call void @nn_backtrace_print()
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.nn_dns, ptr %27, i32 0, i32 1
  %29 = load i32, ptr %28, align 8, !tbaa !13
  %30 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef @.str, i32 noundef %29, ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 75) #8
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 @fflush(ptr noundef %31)
  call void @nn_err_abort() #9
  unreachable

33:                                               ; preds = %16
  br label %34

34:                                               ; preds = %33
  br label %35

35:                                               ; preds = %34
  %36 = load ptr, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.nn_dns, ptr %37, i32 0, i32 2
  store ptr %36, ptr %38, align 8, !tbaa !18
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = load i64, ptr %8, align 8, !tbaa !9
  %41 = load i32, ptr %9, align 4, !tbaa !11
  %42 = load ptr, ptr %6, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.nn_dns, ptr %42, i32 0, i32 2
  %44 = load ptr, ptr %43, align 8, !tbaa !18
  %45 = getelementptr inbounds %struct.nn_dns_result, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.nn_dns, ptr %46, i32 0, i32 2
  %48 = load ptr, ptr %47, align 8, !tbaa !18
  %49 = getelementptr inbounds %struct.nn_dns_result, ptr %48, i32 0, i32 2
  %50 = call i32 @nn_literal_resolve(ptr noundef %39, i64 noundef %40, i32 noundef %41, ptr noundef %45, ptr noundef %49)
  store i32 %50, ptr %11, align 4, !tbaa !11
  %51 = load i32, ptr %11, align 4, !tbaa !11
  %52 = icmp eq i32 %51, 0
  br i1 %52, label %53, label %60

53:                                               ; preds = %35
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.nn_dns, ptr %54, i32 0, i32 2
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = getelementptr inbounds %struct.nn_dns_result, ptr %56, i32 0, i32 0
  store i32 0, ptr %57, align 8, !tbaa !19
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.nn_dns, ptr %58, i32 0, i32 0
  call void @nn_fsm_start(ptr noundef %59)
  store i32 1, ptr %15, align 4
  br label %154

60:                                               ; preds = %35
  br label %61

61:                                               ; preds = %60
  %62 = load i32, ptr %11, align 4, !tbaa !11
  %63 = icmp eq i32 %62, -22
  %64 = xor i1 %63, true
  %65 = zext i1 %64 to i32
  %66 = sext i32 %65 to i64
  %67 = call i64 @llvm.expect.i64(i64 %66, i64 0)
  %68 = icmp ne i64 %67, 0
  br i1 %68, label %69, label %79

69:                                               ; preds = %61
  call void @nn_backtrace_print()
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !11
  %72 = sub nsw i32 0, %71
  %73 = call ptr @nn_err_strerror(i32 noundef %72)
  %74 = load i32, ptr %11, align 4, !tbaa !11
  %75 = sub nsw i32 0, %74
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef @.str.3, ptr noundef %73, i32 noundef %75, ptr noundef @.str.2, i32 noundef 88) #8
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = call i32 @fflush(ptr noundef %77)
  call void @nn_err_abort() #9
  unreachable

79:                                               ; preds = %61
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 48, i1 false)
  %82 = load i32, ptr %9, align 4, !tbaa !11
  %83 = icmp ne i32 %82, 0
  br i1 %83, label %84, label %86

84:                                               ; preds = %81
  %85 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 1
  store i32 2, ptr %85, align 4, !tbaa !23
  br label %89

86:                                               ; preds = %81
  %87 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 1
  store i32 10, ptr %87, align 4, !tbaa !23
  %88 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 0
  store i32 8, ptr %88, align 8, !tbaa !25
  br label %89

89:                                               ; preds = %86, %84
  br label %90

90:                                               ; preds = %89
  %91 = load i64, ptr %8, align 8, !tbaa !9
  %92 = icmp ugt i64 128, %91
  %93 = xor i1 %92, true
  %94 = zext i1 %93 to i32
  %95 = sext i32 %94 to i64
  %96 = call i64 @llvm.expect.i64(i64 %95, i64 0)
  %97 = icmp ne i64 %96, 0
  br i1 %97, label %98, label %103

98:                                               ; preds = %90
  call void @nn_backtrace_print()
  %99 = load ptr, ptr @stderr, align 8, !tbaa !5
  %100 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %99, ptr noundef @.str.4, ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 100) #8
  %101 = load ptr, ptr @stderr, align 8, !tbaa !5
  %102 = call i32 @fflush(ptr noundef %101)
  call void @nn_err_abort() #9
  unreachable

103:                                              ; preds = %90
  br label %104

104:                                              ; preds = %103
  br label %105

105:                                              ; preds = %104
  %106 = getelementptr inbounds %struct.addrinfo, ptr %12, i32 0, i32 2
  store i32 1, ptr %106, align 8, !tbaa !26
  %107 = getelementptr inbounds [128 x i8], ptr %14, i64 0, i64 0
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = load i64, ptr %8, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %107, ptr align 1 %108, i64 %109, i1 false)
  %110 = load i64, ptr %8, align 8, !tbaa !9
  %111 = getelementptr inbounds [128 x i8], ptr %14, i64 0, i64 %110
  store i8 0, ptr %111, align 1, !tbaa !27
  %112 = getelementptr inbounds [128 x i8], ptr %14, i64 0, i64 0
  %113 = call i32 @getaddrinfo(ptr noundef %112, ptr noundef null, ptr noundef %12, ptr noundef %13)
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.nn_dns, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  %117 = getelementptr inbounds %struct.nn_dns_result, ptr %116, i32 0, i32 0
  store i32 %113, ptr %117, align 8, !tbaa !19
  %118 = load ptr, ptr %6, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.nn_dns, ptr %118, i32 0, i32 2
  %120 = load ptr, ptr %119, align 8, !tbaa !18
  %121 = getelementptr inbounds %struct.nn_dns_result, ptr %120, i32 0, i32 0
  %122 = load i32, ptr %121, align 8, !tbaa !19
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %127

124:                                              ; preds = %105
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.nn_dns, ptr %125, i32 0, i32 0
  call void @nn_fsm_start(ptr noundef %126)
  store i32 1, ptr %15, align 4
  br label %154

127:                                              ; preds = %105
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.nn_dns, ptr %128, i32 0, i32 2
  %130 = load ptr, ptr %129, align 8, !tbaa !18
  %131 = getelementptr inbounds %struct.nn_dns_result, ptr %130, i32 0, i32 0
  store i32 0, ptr %131, align 8, !tbaa !19
  %132 = load ptr, ptr %6, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.nn_dns, ptr %132, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !18
  %135 = getelementptr inbounds %struct.nn_dns_result, ptr %134, i32 0, i32 1
  %136 = load ptr, ptr %13, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.addrinfo, ptr %136, i32 0, i32 5
  %138 = load ptr, ptr %137, align 8, !tbaa !28
  %139 = load ptr, ptr %13, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.addrinfo, ptr %139, i32 0, i32 4
  %141 = load i32, ptr %140, align 8, !tbaa !29
  %142 = zext i32 %141 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %135, ptr align 2 %138, i64 %142, i1 false)
  %143 = load ptr, ptr %13, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.addrinfo, ptr %143, i32 0, i32 4
  %145 = load i32, ptr %144, align 8, !tbaa !29
  %146 = zext i32 %145 to i64
  %147 = load ptr, ptr %6, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.nn_dns, ptr %147, i32 0, i32 2
  %149 = load ptr, ptr %148, align 8, !tbaa !18
  %150 = getelementptr inbounds %struct.nn_dns_result, ptr %149, i32 0, i32 2
  store i64 %146, ptr %150, align 8, !tbaa !30
  %151 = load ptr, ptr %13, align 8, !tbaa !5
  call void @freeaddrinfo(ptr noundef %151) #8
  %152 = load ptr, ptr %6, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.nn_dns, ptr %152, i32 0, i32 0
  call void @nn_fsm_start(ptr noundef %153)
  store i32 0, ptr %15, align 4
  br label %154

154:                                              ; preds = %127, %124, %53
  call void @llvm.lifetime.end.p0(i64 128, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  %155 = load i32, ptr %15, align 4
  switch i32 %155, label %157 [
    i32 0, label %156
    i32 1, label %156
  ]

156:                                              ; preds = %154, %154
  ret void

157:                                              ; preds = %154
  unreachable
}

declare i32 @nn_literal_resolve(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) #2

declare void @nn_fsm_start(ptr noundef) #2

declare ptr @nn_err_strerror(i32 noundef) #2

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

; 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) #7

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 "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 = { noreturn "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 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #8 = { nounwind }
attributes #9 = { noreturn }

!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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 88}
!14 = !{!"nn_dns", !15, i64 0, !12, i64 88, !6, i64 96, !16, i64 104}
!15 = !{!"nn_fsm", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24, !6, i64 32, !6, i64 40, !16, i64 48}
!16 = !{!"nn_fsm_event", !6, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !17, i64 32}
!17 = !{!"nn_queue_item", !6, i64 0}
!18 = !{!14, !6, i64 96}
!19 = !{!20, !12, i64 0}
!20 = !{!"nn_dns_result", !12, i64 0, !21, i64 8, !10, i64 136}
!21 = !{!"sockaddr_storage", !22, i64 0, !7, i64 2, !10, i64 120}
!22 = !{!"short", !7, i64 0}
!23 = !{!24, !12, i64 4}
!24 = !{!"addrinfo", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!25 = !{!24, !12, i64 0}
!26 = !{!24, !12, i64 8}
!27 = !{!7, !7, i64 0}
!28 = !{!24, !6, i64 24}
!29 = !{!24, !12, i64 16}
!30 = !{!20, !10, i64 136}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [36 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [137 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [28 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

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

declare void @nn_backtrace_print() local_unnamed_addr #1

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

; Function Attrs: noreturn
declare void @nn_err_abort() local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local void @nn_dns_start(ptr noundef %0, ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #4 {
  %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 48, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %8) #8
  %9 = getelementptr inbounds i8, ptr %0, i64 88
  %10 = load i32, ptr %9, align 8, !tbaa !5
  %.not = icmp eq i32 %10, 1
  br i1 %.not, label %17, label %11, !prof !14

11:                                               ; preds = %5
  tail call void @nn_backtrace_print() #8
  %12 = load ptr, ptr @stderr, align 8, !tbaa !15
  %13 = load i32, ptr %9, align 8, !tbaa !5
  %14 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %12, ptr noundef nonnull @.str, i32 noundef %13, ptr noundef nonnull @.str.1, ptr noundef nonnull @.str.2, i32 noundef 75) #9
  %15 = load ptr, ptr @stderr, align 8, !tbaa !15
  %16 = tail call i32 @fflush(ptr noundef %15)
  tail call void @nn_err_abort() #10
  unreachable

17:                                               ; preds = %5
  %18 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %4, ptr %18, align 8, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %4, i64 8
  %20 = getelementptr inbounds i8, ptr %4, i64 136
  %21 = tail call i32 @nn_literal_resolve(ptr noundef %1, i64 noundef %2, i32 noundef %3, ptr noundef nonnull %19, ptr noundef nonnull %20) #8
  switch i32 %21, label %24 [
    i32 0, label %22
    i32 -22, label %31
  ], !prof !17

22:                                               ; preds = %17
  %23 = load ptr, ptr %18, align 8, !tbaa !16
  store i32 0, ptr %23, align 8, !tbaa !18
  tail call void @nn_fsm_start(ptr noundef nonnull %0) #8
  br label %59

24:                                               ; preds = %17
  tail call void @nn_backtrace_print() #8
  %25 = load ptr, ptr @stderr, align 8, !tbaa !15
  %26 = sub nsw i32 0, %21
  %27 = tail call ptr @nn_err_strerror(i32 noundef %26) #8
  %28 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %25, ptr noundef nonnull @.str.3, ptr noundef %27, i32 noundef %26, ptr noundef nonnull @.str.2, i32 noundef 88) #9
  %29 = load ptr, ptr @stderr, align 8, !tbaa !15
  %30 = tail call i32 @fflush(ptr noundef %29)
  tail call void @nn_err_abort() #10
  unreachable

31:                                               ; preds = %17
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(48) %6, i8 0, i64 48, i1 false)
  %.not27 = icmp eq i32 %3, 0
  br i1 %.not27, label %32, label %33

32:                                               ; preds = %31
  store i32 8, ptr %6, align 8, !tbaa !23
  br label %33

33:                                               ; preds = %31, %32
  %.sink = phi i32 [ 10, %32 ], [ 2, %31 ]
  %34 = getelementptr inbounds i8, ptr %6, i64 4
  store i32 %.sink, ptr %34, align 4
  %35 = icmp ugt i64 %2, 127
  br i1 %35, label %36, label %41, !prof !25

36:                                               ; preds = %33
  tail call void @nn_backtrace_print() #8
  %37 = load ptr, ptr @stderr, align 8, !tbaa !15
  %38 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %37, ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 100) #9
  %39 = load ptr, ptr @stderr, align 8, !tbaa !15
  %40 = tail call i32 @fflush(ptr noundef %39)
  tail call void @nn_err_abort() #10
  unreachable

41:                                               ; preds = %33
  %42 = getelementptr inbounds i8, ptr %6, i64 8
  store i32 1, ptr %42, align 8, !tbaa !26
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %8, ptr align 1 %1, i64 %2, i1 false)
  %43 = getelementptr inbounds [128 x i8], ptr %8, i64 0, i64 %2
  store i8 0, ptr %43, align 1, !tbaa !27
  %44 = call i32 @getaddrinfo(ptr noundef nonnull %8, ptr noundef null, ptr noundef nonnull %6, ptr noundef nonnull %7) #8
  %45 = load ptr, ptr %18, align 8, !tbaa !16
  store i32 %44, ptr %45, align 8, !tbaa !18
  %.not28 = icmp eq i32 %44, 0
  br i1 %.not28, label %47, label %46

46:                                               ; preds = %41
  call void @nn_fsm_start(ptr noundef nonnull %0) #8
  br label %59

47:                                               ; preds = %41
  store i32 0, ptr %45, align 8, !tbaa !18
  %48 = getelementptr inbounds i8, ptr %45, i64 8
  %49 = load ptr, ptr %7, align 8, !tbaa !15
  %50 = getelementptr inbounds i8, ptr %49, i64 24
  %51 = load ptr, ptr %50, align 8, !tbaa !28
  %52 = getelementptr inbounds i8, ptr %49, i64 16
  %53 = load i32, ptr %52, align 8, !tbaa !29
  %54 = zext i32 %53 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 8 %48, ptr align 2 %51, i64 %54, i1 false)
  %55 = load i32, ptr %52, align 8, !tbaa !29
  %56 = zext i32 %55 to i64
  %57 = load ptr, ptr %18, align 8, !tbaa !16
  %58 = getelementptr inbounds i8, ptr %57, i64 136
  store i64 %56, ptr %58, align 8, !tbaa !30
  call void @freeaddrinfo(ptr noundef %49) #8
  call void @nn_fsm_start(ptr noundef nonnull %0) #8
  br label %59

59:                                               ; preds = %47, %46, %22
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %6) #8
  ret void
}

declare i32 @nn_literal_resolve(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @nn_fsm_start(ptr noundef) local_unnamed_addr #1

declare ptr @nn_err_strerror(i32 noundef) local_unnamed_addr #1

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

; 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) #6

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

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

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 = { 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 #3 = { noreturn "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 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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn 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, !11, i64 88}
!6 = !{!"nn_dns", !7, i64 0, !11, i64 88, !8, i64 96, !12, i64 104}
!7 = !{!"nn_fsm", !8, i64 0, !8, i64 8, !11, i64 16, !11, i64 20, !8, i64 24, !8, i64 32, !8, i64 40, !12, i64 48}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"nn_fsm_event", !8, i64 0, !11, i64 8, !8, i64 16, !11, i64 24, !13, i64 32}
!13 = !{!"nn_queue_item", !8, i64 0}
!14 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !8, i64 96}
!17 = !{!"branch_weights", i32 1, i32 2001, i32 2000}
!18 = !{!19, !11, i64 0}
!19 = !{!"nn_dns_result", !11, i64 0, !20, i64 8, !22, i64 136}
!20 = !{!"sockaddr_storage", !21, i64 0, !9, i64 2, !22, i64 120}
!21 = !{!"short", !9, i64 0}
!22 = !{!"long", !9, i64 0}
!23 = !{!24, !11, i64 0}
!24 = !{!"addrinfo", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !8, i64 24, !8, i64 32, !8, i64 40}
!25 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!26 = !{!24, !11, i64 8}
!27 = !{!9, !9, i64 0}
!28 = !{!24, !8, i64 24}
!29 = !{!24, !11, i64 16}
!30 = !{!19, !22, i64 136}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LowerExpectIntrinsicPass,MergedLoadStoreMotionPass,SROAPass,SimplifyCFGPass,TailCallElimPass