; LLVM IR from NTHU-LSALAB/Gemini :: src/comm.ll (Z15prepare_requestPc14comm_request_tz)

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

@_ZZ15prepare_requestPc14comm_request_tzE11client_name = external hidden global ptr, align 8
@_ZZ15prepare_requestPc14comm_request_tzE15client_name_len = external hidden global i64, align 8
@_ZZ15prepare_requestPc14comm_request_tzE2id = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z15prepare_requestPc14comm_request_tz(ptr noundef %0, i32 noundef %1, ...) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca [1 x %struct.__va_list_tag], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %6) #7
  %7 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %8 = icmp eq ptr %7, null
  br i1 %8, label %9, label %20

9:                                                ; preds = %2
  %10 = call ptr @getenv(ptr noundef @.str) #7
  store ptr %10, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %11 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %17

13:                                               ; preds = %9
  %14 = call noalias ptr @malloc(i64 noundef 64) #8
  store ptr %14, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %15 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %16 = call i32 @gethostname(ptr noundef %15, i64 noundef 64) #7
  br label %17

17:                                               ; preds = %13, %9
  %18 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %19 = call i64 @strlen(ptr noundef %18) #9
  store i64 %19, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !11
  br label %20

20:                                               ; preds = %17, %2
  %21 = load ptr, ptr %3, align 8, !tbaa !5
  %22 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !11
  %23 = call noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef %21, ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %22)
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load i64, ptr %5, align 8, !tbaa !11
  %26 = getelementptr inbounds i8, ptr %24, i64 %25
  %27 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !5
  %28 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !11
  %29 = call ptr @strncpy(ptr noundef %26, ptr noundef %27, i64 noundef %28) #7
  %30 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !11
  %31 = load i64, ptr %5, align 8, !tbaa !11
  %32 = add i64 %31, %30
  store i64 %32, ptr %5, align 8, !tbaa !11
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = call noundef i64 @_Z15append_msg_dataIcEmPcRmT_(ptr noundef %33, ptr noundef nonnull align 8 dereferenceable(8) %5, i8 noundef signext 0)
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = load i32, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !13
  %37 = call noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef %35, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %36)
  %38 = load ptr, ptr %3, align 8, !tbaa !5
  %39 = load i32, ptr %4, align 4, !tbaa !9
  %40 = call noundef i64 @_Z15append_msg_dataI14comm_request_tEmPcRmT_(ptr noundef %38, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %39)
  %41 = load i32, ptr %4, align 4, !tbaa !9
  %42 = icmp eq i32 %41, 0
  br i1 %42, label %43, label %82

43:                                               ; preds = %20
  %44 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %44)
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  %47 = getelementptr inbounds %struct.__va_list_tag, ptr %46, i32 0, i32 1
  %48 = load i32, ptr %47, align 4
  %49 = icmp ule i32 %48, 160
  br i1 %49, label %50, label %55

50:                                               ; preds = %43
  %51 = getelementptr inbounds %struct.__va_list_tag, ptr %46, i32 0, i32 3
  %52 = load ptr, ptr %51, align 16
  %53 = getelementptr i8, ptr %52, i32 %48
  %54 = add i32 %48, 16
  store i32 %54, ptr %47, align 4
  br label %59

55:                                               ; preds = %43
  %56 = getelementptr inbounds %struct.__va_list_tag, ptr %46, i32 0, i32 2
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr i8, ptr %57, i32 8
  store ptr %58, ptr %56, align 8
  br label %59

59:                                               ; preds = %55, %50
  %60 = phi ptr [ %53, %50 ], [ %57, %55 ]
  %61 = load double, ptr %60, align 8, !tbaa !15
  %62 = call noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef %45, ptr noundef nonnull align 8 dereferenceable(8) %5, double noundef %61)
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  %64 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  %65 = getelementptr inbounds %struct.__va_list_tag, ptr %64, i32 0, i32 1
  %66 = load i32, ptr %65, align 4
  %67 = icmp ule i32 %66, 160
  br i1 %67, label %68, label %73

