; LLVM IR from Water-Melon/Melon :: t (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.mln_tcp_conn_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.mln_string_t = type { ptr, i64, i32 }
%struct.mln_chain_s = type { ptr, ptr }
%struct.mln_buf_s = type { ptr, ptr, ptr, ptr, ptr, ptr, i64, i64, i64, ptr, i8 }
%struct.mln_http_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8 }

@__const.main.req = external hidden unnamed_addr constant [66 x i8], align 16
@__const.main.key = external hidden unnamed_addr constant { ptr, i64, i8, i8, i8, i8 }, align 8
@__const.main.val = external hidden unnamed_addr constant { ptr, i64, i8, i8, i8, i8 }, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [57 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca ptr, align 8
  %3 = alloca %struct.mln_tcp_conn_t, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [66 x i8], align 16
  %10 = alloca %struct.mln_string_t, align 8
  %11 = alloca %struct.mln_string_t, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 64, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  store ptr null, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 66, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %9, ptr align 16 @__const.main.req, i64 66, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %10, ptr align 8 @__const.main.key, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 @__const.main.val, i64 24, i1 false)
  %12 = call i32 @mln_tcp_conn_init(ptr noundef %3, i32 noundef -1)
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %15

14:                                               ; preds = %0
  br label %16

15:                                               ; preds = %0
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 16, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

16:                                               ; preds = %14
  %17 = call ptr @mln_http_init(ptr noundef %3, ptr noundef null, ptr noundef null)
  store ptr %17, ptr %2, align 8, !tbaa !5
  %18 = icmp ne ptr %17, null
  br i1 %18, label %19, label %20

19:                                               ; preds = %16
  br label %21

20:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.4, ptr noundef @.str.3, i32 noundef 17, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

21:                                               ; preds = %19
  %22 = getelementptr inbounds %struct.mln_tcp_conn_t, ptr %3, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8, !tbaa !9
  store ptr %23, ptr %4, align 8, !tbaa !5
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = call ptr @mln_chain_new(ptr noundef %24)
  store ptr %25, ptr %5, align 8, !tbaa !5
  %26 = icmp ne ptr %25, null
  br i1 %26, label %27, label %28

27:                                               ; preds = %21
  br label %29

28:                                               ; preds = %21
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.3, i32 noundef 21, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

29:                                               ; preds = %27
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = call ptr @mln_buf_new(ptr noundef %30)
  store ptr %31, ptr %8, align 8, !tbaa !5
  %32 = icmp ne ptr %31, null
  br i1 %32, label %33, label %34

33:                                               ; preds = %29
  br label %35

34:                                               ; preds = %29
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.3, i32 noundef 22, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

35:                                               ; preds = %33
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.mln_chain_s, ptr %37, i32 0, i32 0
  store ptr %36, ptr %38, align 8, !tbaa !12
  %39 = getelementptr inbounds [66 x i8], ptr %9, i64 0, i64 0
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.mln_buf_s, ptr %40, i32 0, i32 0
  store ptr %39, ptr %41, align 8, !tbaa !14
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.mln_buf_s, ptr %42, i32 0, i32 1
  store ptr %39, ptr %43, align 8, !tbaa !17
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.mln_buf_s, ptr %44, i32 0, i32 3
  store ptr %39, ptr %45, align 8, !tbaa !18
  %46 = getelementptr inbounds [66 x i8], ptr %9, i64 0, i64 0
  %47 = getelementptr inbounds i8, ptr %46, i64 66
  %48 = getelementptr inbounds i8, ptr %47, i64 -1
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.mln_buf_s, ptr %49, i32 0, i32 4
  store ptr %48, ptr %50, align 8, !tbaa !19
  %51 = load ptr, ptr %8, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mln_buf_s, ptr %51, i32 0, i32 2
  store ptr %48, ptr %52, align 8, !tbaa !20
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.mln_buf_s, ptr %53, i32 0, i32 10
  %55 = load i8, ptr %54, align 8
  %56 = and i8 %55, -2
  %57 = or i8 %56, 1
  store i8 %57, ptr %54, align 8
  %58 = load ptr, ptr %2, align 8, !tbaa !5
  %59 = call i32 @mln_http_parse(ptr noundef %58, ptr noundef %5)
  %60 = icmp eq i32 %59, 1
  br i1 %60, label %61, label %62

61:                                               ; preds = %35
  br label %63

62:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.3, i32 noundef 28, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

