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

; 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_log_t = type { i64, i32, i32, i32, [512 x i8], [1024 x i8], [1024 x i8] }
%struct.mln_conf_s = type { ptr, ptr, ptr, ptr, ptr, ptr }
%struct.rbtree_s = type { ptr, ptr, ptr, ptr, ptr, %struct.mln_rbtree_node_s, ptr, ptr, ptr, ptr, ptr, i64, i8 }
%struct.mln_rbtree_node_s = type { ptr, ptr, ptr, ptr, ptr, ptr, i32 }
%struct.mln_conf_domain_s = type { ptr, ptr, ptr, ptr, ptr }
%struct.mln_conf_cmd_s = type { ptr, ptr, ptr, ptr, i32 }
%struct.mln_conf_item_s = type { i32, %union.anon }
%union.anon = type { ptr }

@g_log = external dso_local global { i64, i32, i8, i8, i8, i8, i32, [512 x i8], [1024 x i8], [1024 x i8] }, align 8
@stdout = external global ptr, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [41 x i8], align 1
@__FUNCTION__.mln_log_init = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local i32 @mln_log_init(ptr noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store ptr @g_log, ptr %9, align 8, !tbaa !5
  %12 = load ptr, ptr %9, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.mln_log_t, ptr %12, i32 0, i32 2
  %14 = load i32, ptr %13, align 4
  %15 = lshr i32 %14, 1
  %16 = and i32 %15, 1
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %19

18:                                               ; preds = %1
  store i32 0, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %146

19:                                               ; preds = %1
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %24

22:                                               ; preds = %19
  %23 = call ptr @mln_conf()
  store ptr %23, ptr %3, align 8, !tbaa !5
  br label %24

24:                                               ; preds = %22, %19
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %47, label %27

27:                                               ; preds = %24
  %28 = load ptr, ptr %3, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.mln_conf_s, ptr %28, i32 0, i32 1
  %30 = load ptr, ptr %29, align 8, !tbaa !11
  %31 = getelementptr inbounds %struct.rbtree_s, ptr %30, i32 0, i32 11
  %32 = load i64, ptr %31, align 8, !tbaa !13
  %33 = icmp ule i64 %32, 1
  br i1 %33, label %34, label %50

34:                                               ; preds = %27
  %35 = load ptr, ptr %3, align 8, !tbaa !5
  %36 = getelementptr inbounds %struct.mln_conf_s, ptr %35, i32 0, i32 1
  %37 = load ptr, ptr %36, align 8, !tbaa !11
  %38 = getelementptr inbounds %struct.rbtree_s, ptr %37, i32 0, i32 6
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  %40 = getelementptr inbounds %struct.mln_rbtree_node_s, ptr %39, i32 0, i32 0
  %41 = load ptr, ptr %40, align 8, !tbaa !18
  %42 = getelementptr inbounds %struct.mln_conf_domain_s, ptr %41, i32 0, i32 4
  %43 = load ptr, ptr %42, align 8, !tbaa !19
  %44 = getelementptr inbounds %struct.rbtree_s, ptr %43, i32 0, i32 11
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = icmp eq i64 %45, 0
  br i1 %46, label %47, label %50

47:                                               ; preds = %34, %24
  %48 = load ptr, ptr @stdout, align 8, !tbaa !5
  %49 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef @.str) #4
  br label %93

50:                                               ; preds = %34, %27
  %51 = load ptr, ptr %3, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.mln_conf_s, ptr %51, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !21
  %54 = load ptr, ptr %3, align 8, !tbaa !5
  %55 = call ptr %53(ptr noundef %54, ptr noundef @.str.1)
  store ptr %55, ptr %6, align 8, !tbaa !5
  %56 = icmp eq ptr %55, null
  br i1 %56, label %57, label %60

57:                                               ; preds = %50
  %58 = load ptr, ptr @stderr, align 8, !tbaa !5
  %59 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %58, ptr noundef @.str.2) #4
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %146

