; LLVM IR from kala13x/libxutils :: tools (xhttp)

; 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_args_ = type { i32, %struct.xcli_bar_, ptr, %struct.XTime, i8, i8, i8, i8, i8, i64, i64, i64, %struct.XByteBuffer, [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8], [2048 x i8] }
%struct.xcli_bar_ = type { %struct.xcli_size_, i64, i64, i32, i32, i8, i8, i8, i8, double, i32, i8, i8, i8, i8, i8, i8, [256 x i8], [256 x i8], [256 x i8] }
%struct.xcli_size_ = type { i64, i64 }
%struct.XTime = type { i16, i8, i8, i8, i8, i8, i8 }
%struct.XByteBuffer = type { ptr, i64, i64, i16, i16, i32 }
%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] }

@.str.49 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [6 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

declare i32 @printf(ptr noundef, ...) #1

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

declare i64 @xstrncpy(ptr noundef, i64 noundef, ptr noundef) #1

declare zeroext i8 @xstrused(ptr noundef) #1

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

declare i64 @xstrncpyf(ptr noundef, i64 noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @XHTTPApp_Prepare(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %8 = load ptr, ptr %5, align 8, !tbaa !5
  %9 = load ptr, ptr %4, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.xhttp_args_, ptr %9, i32 0, i32 14
  %11 = getelementptr inbounds [2048 x i8], ptr %10, i64 0, i64 0
  %12 = call i32 @XLink_Parse(ptr noundef %8, ptr noundef %11)
  %13 = icmp eq i32 %12, -1
  br i1 %13, label %14, label %18

14:                                               ; preds = %2
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.xhttp_args_, ptr %15, i32 0, i32 14
  %17 = getelementptr inbounds [2048 x i8], ptr %16, i64 0, i64 0
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.49, ptr noundef %17)
  store i32 -1, ptr %3, align 4
  br label %149

18:                                               ; preds = %2
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.xhttp_args_, ptr %19, i32 0, i32 7
  %21 = load i8, ptr %20, align 1, !tbaa !9
  %22 = icmp ne i8 %21, 0
  br i1 %22, label %23, label %52

23:                                               ; preds = %18
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.xhttp_args_, ptr %24, i32 0, i32 14
  %26 = getelementptr inbounds [2048 x i8], ptr %25, i64 0, i64 0
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef @.str.50, ptr noundef %26)
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.XLink, ptr %27, i32 0, i32 7
  %29 = getelementptr inbounds [32 x i8], ptr %28, i64 0, i64 0
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.XLink, ptr %30, i32 0, i32 2
  %32 = getelementptr inbounds [256 x i8], ptr %31, i64 0, i64 0
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.XLink, ptr %33, i32 0, i32 3
  %35 = getelementptr inbounds [256 x i8], ptr %34, i64 0, i64 0
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.XLink, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 4, !tbaa !19
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.XLink, ptr %39, i32 0, i32 4
  %41 = getelementptr inbounds [32 x i8], ptr %40, i64 0, i64 0
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.XLink, ptr %42, i32 0, i32 5
  %44 = getelementptr inbounds [32 x i8], ptr %43, i64 0, i64 0
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.XLink, ptr %45, i32 0, i32 6
  %47 = getelementptr inbounds [1024 x i8], ptr %46, i64 0, i64 0
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.XLink, ptr %48, i32 0, i32 1
  %50 = getelementptr inbounds [2048 x i8], ptr %49, i64 0, i64 0
  %51 = call i32 (ptr, ...) @printf(ptr noundef @.str.51, ptr noundef %29, ptr noundef %32, ptr noundef %35, i32 noundef %38, ptr noundef %41, ptr noundef %44, ptr noundef %47, ptr noundef %50)
  br label %52

52:                                               ; preds = %23, %18
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.xhttp_args_, ptr %53, i32 0, i32 6
  %55 = load i8, ptr %54, align 2, !tbaa !21
  %56 = zext i8 %55 to i32
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %99

58:                                               ; preds = %52
  %59 = load ptr, ptr %4, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.xhttp_args_, ptr %59, i32 0, i32 17
  %61 = getelementptr inbounds [2048 x i8], ptr %60, i64 0, i64 0
  %62 = call zeroext i8 @xstrused(ptr noundef %61)
  %63 = icmp ne i8 %62, 0
  br i1 %63, label %99, label %64

64:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.XLink, ptr %65, i32 0, i32 6
  %67 = getelementptr inbounds [1024 x i8], ptr %66, i64 0, i64 0
  %68 = call zeroext i8 @xstrused(ptr noundef %67)
  %69 = zext i8 %68 to i32
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %75

71:                                               ; preds = %64
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.XLink, ptr %72, i32 0, i32 6
  %74 = getelementptr inbounds [1024 x i8], ptr %73, i64 0, i64 0
  br label %76

75:                                               ; preds = %64
  br label %76

76:                                               ; preds = %75, %71
  %77 = phi ptr [ %74, %71 ], [ @.str.52, %75 ]
  store ptr %77, ptr %6, align 8, !tbaa !5
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.xhttp_args_, ptr %78, i32 0, i32 17
  %80 = getelementptr inbounds [2048 x i8], ptr %79, i64 0, i64 0
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = call i64 @xstrncpy(ptr noundef %80, i64 noundef 2048, ptr noundef %81)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store i64 1, ptr %7, align 8, !tbaa !22
  br label %83

83:                                               ; preds = %89, %76
  %84 = load ptr, ptr %4, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.xhttp_args_, ptr %84, i32 0, i32 17
  %86 = getelementptr inbounds [2048 x i8], ptr %85, i64 0, i64 0
  %87 = call zeroext i8 @XPath_Exists(ptr noundef %86)
  %88 = icmp ne i8 %87, 0
  br i1 %88, label %89, label %98

89:                                               ; preds = %83
  %90 = load ptr, ptr %4, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.xhttp_args_, ptr %90, i32 0, i32 17
  %92 = getelementptr inbounds [2048 x i8], ptr %91, i64 0, i64 0
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = load i64, ptr %7, align 8, !tbaa !22
  %95 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef %92, i64 noundef 2048, ptr noundef @.str.53, ptr noundef %93, i64 noundef %94)
  %96 = load i64, ptr %7, align 8, !tbaa !22
  %97 = add i64 %96, 1
  store i64 %97, ptr %7, align 8, !tbaa !22
  br label %83, !llvm.loop !23

98:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  br label %99

99:                                               ; preds = %98, %58, %52
  %100 = load ptr, ptr %4, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.xhttp_args_, ptr %100, i32 0, i32 17
  %102 = getelementptr inbounds [2048 x i8], ptr %101, i64 0, i64 0
  %103 = call zeroext i8 @XPath_Exists(ptr noundef %102)
  %104 = zext i8 %103 to i32
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %116

106:                                              ; preds = %99
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.xhttp_args_, ptr %107, i32 0, i32 5
  %109 = load i8, ptr %108, align 1, !tbaa !25
  %110 = zext i8 %109 to i32
  %111 = icmp eq i32 %110, 0
  br i1 %111, label %112, label %116

112:                                              ; preds = %106
  %113 = load ptr, ptr %4, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.xhttp_args_, ptr %113, i32 0, i32 17
  %115 = getelementptr inbounds [2048 x i8], ptr %114, i64 0, i64 0
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 8, i8 noundef zeroext 1, ptr noundef @.str.54, ptr noundef %115)
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef @.str.55)
  store i32 -1, ptr %3, align 4
  br label %149

116:                                              ; preds = %106, %99
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.xhttp_args_, ptr %117, i32 0, i32 8
  %119 = load i8, ptr %118, align 4, !tbaa !26
  %120 = zext i8 %119 to i32
  %121 = icmp ne i32 %120, 0
  br i1 %121, label %122, label %148

