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

@.str.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [32 x i8], align 1
@optarg = external global ptr, align 8
@.str.28 = external hidden unnamed_addr constant [42 x i8], align 1

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @XHTTPApp_ParseArgs(ptr noundef %0, i32 noundef %1, ptr noundef %2) #1 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.xhttp_args_, ptr %11, i32 0, i32 12
  %13 = call i32 @XByteBuffer_Init(ptr noundef %12, i64 noundef 0, i32 noundef 0)
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.xhttp_args_, ptr %14, i32 0, i32 3
  call void @XTime_Init(ptr noundef %15)
  %16 = load ptr, ptr %5, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.xhttp_args_, ptr %16, i32 0, i32 2
  store ptr null, ptr %17, align 8, !tbaa !11
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.xhttp_args_, ptr %18, i32 0, i32 0
  store i32 2, ptr %19, align 8, !tbaa !20
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.xhttp_args_, ptr %20, i32 0, i32 4
  store i8 0, ptr %21, align 8, !tbaa !21
  %22 = load ptr, ptr %5, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.xhttp_args_, ptr %22, i32 0, i32 5
  store i8 0, ptr %23, align 1, !tbaa !22
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.xhttp_args_, ptr %24, i32 0, i32 6
  store i8 0, ptr %25, align 2, !tbaa !23
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.xhttp_args_, ptr %26, i32 0, i32 7
  store i8 0, ptr %27, align 1, !tbaa !24
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.xhttp_args_, ptr %28, i32 0, i32 8
  store i8 0, ptr %29, align 4, !tbaa !25
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.xhttp_args_, ptr %30, i32 0, i32 9
  store i64 0, ptr %31, align 8, !tbaa !26
  %32 = load ptr, ptr %5, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.xhttp_args_, ptr %32, i32 0, i32 10
  store i64 0, ptr %33, align 8, !tbaa !27
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.xhttp_args_, ptr %34, i32 0, i32 11
  store i64 0, ptr %35, align 8, !tbaa !28
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.xhttp_args_, ptr %36, i32 0, i32 18
  %38 = getelementptr inbounds [2048 x i8], ptr %37, i64 0, i64 0
  %39 = call i64 @xstrncpy(ptr noundef %38, i64 noundef 2048, ptr noundef @.str.26)
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.xhttp_args_, ptr %40, i32 0, i32 13
  %42 = getelementptr inbounds [2048 x i8], ptr %41, i64 0, i64 0
  call void @xstrnul(ptr noundef %42)
  %43 = load ptr, ptr %5, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.xhttp_args_, ptr %43, i32 0, i32 14
  %45 = getelementptr inbounds [2048 x i8], ptr %44, i64 0, i64 0
  call void @xstrnul(ptr noundef %45)
  %46 = load ptr, ptr %5, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.xhttp_args_, ptr %46, i32 0, i32 15
  %48 = getelementptr inbounds [2048 x i8], ptr %47, i64 0, i64 0
  call void @xstrnul(ptr noundef %48)
  %49 = load ptr, ptr %5, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.xhttp_args_, ptr %49, i32 0, i32 16
  %51 = getelementptr inbounds [2048 x i8], ptr %50, i64 0, i64 0
  call void @xstrnul(ptr noundef %51)
  %52 = load ptr, ptr %5, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.xhttp_args_, ptr %52, i32 0, i32 17
  %54 = getelementptr inbounds [2048 x i8], ptr %53, i64 0, i64 0
  call void @xstrnul(ptr noundef %54)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %55

55:                                               ; preds = %120, %3
  %56 = load i32, ptr %6, align 4, !tbaa !9
  %57 = load ptr, ptr %7, align 8, !tbaa !5
  %58 = call i32 @getopt(i32 noundef %56, ptr noundef %57, ptr noundef @.str.27) #6
  store i32 %58, ptr %8, align 4, !tbaa !9
  %59 = icmp ne i32 %58, -1
  br i1 %59, label %60, label %121

60:                                               ; preds = %55
  %61 = load i32, ptr %8, align 4, !tbaa !9
  switch i32 %61, label %119 [
    i32 117, label %62
    i32 108, label %68
    i32 99, label %74
    i32 111, label %80
    i32 120, label %86
    i32 109, label %92
    i32 116, label %97
    i32 100, label %103
    i32 102, label %106
    i32 115, label %109
    i32 118, label %112
    i32 119, label %115
    i32 104, label %118
  ]

62:                                               ; preds = %60
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.xhttp_args_, ptr %63, i32 0, i32 13
  %65 = getelementptr inbounds [2048 x i8], ptr %64, i64 0, i64 0
  %66 = load ptr, ptr @optarg, align 8, !tbaa !5
  %67 = call i64 @xstrncpy(ptr noundef %65, i64 noundef 2048, ptr noundef %66)
  br label %120

68:                                               ; preds = %60
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.xhttp_args_, ptr %69, i32 0, i32 14
  %71 = getelementptr inbounds [2048 x i8], ptr %70, i64 0, i64 0
  %72 = load ptr, ptr @optarg, align 8, !tbaa !5
  %73 = call i64 @xstrncpy(ptr noundef %71, i64 noundef 2048, ptr noundef %72)
  br label %120

74:                                               ; preds = %60
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.xhttp_args_, ptr %75, i32 0, i32 16
  %77 = getelementptr inbounds [2048 x i8], ptr %76, i64 0, i64 0
  %78 = load ptr, ptr @optarg, align 8, !tbaa !5
  %79 = call i64 @xstrncpy(ptr noundef %77, i64 noundef 2048, ptr noundef %78)
  br label %120

80:                                               ; preds = %60
  %81 = load ptr, ptr %5, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.xhttp_args_, ptr %81, i32 0, i32 17
  %83 = getelementptr inbounds [2048 x i8], ptr %82, i64 0, i64 0
  %84 = load ptr, ptr @optarg, align 8, !tbaa !5
  %85 = call i64 @xstrncpy(ptr noundef %83, i64 noundef 2048, ptr noundef %84)
  br label %120

86:                                               ; preds = %60
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.xhttp_args_, ptr %87, i32 0, i32 15
  %89 = getelementptr inbounds [2048 x i8], ptr %88, i64 0, i64 0
  %90 = load ptr, ptr @optarg, align 8, !tbaa !5
  %91 = call i64 @xstrncpy(ptr noundef %89, i64 noundef 2048, ptr noundef %90)
  br label %120

92:                                               ; preds = %60
  %93 = load ptr, ptr @optarg, align 8, !tbaa !5
  %94 = call i32 @XHTTP_GetMethodType(ptr noundef %93)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.xhttp_args_, ptr %95, i32 0, i32 0
  store i32 %94, ptr %96, align 8, !tbaa !20
  br label %120

97:                                               ; preds = %60
  %98 = load ptr, ptr @optarg, align 8, !tbaa !5
  %99 = call i32 @atoi(ptr noundef %98) #7
  %100 = sext i32 %99 to i64
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.xhttp_args_, ptr %101, i32 0, i32 9
  store i64 %100, ptr %102, align 8, !tbaa !26
  br label %120

103:                                              ; preds = %60
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.xhttp_args_, ptr %104, i32 0, i32 6
  store i8 1, ptr %105, align 2, !tbaa !23
  br label %120

106:                                              ; preds = %60
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.xhttp_args_, ptr %107, i32 0, i32 4
  store i8 1, ptr %108, align 8, !tbaa !21
  br label %120

109:                                              ; preds = %60
  %110 = load ptr, ptr %5, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.xhttp_args_, ptr %110, i32 0, i32 8
  store i8 1, ptr %111, align 4, !tbaa !25
  br label %120

112:                                              ; preds = %60
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.xhttp_args_, ptr %113, i32 0, i32 7
  store i8 1, ptr %114, align 1, !tbaa !24
  br label %120

115:                                              ; preds = %60
  %116 = load ptr, ptr %5, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.xhttp_args_, ptr %116, i32 0, i32 5
  store i8 1, ptr %117, align 1, !tbaa !22
  br label %120

118:                                              ; preds = %60
  br label %119

119:                                              ; preds = %118, %60
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %180

120:                                              ; preds = %115, %112, %109, %106, %103, %97, %92, %86, %80, %74, %68, %62
  br label %55, !llvm.loop !29

121:                                              ; preds = %55
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.xhttp_args_, ptr %122, i32 0, i32 14
  %124 = getelementptr inbounds [2048 x i8], ptr %123, i64 0, i64 0
  %125 = call zeroext i8 @xstrused(ptr noundef %124)
  %126 = icmp ne i8 %125, 0
  br i1 %126, label %128, label %127

127:                                              ; preds = %121
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %180

128:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.xhttp_args_, ptr %129, i32 0, i32 1
  store ptr %130, ptr %10, align 8, !tbaa !5
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.xhttp_args_, ptr %131, i32 0, i32 16
  %133 = getelementptr inbounds [2048 x i8], ptr %132, i64 0, i64 0
  %134 = call zeroext i8 @xstrused(ptr noundef %133)
  %135 = zext i8 %134 to i32
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %151

137:                                              ; preds = %128
  %138 = load ptr, ptr %5, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.xhttp_args_, ptr %138, i32 0, i32 16
  %140 = getelementptr inbounds [2048 x i8], ptr %139, i64 0, i64 0
  %141 = load ptr, ptr %5, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.xhttp_args_, ptr %141, i32 0, i32 12
  %143 = call i64 @XPath_LoadBuffer(ptr noundef %140, ptr noundef %142)
  %144 = icmp ule i64 %143, 0
  br i1 %144, label %145, label %151

145:                                              ; preds = %137
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.xhttp_args_, ptr %146, i32 0, i32 16
  %148 = getelementptr inbounds [2048 x i8], ptr %147, i64 0, i64 0
  %149 = call ptr @__errno_location() #8
  %150 = load i32, ptr %149, align 4, !tbaa !9
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.28, ptr noundef %148, i32 noundef %150)
  store i32 0, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %179

151:                                              ; preds = %137, %128
  %152 = load ptr, ptr %5, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.xhttp_args_, ptr %152, i32 0, i32 17
  %154 = getelementptr inbounds [2048 x i8], ptr %153, i64 0, i64 0
  %155 = call zeroext i8 @xstrused(ptr noundef %154)
  %156 = zext i8 %155 to i32
  %157 = icmp ne i32 %156, 0
  br i1 %157, label %164, label %158

158:                                              ; preds = %151
  %159 = load ptr, ptr %5, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.xhttp_args_, ptr %159, i32 0, i32 6
  %161 = load i8, ptr %160, align 2, !tbaa !23
  %162 = zext i8 %161 to i32
  %163 = icmp ne i32 %162, 0
  br i1 %163, label %164, label %172

164:                                              ; preds = %158, %151
  %165 = load ptr, ptr %10, align 8, !tbaa !5
  call void @XProgBar_GetDefaults(ptr noundef %165)
  %166 = load ptr, ptr %5, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.xhttp_args_, ptr %166, i32 0, i32 4
  store i8 1, ptr %167, align 8, !tbaa !21
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.xhttp_args_, ptr %168, i32 0, i32 6
  store i8 1, ptr %169, align 2, !tbaa !23
  %170 = load ptr, ptr %10, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.xcli_bar_, ptr %170, i32 0, i32 5
  store i8 1, ptr %171, align 8, !tbaa !31
  br label %172

172:                                              ; preds = %164, %158
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.xhttp_args_, ptr %173, i32 0, i32 7
  %175 = load i8, ptr %174, align 1, !tbaa !24
  %176 = icmp ne i8 %175, 0
  br i1 %176, label %177, label %178

177:                                              ; preds = %172
  call void @XLog_TimeFormatSet(i32 noundef 1)
  call void @XLog_FlagEnable(i32 noundef 255)
  br label %178

178:                                              ; preds = %177, %172
  store i32 1, ptr %4, align 4
  store i32 1, ptr %9, align 4
  br label %179

179:                                              ; preds = %178, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %180

180:                                              ; preds = %179, %127, %119
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  %181 = load i32, ptr %4, align 4
  ret i32 %181
}

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

declare void @XTime_Init(ptr noundef) #2

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

declare void @xstrnul(ptr noundef) #2

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

declare i32 @XHTTP_GetMethodType(ptr noundef) #2

; Function Attrs: inlinehint nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr noundef nonnull) #4

declare zeroext i8 @xstrused(ptr noundef) #2

declare i64 @XPath_LoadBuffer(ptr noundef, ptr noundef) #2

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #5

declare void @XProgBar_GetDefaults(ptr noundef) #2

declare void @XLog_TimeFormatSet(i32 noundef) #2

declare void @XLog_FlagEnable(i32 noundef) #2

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

!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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 848}
!12 = !{!"xhttp_args_", !10, i64 0, !13, i64 8, !6, i64 848, !17, i64 856, !7, i64 864, !7, i64 865, !7, i64 866, !7, i64 867, !7, i64 868, !15, i64 872, !15, i64 880, !15, i64 888, !19, i64 896, !7, i64 928, !7, i64 2976, !7, i64 5024, !7, i64 7072, !7, i64 9120, !7, i64 11168}
!13 = !{!"xcli_bar_", !14, i64 0, !15, i64 16, !15, i64 24, !10, i64 32, !10, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !16, i64 48, !10, 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}
!14 = !{!"xcli_size_", !15, i64 0, !15, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!"XTime", !18, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!18 = !{!"short", !7, i64 0}
!19 = !{!"XByteBuffer", !6, i64 0, !15, i64 8, !15, i64 16, !18, i64 24, !18, i64 26, !10, i64 28}
!20 = !{!12, !10, i64 0}
!21 = !{!12, !7, i64 864}
!22 = !{!12, !7, i64 865}
!23 = !{!12, !7, i64 866}
!24 = !{!12, !7, i64 867}
!25 = !{!12, !7, i64 868}
!26 = !{!12, !15, i64 872}
!27 = !{!12, !15, i64 880}
!28 = !{!12, !15, i64 888}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!13, !7, i64 40}


; 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.26 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [32 x i8], align 1
@optarg = external local_unnamed_addr global ptr, align 8
@.str.28 = external hidden unnamed_addr constant [42 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 0, 2) i32 @XHTTPApp_ParseArgs(ptr noundef %0, i32 noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %0, i64 896
  %5 = tail call i32 @XByteBuffer_Init(ptr noundef nonnull %4, i64 noundef 0, i32 noundef 0) #6
  %6 = getelementptr inbounds i8, ptr %0, i64 856
  tail call void @XTime_Init(ptr noundef nonnull %6) #6
  %7 = getelementptr inbounds i8, ptr %0, i64 848
  store ptr null, ptr %7, align 8, !tbaa !5
  store i32 2, ptr %0, align 8, !tbaa !18
  %8 = getelementptr inbounds i8, ptr %0, i64 864
  %9 = getelementptr inbounds i8, ptr %0, i64 865
  %10 = getelementptr inbounds i8, ptr %0, i64 866
  %11 = getelementptr inbounds i8, ptr %0, i64 867
  %12 = getelementptr inbounds i8, ptr %0, i64 868
  %13 = getelementptr inbounds i8, ptr %0, i64 872
  %14 = getelementptr inbounds i8, ptr %0, i64 11168
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(5) %8, i8 0, i64 5, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %13, i8 0, i64 24, i1 false)
  %15 = tail call i64 @xstrncpy(ptr noundef nonnull %14, i64 noundef 2048, ptr noundef nonnull @.str.26) #6
  %16 = getelementptr inbounds i8, ptr %0, i64 928
  tail call void @xstrnul(ptr noundef nonnull %16) #6
  %17 = getelementptr inbounds i8, ptr %0, i64 2976
  tail call void @xstrnul(ptr noundef nonnull %17) #6
  %18 = getelementptr inbounds i8, ptr %0, i64 5024
  tail call void @xstrnul(ptr noundef nonnull %18) #6
  %19 = getelementptr inbounds i8, ptr %0, i64 7072
  tail call void @xstrnul(ptr noundef nonnull %19) #6
  %20 = getelementptr inbounds i8, ptr %0, i64 9120
  tail call void @xstrnul(ptr noundef nonnull %20) #6
  br label %21

21:                                               ; preds = %.backedge, %3
  %22 = tail call i32 @getopt(i32 noundef %1, ptr noundef %2, ptr noundef nonnull @.str.27) #6
  switch i32 %22, label %.loopexit [
    i32 -1, label %50
    i32 117, label %23
    i32 108, label %26
    i32 99, label %29
    i32 111, label %32
    i32 120, label %35
    i32 109, label %38
    i32 116, label %41
    i32 100, label %45
    i32 102, label %46
    i32 115, label %47
    i32 118, label %48
    i32 119, label %49
  ]

23:                                               ; preds = %21
  %24 = load ptr, ptr @optarg, align 8, !tbaa !19
  %25 = tail call i64 @xstrncpy(ptr noundef nonnull %16, i64 noundef 2048, ptr noundef %24) #6
  br label %.backedge

26:                                               ; preds = %21
  %27 = load ptr, ptr @optarg, align 8, !tbaa !19
  %28 = tail call i64 @xstrncpy(ptr noundef nonnull %17, i64 noundef 2048, ptr noundef %27) #6
  br label %.backedge

29:                                               ; preds = %21
  %30 = load ptr, ptr @optarg, align 8, !tbaa !19
  %31 = tail call i64 @xstrncpy(ptr noundef nonnull %19, i64 noundef 2048, ptr noundef %30) #6
  br label %.backedge

32:                                               ; preds = %21
  %33 = load ptr, ptr @optarg, align 8, !tbaa !19
  %34 = tail call i64 @xstrncpy(ptr noundef nonnull %20, i64 noundef 2048, ptr noundef %33) #6
  br label %.backedge

35:                                               ; preds = %21
  %36 = load ptr, ptr @optarg, align 8, !tbaa !19
  %37 = tail call i64 @xstrncpy(ptr noundef nonnull %18, i64 noundef 2048, ptr noundef %36) #6
  br label %.backedge

38:                                               ; preds = %21
  %39 = load ptr, ptr @optarg, align 8, !tbaa !19
  %40 = tail call i32 @XHTTP_GetMethodType(ptr noundef %39) #6
  store i32 %40, ptr %0, align 8, !tbaa !18
  br label %.backedge

41:                                               ; preds = %21
  %42 = load ptr, ptr @optarg, align 8, !tbaa !19
  %43 = tail call i32 @atoi(ptr nocapture noundef %42) #7
  %44 = sext i32 %43 to i64
  store i64 %44, ptr %13, align 8, !tbaa !20
  br label %.backedge

45:                                               ; preds = %21
  store i8 1, ptr %10, align 2, !tbaa !21
  br label %.backedge

46:                                               ; preds = %21
  store i8 1, ptr %8, align 8, !tbaa !22
  br label %.backedge

47:                                               ; preds = %21
  store i8 1, ptr %12, align 4, !tbaa !23
  br label %.backedge

48:                                               ; preds = %21
  store i8 1, ptr %11, align 1, !tbaa !24
  br label %.backedge

49:                                               ; preds = %21
  store i8 1, ptr %9, align 1, !tbaa !25
  br label %.backedge

.backedge:                                        ; preds = %49, %48, %47, %46, %45, %41, %38, %35, %32, %29, %26, %23
  br label %21, !llvm.loop !26

50:                                               ; preds = %21
  %51 = tail call zeroext i8 @xstrused(ptr noundef nonnull %17) #6
  %.not47 = icmp eq i8 %51, 0
  br i1 %.not47, label %.loopexit, label %52

52:                                               ; preds = %50
  %53 = getelementptr inbounds i8, ptr %0, i64 8
  %54 = tail call zeroext i8 @xstrused(ptr noundef nonnull %19) #6
  %.not48 = icmp eq i8 %54, 0
  br i1 %.not48, label %61, label %55

55:                                               ; preds = %52
  %56 = tail call i64 @XPath_LoadBuffer(ptr noundef nonnull %19, ptr noundef nonnull %4) #6
  %57 = icmp eq i64 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %55
  %59 = tail call ptr @__errno_location() #8
  %60 = load i32, ptr %59, align 4, !tbaa !28
  tail call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.28, ptr noundef nonnull %19, i32 noundef %60) #6
  br label %.loopexit

61:                                               ; preds = %55, %52
  %62 = tail call zeroext i8 @xstrused(ptr noundef nonnull %20) #6
  %.not49 = icmp eq i8 %62, 0
  br i1 %.not49, label %63, label %65

63:                                               ; preds = %61
  %64 = load i8, ptr %10, align 2, !tbaa !21
  %.not50 = icmp eq i8 %64, 0
  br i1 %.not50, label %67, label %65

65:                                               ; preds = %63, %61
  tail call void @XProgBar_GetDefaults(ptr noundef nonnull %53) #6
  store i8 1, ptr %8, align 8, !tbaa !22
  store i8 1, ptr %10, align 2, !tbaa !21
  %66 = getelementptr inbounds i8, ptr %0, i64 48
  store i8 1, ptr %66, align 8, !tbaa !29
  br label %67

67:                                               ; preds = %65, %63
  %68 = load i8, ptr %11, align 1, !tbaa !24
  %.not51 = icmp eq i8 %68, 0
  br i1 %.not51, label %.loopexit, label %69

69:                                               ; preds = %67
  tail call void @XLog_TimeFormatSet(i32 noundef 1) #6
  tail call void @XLog_FlagEnable(i32 noundef 255) #6
  br label %.loopexit

.loopexit:                                        ; preds = %21, %58, %69, %67, %50
  %.1 = phi i32 [ 0, %50 ], [ 0, %58 ], [ 1, %69 ], [ 1, %67 ], [ 0, %21 ]
  ret i32 %.1
}

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

declare void @XTime_Init(ptr noundef) local_unnamed_addr #1

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

declare void @xstrnul(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind
declare i32 @getopt(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @XHTTP_GetMethodType(ptr noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nofree nounwind willreturn memory(read) uwtable
declare i32 @atoi(ptr nocapture noundef nonnull) local_unnamed_addr #3

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

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

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

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #4

declare void @XProgBar_GetDefaults(ptr noundef) local_unnamed_addr #1

declare void @XLog_TimeFormatSet(i32 noundef) local_unnamed_addr #1

declare void @XLog_FlagEnable(i32 noundef) local_unnamed_addr #1

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

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 "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 = { inlinehint mustprogress nofree nounwind willreturn memory(read) 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 #4 = { mustprogress nofree nosync nounwind willreturn memory(none) "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nounwind }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind willreturn memory(none) }

!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, !14, i64 848}
!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 = !{!6, !7, i64 0}
!19 = !{!14, !14, i64 0}
!20 = !{!6, !12, i64 872}
!21 = !{!6, !8, i64 866}
!22 = !{!6, !8, i64 864}
!23 = !{!6, !8, i64 868}
!24 = !{!6, !8, i64 867}
!25 = !{!6, !8, i64 865}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!7, !7, i64 0}
!29 = !{!10, !8, i64 40}


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