63:                                               ; preds = %61
  %64 = load ptr, ptr %2, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.mln_http_s, ptr %64, i32 0, i32 14
  %66 = load i8, ptr %65, align 8
  %67 = and i8 %66, -4
  %68 = or i8 %67, 2
  store i8 %68, ptr %65, align 8
  %69 = load ptr, ptr %2, align 8, !tbaa !5
  %70 = call i32 @mln_http_field_set(ptr noundef %69, ptr noundef %10, ptr noundef %11)
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %73

72:                                               ; preds = %63
  br label %74

73:                                               ; preds = %63
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.3, i32 noundef 32, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

74:                                               ; preds = %72
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = icmp ne ptr %75, null
  br i1 %76, label %77, label %79

77:                                               ; preds = %74
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  call void @mln_chain_pool_release(ptr noundef %78)
  br label %79

79:                                               ; preds = %77, %74
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = call i32 @mln_http_generate(ptr noundef %80, ptr noundef %6, ptr noundef %7)
  %82 = icmp eq i32 %81, 1
  br i1 %82, label %83, label %84

83:                                               ; preds = %79
  br label %85

84:                                               ; preds = %79
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.3, i32 noundef 36, ptr noundef @__PRETTY_FUNCTION__.main) #6
  unreachable

85:                                               ; preds = %83
  %86 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %86, ptr %5, align 8, !tbaa !5
  br label %87

87:                                               ; preds = %187, %85
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = icmp ne ptr %88, null
  br i1 %89, label %90, label %191

90:                                               ; preds = %87
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.mln_chain_s, ptr %91, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !12
  %94 = icmp eq ptr %93, null
  br i1 %94, label %95, label %96

95:                                               ; preds = %90
  br i1 false, label %134, label %186

96:                                               ; preds = %90
  %97 = load ptr, ptr %5, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.mln_chain_s, ptr %97, i32 0, i32 0
  %99 = load ptr, ptr %98, align 8, !tbaa !12
  %100 = getelementptr inbounds %struct.mln_buf_s, ptr %99, i32 0, i32 10
  %101 = load i8, ptr %100, align 8
  %102 = lshr i8 %101, 3
  %103 = and i8 %102, 1
  %104 = zext i8 %103 to i32
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %119

106:                                              ; preds = %96
  %107 = load ptr, ptr %5, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.mln_chain_s, ptr %107, i32 0, i32 0
  %109 = load ptr, ptr %108, align 8, !tbaa !12
  %110 = getelementptr inbounds %struct.mln_buf_s, ptr %109, i32 0, i32 8
  %111 = load i64, ptr %110, align 8, !tbaa !21
  %112 = load ptr, ptr %5, align 8, !tbaa !5
  %113 = getelementptr inbounds %struct.mln_chain_s, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !12
  %115 = getelementptr inbounds %struct.mln_buf_s, ptr %114, i32 0, i32 7
  %116 = load i64, ptr %115, align 8, !tbaa !22
  %117 = sub nsw i64 %111, %116
  %118 = icmp ne i64 %117, 0
  br i1 %118, label %134, label %186

119:                                              ; preds = %96
  %120 = load ptr, ptr %5, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.mln_chain_s, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !12
  %123 = getelementptr inbounds %struct.mln_buf_s, ptr %122, i32 0, i32 2
  %124 = load ptr, ptr %123, align 8, !tbaa !20
  %125 = load ptr, ptr %5, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.mln_chain_s, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !12
  %128 = getelementptr inbounds %struct.mln_buf_s, ptr %127, i32 0, i32 1
  %129 = load ptr, ptr %128, align 8, !tbaa !17
  %130 = ptrtoint ptr %124 to i64
  %131 = ptrtoint ptr %129 to i64
  %132 = sub i64 %130, %131
  %133 = icmp ne i64 %132, 0
  br i1 %133, label %134, label %186

134:                                              ; preds = %119, %106, %95
  %135 = load ptr, ptr %5, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.mln_chain_s, ptr %135, i32 0, i32 0
  %137 = load ptr, ptr %136, align 8, !tbaa !12
  %138 = getelementptr inbounds %struct.mln_buf_s, ptr %137, i32 0, i32 3
  %139 = load ptr, ptr %138, align 8, !tbaa !18
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.mln_chain_s, ptr %140, i32 0, i32 0
  %142 = load ptr, ptr %141, align 8, !tbaa !12
  %143 = icmp eq ptr %142, null
  br i1 %143, label %144, label %145

144:                                              ; preds = %134
  br label %183

145:                                              ; preds = %134
  %146 = load ptr, ptr %5, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.mln_chain_s, ptr %146, i32 0, i32 0
  %148 = load ptr, ptr %147, align 8, !tbaa !12
  %149 = getelementptr inbounds %struct.mln_buf_s, ptr %148, i32 0, i32 10
  %150 = load i8, ptr %149, align 8
  %151 = lshr i8 %150, 3
  %152 = and i8 %151, 1
  %153 = zext i8 %152 to i32
  %154 = icmp ne i32 %153, 0
  br i1 %154, label %155, label %167

155:                                              ; preds = %145
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.mln_chain_s, ptr %156, i32 0, i32 0
  %158 = load ptr, ptr %157, align 8, !tbaa !12
  %159 = getelementptr inbounds %struct.mln_buf_s, ptr %158, i32 0, i32 8
  %160 = load i64, ptr %159, align 8, !tbaa !21
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.mln_chain_s, ptr %161, i32 0, i32 0
  %163 = load ptr, ptr %162, align 8, !tbaa !12
  %164 = getelementptr inbounds %struct.mln_buf_s, ptr %163, i32 0, i32 7
  %165 = load i64, ptr %164, align 8, !tbaa !22
  %166 = sub nsw i64 %160, %165
  br label %181

167:                                              ; preds = %145
  %168 = load ptr, ptr %5, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.mln_chain_s, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !12
  %171 = getelementptr inbounds %struct.mln_buf_s, ptr %170, i32 0, i32 2
  %172 = load ptr, ptr %171, align 8, !tbaa !20
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.mln_chain_s, ptr %173, i32 0, i32 0
  %175 = load ptr, ptr %174, align 8, !tbaa !12
  %176 = getelementptr inbounds %struct.mln_buf_s, ptr %175, i32 0, i32 1
  %177 = load ptr, ptr %176, align 8, !tbaa !17
  %178 = ptrtoint ptr %172 to i64
  %179 = ptrtoint ptr %177 to i64
  %180 = sub i64 %178, %179
  br label %181

181:                                              ; preds = %167, %155
  %182 = phi i64 [ %166, %155 ], [ %180, %167 ]
  br label %183

183:                                              ; preds = %181, %144
  %184 = phi i64 [ 0, %144 ], [ %182, %181 ]
  %185 = call i64 @write(i32 noundef 1, ptr noundef %139, i64 noundef %184)
  br label %186

186:                                              ; preds = %183, %119, %106, %95
  br label %187

187:                                              ; preds = %186
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.mln_chain_s, ptr %188, i32 0, i32 1
  %190 = load ptr, ptr %189, align 8, !tbaa !23
  store ptr %190, ptr %5, align 8, !tbaa !5
  br label %87, !llvm.loop !24

191:                                              ; preds = %87
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  call void @mln_chain_pool_release_all(ptr noundef %192)
  %193 = load ptr, ptr %2, align 8, !tbaa !5
  call void @mln_http_destroy(ptr noundef %193)
  call void @mln_tcp_conn_destroy(ptr noundef %3)
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 66, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 64, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #5
  ret i32 0
}

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

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

declare i32 @mln_tcp_conn_init(ptr noundef, i32 noundef) #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

declare ptr @mln_http_init(ptr noundef, ptr noundef, ptr noundef) #3

declare ptr @mln_chain_new(ptr noundef) #3

declare ptr @mln_buf_new(ptr noundef) #3

declare i32 @mln_http_parse(ptr noundef, ptr noundef) #3

declare i32 @mln_http_field_set(ptr noundef, ptr noundef, ptr noundef) #3

declare void @mln_chain_pool_release(ptr noundef) #3

declare i32 @mln_http_generate(ptr noundef, ptr noundef, ptr noundef) #3

declare i64 @write(i32 noundef, ptr noundef, i64 noundef) #3

declare void @mln_chain_pool_release_all(ptr noundef) #3

declare void @mln_http_destroy(ptr noundef) #3