122:                                              ; preds = %116
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.XLink, ptr %123, i32 0, i32 7
  %125 = getelementptr inbounds [32 x i8], ptr %124, i64 0, i64 0
  %126 = call i32 @strncmp(ptr noundef %125, ptr noundef @.str.56, i64 noundef 5) #5
  %127 = icmp ne i32 %126, 0
  br i1 %127, label %128, label %148

128:                                              ; preds = %122
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.XLink, ptr %129, i32 0, i32 3
  %131 = getelementptr inbounds [256 x i8], ptr %130, i64 0, i64 0
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.XLink, ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 4, !tbaa !19
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef @.str.57, ptr noundef %131, i32 noundef %134, i32 noundef 443)
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.XLink, ptr %135, i32 0, i32 2
  %137 = getelementptr inbounds [256 x i8], ptr %136, i64 0, i64 0
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.XLink, ptr %138, i32 0, i32 3
  %140 = getelementptr inbounds [256 x i8], ptr %139, i64 0, i64 0
  %141 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef %137, i64 noundef 256, ptr noundef @.str.58, ptr noundef %140, i32 noundef 443)
  %142 = load ptr, ptr %5, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.XLink, ptr %142, i32 0, i32 7
  %144 = getelementptr inbounds [32 x i8], ptr %143, i64 0, i64 0
  %145 = call i64 @xstrncpy(ptr noundef %144, i64 noundef 32, ptr noundef @.str.56)
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.XLink, ptr %146, i32 0, i32 0
  store i32 443, ptr %147, align 4, !tbaa !19
  br label %148

148:                                              ; preds = %128, %122, %116
  store i32 1, ptr %3, align 4
  br label %149

149:                                              ; preds = %148, %112, %14
  %150 = load i32, ptr %3, align 4
  ret i32 %150
}

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

declare zeroext i8 @XPath_Exists(ptr noundef) #1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #3

attributes #0 = { 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 = { 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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/C++ TBAA"}
!9 = !{!10, !7, i64 867}
!10 = !{!"xhttp_args_", !11, i64 0, !12, i64 8, !6, i64 848, !16, i64 856, !7, i64 864, !7, i64 865, !7, i64 866, !7, i64 867, !7, i64 868, !14, i64 872, !14, i64 880, !14, i64 888, !18, i64 896, !7, i64 928, !7, i64 2976, !7, i64 5024, !7, i64 7072, !7, i64 9120, !7, i64 11168}
!11 = !{!"int", !7, i64 0}
!12 = !{!"xcli_bar_", !13, i64 0, !14, i64 16, !14, i64 24, !11, i64 32, !11, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !15, i64 48, !11, i64 56, !7, i64 60, !7, i64 61, !7, i64 62, !7, i64 63, !7, i64 64, !7, i64 65, !7, i64 66, !7, i64 322, !7, i64 578}
!13 = !{!"xcli_size_", !14, i64 0, !14, i64 8}
!14 = !{!"long", !7, i64 0}
!15 = !{!"double", !7, i64 0}
!16 = !{!"XTime", !17, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!17 = !{!"short", !7, i64 0}
!18 = !{!"XByteBuffer", !6, i64 0, !14, i64 8, !14, i64 16, !17, i64 24, !17, i64 26, !11, i64 28}
!19 = !{!20, !11, i64 0}
!20 = !{!"XLink", !11, i64 0, !7, i64 4, !7, i64 2052, !7, i64 2308, !7, i64 2564, !7, i64 2596, !7, i64 2628, !7, i64 3652}
!21 = !{!10, !7, i64 866}
!22 = !{!14, !14, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !7, i64 865}
!26 = !{!10, !7, i64 868}


; 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.49 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.50 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.51 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.52 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.53 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.54 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.55 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.56 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.57 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.58 = external hidden unnamed_addr constant [6 x i8], align 1

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

declare i64 @xstrncpy(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare zeroext i8 @xstrused(ptr noundef) local_unnamed_addr #1

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

declare i64 @xstrncpyf(ptr noundef, i64 noundef, ptr noundef, ...) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @XHTTPApp_Prepare(ptr noundef %0, ptr noundef %1) local_unnamed_addr #2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 2976
  %4 = tail call i32 @XLink_Parse(ptr noundef %1, ptr noundef nonnull %3) #4
  %5 = icmp eq i32 %4, -1
  br i1 %5, label %6, label %7

6:                                                ; preds = %2
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.49, ptr noundef nonnull %3) #4
  br label %54

7:                                                ; preds = %2
  %8 = getelementptr inbounds i8, ptr %0, i64 867
  %9 = load i8, ptr %8, align 1, !tbaa !5
  %.not = icmp eq i8 %9, 0
  br i1 %.not, label %20, label %10

10:                                               ; preds = %7
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef nonnull @.str.50, ptr noundef nonnull %3) #4
  %11 = getelementptr inbounds i8, ptr %1, i64 3652
  %12 = getelementptr inbounds i8, ptr %1, i64 2052
  %13 = getelementptr inbounds i8, ptr %1, i64 2308
  %14 = load i32, ptr %1, align 4, !tbaa !18
  %15 = getelementptr inbounds i8, ptr %1, i64 2564
  %16 = getelementptr inbounds i8, ptr %1, i64 2596
  %17 = getelementptr inbounds i8, ptr %1, i64 2628
  %18 = getelementptr inbounds i8, ptr %1, i64 4
  %19 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.51, ptr noundef nonnull %11, ptr noundef nonnull %12, ptr noundef nonnull %13, i32 noundef %14, ptr noundef nonnull %15, ptr noundef nonnull %16, ptr noundef nonnull %17, ptr noundef nonnull %18)
  br label %20