68:                                               ; preds = %59
  %69 = getelementptr inbounds %struct.__va_list_tag, ptr %64, i32 0, i32 3
  %70 = load ptr, ptr %69, align 16
  %71 = getelementptr i8, ptr %70, i32 %66
  %72 = add i32 %66, 16
  store i32 %72, ptr %65, align 4
  br label %77

73:                                               ; preds = %59
  %74 = getelementptr inbounds %struct.__va_list_tag, ptr %64, i32 0, i32 2
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr i8, ptr %75, i32 8
  store ptr %76, ptr %74, align 8
  br label %77

77:                                               ; preds = %73, %68
  %78 = phi ptr [ %71, %68 ], [ %75, %73 ]
  %79 = load double, ptr %78, align 8, !tbaa !15
  %80 = call noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef %63, ptr noundef nonnull align 8 dereferenceable(8) %5, double noundef %79)
  %81 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %81)
  br label %125

82:                                               ; preds = %20
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = icmp eq i32 %83, 2
  br i1 %84, label %85, label %124

85:                                               ; preds = %82
  %86 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  call void @llvm.va_start.p0(ptr %86)
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  %89 = getelementptr inbounds %struct.__va_list_tag, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 16
  %91 = icmp ule i32 %90, 40
  br i1 %91, label %92, label %97

92:                                               ; preds = %85
  %93 = getelementptr inbounds %struct.__va_list_tag, ptr %88, i32 0, i32 3
  %94 = load ptr, ptr %93, align 16
  %95 = getelementptr i8, ptr %94, i32 %90
  %96 = add i32 %90, 8
  store i32 %96, ptr %89, align 16
  br label %101

97:                                               ; preds = %85
  %98 = getelementptr inbounds %struct.__va_list_tag, ptr %88, i32 0, i32 2
  %99 = load ptr, ptr %98, align 8
  %100 = getelementptr i8, ptr %99, i32 8
  store ptr %100, ptr %98, align 8
  br label %101

101:                                              ; preds = %97, %92
  %102 = phi ptr [ %95, %92 ], [ %99, %97 ]
  %103 = load i64, ptr %102, align 8, !tbaa !11
  %104 = call noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef %87, ptr noundef nonnull align 8 dereferenceable(8) %5, i64 noundef %103)
  %105 = load ptr, ptr %3, align 8, !tbaa !5
  %106 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  %107 = getelementptr inbounds %struct.__va_list_tag, ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 16
  %109 = icmp ule i32 %108, 40
  br i1 %109, label %110, label %115

110:                                              ; preds = %101
  %111 = getelementptr inbounds %struct.__va_list_tag, ptr %106, i32 0, i32 3
  %112 = load ptr, ptr %111, align 16
  %113 = getelementptr i8, ptr %112, i32 %108
  %114 = add i32 %108, 8
  store i32 %114, ptr %107, align 16
  br label %119

115:                                              ; preds = %101
  %116 = getelementptr inbounds %struct.__va_list_tag, ptr %106, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8
  %118 = getelementptr i8, ptr %117, i32 8
  store ptr %118, ptr %116, align 8
  br label %119

119:                                              ; preds = %115, %110
  %120 = phi ptr [ %113, %110 ], [ %117, %115 ]
  %121 = load i32, ptr %120, align 4, !tbaa !13
  %122 = call noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef %105, ptr noundef nonnull align 8 dereferenceable(8) %5, i32 noundef %121)
  %123 = getelementptr inbounds [1 x %struct.__va_list_tag], ptr %6, i64 0, i64 0
  call void @llvm.va_end.p0(ptr %123)
  br label %124

124:                                              ; preds = %119, %82
  br label %125

125:                                              ; preds = %124, %77
  %126 = load i32, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !13
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 24, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  ret i32 %126
}

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

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

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

