; LLVM IR from kala13x/libxutils :: src/net (http)

; 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.xhttp_ = type { ptr, i16, ptr, i32, %struct.XByteBuffer, i32, %struct.XMap, i16, i16, i64, i64, i64, i64, i64, i8, i8, i8, [256 x i8], [128 x i8], [2048 x i8] }
%struct.XByteBuffer = type { ptr, i64, i64, i16, i16, i32 }
%struct.XMap = type { ptr, ptr, ptr, i64, i64, i32 }

@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

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

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

declare void @XByteBuffer_Clear(ptr noundef) #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @XHTTP_Assemble(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i8, align 1
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.xhttp_, ptr %15, i32 0, i32 16
  %17 = load i8, ptr %16, align 2, !tbaa !11
  %18 = icmp ne i8 %17, 0
  br i1 %18, label %19, label %22

19:                                               ; preds = %3
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.xhttp_, ptr %20, i32 0, i32 4
  store ptr %21, ptr %4, align 8
  br label %146

22:                                               ; preds = %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = icmp ne ptr %23, null
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = load i64, ptr %7, align 8, !tbaa !9
  br label %28

27:                                               ; preds = %22
  br label %28

28:                                               ; preds = %27, %25
  %29 = phi i64 [ %26, %25 ], [ 0, %27 ]
  store i64 %29, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #3
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.xhttp_, ptr %30, i32 0, i32 14
  %32 = load i8, ptr %31, align 8, !tbaa !17
  store i8 %32, ptr %8, align 1, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.xhttp_, ptr %33, i32 0, i32 4
  store ptr %34, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  %35 = load ptr, ptr %5, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.xhttp_, ptr %35, i32 0, i32 6
  store ptr %36, ptr %10, align 8, !tbaa !5
  %37 = load ptr, ptr %9, align 8, !tbaa !5
  call void @XByteBuffer_Clear(ptr noundef %37)
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.xhttp_, ptr %38, i32 0, i32 10
  store i64 0, ptr %39, align 8, !tbaa !19
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.xhttp_, ptr %40, i32 0, i32 7
  store i16 0, ptr %41, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  store i32 0, ptr %11, align 4, !tbaa !21
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.xhttp_, ptr %42, i32 0, i32 5
  %44 = load i32, ptr %43, align 8, !tbaa !22
  %45 = icmp eq i32 %44, 1
  br i1 %45, label %46, label %60

46:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.xhttp_, ptr %47, i32 0, i32 3
  %49 = load i32, ptr %48, align 8, !tbaa !23
  %50 = call ptr @XHTTP_GetMethodStr(i32 noundef %49)
  store ptr %50, ptr %12, align 8, !tbaa !5
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = load ptr, ptr %5, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.xhttp_, ptr %53, i32 0, i32 19
  %55 = getelementptr inbounds [2048 x i8], ptr %54, i64 0, i64 0
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.xhttp_, ptr %56, i32 0, i32 18
  %58 = getelementptr inbounds [128 x i8], ptr %57, i64 0, i64 0
  %59 = call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef %51, ptr noundef @.str.34, ptr noundef %52, ptr noundef %55, ptr noundef %58)
  store i32 %59, ptr %11, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  br label %82

60:                                               ; preds = %28
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.xhttp_, ptr %61, i32 0, i32 5
  %63 = load i32, ptr %62, align 8, !tbaa !22
  %64 = icmp eq i32 %63, 2
  br i1 %64, label %65, label %81

65:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %66 = load ptr, ptr %5, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.xhttp_, ptr %66, i32 0, i32 8
  %68 = load i16, ptr %67, align 2, !tbaa !24
  %69 = zext i16 %68 to i32
  %70 = call ptr @XHTTP_GetCodeStr(i32 noundef %69)
  store ptr %70, ptr %13, align 8, !tbaa !5
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.xhttp_, ptr %72, i32 0, i32 18
  %74 = getelementptr inbounds [128 x i8], ptr %73, i64 0, i64 0
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.xhttp_, ptr %75, i32 0, i32 8
  %77 = load i16, ptr %76, align 2, !tbaa !24
  %78 = zext i16 %77 to i32
  %79 = load ptr, ptr %13, align 8, !tbaa !5
  %80 = call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef %71, ptr noundef @.str.35, ptr noundef %74, i32 noundef %78, ptr noundef %79)
  store i32 %80, ptr %11, align 4, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %81