60:                                               ; preds = %50
  %61 = load ptr, ptr %6, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.mln_conf_domain_s, ptr %61, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !22
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = call ptr %63(ptr noundef %64, ptr noundef @.str.3)
  store ptr %65, ptr %7, align 8, !tbaa !5
  %66 = icmp ne ptr %65, null
  br i1 %66, label %67, label %92

67:                                               ; preds = %60
  %68 = load ptr, ptr %7, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.mln_conf_cmd_s, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = load ptr, ptr %7, align 8, !tbaa !5
  %72 = call ptr %70(ptr noundef %71, i32 noundef 1)
  store ptr %72, ptr %8, align 8, !tbaa !5
  %73 = icmp eq ptr %72, null
  br i1 %73, label %74, label %77

74:                                               ; preds = %67
  %75 = load ptr, ptr @stderr, align 8, !tbaa !5
  %76 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %75, ptr noundef @.str.4) #4
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %146

77:                                               ; preds = %67
  %78 = load ptr, ptr %8, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.mln_conf_item_s, ptr %78, i32 0, i32 0
  %80 = load i32, ptr %79, align 8, !tbaa !25
  %81 = icmp ne i32 %80, 3
  br i1 %81, label %82, label %85

82:                                               ; preds = %77
  %83 = load ptr, ptr @stderr, align 8, !tbaa !5
  %84 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %83, ptr noundef @.str.5) #4
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %146

85:                                               ; preds = %77
  %86 = load ptr, ptr %8, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.mln_conf_item_s, ptr %86, i32 0, i32 1
  %88 = load i8, ptr %87, align 8, !tbaa !27
  %89 = icmp ne i8 %88, 0
  br i1 %89, label %90, label %91

90:                                               ; preds = %85
  store i32 1, ptr %4, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %90, %85
  br label %92

92:                                               ; preds = %91, %60
  store i32 1, ptr %5, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %92, %47
  %94 = load i32, ptr %4, align 4, !tbaa !9
  %95 = load ptr, ptr %9, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.mln_log_t, ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 4
  %98 = and i32 %94, 1
  %99 = and i32 %97, -2
  %100 = or i32 %99, %98
  store i32 %100, ptr %96, align 4
  %101 = load i32, ptr %5, align 4, !tbaa !9
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.mln_log_t, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4
  %105 = and i32 %101, 1
  %106 = shl i32 %105, 1
  %107 = and i32 %104, -3
  %108 = or i32 %107, %106
  store i32 %108, ptr %103, align 4
  %109 = load ptr, ptr %9, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.mln_log_t, ptr %109, i32 0, i32 3
  store i32 0, ptr %110, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 0, ptr %11, align 4, !tbaa !9
  %111 = load ptr, ptr %9, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mln_log_t, ptr %111, i32 0, i32 0
  store i64 0, ptr %112, align 8, !tbaa !30
  store i32 0, ptr %11, align 4, !tbaa !9
  br i1 false, label %113, label %118

113:                                              ; preds = %93
  %114 = load ptr, ptr @stderr, align 8, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !9
  %116 = call ptr @strerror(i32 noundef %115) #4
  %117 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %114, ptr noundef @.str.6, ptr noundef @__FUNCTION__.mln_log_init, ptr noundef %116) #4
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %145

118:                                              ; preds = %93
  %119 = call i32 @pthread_atfork(ptr noundef @mln_log_atfork_lock, ptr noundef @mln_log_atfork_unlock, ptr noundef @mln_log_atfork_unlock) #4
  store i32 %119, ptr %11, align 4, !tbaa !9
  %120 = icmp ne i32 %119, 0
  br i1 %120, label %121, label %128

121:                                              ; preds = %118
  %122 = load ptr, ptr @stderr, align 8, !tbaa !5
  %123 = load i32, ptr %11, align 4, !tbaa !9
  %124 = call ptr @strerror(i32 noundef %123) #4
  %125 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %122, ptr noundef @.str.7, ptr noundef @__FUNCTION__.mln_log_init, ptr noundef %124) #4
  %126 = load ptr, ptr %9, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.mln_log_t, ptr %126, i32 0, i32 0
  store i64 0, ptr %127, align 8, !tbaa !30
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %145

128:                                              ; preds = %118
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = load ptr, ptr %3, align 8, !tbaa !5
  %131 = call i32 @mln_log_get_log(ptr noundef %129, ptr noundef %130, i32 noundef 1)
  %132 = icmp slt i32 %131, 0
  br i1 %132, label %133, label %136

133:                                              ; preds = %128
  %134 = load ptr, ptr @stderr, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str.8, ptr noundef @__FUNCTION__.mln_log_init) #4
  call void @mln_log_destroy()
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %145

136:                                              ; preds = %128
  %137 = load ptr, ptr %9, align 8, !tbaa !5
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = call i32 @mln_log_set_level(ptr noundef %137, ptr noundef %138, i32 noundef 1)
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %144

141:                                              ; preds = %136
  %142 = load ptr, ptr @stderr, align 8, !tbaa !5
  %143 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %142, ptr noundef @.str.9, ptr noundef @__FUNCTION__.mln_log_init) #4
  call void @mln_log_destroy()
  store i32 -1, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %145

144:                                              ; preds = %136
  store i32 0, ptr %2, align 4
  store i32 1, ptr %10, align 4
  br label %145

145:                                              ; preds = %144, %141, %133, %121, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %146

146:                                              ; preds = %145, %82, %74, %57, %18
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  %147 = load i32, ptr %2, align 4
  ret i32 %147
}

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

declare ptr @mln_conf() #2

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) #3