; Function Attrs: nounwind
declare i32 @gethostname(ptr noundef, i64 noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #5

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIcEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataI14comm_request_tEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), double noundef) #5

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #6

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

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

!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 = !{!"_ZTS14comm_request_t", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}


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

@_ZZ15prepare_requestPc14comm_request_tzE11client_name = external hidden local_unnamed_addr global ptr, align 8
@_ZZ15prepare_requestPc14comm_request_tzE15client_name_len = external hidden local_unnamed_addr global i64, align 8
@_ZZ15prepare_requestPc14comm_request_tzE2id = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [9 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @_Z15prepare_requestPc14comm_request_tz(ptr noundef %0, i32 noundef %1, ...) local_unnamed_addr #0 {
  %3 = alloca i64, align 8
  %4 = alloca [1 x %struct.__va_list_tag], align 16
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  store i64 0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  %5 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !9
  %6 = icmp eq ptr %5, null
  br i1 %6, label %7, label %._crit_edge

._crit_edge:                                      ; preds = %2
  %.pre15 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !5
  br label %16

7:                                                ; preds = %2
  %8 = tail call ptr @getenv(ptr noundef nonnull @.str) #8
  store ptr %8, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !9
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %13

10:                                               ; preds = %7
  %11 = tail call noalias dereferenceable_or_null(64) ptr @malloc(i64 noundef 64) #9
  store ptr %11, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !9
  %12 = tail call i32 @gethostname(ptr noundef %11, i64 noundef 64) #8
  %.pre = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !9
  br label %13

13:                                               ; preds = %10, %7
  %14 = phi ptr [ %.pre, %10 ], [ %8, %7 ]
  %15 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %14) #10
  store i64 %15, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !5
  br label %16

16:                                               ; preds = %._crit_edge, %13
  %17 = phi i64 [ %.pre15, %._crit_edge ], [ %15, %13 ]
  %18 = call noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %17)
  %19 = load i64, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %0, i64 %19
  %21 = load ptr, ptr @_ZZ15prepare_requestPc14comm_request_tzE11client_name, align 8, !tbaa !9
  %22 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !5
  %23 = call ptr @strncpy(ptr noundef %20, ptr noundef %21, i64 noundef %22) #8
  %24 = load i64, ptr @_ZZ15prepare_requestPc14comm_request_tzE15client_name_len, align 8, !tbaa !5
  %25 = add i64 %24, %19
  store i64 %25, ptr %3, align 8, !tbaa !5
  %26 = call noundef i64 @_Z15append_msg_dataIcEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i8 noundef signext 0)
  %27 = load i32, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !11
  %28 = call noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %27)
  %29 = call noundef i64 @_Z15append_msg_dataI14comm_request_tEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %1)
  switch i32 %1, label %97 [
    i32 0, label %30
    i32 2, label %64
  ]

30:                                               ; preds = %16
  call void @llvm.va_start.p0(ptr nonnull %4)
  %31 = getelementptr inbounds i8, ptr %4, i64 4
  %32 = load i32, ptr %31, align 4
  %33 = icmp ult i32 %32, 161
  br i1 %33, label %34, label %40

34:                                               ; preds = %30
  %35 = getelementptr inbounds i8, ptr %4, i64 16
  %36 = load ptr, ptr %35, align 16
  %37 = zext nneg i32 %32 to i64
  %38 = getelementptr i8, ptr %36, i64 %37
  %39 = add nuw nsw i32 %32, 16
  store i32 %39, ptr %31, align 4
  br label %44

40:                                               ; preds = %30
  %41 = getelementptr inbounds i8, ptr %4, i64 8
  %42 = load ptr, ptr %41, align 8
  %43 = getelementptr i8, ptr %42, i64 8
  store ptr %43, ptr %41, align 8
  br label %44

