; LLVM IR from Water-Melon/Melon :: src (mln_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_http_s = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i32, i32, i32, i8 }
%struct.mln_string_t = type { ptr, i64, i32 }

@.str.122 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [7 x i8], align 1
@stdout = external global ptr, align 8
@.str.124 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [10 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 i32 @mln_hash_iterate(ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @mln_http_dump(ptr noundef %0) #2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 1, ptr %3, align 4, !tbaa !9
  %5 = call i32 (ptr, ...) @printf(ptr noundef @.str.122)
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = icmp eq ptr %6, null
  br i1 %7, label %8, label %9

8:                                                ; preds = %1
  store i32 1, ptr %4, align 4
  br label %103

9:                                                ; preds = %1
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.mln_http_s, ptr %10, i32 0, i32 7
  %12 = load ptr, ptr %11, align 8, !tbaa !11
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %31

14:                                               ; preds = %9
  %15 = call i32 (ptr, ...) @printf(ptr noundef @.str.123)
  %16 = load ptr, ptr @stdout, align 8, !tbaa !5
  %17 = call i32 @fflush(ptr noundef %16)
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.mln_http_s, ptr %18, i32 0, i32 7
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct.mln_string_t, ptr %20, i32 0, i32 0
  %22 = load ptr, ptr %21, align 8, !tbaa !13
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mln_http_s, ptr %23, i32 0, i32 7
  %25 = load ptr, ptr %24, align 8, !tbaa !11
  %26 = getelementptr inbounds %struct.mln_string_t, ptr %25, i32 0, i32 1
  %27 = load i64, ptr %26, align 8, !tbaa !16
  %28 = call i64 @write(i32 noundef 1, ptr noundef %22, i64 noundef %27)
  %29 = trunc i64 %28 to i32
  store i32 %29, ptr %3, align 4, !tbaa !9
  %30 = call i32 (ptr, ...) @printf(ptr noundef @.str.124)
  br label %31

31:                                               ; preds = %14, %9
  %32 = load ptr, ptr %2, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.mln_http_s, ptr %32, i32 0, i32 8
  %34 = load ptr, ptr %33, align 8, !tbaa !17
  %35 = icmp ne ptr %34, null
  br i1 %35, label %36, label %53

36:                                               ; preds = %31
  %37 = call i32 (ptr, ...) @printf(ptr noundef @.str.125)
  %38 = load ptr, ptr @stdout, align 8, !tbaa !5
  %39 = call i32 @fflush(ptr noundef %38)
  %40 = load ptr, ptr %2, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.mln_http_s, ptr %40, i32 0, i32 8
  %42 = load ptr, ptr %41, align 8, !tbaa !17
  %43 = getelementptr inbounds %struct.mln_string_t, ptr %42, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !13
  %45 = load ptr, ptr %2, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.mln_http_s, ptr %45, i32 0, i32 8
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  %48 = getelementptr inbounds %struct.mln_string_t, ptr %47, i32 0, i32 1
  %49 = load i64, ptr %48, align 8, !tbaa !16
  %50 = call i64 @write(i32 noundef 1, ptr noundef %44, i64 noundef %49)
  %51 = trunc i64 %50 to i32
  store i32 %51, ptr %3, align 4, !tbaa !9
  %52 = call i32 (ptr, ...) @printf(ptr noundef @.str.124)
  br label %53

53:                                               ; preds = %36, %31
  %54 = load ptr, ptr %2, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.mln_http_s, ptr %54, i32 0, i32 9
  %56 = load ptr, ptr %55, align 8, !tbaa !18
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %75

58:                                               ; preds = %53
  %59 = call i32 (ptr, ...) @printf(ptr noundef @.str.126)
  %60 = load ptr, ptr @stdout, align 8, !tbaa !5
  %61 = call i32 @fflush(ptr noundef %60)
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.mln_http_s, ptr %62, i32 0, i32 9
  %64 = load ptr, ptr %63, align 8, !tbaa !18
  %65 = getelementptr inbounds %struct.mln_string_t, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !13
  %67 = load ptr, ptr %2, align 8, !tbaa !5
  %68 = getelementptr inbounds %struct.mln_http_s, ptr %67, i32 0, i32 9
  %69 = load ptr, ptr %68, align 8, !tbaa !18
  %70 = getelementptr inbounds %struct.mln_string_t, ptr %69, i32 0, i32 1
  %71 = load i64, ptr %70, align 8, !tbaa !16
  %72 = call i64 @write(i32 noundef 1, ptr noundef %66, i64 noundef %71)
  %73 = trunc i64 %72 to i32
  store i32 %73, ptr %3, align 4, !tbaa !9
  %74 = call i32 (ptr, ...) @printf(ptr noundef @.str.124)
  br label %75

75:                                               ; preds = %58, %53
  %76 = load ptr, ptr %2, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.mln_http_s, ptr %76, i32 0, i32 11
  %78 = load i32, ptr %77, align 4, !tbaa !19
  %79 = call i32 (ptr, ...) @printf(ptr noundef @.str.127, i32 noundef %78)
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.mln_http_s, ptr %80, i32 0, i32 12
  %82 = load i32, ptr %81, align 8, !tbaa !20
  %83 = call i32 (ptr, ...) @printf(ptr noundef @.str.128, i32 noundef %82)
  %84 = load ptr, ptr %2, align 8, !tbaa !5
  %85 = getelementptr inbounds %struct.mln_http_s, ptr %84, i32 0, i32 13
  %86 = load i32, ptr %85, align 4, !tbaa !21
  %87 = call i32 (ptr, ...) @printf(ptr noundef @.str.129, i32 noundef %86)
  %88 = load ptr, ptr %2, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.mln_http_s, ptr %88, i32 0, i32 14
  %90 = load i8, ptr %89, align 8
  %91 = and i8 %90, 3
  %92 = zext i8 %91 to i32
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.130, i32 noundef %92)
  %94 = call i32 (ptr, ...) @printf(ptr noundef @.str.131)
  %95 = load i32, ptr %3, align 4, !tbaa !9
  %96 = icmp sle i32 %95, 0
  br i1 %96, label %97, label %98

97:                                               ; preds = %75
  store i32 1, ptr %3, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %97, %75
  %99 = load ptr, ptr %2, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.mln_http_s, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !22
  %102 = call i32 @mln_hash_iterate(ptr noundef %101, ptr noundef @mln_http_dump_iterate_handler, ptr noundef null)
  store i32 0, ptr %4, align 4
  br label %103

103:                                              ; preds = %98, %8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %104 = load i32, ptr %4, align 4
  switch i32 %104, label %106 [
    i32 0, label %105
    i32 1, label %105
  ]

105:                                              ; preds = %103, %103
  ret void

106:                                              ; preds = %103
  unreachable
}

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

