; LLVM IR from kala13x/libxutils :: examples (ws-client)

; 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.xapi_ = type { ptr, %struct.XEvents, i64, ptr, i8, i8, i8 }
%struct.XEvents = type { ptr, i32, ptr, ptr, i32, i32, i8, %struct.XHash }
%struct.XHash = type { ptr, ptr, i64, [32 x %struct.xlist] }
%struct.xlist = type { ptr, ptr, %struct.xlist_data, i8 }
%struct.xlist_data = type { ptr, ptr, ptr, i64 }
%struct.XLink = type { i32, [2048 x i8], [256 x i8], [256 x i8], [32 x i8], [32 x i8], [1024 x i8], [32 x i8] }
%struct.xapi_endpoint_ = type { i32, %struct.XSocketCert, ptr, ptr, ptr, i32, i16, i32, i8, i8, i8 }
%struct.XSocketCert = type { ptr, ptr, ptr, ptr, ptr, i32 }
%struct.session_data_t = type { i64, i64 }

@g_bFinish = external hidden global i8, align 1
@.str.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signal_callback(i32 noundef) #0

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

declare void @XLog_Display(i32 noundef, i8 noundef zeroext, ptr noundef, ...) #2

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @service_callback(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local i32 @main(i32 noundef %0, ptr noundef %1) #0 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca [3 x i32], align 4
  %7 = alloca i32, align 4
  %8 = alloca %struct.xapi_, align 8
  %9 = alloca %struct.XLink, align 4
  %10 = alloca %struct.xapi_endpoint_, align 8
  %11 = alloca %struct.session_data_t, align 8
  %12 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @XLog_Init(ptr noundef null, i16 noundef zeroext 203, i8 noundef zeroext 0)
  call void @XLog_TimeFormatSet(i32 noundef 1)
  call void @XLog_FlagsSet(i16 noundef zeroext 255)
  call void @XLog_IndentSet(i8 noundef zeroext 1)
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #3
  %13 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  store i32 15, ptr %13, align 4, !tbaa !5
  %14 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 1
  store i32 2, ptr %14, align 4, !tbaa !5
  %15 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 2
  store i32 13, ptr %15, align 4, !tbaa !5
  %16 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %17 = call i32 @XSig_Register(ptr noundef %16, i64 noundef 3, ptr noundef @signal_callback)
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp slt i32 %18, 2
  br i1 %19, label %20, label %27

20:                                               ; preds = %2
  %21 = load ptr, ptr %5, align 8, !tbaa !9
  %22 = getelementptr inbounds ptr, ptr %21, i64 0
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.21, ptr noundef %23)
  %24 = load ptr, ptr %5, align 8, !tbaa !9
  %25 = getelementptr inbounds ptr, ptr %24, i64 0
  %26 = load ptr, ptr %25, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef @.str.22, ptr noundef %26)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %79

27:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1896, ptr %8) #3
  %28 = call i32 @XAPI_Init(ptr noundef %8, ptr noundef @service_callback, ptr noundef %8, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 3684, ptr %9) #3
  %29 = load ptr, ptr %5, align 8, !tbaa !9
  %30 = getelementptr inbounds ptr, ptr %29, i64 1
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = call i32 @XLink_Parse(ptr noundef %9, ptr noundef %31)
  %33 = icmp slt i32 %32, 0
  br i1 %33, label %38, label %34

34:                                               ; preds = %27
  %35 = getelementptr inbounds %struct.XLink, ptr %9, i32 0, i32 0
  %36 = load i32, ptr %35, align 4, !tbaa !11
  %37 = icmp ne i32 %36, 0
  br i1 %37, label %42, label %38

38:                                               ; preds = %34, %27
  %39 = load ptr, ptr %5, align 8, !tbaa !9
  %40 = getelementptr inbounds ptr, ptr %39, i64 1
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.23, ptr noundef %41)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef @.str.24)
  call void @XAPI_Destroy(ptr noundef %8)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %78

42:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 96, ptr %10) #3
  call void @XAPI_InitEndpoint(ptr noundef %10)
  %43 = getelementptr inbounds %struct.XLink, ptr %9, i32 0, i32 7
  %44 = getelementptr inbounds [32 x i8], ptr %43, i64 0, i64 0
  %45 = call zeroext i8 @xstrcmp(ptr noundef %44, ptr noundef @.str.25)
  %46 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 10
  store i8 %45, ptr %46, align 2, !tbaa !13
  %47 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 0
  store i32 5, ptr %47, align 8, !tbaa !17
  %48 = getelementptr inbounds %struct.XLink, ptr %9, i32 0, i32 3
  %49 = getelementptr inbounds [256 x i8], ptr %48, i64 0, i64 0
  %50 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 3
  store ptr %49, ptr %50, align 8, !tbaa !18
  %51 = getelementptr inbounds %struct.XLink, ptr %9, i32 0, i32 0
  %52 = load i32, ptr %51, align 4, !tbaa !11
  %53 = trunc i32 %52 to i16
  %54 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 6
  store i16 %53, ptr %54, align 4, !tbaa !19
  %55 = getelementptr inbounds %struct.XLink, ptr %9, i32 0, i32 1
  %56 = getelementptr inbounds [2048 x i8], ptr %55, i64 0, i64 0
  %57 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 4
  store ptr %56, ptr %57, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #3
  %58 = getelementptr inbounds %struct.xapi_endpoint_, ptr %10, i32 0, i32 2
  store ptr %11, ptr %58, align 8, !tbaa !21
  %59 = call i32 @XAPI_AddEndpoint(ptr noundef %8, ptr noundef %10, i32 noundef 3)
  %60 = icmp slt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %42
  call void @XAPI_Destroy(ptr noundef %8)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %77

62:                                               ; preds = %42
  br label %63

63:                                               ; preds = %75, %62
  %64 = load i8, ptr @g_bFinish, align 1, !tbaa !22
  %65 = icmp ne i8 %64, 0
  %66 = xor i1 %65, true
  br i1 %66, label %67, label %76

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  %68 = call i32 @XAPI_Service(ptr noundef %8, i32 noundef 100)
  store i32 %68, ptr %12, align 4, !tbaa !5
  %69 = load i32, ptr %12, align 4, !tbaa !5
  %70 = icmp ne i32 %69, 11
  br i1 %70, label %71, label %72

71:                                               ; preds = %67
  store i32 3, ptr %7, align 4
  br label %73

72:                                               ; preds = %67
  store i32 0, ptr %7, align 4
  br label %73

73:                                               ; preds = %72, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  %74 = load i32, ptr %7, align 4
  switch i32 %74, label %81 [
    i32 0, label %75
    i32 3, label %76
  ]

75:                                               ; preds = %73
  br label %63, !llvm.loop !23

76:                                               ; preds = %73, %63
  call void @XAPI_Destroy(ptr noundef %8)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %77

77:                                               ; preds = %76, %61
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr %10) #3
  br label %78

78:                                               ; preds = %77, %38
  call void @llvm.lifetime.end.p0(i64 3684, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1896, ptr %8) #3
  br label %79

79:                                               ; preds = %78, %20
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #3
  %80 = load i32, ptr %3, align 4
  ret i32 %80

81:                                               ; preds = %73
  unreachable
}

declare void @XLog_Init(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) #2

declare void @XLog_TimeFormatSet(i32 noundef) #2

declare void @XLog_FlagsSet(i16 noundef zeroext) #2

declare void @XLog_IndentSet(i8 noundef zeroext) #2

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

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

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

declare void @XAPI_Destroy(ptr noundef) #2

declare void @XAPI_InitEndpoint(ptr noundef) #2

