; LLVM IR from guanzhi/GmSSL :: src (http)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }
%struct.hostent = type { ptr, ptr, i32, i32, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@__FUNCTION__.http_get = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @http_get(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca [128 x i8], align 16
  %12 = alloca i32, align 4
  %13 = alloca [256 x i8], align 16
  %14 = alloca ptr, align 8
  %15 = alloca %struct.sockaddr_in, align 4
  %16 = alloca i32, align 4
  %17 = alloca [416 x i8], align 16
  %18 = alloca i32, align 4
  %19 = alloca [1024 x i8], align 16
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 -1, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 128, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 256, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 416, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %26 = getelementptr inbounds [256 x i8], ptr %13, i64 0, i64 0
  %27 = call i32 @http_parse_uri(ptr noundef %24, ptr noundef %25, ptr noundef %12, ptr noundef %26)
  %28 = icmp ne i32 %27, 1
  br i1 %28, label %29, label %35

29:                                               ; preds = %4
  br label %30

30:                                               ; preds = %29
  %31 = load ptr, ptr @stderr, align 8, !tbaa !5
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 129, ptr noundef @__FUNCTION__.http_get) #7
  br label %33

33:                                               ; preds = %30
  br label %34

34:                                               ; preds = %33
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %169

35:                                               ; preds = %4
  %36 = getelementptr inbounds [416 x i8], ptr %17, i64 0, i64 0
  %37 = getelementptr inbounds [256 x i8], ptr %13, i64 0, i64 0
  %38 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %39 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %36, i64 noundef 416, ptr noundef @.str.9, ptr noundef %37, ptr noundef %38) #7
  store i32 %39, ptr %18, align 4, !tbaa !11
  %40 = icmp sle i32 %39, 0
  br i1 %40, label %41, label %47

41:                                               ; preds = %35
  br label %42

42:                                               ; preds = %41
  %43 = load ptr, ptr @stderr, align 8, !tbaa !5
  %44 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 133, ptr noundef @__FUNCTION__.http_get) #7
  br label %45

45:                                               ; preds = %42
  br label %46

46:                                               ; preds = %45
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %169

47:                                               ; preds = %35
  %48 = getelementptr inbounds [128 x i8], ptr %11, i64 0, i64 0
  %49 = call ptr @gethostbyname(ptr noundef %48)
  store ptr %49, ptr %14, align 8, !tbaa !5
  %50 = icmp ne ptr %49, null
  br i1 %50, label %57, label %51

51:                                               ; preds = %47
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr @stderr, align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 139, ptr noundef @__FUNCTION__.http_get) #7
  br label %55

55:                                               ; preds = %52
  br label %56

56:                                               ; preds = %55
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %169

57:                                               ; preds = %47
  %58 = getelementptr inbounds %struct.sockaddr_in, ptr %15, i32 0, i32 2
  %59 = load ptr, ptr %14, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.hostent, ptr %59, i32 0, i32 4
  %61 = load ptr, ptr %60, align 8, !tbaa !13
  %62 = getelementptr inbounds ptr, ptr %61, i64 0
  %63 = load ptr, ptr %62, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %58, ptr align 4 %63, i64 4, i1 false), !tbaa.struct !15
  %64 = getelementptr inbounds %struct.sockaddr_in, ptr %15, i32 0, i32 0
  store i16 2, ptr %64, align 4, !tbaa !16
  %65 = load i32, ptr %12, align 4, !tbaa !11
  %66 = trunc i32 %65 to i16
  %67 = call zeroext i16 @__bswap_16(i16 noundef zeroext %66)
  %68 = getelementptr inbounds %struct.sockaddr_in, ptr %15, i32 0, i32 1
  store i16 %67, ptr %68, align 2, !tbaa !20
  %69 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #7
  store i32 %69, ptr %16, align 4, !tbaa !11
  %70 = icmp slt i32 %69, 0
  br i1 %70, label %71, label %77

71:                                               ; preds = %57
  br label %72

72:                                               ; preds = %71
  %73 = load ptr, ptr @stderr, align 8, !tbaa !5
  %74 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 147, ptr noundef @__FUNCTION__.http_get) #7
  br label %75

75:                                               ; preds = %72
  br label %76

76:                                               ; preds = %75
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %169

77:                                               ; preds = %57
  %78 = load i32, ptr %16, align 4, !tbaa !11
  %79 = call i32 @connect(i32 noundef %78, ptr noundef %15, i32 noundef 16)
  %80 = icmp slt i32 %79, 0
  br i1 %80, label %81, label %87

81:                                               ; preds = %77
  br label %82

82:                                               ; preds = %81
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 151, ptr noundef @__FUNCTION__.http_get) #7
  br label %85

85:                                               ; preds = %82
  br label %86

86:                                               ; preds = %85
  br label %165