; Function Attrs: nounwind
declare i32 @pthread_atfork(ptr noundef, ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare hidden void @mln_log_atfork_lock() #0

; Function Attrs: nounwind uwtable
declare hidden void @mln_log_atfork_unlock() #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @mln_log_destroy() #0

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

; 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 "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, !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 8}
!12 = !{!"mln_conf_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40}
!13 = !{!14, !16, i64 136}
!14 = !{!"rbtree_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !15, i64 40, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !16, i64 136, !10, i64 144}
!15 = !{!"mln_rbtree_node_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !10, i64 48, !10, i64 48}
!16 = !{!"long", !7, i64 0}
!17 = !{!14, !6, i64 96}
!18 = !{!15, !6, i64 0}
!19 = !{!20, !6, i64 32}
!20 = !{!"mln_conf_domain_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!21 = !{!12, !6, i64 16}
!22 = !{!20, !6, i64 0}
!23 = !{!24, !6, i64 8}
!24 = !{!"mln_conf_cmd_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !10, i64 32}
!25 = !{!26, !10, i64 0}
!26 = !{!"mln_conf_item_s", !10, i64 0, !7, i64 8}
!27 = !{!7, !7, i64 0}
!28 = !{!29, !10, i64 16}
!29 = !{!"", !16, i64 0, !10, i64 8, !10, i64 12, !10, i64 12, !10, i64 12, !10, i64 16, !7, i64 20, !7, i64 532, !7, i64 1556}
!30 = !{!29, !16, 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"

@g_log = external dso_local global { i64, i32, i8, i8, i8, i8, i32, [512 x i8], [1024 x i8], [1024 x i8] }, align 8
@stdout = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [64 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [36 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [43 x i8], align 1
@__FUNCTION__.mln_log_init = external hidden unnamed_addr constant [13 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [33 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @mln_log_init(ptr noundef %0) local_unnamed_addr #0 {
  %2 = load i32, ptr getelementptr inbounds (i8, ptr @g_log, i64 12), align 4
  %3 = and i32 %2, 2
  %.not = icmp eq i32 %3, 0
  br i1 %.not, label %4, label %75

4:                                                ; preds = %1
  %5 = icmp eq ptr %0, null
  br i1 %5, label %6, label %.thread

6:                                                ; preds = %4
  %7 = tail call ptr @mln_conf() #4
  %8 = icmp eq ptr %7, null
  br i1 %8, label %23, label %.thread

.thread:                                          ; preds = %4, %6
  %.02541 = phi ptr [ %7, %6 ], [ %0, %4 ]
  %9 = getelementptr inbounds i8, ptr %.02541, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %10, i64 136
  %12 = load i64, ptr %11, align 8, !tbaa !10
  %13 = icmp ult i64 %12, 2
  br i1 %13, label %14, label %26

14:                                               ; preds = %.thread
  %15 = getelementptr inbounds i8, ptr %10, i64 96
  %16 = load ptr, ptr %15, align 8, !tbaa !15
  %17 = load ptr, ptr %16, align 8, !tbaa !16
  %18 = getelementptr inbounds i8, ptr %17, i64 32
  %19 = load ptr, ptr %18, align 8, !tbaa !17
  %20 = getelementptr inbounds i8, ptr %19, i64 136
  %21 = load i64, ptr %20, align 8, !tbaa !10
  %22 = icmp eq i64 %21, 0
  br i1 %22, label %23, label %26

23:                                               ; preds = %14, %6
  %.02540 = phi ptr [ %.02541, %14 ], [ null, %6 ]
  %24 = load ptr, ptr @stdout, align 8, !tbaa !19
  %25 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %24, ptr noundef nonnull @.str) #4
  br label %53

26:                                               ; preds = %14, %.thread
  %27 = getelementptr inbounds i8, ptr %.02541, i64 16
  %28 = load ptr, ptr %27, align 8, !tbaa !20
  %29 = tail call ptr %28(ptr noundef nonnull %.02541, ptr noundef nonnull @.str.1) #4
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %34

31:                                               ; preds = %26
  %32 = load ptr, ptr @stderr, align 8, !tbaa !19
  %33 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %32, ptr noundef nonnull @.str.2) #5
  br label %75

34:                                               ; preds = %26
  %35 = load ptr, ptr %29, align 8, !tbaa !21
  %36 = tail call ptr %35(ptr noundef nonnull %29, ptr noundef nonnull @.str.3) #4
  %.not34 = icmp eq ptr %36, null
  br i1 %.not34, label %53, label %37

37:                                               ; preds = %34
  %38 = getelementptr inbounds i8, ptr %36, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !22
  %40 = tail call ptr %39(ptr noundef nonnull %36, i32 noundef 1) #4
  %41 = icmp eq ptr %40, null
  br i1 %41, label %42, label %45

42:                                               ; preds = %37
  %43 = load ptr, ptr @stderr, align 8, !tbaa !19
  %44 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %43, ptr noundef nonnull @.str.4) #5
  br label %75

45:                                               ; preds = %37
  %46 = load i32, ptr %40, align 8, !tbaa !24
  %.not35 = icmp eq i32 %46, 3
  br i1 %.not35, label %50, label %47

47:                                               ; preds = %45
  %48 = load ptr, ptr @stderr, align 8, !tbaa !19
  %49 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %48, ptr noundef nonnull @.str.5) #5
  br label %75

50:                                               ; preds = %45
  %51 = getelementptr inbounds i8, ptr %40, i64 8
  %52 = load i8, ptr %51, align 8, !tbaa !26
  %.not36 = icmp ne i8 %52, 0
  %spec.select = zext i1 %.not36 to i32
  br label %53

53:                                               ; preds = %50, %34, %23
  %.02539 = phi ptr [ %.02540, %23 ], [ %.02541, %50 ], [ %.02541, %34 ]
  %.028 = phi i32 [ 0, %23 ], [ 2, %50 ], [ 2, %34 ]
  %.127 = phi i32 [ 0, %23 ], [ %spec.select, %50 ], [ 0, %34 ]
  %54 = load i32, ptr getelementptr inbounds (i8, ptr @g_log, i64 12), align 4
  %55 = and i32 %54, -4
  %56 = or disjoint i32 %.127, %.028
  %57 = or disjoint i32 %56, %55
  store i32 %57, ptr getelementptr inbounds (i8, ptr @g_log, i64 12), align 4
  store i32 0, ptr getelementptr inbounds (i8, ptr @g_log, i64 16), align 8, !tbaa !27
  store i64 0, ptr @g_log, align 8, !tbaa !29
  %58 = tail call i32 @pthread_atfork(ptr noundef nonnull @mln_log_atfork_lock, ptr noundef nonnull @mln_log_atfork_unlock, ptr noundef nonnull @mln_log_atfork_unlock) #4
  %.not37 = icmp eq i32 %58, 0
  br i1 %.not37, label %63, label %59

59:                                               ; preds = %53
  %60 = load ptr, ptr @stderr, align 8, !tbaa !19
  %61 = tail call ptr @strerror(i32 noundef %58) #4
  %62 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %60, ptr noundef nonnull @.str.7, ptr noundef nonnull @__FUNCTION__.mln_log_init, ptr noundef %61) #5
  store i64 0, ptr @g_log, align 8, !tbaa !29
  br label %75

63:                                               ; preds = %53
  %64 = tail call i32 @mln_log_get_log(ptr noundef nonnull @g_log, ptr noundef %.02539, i32 noundef 1)
  %65 = icmp slt i32 %64, 0
  br i1 %65, label %66, label %69

66:                                               ; preds = %63
  %67 = load ptr, ptr @stderr, align 8, !tbaa !19
  %68 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %67, ptr noundef nonnull @.str.8, ptr noundef nonnull @__FUNCTION__.mln_log_init) #5
  tail call void @mln_log_destroy()
  br label %75

69:                                               ; preds = %63
  %70 = tail call i32 @mln_log_set_level(ptr noundef nonnull @g_log, ptr noundef %.02539, i32 noundef 1)
  %71 = icmp slt i32 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %69
  %73 = load ptr, ptr @stderr, align 8, !tbaa !19
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %73, ptr noundef nonnull @.str.9, ptr noundef nonnull @__FUNCTION__.mln_log_init) #5
  tail call void @mln_log_destroy()
  br label %75

75:                                               ; preds = %59, %66, %72, %69, %1, %47, %42, %31
  %.1 = phi i32 [ -1, %31 ], [ -1, %42 ], [ -1, %47 ], [ 0, %1 ], [ -1, %59 ], [ -1, %66 ], [ -1, %72 ], [ 0, %69 ]
  ret i32 %.1
}

declare ptr @mln_conf() local_unnamed_addr #1

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare i32 @pthread_atfork(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare hidden void @mln_log_atfork_lock() #0

; Function Attrs: nounwind uwtable
declare hidden void @mln_log_atfork_unlock() #0

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

; Function Attrs: nounwind uwtable
declare dso_local void @mln_log_destroy() local_unnamed_addr #0

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

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 = { 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 = { 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 #4 = { nounwind }
attributes #5 = { cold 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 8}
!6 = !{!"mln_conf_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !14, i64 136}
!11 = !{!"rbtree_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !12, i64 40, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !14, i64 136, !13, i64 144}
!12 = !{!"mln_rbtree_node_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !13, i64 48, !13, i64 48}
!13 = !{!"int", !8, i64 0}
!14 = !{!"long", !8, i64 0}
!15 = !{!11, !7, i64 96}
!16 = !{!12, !7, i64 0}
!17 = !{!18, !7, i64 32}
!18 = !{!"mln_conf_domain_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32}
!19 = !{!7, !7, i64 0}
!20 = !{!6, !7, i64 16}
!21 = !{!18, !7, i64 0}
!22 = !{!23, !7, i64 8}
!23 = !{!"mln_conf_cmd_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !13, i64 32}
!24 = !{!25, !13, i64 0}
!25 = !{!"mln_conf_item_s", !13, i64 0, !8, i64 8}
!26 = !{!8, !8, i64 0}
!27 = !{!28, !13, i64 16}
!28 = !{!"", !14, i64 0, !13, i64 8, !13, i64 12, !13, i64 12, !13, i64 12, !13, i64 16, !8, i64 20, !8, i64 532, !8, i64 1556}
!29 = !{!28, !14, i64 0}


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