declare i32 @fflush(ptr noundef) #1

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mln_http_dump_iterate_handler(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

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 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 #3 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 56}
!12 = !{!"mln_http_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 96}
!13 = !{!14, !6, i64 0}
!14 = !{!"", !6, i64 0, !15, i64 8, !15, i64 16, !15, i64 16, !15, i64 16}
!15 = !{!"long", !7, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{!12, !6, i64 64}
!18 = !{!12, !6, i64 72}
!19 = !{!12, !10, i64 84}
!20 = !{!12, !10, i64 88}
!21 = !{!12, !10, i64 92}
!22 = !{!12, !6, i64 16}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@.str.122 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [7 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@.str.124 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.125 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.126 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.127 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.128 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.129 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.130 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.131 = external hidden unnamed_addr constant [10 x i8], align 1

declare i32 @mln_hash_iterate(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @mln_http_dump(ptr noundef readonly %0) local_unnamed_addr #1 {
  %2 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.122)
  %3 = icmp eq ptr %0, null
  br i1 %3, label %62, label %4

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 56
  %6 = load ptr, ptr %5, align 8, !tbaa !5
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %17, label %7

7:                                                ; preds = %4
  %8 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.123)
  %9 = load ptr, ptr @stdout, align 8, !tbaa !11
  %10 = tail call i32 @fflush(ptr noundef %9)
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %11, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !15
  %15 = tail call i64 @write(i32 noundef 1, ptr noundef %12, i64 noundef %14) #4
  %16 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.124)
  br label %17

17:                                               ; preds = %7, %4
  %18 = getelementptr inbounds i8, ptr %0, i64 64
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  %.not16 = icmp eq ptr %19, null
  br i1 %.not16, label %30, label %20

20:                                               ; preds = %17
  %21 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.125)
  %22 = load ptr, ptr @stdout, align 8, !tbaa !11
  %23 = tail call i32 @fflush(ptr noundef %22)
  %24 = load ptr, ptr %18, align 8, !tbaa !16
  %25 = load ptr, ptr %24, align 8, !tbaa !12
  %26 = getelementptr inbounds i8, ptr %24, i64 8
  %27 = load i64, ptr %26, align 8, !tbaa !15
  %28 = tail call i64 @write(i32 noundef 1, ptr noundef %25, i64 noundef %27) #4
  %29 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.124)
  br label %30