declare zeroext i8 @xstrcmp(ptr noundef, ptr noundef) #2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"XLink", !6, i64 0, !7, i64 4, !7, i64 2052, !7, i64 2308, !7, i64 2564, !7, i64 2596, !7, i64 2628, !7, i64 3652}
!13 = !{!14, !7, i64 94}
!14 = !{!"xapi_endpoint_", !6, i64 0, !15, i64 8, !10, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !16, i64 84, !6, i64 88, !7, i64 92, !7, i64 93, !7, i64 94}
!15 = !{!"XSocketCert", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40}
!16 = !{!"short", !7, i64 0}
!17 = !{!14, !6, i64 0}
!18 = !{!14, !10, i64 64}
!19 = !{!14, !16, i64 84}
!20 = !{!14, !10, i64 72}
!21 = !{!14, !10, i64 56}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"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.xapi_ = type { ptr, %struct.XEvents, i64, ptr, i8, i8, i8 }
%struct.XEvents = type { ptr, i32, ptr, ptr, i32, i32, i8, %struct.XHash }
%struct.XHash = type { ptr, ptr, i64, [32 x %struct.xlist] }
%struct.xlist = type { ptr, ptr, %struct.xlist_data, i8 }
%struct.xlist_data = type { ptr, ptr, ptr, i64 }
%struct.XLink = type { i32, [2048 x i8], [256 x i8], [256 x i8], [32 x i8], [32 x i8], [1024 x i8], [32 x i8] }
%struct.xapi_endpoint_ = type { i32, %struct.XSocketCert, ptr, ptr, ptr, i32, i16, i32, i8, i8, i8 }
%struct.XSocketCert = type { ptr, ptr, ptr, ptr, ptr, i32 }
%struct.session_data_t = type { i64, i64 }

@g_bFinish = external hidden local_unnamed_addr global i8, align 1
@.str.21 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [25 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @signal_callback(i32 noundef) #0

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

declare void @XLog_Display(i32 noundef, i8 noundef zeroext, ptr noundef, ...) 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @service_callback(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @main(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = alloca [3 x i32], align 4
  %4 = alloca %struct.xapi_, align 8
  %5 = alloca %struct.XLink, align 4
  %6 = alloca %struct.xapi_endpoint_, align 8
  %7 = alloca %struct.session_data_t, align 8
  tail call void @XLog_Init(ptr noundef null, i16 noundef zeroext 203, i8 noundef zeroext 0) #3
  tail call void @XLog_TimeFormatSet(i32 noundef 1) #3
  tail call void @XLog_FlagsSet(i16 noundef zeroext 255) #3
  tail call void @XLog_IndentSet(i8 noundef zeroext 1) #3
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #3
  store i32 15, ptr %3, align 4, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %3, i64 4
  store i32 2, ptr %8, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %3, i64 8
  store i32 13, ptr %9, align 4, !tbaa !5
  %10 = call i32 @XSig_Register(ptr noundef nonnull %3, i64 noundef 3, ptr noundef nonnull @signal_callback) #3
  %11 = icmp slt i32 %0, 2
  br i1 %11, label %12, label %15

12:                                               ; preds = %2
  %13 = load ptr, ptr %1, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.21, ptr noundef %13) #3
  %14 = load ptr, ptr %1, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 1, i8 noundef zeroext 1, ptr noundef nonnull @.str.22, ptr noundef %14) #3
  br label %43

15:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 1896, ptr nonnull %4) #3
  %16 = call i32 @XAPI_Init(ptr noundef nonnull %4, ptr noundef nonnull @service_callback, ptr noundef nonnull %4, i64 noundef 0) #3
  call void @llvm.lifetime.start.p0(i64 3684, ptr nonnull %5) #3
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = load ptr, ptr %17, align 8, !tbaa !9
  %19 = call i32 @XLink_Parse(ptr noundef nonnull %5, ptr noundef %18) #3
  %20 = icmp sgt i32 %19, -1
  %21 = load i32, ptr %5, align 4
  %22 = icmp ne i32 %21, 0
  %or.cond = select i1 %20, i1 %22, i1 false
  br i1 %or.cond, label %25, label %23

23:                                               ; preds = %15
  %24 = load ptr, ptr %17, align 8, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.23, ptr noundef %24) #3
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef nonnull @.str.24) #3
  call void @XAPI_Destroy(ptr noundef nonnull %4) #3
  br label %42

25:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 96, ptr nonnull %6) #3
  call void @XAPI_InitEndpoint(ptr noundef nonnull %6) #3
  %26 = getelementptr inbounds i8, ptr %5, i64 3652
  %27 = call zeroext i8 @xstrcmp(ptr noundef nonnull %26, ptr noundef nonnull @.str.25) #3
  %28 = getelementptr inbounds i8, ptr %6, i64 94
  store i8 %27, ptr %28, align 2, !tbaa !11
  store i32 5, ptr %6, align 8, !tbaa !15
  %29 = getelementptr inbounds i8, ptr %5, i64 2308
  %30 = getelementptr inbounds i8, ptr %6, i64 64
  store ptr %29, ptr %30, align 8, !tbaa !16
  %31 = load i32, ptr %5, align 4, !tbaa !17
  %32 = trunc i32 %31 to i16
  %33 = getelementptr inbounds i8, ptr %6, i64 84
  store i16 %32, ptr %33, align 4, !tbaa !19
  %34 = getelementptr inbounds i8, ptr %5, i64 4
  %35 = getelementptr inbounds i8, ptr %6, i64 72
  store ptr %34, ptr %35, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #3
  %36 = getelementptr inbounds i8, ptr %6, i64 56
  store ptr %7, ptr %36, align 8, !tbaa !21
  %37 = call i32 @XAPI_AddEndpoint(ptr noundef nonnull %4, ptr noundef nonnull %6, i32 noundef 3) #3
  %38 = icmp slt i32 %37, 0
  br i1 %38, label %.loopexit, label %39

39:                                               ; preds = %25
  %.old = load i8, ptr @g_bFinish, align 1, !tbaa !22
  %.not.old = icmp eq i8 %.old, 0
  br i1 %.not.old, label %.preheader, label %.loopexit

.preheader:                                       ; preds = %39, %.preheader
  %40 = call i32 @XAPI_Service(ptr noundef nonnull %4, i32 noundef 100) #3
  %.not10 = icmp eq i32 %40, 11
  %41 = load i8, ptr @g_bFinish, align 1
  %.not = icmp eq i8 %41, 0
  %or.cond11 = select i1 %.not10, i1 %.not, i1 false
  br i1 %or.cond11, label %.preheader, label %.loopexit

.loopexit:                                        ; preds = %.preheader, %39, %25
  %.0 = phi i32 [ -1, %25 ], [ 0, %39 ], [ 0, %.preheader ]
  call void @XAPI_Destroy(ptr noundef nonnull %4) #3
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 96, ptr nonnull %6) #3
  br label %42

42:                                               ; preds = %.loopexit, %23
  %.1 = phi i32 [ %.0, %.loopexit ], [ -1, %23 ]
  call void @llvm.lifetime.end.p0(i64 3684, ptr nonnull %5) #3
  call void @llvm.lifetime.end.p0(i64 1896, ptr nonnull %4) #3
  br label %43

43:                                               ; preds = %42, %12
  %.2 = phi i32 [ 1, %12 ], [ %.1, %42 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #3
  ret i32 %.2
}

declare void @XLog_Init(ptr noundef, i16 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #2

declare void @XLog_TimeFormatSet(i32 noundef) local_unnamed_addr #2

declare void @XLog_FlagsSet(i16 noundef zeroext) local_unnamed_addr #2

declare void @XLog_IndentSet(i8 noundef zeroext) local_unnamed_addr #2

declare i32 @XSig_Register(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

declare i32 @XAPI_Init(ptr noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2

declare i32 @XLink_Parse(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @XAPI_Destroy(ptr noundef) local_unnamed_addr #2

declare void @XAPI_InitEndpoint(ptr noundef) local_unnamed_addr #2

declare zeroext i8 @xstrcmp(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @XAPI_AddEndpoint(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare i32 @XAPI_Service(ptr noundef, i32 noundef) local_unnamed_addr #2

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !7, i64 94}
!12 = !{!"xapi_endpoint_", !6, i64 0, !13, i64 8, !10, i64 56, !10, i64 64, !10, i64 72, !6, i64 80, !14, i64 84, !6, i64 88, !7, i64 92, !7, i64 93, !7, i64 94}
!13 = !{!"XSocketCert", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40}
!14 = !{!"short", !7, i64 0}
!15 = !{!12, !6, i64 0}
!16 = !{!12, !10, i64 64}
!17 = !{!18, !6, i64 0}
!18 = !{!"XLink", !6, i64 0, !7, i64 4, !7, i64 2052, !7, i64 2308, !7, i64 2564, !7, i64 2596, !7, i64 2628, !7, i64 3652}
!19 = !{!12, !14, i64 84}
!20 = !{!12, !10, i64 72}
!21 = !{!12, !10, i64 56}
!22 = !{!7, !7, i64 0}


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