declare void @mln_tcp_conn_destroy(ptr noundef) #3

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

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { "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 = { noreturn 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 = { noreturn nounwind }

!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 0}
!10 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"mln_chain_s", !6, i64 0, !6, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"mln_buf_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !6, i64 72, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !6, i64 8}
!18 = !{!15, !6, i64 24}
!19 = !{!15, !6, i64 32}
!20 = !{!15, !6, i64 16}
!21 = !{!15, !16, i64 64}
!22 = !{!15, !16, i64 56}
!23 = !{!13, !6, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


; 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.mln_tcp_conn_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.mln_string_t = type { ptr, i64, i32 }

@__const.main.req = external hidden unnamed_addr constant [66 x i8], align 16
@__const.main.key = external hidden unnamed_addr constant { ptr, i64, i8, i8, i8, i8 }, align 8
@__const.main.val = external hidden unnamed_addr constant { ptr, i64, i8, i8, i8, i8 }, align 8
@.str.2 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [60 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [44 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [57 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca %struct.mln_tcp_conn_t, align 8
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca [66 x i8], align 16
  %6 = alloca %struct.mln_string_t, align 8
  %7 = alloca %struct.mln_string_t, align 8
  call void @llvm.lifetime.start.p0(i64 64, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store ptr null, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store ptr null, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 66, ptr nonnull %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(66) %5, ptr noundef nonnull align 16 dereferenceable(66) @__const.main.req, i64 66, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 8 dereferenceable(24) @__const.main.key, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %7, ptr noundef nonnull align 8 dereferenceable(24) @__const.main.val, i64 24, i1 false)
  %8 = call i32 @mln_tcp_conn_init(ptr noundef nonnull %1, i32 noundef -1) #6
  %9 = icmp eq i32 %8, 0
  br i1 %9, label %11, label %10

10:                                               ; preds = %0
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 16, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

11:                                               ; preds = %0
  %12 = call ptr @mln_http_init(ptr noundef nonnull %1, ptr noundef null, ptr noundef null) #6
  %.not = icmp eq ptr %12, null
  br i1 %.not, label %13, label %14

13:                                               ; preds = %11
  call void @__assert_fail(ptr noundef nonnull @.str.4, ptr noundef nonnull @.str.3, i32 noundef 17, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

14:                                               ; preds = %11
  %15 = load ptr, ptr %1, align 8, !tbaa !9
  %16 = call ptr @mln_chain_new(ptr noundef %15) #6
  store ptr %16, ptr %2, align 8, !tbaa !5
  %.not19 = icmp eq ptr %16, null
  br i1 %.not19, label %17, label %18

17:                                               ; preds = %14
  call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.3, i32 noundef 21, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

18:                                               ; preds = %14
  %19 = call ptr @mln_buf_new(ptr noundef %15) #6
  %.not20 = icmp eq ptr %19, null
  br i1 %.not20, label %20, label %21

20:                                               ; preds = %18
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.3, i32 noundef 22, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

21:                                               ; preds = %18
  store ptr %19, ptr %16, align 8, !tbaa !12
  store ptr %5, ptr %19, align 8, !tbaa !14
  %22 = getelementptr inbounds i8, ptr %19, i64 8
  store ptr %5, ptr %22, align 8, !tbaa !17
  %23 = getelementptr inbounds i8, ptr %19, i64 24
  store ptr %5, ptr %23, align 8, !tbaa !18
  %24 = getelementptr inbounds i8, ptr %5, i64 65
  %25 = getelementptr inbounds i8, ptr %19, i64 32
  store ptr %24, ptr %25, align 8, !tbaa !19
  %26 = getelementptr inbounds i8, ptr %19, i64 16
  store ptr %24, ptr %26, align 8, !tbaa !20
  %27 = getelementptr inbounds i8, ptr %19, i64 80
  %28 = load i8, ptr %27, align 8
  %29 = or i8 %28, 1
  store i8 %29, ptr %27, align 8
  %30 = call i32 @mln_http_parse(ptr noundef nonnull %12, ptr noundef nonnull %2) #6
  %31 = icmp eq i32 %30, 1
  br i1 %31, label %33, label %32

32:                                               ; preds = %21
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.3, i32 noundef 28, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

33:                                               ; preds = %21
  %34 = getelementptr inbounds i8, ptr %12, i64 96
  %35 = load i8, ptr %34, align 8
  %36 = and i8 %35, -4
  %37 = or disjoint i8 %36, 2
  store i8 %37, ptr %34, align 8
  %38 = call i32 @mln_http_field_set(ptr noundef nonnull %12, ptr noundef nonnull %6, ptr noundef nonnull %7) #6
  %39 = icmp eq i32 %38, 0
  br i1 %39, label %41, label %40

40:                                               ; preds = %33
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.3, i32 noundef 32, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

41:                                               ; preds = %33
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %.not21 = icmp eq ptr %42, null
  br i1 %.not21, label %44, label %43

43:                                               ; preds = %41
  call void @mln_chain_pool_release(ptr noundef nonnull %42) #6
  br label %44

44:                                               ; preds = %43, %41
  %45 = call i32 @mln_http_generate(ptr noundef nonnull %12, ptr noundef nonnull %3, ptr noundef nonnull %4) #6
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %.preheader, label %47

.preheader:                                       ; preds = %44
  %storemerge27 = load ptr, ptr %3, align 8, !tbaa !5
  store ptr %storemerge27, ptr %2, align 8, !tbaa !5
  %.not2228 = icmp eq ptr %storemerge27, null
  br i1 %.not2228, label %._crit_edge, label %.lr.ph

47:                                               ; preds = %44
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.3, i32 noundef 36, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #7
  unreachable

.lr.ph:                                           ; preds = %.preheader, %74
  %storemerge29 = phi ptr [ %storemerge, %74 ], [ %storemerge27, %.preheader ]
  %48 = load ptr, ptr %storemerge29, align 8, !tbaa !12
  %49 = icmp eq ptr %48, null
  br i1 %49, label %74, label %50

50:                                               ; preds = %.lr.ph
  %51 = getelementptr inbounds i8, ptr %48, i64 80
  %52 = load i8, ptr %51, align 8
  %53 = and i8 %52, 8
  %.not23 = icmp eq i8 %53, 0
  br i1 %.not23, label %59, label %54

54:                                               ; preds = %50
  %55 = getelementptr inbounds i8, ptr %48, i64 64
  %56 = load i64, ptr %55, align 8, !tbaa !21
  %57 = getelementptr inbounds i8, ptr %48, i64 56
  %58 = load i64, ptr %57, align 8, !tbaa !22
  %.not25 = icmp eq i64 %56, %58
  br i1 %.not25, label %74, label %64

59:                                               ; preds = %50
  %60 = getelementptr inbounds i8, ptr %48, i64 16
  %61 = load ptr, ptr %60, align 8, !tbaa !20
  %62 = getelementptr inbounds i8, ptr %48, i64 8
  %63 = load ptr, ptr %62, align 8, !tbaa !17
  %.not24 = icmp eq ptr %61, %63
  br i1 %.not24, label %74, label %66

64:                                               ; preds = %54
  %65 = sub nsw i64 %56, %58
  br label %70

66:                                               ; preds = %59
  %67 = ptrtoint ptr %61 to i64
  %68 = ptrtoint ptr %63 to i64
  %69 = sub i64 %67, %68
  br label %70

70:                                               ; preds = %64, %66
  %71 = phi i64 [ %65, %64 ], [ %69, %66 ]
  %.in = getelementptr inbounds i8, ptr %48, i64 24
  %72 = load ptr, ptr %.in, align 8, !tbaa !18
  %73 = call i64 @write(i32 noundef 1, ptr noundef %72, i64 noundef %71) #6
  %.pre = load ptr, ptr %2, align 8, !tbaa !5
  br label %74

74:                                               ; preds = %54, %59, %70, %.lr.ph
  %75 = phi ptr [ %storemerge29, %54 ], [ %storemerge29, %59 ], [ %.pre, %70 ], [ %storemerge29, %.lr.ph ]
  %76 = getelementptr inbounds i8, ptr %75, i64 8
  %storemerge = load ptr, ptr %76, align 8, !tbaa !5
  store ptr %storemerge, ptr %2, align 8, !tbaa !5
  %.not22 = icmp eq ptr %storemerge, null
  br i1 %.not22, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !23

._crit_edge.loopexit:                             ; preds = %74
  %.pre30 = load ptr, ptr %3, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %77 = phi ptr [ %.pre30, %._crit_edge.loopexit ], [ null, %.preheader ]
  call void @mln_chain_pool_release_all(ptr noundef %77) #6
  call void @mln_http_destroy(ptr noundef nonnull %12) #6
  call void @mln_tcp_conn_destroy(ptr noundef nonnull %1) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 66, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 64, ptr nonnull %1) #6
  ret i32 0
}

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

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

declare i32 @mln_tcp_conn_init(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

declare ptr @mln_http_init(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @mln_chain_new(ptr noundef) local_unnamed_addr #3

declare ptr @mln_buf_new(ptr noundef) local_unnamed_addr #3

declare i32 @mln_http_parse(ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @mln_http_field_set(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @mln_chain_pool_release(ptr noundef) local_unnamed_addr #3

declare i32 @mln_http_generate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree
declare noundef i64 @write(i32 noundef, ptr nocapture noundef readonly, i64 noundef) local_unnamed_addr #5

declare void @mln_chain_pool_release_all(ptr noundef) local_unnamed_addr #3

declare void @mln_http_destroy(ptr noundef) local_unnamed_addr #3

declare void @mln_tcp_conn_destroy(ptr 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) #1

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

!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 0}
!10 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !11, i64 56}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"mln_chain_s", !6, i64 0, !6, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"mln_buf_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !6, i64 72, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80, !11, i64 80}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !6, i64 8}
!18 = !{!15, !6, i64 24}
!19 = !{!15, !6, i64 32}
!20 = !{!15, !6, i64 16}
!21 = !{!15, !16, i64 64}
!22 = !{!15, !16, i64 56}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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