; LLVM IR from Water-Melon/Melon :: src (mln_conf)

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

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_conf_lex_lex_dup(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %5, align 8, !tbaa !5
  %12 = icmp eq ptr %11, null
  br i1 %12, label %13, label %14

13:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  br label %77

14:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #3
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %15, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = call ptr @mln_alloc_m(ptr noundef %16, i64 noundef 24)
  store ptr %17, ptr %7, align 8, !tbaa !5
  %18 = load ptr, ptr %7, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %14
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %76

21:                                               ; preds = %14
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = call ptr @mln_string_pool_dup(ptr noundef %22, ptr noundef %25)
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %27, i32 0, i32 0
  store ptr %26, ptr %28, align 8, !tbaa !9
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = icmp eq ptr %31, null
  br i1 %32, label %33, label %35

33:                                               ; preds = %21
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  call void @mln_alloc_free(ptr noundef %34)
  store ptr null, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %76

35:                                               ; preds = %21
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 8, !tbaa !12
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %39, i32 0, i32 1
  store i32 %38, ptr %40, align 8, !tbaa !12
  %41 = load ptr, ptr %6, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %41, i32 0, i32 2
  %43 = load i32, ptr %42, align 4, !tbaa !13
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %44, i32 0, i32 2
  store i32 %43, ptr %45, align 4, !tbaa !13
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %46, i32 0, i32 3
  %48 = load ptr, ptr %47, align 8, !tbaa !14
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %53

50:                                               ; preds = %35
  %51 = load ptr, ptr %7, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %51, i32 0, i32 3
  store ptr null, ptr %52, align 8, !tbaa !14
  br label %74

53:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %54, i32 0, i32 3
  %56 = load ptr, ptr %55, align 8, !tbaa !14
  store ptr %56, ptr %9, align 8, !tbaa !5
  %57 = load ptr, ptr %9, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.mln_string_t, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8
  %60 = lshr i32 %59, 2
  %61 = zext i32 %60 to i64
  %62 = add i64 %61, 1
  %63 = trunc i64 %62 to i32
  %64 = load i32, ptr %58, align 8
  %65 = and i32 %63, 1073741823
  %66 = shl i32 %65, 2
  %67 = and i32 %64, 3
  %68 = or i32 %67, %66
  store i32 %68, ptr %58, align 8
  %69 = zext i32 %65 to i64
  %70 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %70, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  %71 = load ptr, ptr %10, align 8, !tbaa !5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.mln_conf_lex_struct_t, ptr %72, i32 0, i32 3
  store ptr %71, ptr %73, align 8, !tbaa !14
  br label %74

74:                                               ; preds = %53, %50
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %75, ptr %3, align 8
  store i32 1, ptr %8, align 4
  br label %76

76:                                               ; preds = %74, %33, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #3
  br label %77

77:                                               ; preds = %76, %13
  %78 = load ptr, ptr %3, align 8
  ret ptr %78
}

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

declare ptr @mln_alloc_m(ptr noundef, i64 noundef) #2

declare ptr @mln_string_pool_dup(ptr noundef, ptr noundef) #2

declare void @mln_alloc_free(ptr noundef) #2

; 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 = { "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, !6, i64 0}
!10 = !{!"", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 8}
!13 = !{!10, !11, i64 12}
!14 = !{!10, !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"

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_conf_lex_lex_dup(ptr noundef %0, ptr noundef readonly %1) local_unnamed_addr #0 {
  %3 = icmp eq ptr %1, null
  br i1 %3, label %29, label %4

4:                                                ; preds = %2
  %5 = tail call ptr @mln_alloc_m(ptr noundef %0, i64 noundef 24) #2
  %6 = icmp eq ptr %5, null
  br i1 %6, label %29, label %7

7:                                                ; preds = %4
  %8 = load ptr, ptr %1, align 8, !tbaa !5
  %9 = tail call ptr @mln_string_pool_dup(ptr noundef %0, ptr noundef %8) #2
  store ptr %9, ptr %5, align 8, !tbaa !5
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %7
  tail call void @mln_alloc_free(ptr noundef nonnull %5) #2
  br label %29

12:                                               ; preds = %7
  %13 = getelementptr inbounds i8, ptr %1, i64 8
  %14 = getelementptr inbounds i8, ptr %5, i64 8
  %15 = load <2 x i32>, ptr %13, align 8, !tbaa !11
  store <2 x i32> %15, ptr %14, align 8, !tbaa !11
  %16 = getelementptr inbounds i8, ptr %1, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !12
  %18 = icmp eq ptr %17, null
  br i1 %18, label %19, label %21

19:                                               ; preds = %12
  %20 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %20, align 8, !tbaa !12
  br label %29

21:                                               ; preds = %12
  %22 = getelementptr inbounds i8, ptr %17, i64 16
  %23 = load i32, ptr %22, align 8
  %24 = and i32 %23, -4
  %25 = add i32 %24, 4
  %26 = and i32 %23, 3
  %27 = or disjoint i32 %25, %26
  store i32 %27, ptr %22, align 8
  %28 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr %17, ptr %28, align 8, !tbaa !12
  br label %29

29:                                               ; preds = %11, %4, %21, %19, %2
  %.1 = phi ptr [ null, %2 ], [ null, %11 ], [ null, %4 ], [ %5, %21 ], [ %5, %19 ]
  ret ptr %.1
}

declare ptr @mln_alloc_m(ptr noundef, i64 noundef) local_unnamed_addr #1

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

declare void @mln_alloc_free(ptr noundef) local_unnamed_addr #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 = { "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 }

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

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


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