; 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_ = 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 }
%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.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.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [23 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

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

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

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

declare i64 @XHTTP_GetBodySize(ptr noundef) #1

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

declare zeroext i8 @XHTTP_IsSuccessCode(ptr noundef) #1

declare ptr @XHTTP_GetCodeStr(i32 noundef) #1

declare ptr @XHTTP_GetHeader(ptr noundef, ptr noundef) #1

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

declare zeroext i8 @XPath_Exists(ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local i32 @XHTTPApp_Perform(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %struct.xhttp_, align 8
  %7 = alloca i16, align 2
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  %11 = alloca [2048 x i8], align 16
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2608, ptr %6) #5
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.xhttp_args_, ptr %16, i32 0, i32 0
  %18 = load i32, ptr %17, align 8, !tbaa !9
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.XLink, ptr %19, i32 0, i32 1
  %21 = getelementptr inbounds [2048 x i8], ptr %20, i64 0, i64 0
  %22 = call i32 @XHTTP_InitRequest(ptr noundef %6, i32 noundef %18, ptr noundef %21, ptr noundef null)
  %23 = load ptr, ptr %5, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.XLink, ptr %23, i32 0, i32 3
  %25 = getelementptr inbounds [256 x i8], ptr %24, i64 0, i64 0
  %26 = call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef %6, ptr noundef @.str.59, ptr noundef @.str.31, ptr noundef %25)
  %27 = call ptr @XUtils_VersionShort()
  %28 = call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef %6, ptr noundef @.str.60, ptr noundef @.str.61, ptr noundef %27)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.xhttp_args_, ptr %29, i32 0, i32 13
  %31 = getelementptr inbounds [2048 x i8], ptr %30, i64 0, i64 0
  %32 = call i64 @XHTTP_SetUnixAddr(ptr noundef %6, ptr noundef %31)
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.xhttp_args_, ptr %33, i32 0, i32 9
  %35 = load i64, ptr %34, align 8, !tbaa !19
  %36 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 13
  store i64 %35, ptr %36, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 2, ptr %7) #5
  store i16 46, ptr %7, align 2, !tbaa !23
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = load i16, ptr %7, align 2, !tbaa !23
  %39 = call i32 @XHTTP_SetCallback(ptr noundef %6, ptr noundef @XHTTPApp_Callback, ptr noundef %37, i16 noundef zeroext %38)
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.xhttp_args_, ptr %40, i32 0, i32 15
  %42 = getelementptr inbounds [2048 x i8], ptr %41, i64 0, i64 0
  %43 = call zeroext i8 @xstrused(ptr noundef %42)
  %44 = zext i8 %43 to i32
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %56

46:                                               ; preds = %2
  %47 = load ptr, ptr %4, align 8, !tbaa !5
  %48 = call i32 @XHTTPApp_AppendArgHeaders(ptr noundef %6, ptr noundef %47)
  %49 = icmp slt i32 %48, 0
  br i1 %49, label %50, label %56

50:                                               ; preds = %46
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.xhttp_args_, ptr %51, i32 0, i32 15
  %53 = getelementptr inbounds [2048 x i8], ptr %52, i64 0, i64 0
  %54 = call ptr @__errno_location() #6
  %55 = load i32, ptr %54, align 4, !tbaa !24
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.62, ptr noundef %53, i32 noundef %55)
  call void @XHTTP_Clear(ptr noundef %6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %192

56:                                               ; preds = %46, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.xhttp_args_, ptr %57, i32 0, i32 17
  %59 = getelementptr inbounds [2048 x i8], ptr %58, i64 0, i64 0
  %60 = call zeroext i8 @xstrused(ptr noundef %59)
  store i8 %60, ptr %9, align 1, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.xhttp_args_, ptr %62, i32 0, i32 12
  %64 = getelementptr inbounds %struct.XByteBuffer, ptr %63, i32 0, i32 0
  %65 = load ptr, ptr %64, align 8, !tbaa !26
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.xhttp_args_, ptr %66, i32 0, i32 12
  %68 = getelementptr inbounds %struct.XByteBuffer, ptr %67, i32 0, i32 2
  %69 = load i64, ptr %68, align 8, !tbaa !27
  %70 = call i32 @XHTTP_LinkPerform(ptr noundef %6, ptr noundef %61, ptr noundef %65, i64 noundef %69)
  store i32 %70, ptr %10, align 4, !tbaa !24
  %71 = load i32, ptr %10, align 4, !tbaa !24
  %72 = icmp ne i32 %71, 20
  br i1 %72, label %73, label %83

73:                                               ; preds = %56
  %74 = call i64 @XHTTP_GetBodySize(ptr noundef %6)
  %75 = icmp ne i64 %74, 0
  br i1 %75, label %83, label %76

76:                                               ; preds = %73
  %77 = load i32, ptr %10, align 4, !tbaa !24
  %78 = icmp eq i32 %77, 21
  br i1 %78, label %79, label %80

79:                                               ; preds = %76
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef @.str.63)
  br label %80

80:                                               ; preds = %79, %76
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.xhttp_args_, ptr %81, i32 0, i32 2
  call void @XFile_Free(ptr noundef %82)
  call void @XHTTP_Clear(ptr noundef %6)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %191

83:                                               ; preds = %73, %56
  %84 = load i8, ptr %9, align 1, !tbaa !25
  %85 = icmp ne i8 %84, 0
  br i1 %85, label %86, label %111

86:                                               ; preds = %83
  call void @llvm.lifetime.start.p0(i64 2048, ptr %11) #5
  %87 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.xhttp_args_, ptr %88, i32 0, i32 17
  %90 = getelementptr inbounds [2048 x i8], ptr %89, i64 0, i64 0
  %91 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef %87, i64 noundef 2048, ptr noundef @.str.37, ptr noundef %90)
  %92 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %93 = call zeroext i8 @XPath_Exists(ptr noundef %92)
  %94 = zext i8 %93 to i32
  %95 = icmp ne i32 %94, 0
  br i1 %95, label %96, label %110

96:                                               ; preds = %86
  %97 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.xhttp_args_, ptr %98, i32 0, i32 17
  %100 = getelementptr inbounds [2048 x i8], ptr %99, i64 0, i64 0
  %101 = call i32 @rename(ptr noundef %97, ptr noundef %100) #5
  %102 = icmp slt i32 %101, 0
  br i1 %102, label %103, label %110

103:                                              ; preds = %96
  %104 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.xhttp_args_, ptr %105, i32 0, i32 17
  %107 = getelementptr inbounds [2048 x i8], ptr %106, i64 0, i64 0
  %108 = call ptr @__errno_location() #6
  %109 = load i32, ptr %108, align 4, !tbaa !24
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.64, ptr noundef %104, ptr noundef %107, i32 noundef %109)
  br label %110

110:                                              ; preds = %103, %96, %86
  call void @llvm.lifetime.end.p0(i64 2048, ptr %11) #5
  br label %111

111:                                              ; preds = %110, %83
  %112 = load ptr, ptr %4, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.xhttp_args_, ptr %112, i32 0, i32 11
  %114 = load i64, ptr %113, align 8, !tbaa !28
  %115 = icmp ne i64 %114, 0
  br i1 %115, label %116, label %123

116:                                              ; preds = %111
  %117 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 9
  %118 = load i64, ptr %117, align 8, !tbaa !29
  %119 = icmp ne i64 %118, 0
  br i1 %119, label %123, label %120

120:                                              ; preds = %116
  %121 = load ptr, ptr %4, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.xhttp_args_, ptr %121, i32 0, i32 1
  call void @XProgBar_Finish(ptr noundef %122)
  br label %123

123:                                              ; preds = %120, %116, %111
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.xhttp_args_, ptr %124, i32 0, i32 4
  %126 = load i8, ptr %125, align 8, !tbaa !30
  %127 = zext i8 %126 to i32
  %128 = icmp ne i32 %127, 0
  br i1 %128, label %129, label %166

129:                                              ; preds = %123
  %130 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %131 = load i16, ptr %130, align 2, !tbaa !31
  %132 = zext i16 %131 to i32
  %133 = icmp slt i32 %132, 400
  br i1 %133, label %134, label %166

134:                                              ; preds = %129
  %135 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %136 = load i16, ptr %135, align 2, !tbaa !31
  %137 = zext i16 %136 to i32
  %138 = icmp sge i32 %137, 300
  br i1 %138, label %139, label %166

139:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %140 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %141 = load i16, ptr %140, align 2, !tbaa !31
  %142 = zext i16 %141 to i32
  %143 = call ptr @XHTTP_GetCodeStr(i32 noundef %142)
  store ptr %143, ptr %12, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %145 = load i16, ptr %144, align 2, !tbaa !31
  %146 = zext i16 %145 to i32
  %147 = load ptr, ptr %12, align 8, !tbaa !5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef @.str.65, i32 noundef %146, ptr noundef %147)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %148 = call ptr @XHTTP_GetHeader(ptr noundef %6, ptr noundef @.str.46)
  store ptr %148, ptr %13, align 8, !tbaa !5
  %149 = load ptr, ptr %13, align 8, !tbaa !5
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %162

151:                                              ; preds = %139
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.xhttp_args_, ptr %152, i32 0, i32 14
  %154 = getelementptr inbounds [2048 x i8], ptr %153, i64 0, i64 0
  %155 = load ptr, ptr %13, align 8, !tbaa !5
  %156 = call i64 @xstrncpy(ptr noundef %154, i64 noundef 2048, ptr noundef %155)
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.xhttp_args_, ptr %157, i32 0, i32 14
  %159 = getelementptr inbounds [2048 x i8], ptr %158, i64 0, i64 0
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef @.str.66, ptr noundef %159)
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.xhttp_args_, ptr %160, i32 0, i32 2
  call void @XFile_Free(ptr noundef %161)
  call void @XHTTP_Clear(ptr noundef %6)
  store i32 1, ptr %3, align 4
  store i32 1, ptr %8, align 4
  br label %163

162:                                              ; preds = %139
  store i32 0, ptr %8, align 4
  br label %163

163:                                              ; preds = %162, %151
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  %164 = load i32, ptr %8, align 4
  switch i32 %164, label %191 [
    i32 0, label %165
  ]

165:                                              ; preds = %163
  br label %166

166:                                              ; preds = %165, %134, %129, %123
  %167 = call zeroext i8 @XHTTP_IsSuccessCode(ptr noundef %6)
  %168 = icmp ne i8 %167, 0
  br i1 %168, label %178, label %169

169:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %170 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %171 = load i16, ptr %170, align 2, !tbaa !31
  %172 = zext i16 %171 to i32
  %173 = call ptr @XHTTP_GetCodeStr(i32 noundef %172)
  store ptr %173, ptr %14, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.xhttp_, ptr %6, i32 0, i32 8
  %175 = load i16, ptr %174, align 2, !tbaa !31
  %176 = zext i16 %175 to i32
  %177 = load ptr, ptr %14, align 8, !tbaa !5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 8, i8 noundef zeroext 1, ptr noundef @.str.67, i32 noundef %176, ptr noundef %177)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %178

178:                                              ; preds = %169, %166
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %179 = call ptr @XHTTP_GetBody(ptr noundef %6)
  store ptr %179, ptr %15, align 8, !tbaa !5
  %180 = load ptr, ptr %15, align 8, !tbaa !5
  %181 = icmp ne ptr %180, null
  br i1 %181, label %182, label %188

182:                                              ; preds = %178
  %183 = load i8, ptr %9, align 1, !tbaa !25
  %184 = icmp ne i8 %183, 0
  br i1 %184, label %188, label %185

185:                                              ; preds = %182
  %186 = load ptr, ptr %15, align 8, !tbaa !5
  %187 = call i32 (ptr, ...) @printf(ptr noundef @.str.45, ptr noundef %186)
  br label %188

188:                                              ; preds = %185, %182, %178
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.xhttp_args_, ptr %189, i32 0, i32 2
  call void @XFile_Free(ptr noundef %190)
  call void @XHTTP_Clear(ptr noundef %6)
  store i32 0, ptr %3, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  br label %191

191:                                              ; preds = %188, %163, %80
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  br label %192

192:                                              ; preds = %191, %50
  call void @llvm.lifetime.end.p0(i64 2, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 2608, ptr %6) #5
  %193 = load i32, ptr %3, align 4
  ret i32 %193
}

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

declare ptr @XUtils_VersionShort() #1

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

declare i32 @XHTTP_SetCallback(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) #1

declare void @XHTTP_Clear(ptr noundef) #1

declare i32 @XHTTP_LinkPerform(ptr noundef, ptr noundef, ptr noundef, i64 noundef) #1

declare void @XFile_Free(ptr noundef) #1

; Function Attrs: nounwind
declare i32 @rename(ptr noundef, ptr noundef) #4

declare void @XProgBar_Finish(ptr noundef) #1

declare ptr @XHTTP_GetBody(ptr noundef) #1

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 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 #3 = { 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 #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 = { nounwind }
attributes #6 = { 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, !11, i64 0}
!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 = !{!10, !14, i64 872}
!20 = !{!21, !14, i64 160}
!21 = !{!"xhttp_", !6, i64 0, !17, i64 8, !6, i64 16, !11, i64 24, !18, i64 32, !11, i64 64, !22, i64 72, !17, i64 120, !17, i64 122, !14, i64 128, !14, i64 136, !14, i64 144, !14, i64 152, !14, i64 160, !7, i64 168, !7, i64 169, !7, i64 170, !7, i64 171, !7, i64 427, !7, i64 555}
!22 = !{!"XMap", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 32, !11, i64 40}
!23 = !{!17, !17, i64 0}
!24 = !{!11, !11, i64 0}
!25 = !{!7, !7, i64 0}
!26 = !{!10, !6, i64 896}
!27 = !{!10, !14, i64 912}
!28 = !{!10, !14, i64 888}
!29 = !{!21, !14, i64 128}
!30 = !{!10, !7, i64 864}
!31 = !{!21, !17, i64 122}


; 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.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.31 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.45 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.46 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.59 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.60 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [52 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.65 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.66 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [23 x i8], align 1

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

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

; Function Attrs: mustprogress 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) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @XHTTPApp_AppendArgHeaders(ptr noundef, ptr noundef) local_unnamed_addr #4

declare i32 @XHTTP_AddHeader(ptr noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare i64 @XHTTP_GetBodySize(ptr noundef) local_unnamed_addr #2

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

declare zeroext i8 @XHTTP_IsSuccessCode(ptr noundef) local_unnamed_addr #2

declare ptr @XHTTP_GetCodeStr(i32 noundef) local_unnamed_addr #2

declare ptr @XHTTP_GetHeader(ptr noundef, ptr noundef) local_unnamed_addr #2

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @XHTTPApp_Perform(ptr noundef %0, ptr noundef %1) local_unnamed_addr #4 {
  %3 = alloca %struct.xhttp_, align 8
  %4 = alloca [2048 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 2608, ptr nonnull %3) #5
  %5 = load i32, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 4
  %7 = call i32 @XHTTP_InitRequest(ptr noundef nonnull %3, i32 noundef %5, ptr noundef nonnull %6, ptr noundef null) #5
  %8 = getelementptr inbounds i8, ptr %1, i64 2308
  %9 = call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef nonnull %3, ptr noundef nonnull @.str.59, ptr noundef nonnull @.str.31, ptr noundef nonnull %8) #5
  %10 = call ptr @XUtils_VersionShort() #5
  %11 = call i32 (ptr, ptr, ptr, ...) @XHTTP_AddHeader(ptr noundef nonnull %3, ptr noundef nonnull @.str.60, ptr noundef nonnull @.str.61, ptr noundef %10) #5
  %12 = getelementptr inbounds i8, ptr %0, i64 928
  %13 = call i64 @XHTTP_SetUnixAddr(ptr noundef nonnull %3, ptr noundef nonnull %12) #5
  %14 = getelementptr inbounds i8, ptr %0, i64 872
  %15 = load i64, ptr %14, align 8, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %3, i64 160
  store i64 %15, ptr %16, align 8, !tbaa !19
  %17 = call i32 @XHTTP_SetCallback(ptr noundef nonnull %3, ptr noundef nonnull @XHTTPApp_Callback, ptr noundef nonnull %0, i16 noundef zeroext 46) #5
  %18 = getelementptr inbounds i8, ptr %0, i64 5024
  %19 = call zeroext i8 @xstrused(ptr noundef nonnull %18) #5
  %.not = icmp eq i8 %19, 0
  br i1 %.not, label %26, label %20

20:                                               ; preds = %2
  %21 = call i32 @XHTTPApp_AppendArgHeaders(ptr noundef nonnull %3, ptr noundef nonnull %0)
  %22 = icmp slt i32 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %20
  %24 = tail call ptr @__errno_location() #6
  %25 = load i32, ptr %24, align 4, !tbaa !22
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.62, ptr noundef nonnull %18, i32 noundef %25) #5
  br label %94

26:                                               ; preds = %20, %2
  %27 = getelementptr inbounds i8, ptr %0, i64 9120
  %28 = call zeroext i8 @xstrused(ptr noundef nonnull %27) #5
  %29 = getelementptr inbounds i8, ptr %0, i64 896
  %30 = load ptr, ptr %29, align 8, !tbaa !23
  %31 = getelementptr inbounds i8, ptr %0, i64 912
  %32 = load i64, ptr %31, align 8, !tbaa !24
  %33 = call i32 @XHTTP_LinkPerform(ptr noundef nonnull %3, ptr noundef %1, ptr noundef %30, i64 noundef %32) #5
  %.not52 = icmp eq i32 %33, 20
  br i1 %.not52, label %41, label %34

34:                                               ; preds = %26
  %35 = call i64 @XHTTP_GetBodySize(ptr noundef nonnull %3) #5
  %.not53 = icmp eq i64 %35, 0
  br i1 %.not53, label %36, label %41

36:                                               ; preds = %34
  %37 = icmp eq i32 %33, 21
  br i1 %37, label %38, label %39

38:                                               ; preds = %36
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 4, i8 noundef zeroext 1, ptr noundef nonnull @.str.63) #5
  br label %39

39:                                               ; preds = %38, %36
  %40 = getelementptr inbounds i8, ptr %0, i64 848
  call void @XFile_Free(ptr noundef nonnull %40) #5
  br label %94

41:                                               ; preds = %34, %26
  %42 = icmp ne i8 %28, 0
  br i1 %42, label %43, label %53

43:                                               ; preds = %41
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %4) #5
  %44 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef nonnull %4, i64 noundef 2048, ptr noundef nonnull @.str.37, ptr noundef nonnull %27) #5
  %45 = call zeroext i8 @XPath_Exists(ptr noundef nonnull %4) #5
  %.not54 = icmp eq i8 %45, 0
  br i1 %.not54, label %52, label %46

46:                                               ; preds = %43
  %47 = call i32 @rename(ptr noundef nonnull %4, ptr noundef nonnull %27) #5
  %48 = icmp slt i32 %47, 0
  br i1 %48, label %49, label %52

49:                                               ; preds = %46
  %50 = tail call ptr @__errno_location() #6
  %51 = load i32, ptr %50, align 4, !tbaa !22
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.64, ptr noundef nonnull %4, ptr noundef nonnull %27, i32 noundef %51) #5
  br label %52

52:                                               ; preds = %49, %46, %43
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %4) #5
  br label %53

53:                                               ; preds = %52, %41
  %54 = getelementptr inbounds i8, ptr %0, i64 888
  %55 = load i64, ptr %54, align 8, !tbaa !25
  %56 = icmp eq i64 %55, 0
  %57 = getelementptr inbounds i8, ptr %3, i64 128
  %58 = load i64, ptr %57, align 8
  %59 = icmp ne i64 %58, 0
  %or.cond = select i1 %56, i1 true, i1 %59
  br i1 %or.cond, label %62, label %60

60:                                               ; preds = %53
  %61 = getelementptr inbounds i8, ptr %0, i64 8
  call void @XProgBar_Finish(ptr noundef nonnull %61) #5
  br label %62

62:                                               ; preds = %60, %53
  %63 = getelementptr inbounds i8, ptr %0, i64 864
  %64 = load i8, ptr %63, align 8, !tbaa !26
  %65 = icmp ne i8 %64, 0
  %66 = getelementptr inbounds i8, ptr %3, i64 122
  %67 = load i16, ptr %66, align 2
  %68 = add i16 %67, -300
  %69 = icmp ult i16 %68, 100
  %or.cond10 = select i1 %65, i1 %69, i1 false
  br i1 %or.cond10, label %70, label %.critedge