20:                                               ; preds = %10, %7
  %21 = getelementptr inbounds i8, ptr %0, i64 866
  %22 = load i8, ptr %21, align 2, !tbaa !20
  %.not36 = icmp eq i8 %22, 0
  br i1 %.not36, label %.loopexit, label %23

23:                                               ; preds = %20
  %24 = getelementptr inbounds i8, ptr %0, i64 9120
  %25 = tail call zeroext i8 @xstrused(ptr noundef nonnull %24) #4
  %.not37 = icmp eq i8 %25, 0
  br i1 %.not37, label %26, label %.loopexit

26:                                               ; preds = %23
  %27 = getelementptr inbounds i8, ptr %1, i64 2628
  %28 = tail call zeroext i8 @xstrused(ptr noundef nonnull %27) #4
  %.not38 = icmp eq i8 %28, 0
  %29 = select i1 %.not38, ptr @.str.52, ptr %27
  %30 = tail call i64 @xstrncpy(ptr noundef nonnull %24, i64 noundef 2048, ptr noundef nonnull %29) #4
  %31 = tail call zeroext i8 @XPath_Exists(ptr noundef nonnull %24) #4
  %.not3943 = icmp eq i8 %31, 0
  br i1 %.not3943, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %26, %.lr.ph
  %.044 = phi i64 [ %33, %.lr.ph ], [ 1, %26 ]
  %32 = tail call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef nonnull %24, i64 noundef 2048, ptr noundef nonnull @.str.53, ptr noundef nonnull %29, i64 noundef %.044) #4
  %33 = add i64 %.044, 1
  %34 = tail call zeroext i8 @XPath_Exists(ptr noundef nonnull %24) #4
  %.not39 = icmp eq i8 %34, 0
  br i1 %.not39, label %.loopexit, label %.lr.ph, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph, %26, %23, %20
  %35 = getelementptr inbounds i8, ptr %0, i64 9120
  %36 = tail call zeroext i8 @XPath_Exists(ptr noundef nonnull %35) #4
  %.not40 = icmp eq i8 %36, 0
  br i1 %.not40, label %42, label %37