87:                                               ; preds = %77
  %88 = load i32, ptr %16, align 4, !tbaa !11
  %89 = getelementptr inbounds [416 x i8], ptr %17, i64 0, i64 0
  %90 = getelementptr inbounds [416 x i8], ptr %17, i64 0, i64 0
  %91 = call i64 @strlen(ptr noundef %90) #8
  %92 = call i64 @send(i32 noundef %88, ptr noundef %89, i64 noundef %91, i32 noundef 0)
  %93 = load i32, ptr %18, align 4, !tbaa !11
  %94 = sext i32 %93 to i64
  %95 = icmp ne i64 %92, %94
  br i1 %95, label %96, label %102

96:                                               ; preds = %87
  br label %97

97:                                               ; preds = %96
  %98 = load ptr, ptr @stderr, align 8, !tbaa !5
  %99 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %98, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 155, ptr noundef @__FUNCTION__.http_get) #7
  br label %100

100:                                              ; preds = %97
  br label %101

101:                                              ; preds = %100
  br label %165

102:                                              ; preds = %87
  %103 = load i32, ptr %16, align 4, !tbaa !11
  %104 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 0
  %105 = call i64 @recv(i32 noundef %103, ptr noundef %104, i64 noundef 1023, i32 noundef 0)
  store i64 %105, ptr %21, align 8, !tbaa !9
  %106 = icmp ule i64 %105, 0
  br i1 %106, label %107, label %113

107:                                              ; preds = %102
  br label %108

108:                                              ; preds = %107
  %109 = load ptr, ptr @stderr, align 8, !tbaa !5
  %110 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %109, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 159, ptr noundef @__FUNCTION__.http_get) #7
  br label %111

111:                                              ; preds = %108
  br label %112

112:                                              ; preds = %111
  br label %165

113:                                              ; preds = %102
  %114 = load i64, ptr %21, align 8, !tbaa !9
  %115 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 %114
  store i8 0, ptr %115, align 1, !tbaa !21
  %116 = getelementptr inbounds [1024 x i8], ptr %19, i64 0, i64 0
  %117 = load i64, ptr %21, align 8, !tbaa !9
  %118 = load ptr, ptr %8, align 8, !tbaa !5
  %119 = call i32 @http_parse_response(ptr noundef %116, i64 noundef %117, ptr noundef %20, ptr noundef %118, ptr noundef %22)
  %120 = icmp ne i32 %119, 1
  br i1 %120, label %121, label %127

121:                                              ; preds = %113
  br label %122

122:                                              ; preds = %121
  %123 = load ptr, ptr @stderr, align 8, !tbaa !5
  %124 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %123, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 166, ptr noundef @__FUNCTION__.http_get) #7
  br label %125

125:                                              ; preds = %122
  br label %126

126:                                              ; preds = %125
  br label %165

127:                                              ; preds = %113
  %128 = load ptr, ptr %7, align 8, !tbaa !5
  %129 = icmp ne ptr %128, null
  br i1 %129, label %130, label %135

130:                                              ; preds = %127
  %131 = load i64, ptr %9, align 8, !tbaa !9
  %132 = load ptr, ptr %8, align 8, !tbaa !5
  %133 = load i64, ptr %132, align 8, !tbaa !9
  %134 = icmp ult i64 %131, %133
  br i1 %134, label %135, label %136

135:                                              ; preds = %130, %127
  store i32 0, ptr %10, align 4, !tbaa !11
  br label %165

136:                                              ; preds = %130
  %137 = load ptr, ptr %7, align 8, !tbaa !5
  %138 = load ptr, ptr %20, align 8, !tbaa !5
  %139 = load ptr, ptr %8, align 8, !tbaa !5
  %140 = load i64, ptr %139, align 8, !tbaa !9
  %141 = load i64, ptr %22, align 8, !tbaa !9
  %142 = sub i64 %140, %141
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %137, ptr align 1 %138, i64 %142, i1 false)
  %143 = load i64, ptr %22, align 8, !tbaa !9
  %144 = icmp ne i64 %143, 0
  br i1 %144, label %145, label %164

145:                                              ; preds = %136
  %146 = load i32, ptr %16, align 4, !tbaa !11
  %147 = load ptr, ptr %7, align 8, !tbaa !5
  %148 = load ptr, ptr %8, align 8, !tbaa !5
  %149 = load i64, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds i8, ptr %147, i64 %149
  %151 = load i64, ptr %22, align 8, !tbaa !9
  %152 = sub i64 0, %151
  %153 = getelementptr inbounds i8, ptr %150, i64 %152
  %154 = load i64, ptr %22, align 8, !tbaa !9
  %155 = call i32 @socket_recv_all(i32 noundef %146, ptr noundef %153, i64 noundef %154)
  %156 = icmp ne i32 %155, 1
  br i1 %156, label %157, label %163

157:                                              ; preds = %145
  br label %158

158:                                              ; preds = %157
  %159 = load ptr, ptr @stderr, align 8, !tbaa !5
  %160 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %159, ptr noundef @.str, ptr noundef @.str.1, i32 noundef 176, ptr noundef @__FUNCTION__.http_get) #7
  br label %161

161:                                              ; preds = %158
  br label %162

162:                                              ; preds = %161
  br label %165

163:                                              ; preds = %145
  br label %164

164:                                              ; preds = %163, %136
  store i32 1, ptr %10, align 4, !tbaa !11
  br label %165

165:                                              ; preds = %164, %162, %135, %126, %112, %101, %86
  %166 = load i32, ptr %16, align 4, !tbaa !11
  %167 = call i32 @close(i32 noundef %166)
  %168 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %168, ptr %5, align 4
  store i32 1, ptr %23, align 4
  br label %169

169:                                              ; preds = %165, %76, %56, %46, %34
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 416, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  %170 = load i32, ptr %5, align 4
  ret i32 %170
}

; Function Attrs: nounwind
declare i32 @snprintf(ptr noundef, i64 noundef, ptr noundef, ...) #1

declare ptr @gethostbyname(ptr noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) #6

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) #1

declare i32 @connect(i32 noundef, ptr noundef, i32 noundef) #4

declare i64 @send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #4

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) #4

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

declare i32 @close(i32 noundef) #4

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"hostent", !6, i64 0, !6, i64 8, !12, i64 16, !12, i64 20, !6, i64 24}
!15 = !{i64 0, i64 4, !11}
!16 = !{!17, !18, i64 0}
!17 = !{!"sockaddr_in", !18, i64 0, !18, i64 2, !19, i64 4, !7, i64 8}
!18 = !{!"short", !7, i64 0}
!19 = !{!"in_addr", !12, i64 0}
!20 = !{!17, !18, i64 2}
!21 = !{!7, !7, i64 0}


; 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.sockaddr_in = type { i16, i16, %struct.in_addr, [8 x i8] }
%struct.in_addr = type { i32 }

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [58 x i8], align 1
@__FUNCTION__.http_get = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [32 x i8], align 1

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

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

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 2) i32 @http_get(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #0 {
  %5 = alloca [128 x i8], align 16
  %6 = alloca i32, align 4
  %7 = alloca [256 x i8], align 16
  %8 = alloca %struct.sockaddr_in, align 4
  %9 = alloca [416 x i8], align 16
  %10 = alloca [1024 x i8], align 16
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 416, ptr nonnull %9) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  %13 = call i32 @http_parse_uri(ptr noundef %0, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %.not = icmp eq i32 %13, 1
  br i1 %.not, label %17, label %14

14:                                               ; preds = %4
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 129, ptr noundef nonnull @__FUNCTION__.http_get) #9
  br label %74

17:                                               ; preds = %4
  %18 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull dereferenceable(1) %9, i64 noundef 416, ptr noundef nonnull @.str.9, ptr noundef nonnull %7, ptr noundef nonnull %5) #8
  %19 = icmp slt i32 %18, 1
  br i1 %19, label %20, label %23

20:                                               ; preds = %17
  %21 = load ptr, ptr @stderr, align 8, !tbaa !5
  %22 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %21, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 133, ptr noundef nonnull @__FUNCTION__.http_get) #9
  br label %74

23:                                               ; preds = %17
  %24 = call ptr @gethostbyname(ptr noundef nonnull %5) #8
  %.not27 = icmp eq ptr %24, null
  br i1 %.not27, label %25, label %28

25:                                               ; preds = %23
  %26 = load ptr, ptr @stderr, align 8, !tbaa !5
  %27 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %26, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 139, ptr noundef nonnull @__FUNCTION__.http_get) #9
  br label %74

28:                                               ; preds = %23
  %29 = getelementptr inbounds i8, ptr %8, i64 4
  %30 = getelementptr inbounds i8, ptr %24, i64 24
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  %33 = load i32, ptr %32, align 4, !tbaa !12
  store i32 %33, ptr %29, align 4, !tbaa !12
  store i16 2, ptr %8, align 4, !tbaa !13
  %34 = load i32, ptr %6, align 4, !tbaa !12
  %35 = trunc i32 %34 to i16
  %36 = call zeroext i16 @__bswap_16(i16 noundef zeroext %35)
  %37 = getelementptr inbounds i8, ptr %8, i64 2
  store i16 %36, ptr %37, align 2, !tbaa !17
  %38 = call i32 @socket(i32 noundef 2, i32 noundef 1, i32 noundef 0) #8
  %39 = icmp slt i32 %38, 0
  br i1 %39, label %40, label %43

40:                                               ; preds = %28
  %41 = load ptr, ptr @stderr, align 8, !tbaa !5
  %42 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %41, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 147, ptr noundef nonnull @__FUNCTION__.http_get) #9
  br label %74

43:                                               ; preds = %28
  %44 = call i32 @connect(i32 noundef %38, ptr noundef nonnull %8, i32 noundef 16) #8
  %45 = icmp slt i32 %44, 0
  br i1 %45, label %.sink.split, label %46

46:                                               ; preds = %43
  %47 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %9) #10
  %48 = call i64 @send(i32 noundef %38, ptr noundef nonnull %9, i64 noundef %47, i32 noundef 0) #8
  %49 = zext nneg i32 %18 to i64
  %.not28 = icmp eq i64 %48, %49
  br i1 %.not28, label %50, label %.sink.split

50:                                               ; preds = %46
  %51 = call i64 @recv(i32 noundef %38, ptr noundef nonnull %10, i64 noundef 1023, i32 noundef 0) #8
  %52 = icmp eq i64 %51, 0
  br i1 %52, label %.sink.split, label %53

53:                                               ; preds = %50
  %54 = getelementptr inbounds [1024 x i8], ptr %10, i64 0, i64 %51
  store i8 0, ptr %54, align 1, !tbaa !18
  %55 = call i32 @http_parse_response(ptr noundef nonnull %10, i64 noundef %51, ptr noundef nonnull %11, ptr noundef %2, ptr noundef nonnull %12)
  %.not29 = icmp eq i32 %55, 1
  br i1 %.not29, label %56, label %.sink.split

56:                                               ; preds = %53
  %.not30 = icmp eq ptr %1, null
  br i1 %.not30, label %72, label %57

57:                                               ; preds = %56
  %58 = load i64, ptr %2, align 8, !tbaa !19
  %59 = icmp ugt i64 %58, %3
  br i1 %59, label %72, label %60

60:                                               ; preds = %57
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = load i64, ptr %12, align 8, !tbaa !19
  %63 = sub i64 %58, %62
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %1, ptr align 1 %61, i64 %63, i1 false)
  %.not31 = icmp eq i64 %62, 0
  br i1 %.not31, label %72, label %64

64:                                               ; preds = %60
  %65 = load i64, ptr %2, align 8, !tbaa !19
  %66 = getelementptr inbounds i8, ptr %1, i64 %65
  %67 = sub i64 0, %62
  %68 = getelementptr inbounds i8, ptr %66, i64 %67
  %69 = call i32 @socket_recv_all(i32 noundef %38, ptr noundef nonnull %68, i64 noundef %62)
  %.not32 = icmp eq i32 %69, 1
  br i1 %.not32, label %72, label %.sink.split

.sink.split:                                      ; preds = %64, %53, %50, %46, %43
  %.sink33 = phi i32 [ 151, %43 ], [ 155, %46 ], [ 159, %50 ], [ 166, %53 ], [ 176, %64 ]
  %70 = load ptr, ptr @stderr, align 8, !tbaa !5
  %71 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %70, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef %.sink33, ptr noundef nonnull @__FUNCTION__.http_get) #9
  br label %72

72:                                               ; preds = %.sink.split, %60, %64, %56, %57
  %.019 = phi i32 [ 0, %57 ], [ 0, %56 ], [ 1, %64 ], [ 1, %60 ], [ -1, %.sink.split ]
  %73 = call i32 @close(i32 noundef %38) #8
  br label %74

74:                                               ; preds = %72, %40, %25, %20, %14
  %.0 = phi i32 [ -1, %14 ], [ -1, %20 ], [ -1, %40 ], [ %.019, %72 ], [ -1, %25 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 416, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %5) #8
  ret i32 %.0
}

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

declare ptr @gethostbyname(ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i16 @__bswap_16(i16 noundef zeroext) local_unnamed_addr #6

; Function Attrs: nounwind
declare i32 @socket(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #7

declare i32 @connect(i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

declare i64 @send(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

declare i64 @recv(i32 noundef, ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #4

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

declare i32 @close(i32 noundef) local_unnamed_addr #4

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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { inlinehint 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 #7 = { 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 #8 = { nounwind }
attributes #9 = { cold nounwind }
attributes #10 = { nounwind willreturn memory(read) }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 24}
!10 = !{!"hostent", !6, i64 0, !6, i64 8, !11, i64 16, !11, i64 20, !6, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!11, !11, i64 0}
!13 = !{!14, !15, i64 0}
!14 = !{!"sockaddr_in", !15, i64 0, !15, i64 2, !16, i64 4, !7, i64 8}
!15 = !{!"short", !7, i64 0}
!16 = !{!"in_addr", !11, i64 0}
!17 = !{!14, !15, i64 2}
!18 = !{!7, !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"long", !7, i64 0}


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