70:                                               ; preds = %62
  %71 = zext nneg i16 %67 to i32
  %72 = call ptr @XHTTP_GetCodeStr(i32 noundef %71) #5
  %73 = load i16, ptr %66, align 2, !tbaa !27
  %74 = zext i16 %73 to i32
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef nonnull @.str.65, i32 noundef %74, ptr noundef %72) #5
  %75 = call ptr @XHTTP_GetHeader(ptr noundef nonnull %3, ptr noundef nonnull @.str.46) #5
  %.not55 = icmp eq ptr %75, null
  br i1 %.not55, label %.critedge, label %76

76:                                               ; preds = %70
  %77 = getelementptr inbounds i8, ptr %0, i64 2976
  %78 = call i64 @xstrncpy(ptr noundef nonnull %77, i64 noundef 2048, ptr noundef nonnull %75) #5
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 16, i8 noundef zeroext 1, ptr noundef nonnull @.str.66, ptr noundef nonnull %77) #5
  %79 = getelementptr inbounds i8, ptr %0, i64 848
  call void @XFile_Free(ptr noundef nonnull %79) #5
  br label %94

.critedge:                                        ; preds = %70, %62
  %80 = call zeroext i8 @XHTTP_IsSuccessCode(ptr noundef nonnull %3) #5
  %.not56 = icmp eq i8 %80, 0
  br i1 %.not56, label %81, label %87

81:                                               ; preds = %.critedge
  %82 = load i16, ptr %66, align 2, !tbaa !27
  %83 = zext i16 %82 to i32
  %84 = call ptr @XHTTP_GetCodeStr(i32 noundef %83) #5
  %85 = load i16, ptr %66, align 2, !tbaa !27
  %86 = zext i16 %85 to i32
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 8, i8 noundef zeroext 1, ptr noundef nonnull @.str.67, i32 noundef %86, ptr noundef %84) #5
  br label %87

87:                                               ; preds = %81, %.critedge
  %88 = call ptr @XHTTP_GetBody(ptr noundef nonnull %3) #5
  %89 = icmp eq ptr %88, null
  %or.cond12 = or i1 %42, %89
  br i1 %or.cond12, label %92, label %90

90:                                               ; preds = %87
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.45, ptr noundef nonnull %88)
  br label %92

92:                                               ; preds = %90, %87
  %93 = getelementptr inbounds i8, ptr %0, i64 848
  call void @XFile_Free(ptr noundef nonnull %93) #5
  br label %94

94:                                               ; preds = %76, %39, %92, %23
  %.2 = phi i32 [ -1, %23 ], [ 0, %92 ], [ 1, %76 ], [ -1, %39 ]
  call void @XHTTP_Clear(ptr noundef nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 2608, ptr nonnull %3) #5
  ret i32 %.2
}

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

declare ptr @XUtils_VersionShort() local_unnamed_addr #2

declare i64 @XHTTP_SetUnixAddr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare i32 @XHTTP_SetCallback(ptr noundef, ptr noundef, ptr noundef, i16 noundef zeroext) local_unnamed_addr #2

declare void @XHTTP_Clear(ptr noundef) local_unnamed_addr #2

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

declare void @XFile_Free(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @rename(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

declare void @XProgBar_Finish(ptr noundef) local_unnamed_addr #2

declare ptr @XHTTP_GetBody(ptr noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { 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, !7, i64 0}
!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, !12, i64 872}
!19 = !{!20, !12, i64 160}
!20 = !{!"xhttp_", !14, i64 0, !16, i64 8, !14, i64 16, !7, i64 24, !17, i64 32, !7, i64 64, !21, i64 72, !16, i64 120, !16, i64 122, !12, i64 128, !12, i64 136, !12, i64 144, !12, i64 152, !12, i64 160, !8, i64 168, !8, i64 169, !8, i64 170, !8, i64 171, !8, i64 427, !8, i64 555}
!21 = !{!"XMap", !14, i64 0, !14, i64 8, !14, i64 16, !12, i64 24, !12, i64 32, !7, i64 40}
!22 = !{!7, !7, i64 0}
!23 = !{!6, !14, i64 896}
!24 = !{!6, !12, i64 912}
!25 = !{!6, !12, i64 888}
!26 = !{!6, !8, i64 864}
!27 = !{!20, !16, i64 122}


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