37:                                               ; preds = %.loopexit
  %38 = getelementptr inbounds i8, ptr %0, i64 865
  %39 = load i8, ptr %38, align 1, !tbaa !23
  %40 = icmp eq i8 %39, 0
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 8, i8 noundef zeroext 1, ptr noundef nonnull @.str.54, ptr noundef nonnull %35) #4
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef nonnull @.str.55) #4
  br label %54

42:                                               ; preds = %37, %.loopexit
  %43 = getelementptr inbounds i8, ptr %0, i64 868
  %44 = load i8, ptr %43, align 4, !tbaa !24
  %.not41 = icmp eq i8 %44, 0
  br i1 %.not41, label %54, label %45

45:                                               ; preds = %42
  %46 = getelementptr inbounds i8, ptr %1, i64 3652
  %47 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %46, ptr noundef nonnull dereferenceable(1) @.str.56, i64 noundef 5) #5
  %.not42 = icmp eq i32 %47, 0
  br i1 %.not42, label %54, label %48

48:                                               ; preds = %45
  %49 = getelementptr inbounds i8, ptr %1, i64 2308
  %50 = load i32, ptr %1, align 4, !tbaa !18
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef nonnull @.str.57, ptr noundef nonnull %49, i32 noundef %50, i32 noundef 443) #4
  %51 = getelementptr inbounds i8, ptr %1, i64 2052
  %52 = tail call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef nonnull %51, i64 noundef 256, ptr noundef nonnull @.str.58, ptr noundef nonnull %49, i32 noundef 443) #4
  %53 = tail call i64 @xstrncpy(ptr noundef nonnull %46, i64 noundef 32, ptr noundef nonnull @.str.56) #4
  store i32 443, ptr %1, align 4, !tbaa !18
  br label %54

54:                                               ; preds = %42, %45, %48, %41, %6
  %.035 = phi i32 [ -1, %6 ], [ -1, %41 ], [ 1, %48 ], [ 1, %45 ], [ 1, %42 ]
  ret i32 %.035
}

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

declare zeroext i8 @XPath_Exists(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #3

attributes #0 = { 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 #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 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 #3 = { 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 #4 = { nounwind }
attributes #5 = { 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, !8, i64 867}
!6 = !{!"xhttp_args_", !7, i64 0, !10, i64 8, !14, i64 848, !15, i64 856, !8, i64 864, !8, i64 865, !8, i64 866, !8, i64 867, !8, i64 868, !12, i64 872, !12, i64 880, !12, i64 888, !17, i64 896, !8, i64 928, !8, i64 2976, !8, i64 5024, !8, i64 7072, !8, i64 9120, !8, i64 11168}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"xcli_bar_", !11, i64 0, !12, i64 16, !12, i64 24, !7, i64 32, !7, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !13, i64 48, !7, i64 56, !8, i64 60, !8, i64 61, !8, i64 62, !8, i64 63, !8, i64 64, !8, i64 65, !8, i64 66, !8, i64 322, !8, i64 578}
!11 = !{!"xcli_size_", !12, i64 0, !12, i64 8}
!12 = !{!"long", !8, i64 0}
!13 = !{!"double", !8, i64 0}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!"XTime", !16, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!16 = !{!"short", !8, i64 0}
!17 = !{!"XByteBuffer", !14, i64 0, !12, i64 8, !12, i64 16, !16, i64 24, !16, i64 26, !7, i64 28}
!18 = !{!19, !7, i64 0}
!19 = !{!"XLink", !7, i64 0, !8, i64 4, !8, i64 2052, !8, i64 2308, !8, i64 2564, !8, i64 2596, !8, i64 2628, !8, i64 3652}
!20 = !{!6, !8, i64 866}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !8, i64 865}
!24 = !{!6, !8, i64 868}


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