81:                                               ; preds = %65, %60
  br label %82

82:                                               ; preds = %81, %46
  %83 = load i32, ptr %11, align 4, !tbaa !21
  %84 = icmp eq i32 %83, -1
  br i1 %84, label %85, label %86

85:                                               ; preds = %82
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %145

86:                                               ; preds = %82
  %87 = load i64, ptr %7, align 8, !tbaa !9
  %88 = icmp ugt i64 %87, 0
  br i1 %88, label %89, label %99

89:                                               ; preds = %86
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.xhttp_, ptr %90, i32 0, i32 14
  store i8 1, ptr %91, align 8, !tbaa !17
  %92 = load ptr, ptr %5, align 8, !tbaa !5
  %93 = load i64, ptr %7, align 8, !tbaa !9
  %94 = call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef %92, ptr noundef @.str.36, ptr noundef @.str.37, i64 noundef %93)
  store i32 %94, ptr %11, align 4, !tbaa !21
  %95 = load i32, ptr %11, align 4, !tbaa !21
  %96 = icmp sle i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %89
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %145

98:                                               ; preds = %89
  br label %99

99:                                               ; preds = %98, %86
  %100 = load ptr, ptr %10, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.XMap, ptr %100, i32 0, i32 4
  %102 = load i64, ptr %101, align 8, !tbaa !25
  %103 = icmp ugt i64 %102, 0
  br i1 %103, label %104, label %109

104:                                              ; preds = %99
  %105 = load ptr, ptr %10, align 8, !tbaa !5
  %106 = load ptr, ptr %5, align 8, !tbaa !5
  %107 = call i32 @XMap_Iterate(ptr noundef %105, ptr noundef @XHTTP_HeaderWriteCb, ptr noundef %106)
  %108 = icmp ne i32 %107, 1
  br i1 %108, label %113, label %109

109:                                              ; preds = %104, %99
  %110 = load ptr, ptr %9, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef %110, ptr noundef @.str.38, ptr noundef @.str.39)
  %112 = icmp eq i32 %111, -1
  br i1 %112, label %113, label %114

113:                                              ; preds = %109, %104
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %145

114:                                              ; preds = %109
  %115 = load ptr, ptr %9, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.XByteBuffer, ptr %115, i32 0, i32 2
  %117 = load i64, ptr %116, align 8, !tbaa !26
  %118 = load ptr, ptr %5, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.xhttp_, ptr %118, i32 0, i32 10
  store i64 %117, ptr %119, align 8, !tbaa !19
  %120 = load ptr, ptr %10, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.XMap, ptr %120, i32 0, i32 4
  %122 = load i64, ptr %121, align 8, !tbaa !25
  %123 = trunc i64 %122 to i16
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.xhttp_, ptr %124, i32 0, i32 7
  store i16 %123, ptr %125, align 8, !tbaa !20
  %126 = load i64, ptr %7, align 8, !tbaa !9
  %127 = icmp ugt i64 %126, 0
  br i1 %127, label %128, label %135

128:                                              ; preds = %114
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = load i64, ptr %7, align 8, !tbaa !9
  %132 = call i32 @XByteBuffer_Add(ptr noundef %129, ptr noundef %130, i64 noundef %131)
  %133 = icmp sle i32 %132, 0
  br i1 %133, label %134, label %135

134:                                              ; preds = %128
  store ptr null, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %145

135:                                              ; preds = %128, %114
  %136 = load i8, ptr %8, align 1, !tbaa !18
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.xhttp_, ptr %137, i32 0, i32 14
  store i8 %136, ptr %138, align 8, !tbaa !17
  %139 = load i64, ptr %7, align 8, !tbaa !9
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.xhttp_, ptr %140, i32 0, i32 9
  store i64 %139, ptr %141, align 8, !tbaa !27
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.xhttp_, ptr %142, i32 0, i32 16
  store i8 1, ptr %143, align 2, !tbaa !11
  %144 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %144, ptr %4, align 8
  store i32 1, ptr %14, align 4
  br label %145