44:                                               ; preds = %40, %34
  %45 = phi ptr [ %38, %34 ], [ %42, %40 ]
  %46 = load double, ptr %45, align 8, !tbaa !13
  %47 = call noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, double noundef %46)
  %48 = load i32, ptr %31, align 4
  %49 = icmp ult i32 %48, 161
  br i1 %49, label %50, label %56

50:                                               ; preds = %44
  %51 = getelementptr inbounds i8, ptr %4, i64 16
  %52 = load ptr, ptr %51, align 16
  %53 = zext nneg i32 %48 to i64
  %54 = getelementptr i8, ptr %52, i64 %53
  %55 = add nuw nsw i32 %48, 16
  store i32 %55, ptr %31, align 4
  br label %60

56:                                               ; preds = %44
  %57 = getelementptr inbounds i8, ptr %4, i64 8
  %58 = load ptr, ptr %57, align 8
  %59 = getelementptr i8, ptr %58, i64 8
  store ptr %59, ptr %57, align 8
  br label %60

60:                                               ; preds = %56, %50
  %61 = phi ptr [ %54, %50 ], [ %58, %56 ]
  %62 = load double, ptr %61, align 8, !tbaa !13
  %63 = call noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, double noundef %62)
  br label %.sink.split

64:                                               ; preds = %16
  call void @llvm.va_start.p0(ptr nonnull %4)
  %65 = load i32, ptr %4, align 16
  %66 = icmp ult i32 %65, 41
  br i1 %66, label %67, label %73

67:                                               ; preds = %64
  %68 = getelementptr inbounds i8, ptr %4, i64 16
  %69 = load ptr, ptr %68, align 16
  %70 = zext nneg i32 %65 to i64
  %71 = getelementptr i8, ptr %69, i64 %70
  %72 = add nuw nsw i32 %65, 8
  store i32 %72, ptr %4, align 16
  br label %77

73:                                               ; preds = %64
  %74 = getelementptr inbounds i8, ptr %4, i64 8
  %75 = load ptr, ptr %74, align 8
  %76 = getelementptr i8, ptr %75, i64 8
  store ptr %76, ptr %74, align 8
  br label %77

77:                                               ; preds = %73, %67
  %78 = phi ptr [ %71, %67 ], [ %75, %73 ]
  %79 = load i64, ptr %78, align 8, !tbaa !5
  %80 = call noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %79)
  %81 = load i32, ptr %4, align 16
  %82 = icmp ult i32 %81, 41
  br i1 %82, label %83, label %89

83:                                               ; preds = %77
  %84 = getelementptr inbounds i8, ptr %4, i64 16
  %85 = load ptr, ptr %84, align 16
  %86 = zext nneg i32 %81 to i64
  %87 = getelementptr i8, ptr %85, i64 %86
  %88 = add nuw nsw i32 %81, 8
  store i32 %88, ptr %4, align 16
  br label %93

89:                                               ; preds = %77
  %90 = getelementptr inbounds i8, ptr %4, i64 8
  %91 = load ptr, ptr %90, align 8
  %92 = getelementptr i8, ptr %91, i64 8
  store ptr %92, ptr %90, align 8
  br label %93

93:                                               ; preds = %89, %83
  %94 = phi ptr [ %87, %83 ], [ %91, %89 ]
  %95 = load i32, ptr %94, align 4, !tbaa !11
  %96 = call noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(8) %3, i32 noundef %95)
  br label %.sink.split

.sink.split:                                      ; preds = %60, %93
  call void @llvm.va_end.p0(ptr nonnull %4)
  br label %97

97:                                               ; preds = %.sink.split, %16
  %98 = load i32, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !11
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr @_ZZ15prepare_requestPc14comm_request_tzE2id, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  ret i32 %98
}

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

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataImEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIcEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIiEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataI14comm_request_tEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_start.p0(ptr) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z15append_msg_dataIdEmPcRmT_(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), double noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.va_end.p0(ptr) #7

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

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

!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 = !{!"long", !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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass