; 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.XTime = type { i16, i8, i8, i8, i8, i8, i8 }
%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.xhttp_ctx_ = type { i32, i32, ptr, i64 }

@.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.38 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [45 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

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

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

declare i32 @XTime_Get(ptr noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @XHTTPApp_UpdateProgress(ptr noundef) #3

declare i64 @XBytesToUnit(ptr noundef, i64 noundef, i64 noundef, i8 noundef zeroext) #1

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

; Function Attrs: nounwind uwtable
define dso_local i32 @XHTTPApp_DumpResponse(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca [2048 x i8], align 16
  %9 = alloca %struct.XTime, align 2
  %10 = alloca i32, align 4
  %11 = alloca [2048 x i8], align 16
  %12 = alloca [2048 x i8], align 16
  %13 = alloca i64, 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 8, ptr %6) #4
  %14 = load ptr, ptr %4, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.xhttp_, ptr %14, i32 0, i32 2
  %16 = load ptr, ptr %15, align 8, !tbaa !9
  store ptr %16, ptr %6, align 8, !tbaa !5
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.xhttp_args_, ptr %17, i32 0, i32 6
  %19 = load i8, ptr %18, align 2, !tbaa !16
  %20 = icmp ne i8 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %2
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call zeroext i8 @XHTTP_IsSuccessCode(ptr noundef %22)
  %24 = icmp ne i8 %23, 0
  br i1 %24, label %26, label %25

25:                                               ; preds = %21, %2
  store i32 2, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %118

26:                                               ; preds = %21
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.xhttp_args_, ptr %27, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !22
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %53

31:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 2048, ptr %8) #4
  %32 = getelementptr inbounds [2048 x i8], ptr %8, i64 0, i64 0
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.xhttp_args_, ptr %33, i32 0, i32 17
  %35 = getelementptr inbounds [2048 x i8], ptr %34, i64 0, i64 0
  %36 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef %32, i64 noundef 2048, ptr noundef @.str.37, ptr noundef %35)
  %37 = getelementptr inbounds [2048 x i8], ptr %8, i64 0, i64 0
  %38 = call ptr @XFile_Alloc(ptr noundef %37, ptr noundef @.str.38, ptr noundef null)
  %39 = load ptr, ptr %6, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.xhttp_args_, ptr %39, i32 0, i32 2
  store ptr %38, ptr %40, align 8, !tbaa !22
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.xhttp_args_, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !22
  %44 = icmp eq ptr %43, null
  br i1 %44, label %45, label %49

45:                                               ; preds = %31
  %46 = getelementptr inbounds [2048 x i8], ptr %8, i64 0, i64 0
  %47 = call ptr @__errno_location() #5
  %48 = load i32, ptr %47, align 4, !tbaa !23
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.39, ptr noundef %46, i32 noundef %48)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %50

49:                                               ; preds = %31
  store i32 0, ptr %7, align 4
  br label %50

50:                                               ; preds = %49, %45
  call void @llvm.lifetime.end.p0(i64 2048, ptr %8) #4
  %51 = load i32, ptr %7, align 4
  switch i32 %51, label %118 [
    i32 0, label %52
  ]

52:                                               ; preds = %50
  br label %53

53:                                               ; preds = %52, %26
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %54 = call i32 @XTime_Get(ptr noundef %9)
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.xhttp_ctx_, ptr %55, i32 0, i32 3
  %57 = load i64, ptr %56, align 8, !tbaa !24
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.xhttp_args_, ptr %58, i32 0, i32 10
  %60 = load i64, ptr %59, align 8, !tbaa !26
  %61 = add i64 %60, %57
  store i64 %61, ptr %59, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  %62 = load ptr, ptr %6, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.xhttp_args_, ptr %62, i32 0, i32 3
  %64 = call double @XTime_DiffSec(ptr noundef %9, ptr noundef %63)
  %65 = fptosi double %64 to i32
  store i32 %65, ptr %10, align 4, !tbaa !23
  %66 = load i32, ptr %10, align 4, !tbaa !23
  %67 = icmp sgt i32 %66, 1
  br i1 %67, label %68, label %90

68:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 2048, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 2048, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.xhttp_args_, ptr %69, i32 0, i32 10
  %71 = load i64, ptr %70, align 8, !tbaa !26
  %72 = load i32, ptr %10, align 4, !tbaa !23
  %73 = sext i32 %72 to i64
  %74 = udiv i64 %71, %73
  store i64 %74, ptr %13, align 8, !tbaa !27
  %75 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %76 = load i64, ptr %13, align 8, !tbaa !27
  %77 = call i64 @XBytesToUnit(ptr noundef %75, i64 noundef 2048, i64 noundef %76, i8 noundef zeroext 0)
  %78 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  %79 = getelementptr inbounds [2048 x i8], ptr %11, i64 0, i64 0
  %80 = call i64 (ptr, i64, i64, i8, ptr, ...) @xstrncpyfl(ptr noundef %78, i64 noundef 2048, i64 noundef 12, i8 noundef signext 32, ptr noundef @.str.40, ptr noundef %79)
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.xhttp_args_, ptr %81, i32 0, i32 18
  %83 = getelementptr inbounds [2048 x i8], ptr %82, i64 0, i64 0
  %84 = getelementptr inbounds [2048 x i8], ptr %12, i64 0, i64 0
  %85 = call i64 (ptr, i64, ptr, ptr, ...) @xstrnclr(ptr noundef %83, i64 noundef 2048, ptr noundef @.str.41, ptr noundef @.str.31, ptr noundef %84)
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.xhttp_args_, ptr %86, i32 0, i32 3
  call void @XTime_Copy(ptr noundef %87, ptr noundef %9)
  %88 = load ptr, ptr %6, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.xhttp_args_, ptr %88, i32 0, i32 10
  store i64 0, ptr %89, align 8, !tbaa !26
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr %11) #4
  br label %90

90:                                               ; preds = %68, %53
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.xhttp_ctx_, ptr %91, i32 0, i32 3
  %93 = load i64, ptr %92, align 8, !tbaa !24
  %94 = load ptr, ptr %6, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.xhttp_args_, ptr %94, i32 0, i32 11
  %96 = load i64, ptr %95, align 8, !tbaa !28
  %97 = add i64 %96, %93
  store i64 %97, ptr %95, align 8, !tbaa !28
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  call void @XHTTPApp_UpdateProgress(ptr noundef %98)
  %99 = load ptr, ptr %6, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.xhttp_args_, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !22
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.xhttp_ctx_, ptr %102, i32 0, i32 2
  %104 = load ptr, ptr %103, align 8, !tbaa !29
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.xhttp_ctx_, ptr %105, i32 0, i32 3
  %107 = load i64, ptr %106, align 8, !tbaa !24
  %108 = call i32 @XFile_Write(ptr noundef %101, ptr noundef %104, i64 noundef %107)
  %109 = icmp sle i32 %108, 0
  br i1 %109, label %110, label %116

110:                                              ; preds = %90
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.xhttp_args_, ptr %111, i32 0, i32 17
  %113 = getelementptr inbounds [2048 x i8], ptr %112, i64 0, i64 0
  %114 = call ptr @__errno_location() #5
  %115 = load i32, ptr %114, align 4, !tbaa !23
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef @.str.42, ptr noundef %113, i32 noundef %115)
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %117

116:                                              ; preds = %90
  store i32 1, ptr %3, align 4
  store i32 1, ptr %7, align 4
  br label %117

117:                                              ; preds = %116, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  br label %118

118:                                              ; preds = %117, %50, %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  %119 = load i32, ptr %3, align 4
  ret i32 %119
}

declare zeroext i8 @XHTTP_IsSuccessCode(ptr noundef) #1

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

declare double @XTime_DiffSec(ptr noundef, ptr noundef) #1

declare i64 @xstrncpyfl(ptr noundef, i64 noundef, i64 noundef, i8 noundef signext, ptr noundef, ...) #1

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

declare void @XTime_Copy(ptr noundef, ptr noundef) #1

declare i32 @XFile_Write(ptr noundef, ptr noundef, i64 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 }
attributes #5 = { 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, !6, i64 16}
!10 = !{!"xhttp_", !6, i64 0, !11, i64 8, !6, i64 16, !12, i64 24, !13, i64 32, !12, i64 64, !15, i64 72, !11, i64 120, !11, 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}
!11 = !{!"short", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!"XByteBuffer", !6, i64 0, !14, i64 8, !14, i64 16, !11, i64 24, !11, i64 26, !12, i64 28}
!14 = !{!"long", !7, i64 0}
!15 = !{!"XMap", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !14, i64 32, !12, i64 40}
!16 = !{!17, !7, i64 866}
!17 = !{!"xhttp_args_", !12, i64 0, !18, i64 8, !6, i64 848, !21, 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, !13, i64 896, !7, i64 928, !7, i64 2976, !7, i64 5024, !7, i64 7072, !7, i64 9120, !7, i64 11168}
!18 = !{!"xcli_bar_", !19, i64 0, !14, i64 16, !14, i64 24, !12, i64 32, !12, i64 36, !7, i64 40, !7, i64 41, !7, i64 42, !7, i64 43, !20, i64 48, !12, 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}
!19 = !{!"xcli_size_", !14, i64 0, !14, i64 8}
!20 = !{!"double", !7, i64 0}
!21 = !{!"XTime", !11, i64 0, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7}
!22 = !{!17, !6, i64 848}
!23 = !{!12, !12, i64 0}
!24 = !{!25, !14, i64 16}
!25 = !{!"xhttp_ctx_", !12, i64 0, !12, i64 4, !6, i64 8, !14, i64 16}
!26 = !{!17, !14, i64 880}
!27 = !{!14, !14, i64 0}
!28 = !{!17, !14, i64 888}
!29 = !{!25, !6, i64 8}


; 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.XTime = type { i16, i8, i8, i8, i8, i8, 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.38 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.39 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.40 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.41 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.42 = external hidden unnamed_addr constant [45 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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 #2

declare i32 @XTime_Get(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @XHTTPApp_UpdateProgress(ptr noundef) local_unnamed_addr #3

declare i64 @XBytesToUnit(ptr noundef, i64 noundef, i64 noundef, i8 noundef zeroext) 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, 3) i32 @XHTTPApp_DumpResponse(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca [2048 x i8], align 16
  %4 = alloca %struct.XTime, align 2
  %5 = alloca [2048 x i8], align 16
  %6 = alloca [2048 x i8], align 16
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %8, i64 866
  %10 = load i8, ptr %9, align 2, !tbaa !15
  %.not = icmp eq i8 %10, 0
  br i1 %.not, label %59, label %11

11:                                               ; preds = %2
  %12 = tail call zeroext i8 @XHTTP_IsSuccessCode(ptr noundef nonnull %0) #4
  %.not26 = icmp eq i8 %12, 0
  br i1 %.not26, label %59, label %13

13:                                               ; preds = %11
  %14 = getelementptr inbounds i8, ptr %8, i64 848
  %15 = load ptr, ptr %14, align 8, !tbaa !21
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %24

17:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %3) #4
  %18 = getelementptr inbounds i8, ptr %8, i64 9120
  %19 = call i64 (ptr, i64, ptr, ...) @xstrncpyf(ptr noundef nonnull %3, i64 noundef 2048, ptr noundef nonnull @.str.37, ptr noundef nonnull %18) #4
  %20 = call ptr @XFile_Alloc(ptr noundef nonnull %3, ptr noundef nonnull @.str.38, ptr noundef null) #4
  store ptr %20, ptr %14, align 8, !tbaa !21
  %.not27 = icmp eq ptr %20, null
  br i1 %.not27, label %21, label %.critedge

21:                                               ; preds = %17
  %22 = tail call ptr @__errno_location() #5
  %23 = load i32, ptr %22, align 4, !tbaa !22
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.39, ptr noundef nonnull %3, i32 noundef %23) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %3) #4
  br label %59

.critedge:                                        ; preds = %17
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %3) #4
  br label %24

24:                                               ; preds = %.critedge, %13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %25 = call i32 @XTime_Get(ptr noundef nonnull %4) #4
  %26 = getelementptr inbounds i8, ptr %1, i64 16
  %27 = load i64, ptr %26, align 8, !tbaa !23
  %28 = getelementptr inbounds i8, ptr %8, i64 880
  %29 = load i64, ptr %28, align 8, !tbaa !25
  %30 = add i64 %29, %27
  store i64 %30, ptr %28, align 8, !tbaa !25
  %31 = getelementptr inbounds i8, ptr %8, i64 856
  %32 = call double @XTime_DiffSec(ptr noundef nonnull %4, ptr noundef nonnull %31) #4
  %33 = fptosi double %32 to i32
  %34 = icmp sgt i32 %33, 1
  br i1 %34, label %35, label %43

35:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %6) #4
  %36 = load i64, ptr %28, align 8, !tbaa !25
  %37 = zext nneg i32 %33 to i64
  %38 = udiv i64 %36, %37
  %39 = call i64 @XBytesToUnit(ptr noundef nonnull %5, i64 noundef 2048, i64 noundef %38, i8 noundef zeroext 0) #4
  %40 = call i64 (ptr, i64, i64, i8, ptr, ...) @xstrncpyfl(ptr noundef nonnull %6, i64 noundef 2048, i64 noundef 12, i8 noundef signext 32, ptr noundef nonnull @.str.40, ptr noundef nonnull %5) #4
  %41 = getelementptr inbounds i8, ptr %8, i64 11168
  %42 = call i64 (ptr, i64, ptr, ptr, ...) @xstrnclr(ptr noundef nonnull %41, i64 noundef 2048, ptr noundef nonnull @.str.41, ptr noundef nonnull @.str.31, ptr noundef nonnull %6) #4
  call void @XTime_Copy(ptr noundef nonnull %31, ptr noundef nonnull %4) #4
  store i64 0, ptr %28, align 8, !tbaa !25
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %5) #4
  br label %43

43:                                               ; preds = %35, %24
  %44 = load i64, ptr %26, align 8, !tbaa !23
  %45 = getelementptr inbounds i8, ptr %8, i64 888
  %46 = load i64, ptr %45, align 8, !tbaa !26
  %47 = add i64 %46, %44
  store i64 %47, ptr %45, align 8, !tbaa !26
  call void @XHTTPApp_UpdateProgress(ptr noundef nonnull %0)
  %48 = load ptr, ptr %14, align 8, !tbaa !21
  %49 = getelementptr inbounds i8, ptr %1, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !27
  %51 = load i64, ptr %26, align 8, !tbaa !23
  %52 = call i32 @XFile_Write(ptr noundef %48, ptr noundef %50, i64 noundef %51) #4
  %53 = icmp slt i32 %52, 1
  br i1 %53, label %54, label %58

54:                                               ; preds = %43
  %55 = getelementptr inbounds i8, ptr %8, i64 9120
  %56 = tail call ptr @__errno_location() #5
  %57 = load i32, ptr %56, align 4, !tbaa !22
  call void (i32, i8, ptr, ...) @XLog_Display(i32 noundef 64, i8 noundef zeroext 1, ptr noundef nonnull @.str.42, ptr noundef nonnull %55, i32 noundef %57) #4
  br label %58

58:                                               ; preds = %43, %54
  %.1 = phi i32 [ -1, %54 ], [ 1, %43 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  br label %59

59:                                               ; preds = %21, %2, %11, %58
  %.2 = phi i32 [ %.1, %58 ], [ -1, %21 ], [ 2, %11 ], [ 2, %2 ]
  ret i32 %.2
}

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

declare ptr @XFile_Alloc(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare double @XTime_DiffSec(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i64 @xstrncpyfl(ptr noundef, i64 noundef, i64 noundef, i8 noundef signext, ptr noundef, ...) local_unnamed_addr #1

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

declare void @XTime_Copy(ptr noundef, ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress 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 = { 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 #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 }
attributes #5 = { 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 16}
!6 = !{!"xhttp_", !7, i64 0, !10, i64 8, !7, i64 16, !11, i64 24, !12, i64 32, !11, i64 64, !14, i64 72, !10, i64 120, !10, i64 122, !13, i64 128, !13, i64 136, !13, i64 144, !13, i64 152, !13, i64 160, !8, i64 168, !8, i64 169, !8, i64 170, !8, i64 171, !8, i64 427, !8, i64 555}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"short", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!"XByteBuffer", !7, i64 0, !13, i64 8, !13, i64 16, !10, i64 24, !10, i64 26, !11, i64 28}
!13 = !{!"long", !8, i64 0}
!14 = !{!"XMap", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !13, i64 32, !11, i64 40}
!15 = !{!16, !8, i64 866}
!16 = !{!"xhttp_args_", !11, i64 0, !17, i64 8, !7, i64 848, !20, i64 856, !8, i64 864, !8, i64 865, !8, i64 866, !8, i64 867, !8, i64 868, !13, i64 872, !13, i64 880, !13, i64 888, !12, i64 896, !8, i64 928, !8, i64 2976, !8, i64 5024, !8, i64 7072, !8, i64 9120, !8, i64 11168}
!17 = !{!"xcli_bar_", !18, i64 0, !13, i64 16, !13, i64 24, !11, i64 32, !11, i64 36, !8, i64 40, !8, i64 41, !8, i64 42, !8, i64 43, !19, i64 48, !11, 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}
!18 = !{!"xcli_size_", !13, i64 0, !13, i64 8}
!19 = !{!"double", !8, i64 0}
!20 = !{!"XTime", !10, i64 0, !8, i64 2, !8, i64 3, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7}
!21 = !{!16, !7, i64 848}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !13, i64 16}
!24 = !{!"xhttp_ctx_", !11, i64 0, !11, i64 4, !7, i64 8, !13, i64 16}
!25 = !{!16, !13, i64 880}
!26 = !{!16, !13, i64 888}
!27 = !{!24, !7, i64 8}


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