30:                                               ; preds = %20, %17
  %31 = getelementptr inbounds i8, ptr %0, i64 72
  %32 = load ptr, ptr %31, align 8, !tbaa !17
  %.not17 = icmp eq ptr %32, null
  br i1 %.not17, label %43, label %33

33:                                               ; preds = %30
  %34 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.126)
  %35 = load ptr, ptr @stdout, align 8, !tbaa !11
  %36 = tail call i32 @fflush(ptr noundef %35)
  %37 = load ptr, ptr %31, align 8, !tbaa !17
  %38 = load ptr, ptr %37, align 8, !tbaa !12
  %39 = getelementptr inbounds i8, ptr %37, i64 8
  %40 = load i64, ptr %39, align 8, !tbaa !15
  %41 = tail call i64 @write(i32 noundef 1, ptr noundef %38, i64 noundef %40) #4
  %42 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.124)
  br label %43

43:                                               ; preds = %33, %30
  %44 = getelementptr inbounds i8, ptr %0, i64 84
  %45 = load i32, ptr %44, align 4, !tbaa !18
  %46 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.127, i32 noundef %45)
  %47 = getelementptr inbounds i8, ptr %0, i64 88
  %48 = load i32, ptr %47, align 8, !tbaa !19
  %49 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.128, i32 noundef %48)
  %50 = getelementptr inbounds i8, ptr %0, i64 92
  %51 = load i32, ptr %50, align 4, !tbaa !20
  %52 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.129, i32 noundef %51)
  %53 = getelementptr inbounds i8, ptr %0, i64 96
  %54 = load i8, ptr %53, align 8
  %55 = and i8 %54, 3
  %56 = zext nneg i8 %55 to i32
  %57 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.130, i32 noundef %56)
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.131)
  %59 = getelementptr inbounds i8, ptr %0, i64 16
  %60 = load ptr, ptr %59, align 8, !tbaa !21
  %61 = tail call i32 @mln_hash_iterate(ptr noundef %60, ptr noundef nonnull @mln_http_dump_iterate_handler, ptr noundef null) #4
  br label %62

62:                                               ; preds = %1, %43
  ret void
}

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

; Function Attrs: nofree nounwind
declare noundef i32 @fflush(ptr nocapture noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden i32 @mln_http_dump_iterate_handler(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

attributes #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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #3 = { 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 #4 = { 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, !7, i64 56}
!6 = !{!"mln_http_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !10, i64 80, !10, i64 84, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 96}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !7, i64 0}
!13 = !{!"", !7, i64 0, !14, i64 8, !14, i64 16, !14, i64 16, !14, i64 16}
!14 = !{!"long", !8, i64 0}
!15 = !{!13, !14, i64 8}
!16 = !{!6, !7, i64 64}
!17 = !{!6, !7, i64 72}
!18 = !{!6, !10, i64 84}
!19 = !{!6, !10, i64 88}
!20 = !{!6, !10, i64 92}
!21 = !{!6, !7, i64 16}


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