145:                                              ; preds = %135, %134, %113, %97, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #3
  br label %146

146:                                              ; preds = %145, %19
  %147 = load ptr, ptr %4, align 8
  ret ptr %147
}

declare i32 @XByteBuffer_AddFmt(ptr noundef, ptr noundef, ...) #2

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

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 = !{!"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, !7, i64 170}
!12 = !{!"xhttp_", !6, i64 0, !13, i64 8, !6, i64 16, !14, i64 24, !15, i64 32, !14, i64 64, !16, i64 72, !13, i64 120, !13, i64 122, !10, i64 128, !10, i64 136, !10, i64 144, !10, i64 152, !10, i64 160, !7, i64 168, !7, i64 169, !7, i64 170, !7, i64 171, !7, i64 427, !7, i64 555}
!13 = !{!"short", !7, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = !{!"XByteBuffer", !6, i64 0, !10, i64 8, !10, i64 16, !13, i64 24, !13, i64 26, !14, i64 28}
!16 = !{!"XMap", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 32, !14, i64 40}
!17 = !{!12, !7, i64 168}
!18 = !{!7, !7, i64 0}
!19 = !{!12, !10, i64 136}
!20 = !{!12, !13, i64 120}
!21 = !{!14, !14, i64 0}
!22 = !{!12, !14, i64 64}
!23 = !{!12, !14, i64 24}
!24 = !{!12, !13, i64 122}
!25 = !{!16, !10, i64 32}
!26 = !{!15, !10, i64 16}
!27 = !{!12, !10, i64 128}


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

@.str.34 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.36 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.38 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

declare void @XByteBuffer_Clear(ptr noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @XHTTP_Assemble(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 170
  %5 = load i8, ptr %4, align 2, !tbaa !5
  %.not = icmp eq i8 %5, 0
  br i1 %.not, label %8, label %6

6:                                                ; preds = %3
  %7 = getelementptr inbounds i8, ptr %0, i64 32
  br label %57

8:                                                ; preds = %3
  %.not50 = icmp eq ptr %1, null
  %9 = select i1 %.not50, i64 0, i64 %2
  %10 = getelementptr inbounds i8, ptr %0, i64 168
  %11 = load i8, ptr %10, align 8, !tbaa !15
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = getelementptr inbounds i8, ptr %0, i64 72
  tail call void @XByteBuffer_Clear(ptr noundef nonnull %12) #2
  %14 = getelementptr inbounds i8, ptr %0, i64 136
  store i64 0, ptr %14, align 8, !tbaa !16
  %15 = getelementptr inbounds i8, ptr %0, i64 120
  store i16 0, ptr %15, align 8, !tbaa !17
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  %17 = load i32, ptr %16, align 8, !tbaa !18
  switch i32 %17, label %.thread [
    i32 1, label %18
    i32 2, label %25
  ]

18:                                               ; preds = %8
  %19 = getelementptr inbounds i8, ptr %0, i64 24
  %20 = load i32, ptr %19, align 8, !tbaa !19
  %21 = tail call ptr @XHTTP_GetMethodStr(i32 noundef %20)
  %22 = getelementptr inbounds i8, ptr %0, i64 555
  %23 = getelementptr inbounds i8, ptr %0, i64 427
  %24 = tail call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef nonnull %12, ptr noundef nonnull @.str.34, ptr noundef %21, ptr noundef nonnull %22, ptr noundef nonnull %23) #2
  br label %34

25:                                               ; preds = %8
  %26 = getelementptr inbounds i8, ptr %0, i64 122
  %27 = load i16, ptr %26, align 2, !tbaa !20
  %28 = zext i16 %27 to i32
  %29 = tail call ptr @XHTTP_GetCodeStr(i32 noundef %28)
  %30 = getelementptr inbounds i8, ptr %0, i64 427
  %31 = load i16, ptr %26, align 2, !tbaa !20
  %32 = zext i16 %31 to i32
  %33 = tail call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef nonnull %12, ptr noundef nonnull @.str.35, ptr noundef nonnull %30, i32 noundef %32, ptr noundef %29) #2
  br label %34

34:                                               ; preds = %25, %18
  %.046 = phi i32 [ %24, %18 ], [ %33, %25 ]
  %35 = icmp eq i32 %.046, -1
  br i1 %35, label %57, label %.thread

.thread:                                          ; preds = %8, %34
  %.not51 = icmp eq i64 %9, 0
  br i1 %.not51, label %39, label %36

36:                                               ; preds = %.thread
  store i8 1, ptr %10, align 8, !tbaa !15
  %37 = tail call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef nonnull %0, ptr noundef nonnull @.str.36, ptr noundef nonnull @.str.37, i64 noundef %9)
  %38 = icmp slt i32 %37, 1
  br i1 %38, label %57, label %39

39:                                               ; preds = %36, %.thread
  %40 = getelementptr inbounds i8, ptr %0, i64 104
  %41 = load i64, ptr %40, align 8, !tbaa !21
  %.not52 = icmp eq i64 %41, 0
  br i1 %.not52, label %44, label %42

42:                                               ; preds = %39
  %43 = tail call i32 @XMap_Iterate(ptr noundef nonnull %13, ptr noundef nonnull @XHTTP_HeaderWriteCb, ptr noundef nonnull %0) #2
  %.not53 = icmp eq i32 %43, 1
  br i1 %.not53, label %44, label %57

44:                                               ; preds = %42, %39
  %45 = tail call i32 (ptr, ptr, ...) @XByteBuffer_AddFmt(ptr noundef nonnull %12, ptr noundef nonnull @.str.38, ptr noundef nonnull @.str.39) #2
  %46 = icmp eq i32 %45, -1
  br i1 %46, label %57, label %47

47:                                               ; preds = %44
  %48 = getelementptr inbounds i8, ptr %0, i64 48
  %49 = load i64, ptr %48, align 8, !tbaa !22
  store i64 %49, ptr %14, align 8, !tbaa !16
  %50 = load i64, ptr %40, align 8, !tbaa !21
  %51 = trunc i64 %50 to i16
  store i16 %51, ptr %15, align 8, !tbaa !17
  br i1 %.not51, label %55, label %52

52:                                               ; preds = %47
  %53 = tail call i32 @XByteBuffer_Add(ptr noundef nonnull %12, ptr noundef %1, i64 noundef %9) #2
  %54 = icmp slt i32 %53, 1
  br i1 %54, label %57, label %55

55:                                               ; preds = %52, %47
  store i8 %11, ptr %10, align 8, !tbaa !15
  %56 = getelementptr inbounds i8, ptr %0, i64 128
  store i64 %9, ptr %56, align 8, !tbaa !23
  store i8 1, ptr %4, align 2, !tbaa !5
  br label %57

57:                                               ; preds = %55, %34, %36, %44, %42, %52, %6
  %.1 = phi ptr [ %7, %6 ], [ %12, %55 ], [ null, %34 ], [ null, %36 ], [ null, %44 ], [ null, %42 ], [ null, %52 ]
  ret ptr %.1
}

declare i32 @XByteBuffer_AddFmt(ptr noundef, ptr noundef, ...) local_unnamed_addr #1

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

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 = { "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 }

!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 170}
!6 = !{!"xhttp_", !7, i64 0, !10, i64 8, !7, i64 16, !11, i64 24, !12, i64 32, !11, i64 64, !14, i64 72, !10, i64 120, !10, i64 122, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !8, i64 168, !8, i64 169, !8, i64 170, !8, i64 171, !8, i64 427, !8, i64 555}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"XByteBuffer", !7, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 26, !11, i64 28}
!13 = !{!"long", !8, i64 0}
!14 = !{!"XMap", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !13, i64 32, !11, i64 40}
!15 = !{!6, !8, i64 168}
!16 = !{!6, !13, i64 136}
!17 = !{!6, !10, i64 120}
!18 = !{!6, !11, i64 64}
!19 = !{!6, !11, i64 24}
!20 = !{!6, !10, i64 122}
!21 = !{!14, !13, i64 32}
!22 = !{!12, !13, i64 16}
!23 = !{!6, !13, i64 128}


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