; LLVM IR from pmwkaa/monotone :: monotone/engine/engine (write)

; 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.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Log = type { %struct.Buf, %struct.LogWrite, %struct.Iov }
%struct.Buf = type { ptr, ptr, ptr }
%struct.LogWrite = type <{ i32, i64, i8, i32, i32 }>
%struct.Iov = type { %struct.Buf, i32, i32 }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.EventArg = type { i32, i64, ptr, i64, ptr, i64 }
%struct.LogOp = type { ptr, ptr, ptr }
%struct.Ref = type { ptr, %struct.Lockage, %struct.Slice }
%struct.Lockage = type { [2 x %struct.Lock], ptr, ptr }
%struct.Lock = type { i64, i32, i32 }
%struct.Slice = type { i64, i64, %struct.RbtreeNode }
%struct.RbtreeNode = type { ptr, ptr, ptr, i8 }
%struct.Part = type { %struct.Id, i32, i64, i64, i8, ptr, %struct.Memtable, %struct.Memtable, %struct.File, %struct.Index, %struct.Buf, ptr, ptr, ptr, %struct.List }
%struct.Id = type { i64, i64 }
%struct.Memtable = type { ptr, %struct.Rbtree, i32, i32, i32, i64, i64, i64, %struct.List, i32, %struct.Heap }
%struct.Rbtree = type { ptr }
%struct.Heap = type { ptr, ptr, i32, ptr }
%struct.File = type { i32, i64, %struct.Str, %struct.List }
%struct.Str = type { ptr, ptr, i8 }
%struct.Index = type <{ i32, i32, i32, i32, %struct.Id, i32, i32, i64, i64, i64, i64, i32, i64, i64, i64, i32, i64, i8, i8, [4 x i32] }>
%struct.List = type { ptr, ptr }
%struct.Context = type { ptr, ptr, ptr }
%struct.Global = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.Config = type { %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.Var, %struct.List, %struct.List, i32, i32, i32, i32 }
%struct.Var = type { i32, i32, %struct.Str, %struct.List, %struct.List, %union.anon }
%union.anon = type { %struct.Str }
%struct.Engine = type { %struct.Mutex, %struct.CondVar, %struct.Mapping, %struct.Pipeline, %struct.StorageMgr, ptr, ptr, ptr }
%struct.Mutex = type { %union.pthread_mutex_t }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%struct.CondVar = type { %union.pthread_cond_t }
%union.pthread_cond_t = type { %struct.__pthread_cond_s }
%struct.__pthread_cond_s = type { %union.__atomic_wide_counter, %union.__atomic_wide_counter, [2 x i32], [2 x i32], i32, i32, [2 x i32] }
%union.__atomic_wide_counter = type { i64 }
%struct.Mapping = type { %struct.Rbtree, i32 }
%struct.Pipeline = type { %struct.List, i32, ptr }
%struct.StorageMgr = type { %struct.List, i32, ptr }

@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [80 x i8], align 1
@__func__.engine_write = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: hot nounwind uwtable
define dso_local void @engine_write(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca %struct.Log, align 8
  %8 = alloca %struct.Exception, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %7) #11
  call void @log_init(ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 224, ptr %8) #11
  %17 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %18 = getelementptr inbounds %struct.Runtime, ptr %17, i32 0, i32 0
  %19 = getelementptr inbounds %struct.ExceptionMgr, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds %struct.Exception, ptr %8, i32 0, i32 0
  store ptr %20, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds %struct.Exception, ptr %8, i32 0, i32 1
  store i8 0, ptr %22, align 8, !tbaa !18
  %23 = getelementptr inbounds %struct.Exception, ptr %8, i32 0, i32 2
  store ptr null, ptr %23, align 8, !tbaa !19
  %24 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %25 = getelementptr inbounds %struct.Runtime, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.ExceptionMgr, ptr %25, i32 0, i32 0
  store ptr %8, ptr %26, align 8, !tbaa !11
  %27 = getelementptr inbounds %struct.Exception, ptr %8, i32 0, i32 3
  %28 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %27, i64 0, i64 0
  %29 = call i32 @_setjmp(ptr noundef %28) #12
  %30 = icmp eq i32 %29, 0
  %31 = zext i1 %30 to i32
  store i32 %31, ptr %9, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %151

34:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #11
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %35

35:                                               ; preds = %97, %34
  %36 = load i32, ptr %10, align 4, !tbaa !9
  %37 = load i32, ptr %6, align 4, !tbaa !9
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #11
  br label %100

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #11
  %41 = load ptr, ptr %5, align 8, !tbaa !5
  %42 = load i32, ptr %10, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.EventArg, ptr %41, i64 %43
  store ptr %44, ptr %11, align 8, !tbaa !5
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.EventArg, ptr %45, i32 0, i32 3
  %47 = load i64, ptr %46, align 8, !tbaa !20
  %48 = icmp ugt i64 %47, 255
  %49 = xor i1 %48, true
  %50 = xor i1 %49, true
  %51 = zext i1 %50 to i32
  %52 = sext i32 %51 to i64
  %53 = call i64 @llvm.expect.i64(i64 %52, i64 0)
  %54 = icmp ne i64 %53, 0
  br i1 %54, label %55, label %60

55:                                               ; preds = %40
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %57 = getelementptr inbounds %struct.Runtime, ptr %56, i32 0, i32 1
  %58 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %59 = getelementptr inbounds %struct.Runtime, ptr %58, i32 0, i32 0
  call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef %57, ptr noundef %59, ptr noundef @.str, ptr noundef @__func__.engine_write, i32 noundef 87, ptr noundef @.str.1) #13
  unreachable

60:                                               ; preds = %40
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.EventArg, ptr %61, i32 0, i32 1
  %63 = load i64, ptr %62, align 8, !tbaa !23
  %64 = icmp eq i64 %63, -1
  br i1 %64, label %65, label %71

65:                                               ; preds = %60
  %66 = call zeroext i1 @config_serial()
  br i1 %66, label %67, label %71

67:                                               ; preds = %65
  %68 = call i64 @config_ssn_next()
  %69 = load ptr, ptr %11, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.EventArg, ptr %69, i32 0, i32 1
  store i64 %68, ptr %70, align 8, !tbaa !23
  br label %71

71:                                               ; preds = %67, %65, %60
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #11
  %72 = call ptr @log_add(ptr noundef %7) #14
  store ptr %72, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #11
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.EventArg, ptr %74, i32 0, i32 1
  %76 = load i64, ptr %75, align 8, !tbaa !23
  %77 = call ptr @engine_lock(ptr noundef %73, i64 noundef %76, i32 noundef 1, i1 noundef zeroext false, i1 noundef zeroext true)
  store ptr %77, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.LogOp, ptr %79, i32 0, i32 2
  store ptr %78, ptr %80, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #11
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.Ref, ptr %81, i32 0, i32 0
  %83 = load ptr, ptr %82, align 8, !tbaa !26
  %84 = getelementptr inbounds %struct.Part, ptr %83, i32 0, i32 5
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  store ptr %85, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #11
  %86 = load ptr, ptr %14, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.Memtable, ptr %86, i32 0, i32 10
  %88 = load ptr, ptr %11, align 8, !tbaa !5
  %89 = call ptr @event_allocate(ptr noundef %87, ptr noundef %88)
  store ptr %89, ptr %15, align 8, !tbaa !5
  %90 = load ptr, ptr %12, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  call void @log_add_event(ptr noundef %7, ptr noundef %90, ptr noundef %91) #14
  %92 = load ptr, ptr %14, align 8, !tbaa !5
  %93 = load ptr, ptr %15, align 8, !tbaa !5
  %94 = call ptr @memtable_set(ptr noundef %92, ptr noundef %93)
  %95 = load ptr, ptr %12, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.LogOp, ptr %95, i32 0, i32 1
  store ptr %94, ptr %96, align 8, !tbaa !42
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #11
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #11
  br label %97

97:                                               ; preds = %71
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = add nsw i32 %98, 1
  store i32 %99, ptr %10, align 4, !tbaa !9
  br label %35, !llvm.loop !43

100:                                              ; preds = %39
  %101 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %102 = getelementptr inbounds %struct.Runtime, ptr %101, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !45
  %104 = getelementptr inbounds %struct.Context, ptr %103, i32 0, i32 2
  %105 = load ptr, ptr %104, align 8, !tbaa !46
  %106 = getelementptr inbounds %struct.Global, ptr %105, i32 0, i32 0
  %107 = load ptr, ptr %106, align 8, !tbaa !48
  %108 = getelementptr inbounds %struct.Config, ptr %107, i32 0, i32 13
  %109 = call i64 @var_int_of(ptr noundef %108)
  %110 = icmp ne i64 %109, 0
  br i1 %110, label %111, label %146

111:                                              ; preds = %100
  %112 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %113 = getelementptr inbounds %struct.Runtime, ptr %112, i32 0, i32 2
  %114 = load ptr, ptr %113, align 8, !tbaa !45
  %115 = getelementptr inbounds %struct.Context, ptr %114, i32 0, i32 2
  %116 = load ptr, ptr %115, align 8, !tbaa !46
  %117 = getelementptr inbounds %struct.Global, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !48
  %119 = getelementptr inbounds %struct.Config, ptr %118, i32 0, i32 34
  %120 = call i64 @var_int_of(ptr noundef %119)
  %121 = icmp ne i64 %120, 0
  %122 = xor i1 %121, true
  %123 = xor i1 %122, true
  %124 = zext i1 %123 to i32
  %125 = sext i32 %124 to i64
  %126 = call i64 @llvm.expect.i64(i64 %125, i64 0)
  %127 = icmp ne i64 %126, 0
  br i1 %127, label %128, label %133

128:                                              ; preds = %111
  %129 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %130 = getelementptr inbounds %struct.Runtime, ptr %129, i32 0, i32 1
  %131 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %132 = getelementptr inbounds %struct.Runtime, ptr %131, i32 0, i32 0
  call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef %130, ptr noundef %132, ptr noundef @.str, ptr noundef @__func__.engine_write, i32 noundef 113, ptr noundef @.str.2, ptr noundef @.str.3) #13
  unreachable

133:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #11
  %134 = load ptr, ptr %4, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.Engine, ptr %134, i32 0, i32 5
  %136 = load ptr, ptr %135, align 8, !tbaa !50
  %137 = call zeroext i1 @wal_write(ptr noundef %136, ptr noundef %7)
  %138 = zext i1 %137 to i8
  store i8 %138, ptr %16, align 1, !tbaa !57
  %139 = load i8, ptr %16, align 1, !tbaa !57, !range !58, !noundef !59
  %140 = trunc i8 %139 to i1
  br i1 %140, label %141, label %145

141:                                              ; preds = %133
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.Engine, ptr %142, i32 0, i32 6
  %144 = load ptr, ptr %143, align 8, !tbaa !60
  call void @service_rotate(ptr noundef %144)
  br label %145

145:                                              ; preds = %141, %133
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #11
  br label %150

146:                                              ; preds = %100
  %147 = call i64 @config_lsn_next()
  %148 = getelementptr inbounds %struct.Log, ptr %7, i32 0, i32 1
  %149 = getelementptr inbounds %struct.LogWrite, ptr %148, i32 0, i32 1
  store i64 %147, ptr %149, align 4, !tbaa !61
  br label %150

150:                                              ; preds = %146, %145
  br label %151

151:                                              ; preds = %150, %3
  %152 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %153 = getelementptr inbounds %struct.Runtime, ptr %152, i32 0, i32 0
  %154 = call zeroext i1 @exception_mgr_leave(ptr noundef %153, ptr noundef %8)
  br i1 %154, label %155, label %159

155:                                              ; preds = %151
  %156 = load ptr, ptr %4, align 8, !tbaa !5
  call void @engine_rollback(ptr noundef %156, ptr noundef %7)
  call void @log_free(ptr noundef %7)
  %157 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %158 = getelementptr inbounds %struct.Runtime, ptr %157, i32 0, i32 0
  call void @exception_mgr_throw(ptr noundef %158) #13
  unreachable

159:                                              ; preds = %151
  %160 = load ptr, ptr %4, align 8, !tbaa !5
  call void @engine_commit(ptr noundef %160, ptr noundef %7) #14
  call void @log_free(ptr noundef %7)
  call void @llvm.lifetime.end.p0(i64 224, ptr %8) #11
  call void @llvm.lifetime.end.p0(i64 80, ptr %7) #11
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @log_init(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #4

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #5

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @error_throw_as(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @config_serial() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_ssn_next() #2

; Function Attrs: hot inlinehint nounwind uwtable
declare hidden ptr @log_add(ptr noundef) #7

declare ptr @engine_lock(ptr noundef, i64 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #8

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

; Function Attrs: hot inlinehint nounwind uwtable
declare hidden void @log_add_event(ptr noundef, ptr noundef, ptr noundef) #7

declare ptr @memtable_set(ptr noundef, ptr noundef) #8

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @var_int_of(ptr noundef) #2

declare zeroext i1 @wal_write(ptr noundef, ptr noundef) #8

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @service_rotate(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_lsn_next() #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) #9

; Function Attrs: nounwind uwtable
declare hidden void @engine_rollback(ptr noundef, ptr noundef) #10

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @log_free(ptr noundef) #2

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) #6

; Function Attrs: hot nounwind uwtable
declare hidden void @engine_commit(ptr noundef, ptr noundef) #0

attributes #0 = { hot 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 = { 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 #3 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind returns_twice "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 nosync nounwind willreturn memory(none) }
attributes #6 = { inlinehint noreturn 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 = { hot 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 #8 = { "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 #9 = { alwaysinline 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 #10 = { 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 #11 = { nounwind }
attributes #12 = { nounwind returns_twice }
attributes #13 = { noreturn }
attributes #14 = { hot }

!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 0}
!12 = !{!"Runtime", !13, i64 0, !14, i64 8, !6, i64 312}
!13 = !{!"ExceptionMgr", !6, i64 0}
!14 = !{!"Error", !7, i64 0, !10, i64 256, !6, i64 264, !6, i64 272, !10, i64 280, !6, i64 288, !6, i64 296}
!15 = !{!16, !6, i64 0}
!16 = !{!"Exception", !6, i64 0, !17, i64 8, !6, i64 16, !7, i64 24}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!16, !17, i64 8}
!19 = !{!16, !6, i64 16}
!20 = !{!21, !22, i64 24}
!21 = !{!"EventArg", !10, i64 0, !22, i64 8, !6, i64 16, !22, i64 24, !6, i64 32, !22, i64 40}
!22 = !{!"long", !7, i64 0}
!23 = !{!21, !22, i64 8}
!24 = !{!25, !6, i64 16}
!25 = !{!"LogOp", !6, i64 0, !6, i64 8, !6, i64 16}
!26 = !{!27, !6, i64 0}
!27 = !{!"Ref", !6, i64 0, !28, i64 8, !29, i64 56}
!28 = !{!"Lockage", !7, i64 0, !6, i64 32, !6, i64 40}
!29 = !{!"Slice", !22, i64 0, !22, i64 8, !30, i64 16}
!30 = !{!"RbtreeNode", !6, i64 0, !6, i64 8, !6, i64 16, !7, i64 24}
!31 = !{!32, !6, i64 48}
!32 = !{!"Part", !33, i64 0, !10, i64 16, !22, i64 24, !22, i64 32, !17, i64 40, !6, i64 48, !34, i64 56, !34, i64 168, !38, i64 280, !40, i64 336, !41, i64 472, !6, i64 496, !6, i64 504, !6, i64 512, !36, i64 520}
!33 = !{!"Id", !22, i64 0, !22, i64 8}
!34 = !{!"Memtable", !6, i64 0, !35, i64 8, !10, i64 16, !10, i64 20, !10, i64 24, !22, i64 32, !22, i64 40, !22, i64 48, !36, i64 56, !10, i64 72, !37, i64 80}
!35 = !{!"Rbtree", !6, i64 0}
!36 = !{!"List", !6, i64 0, !6, i64 8}
!37 = !{!"Heap", !6, i64 0, !6, i64 8, !10, i64 16, !6, i64 24}
!38 = !{!"File", !10, i64 0, !22, i64 8, !39, i64 16, !36, i64 40}
!39 = !{!"Str", !6, i64 0, !6, i64 8, !17, i64 16}
!40 = !{!"Index", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !33, i64 16, !10, i64 32, !10, i64 36, !22, i64 40, !22, i64 48, !22, i64 56, !22, i64 64, !10, i64 72, !22, i64 76, !22, i64 84, !22, i64 92, !10, i64 100, !22, i64 104, !7, i64 112, !7, i64 113, !7, i64 114}
!41 = !{!"Buf", !6, i64 0, !6, i64 8, !6, i64 16}
!42 = !{!25, !6, i64 8}
!43 = distinct !{!43, !44}
!44 = !{!"llvm.loop.mustprogress"}
!45 = !{!12, !6, i64 312}
!46 = !{!47, !6, i64 16}
!47 = !{!"Context", !6, i64 0, !6, i64 8, !6, i64 16}
!48 = !{!49, !6, i64 0}
!49 = !{!"Global", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!50 = !{!51, !6, i64 168}
!51 = !{!"Engine", !52, i64 0, !53, i64 40, !54, i64 88, !55, i64 104, !56, i64 136, !6, i64 168, !6, i64 176, !6, i64 184}
!52 = !{!"Mutex", !7, i64 0}
!53 = !{!"CondVar", !7, i64 0}
!54 = !{!"Mapping", !35, i64 0, !10, i64 8}
!55 = !{!"Pipeline", !36, i64 0, !10, i64 16, !6, i64 24}
!56 = !{!"StorageMgr", !36, i64 0, !10, i64 16, !6, i64 24}
!57 = !{!17, !17, i64 0}
!58 = !{i8 0, i8 2}
!59 = !{}
!60 = !{!51, !6, i64 176}
!61 = !{!62, !22, i64 28}
!62 = !{!"Log", !41, i64 0, !63, i64 24, !64, i64 48}
!63 = !{!"LogWrite", !10, i64 0, !22, i64 4, !7, i64 12, !10, i64 13, !10, i64 17}
!64 = !{!"Iov", !41, i64 0, !10, i64 24, !10, i64 28}


; 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.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Log = type { %struct.Buf, %struct.LogWrite, %struct.Iov }
%struct.Buf = type { ptr, ptr, ptr }
%struct.LogWrite = type <{ i32, i64, i8, i32, i32 }>
%struct.Iov = type { %struct.Buf, i32, i32 }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.EventArg = type { i32, i64, ptr, i64, ptr, i64 }

@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [80 x i8], align 1
@__func__.engine_write = external hidden unnamed_addr constant [13 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

; Function Attrs: hot nounwind uwtable
define dso_local void @engine_write(ptr noundef %0, ptr noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct.Log, align 8
  %5 = alloca %struct.Exception, align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %4) #10
  call void @log_init(ptr noundef nonnull %4)
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %5) #10
  %6 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %7 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %7, ptr %5, align 8, !tbaa !13
  %8 = getelementptr inbounds i8, ptr %5, i64 8
  store i8 0, ptr %8, align 8, !tbaa !16
  %9 = getelementptr inbounds i8, ptr %5, i64 16
  store ptr null, ptr %9, align 8, !tbaa !17
  store ptr %5, ptr %6, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %5, i64 24
  %11 = call i32 @_setjmp(ptr noundef nonnull %10) #11
  %12 = icmp eq i32 %11, 0
  br i1 %12, label %.preheader, label %66

.preheader:                                       ; preds = %3
  %13 = icmp sgt i32 %2, 0
  br i1 %13, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.lr.ph

._crit_edge:                                      ; preds = %35, %.preheader
  %14 = getelementptr inbounds i8, ptr %6, i64 312
  %15 = load ptr, ptr %14, align 8, !tbaa !18
  %16 = getelementptr inbounds i8, ptr %15, i64 16
  %17 = load ptr, ptr %16, align 8, !tbaa !19
  %18 = load ptr, ptr %17, align 8, !tbaa !21
  %19 = getelementptr inbounds i8, ptr %18, i64 1144
  %20 = call i64 @var_int_of(ptr noundef nonnull %19)
  %.not = icmp eq i64 %20, 0
  br i1 %.not, label %63, label %47

.lr.ph:                                           ; preds = %.lr.ph.preheader, %35
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %35 ]
  %21 = getelementptr inbounds %struct.EventArg, ptr %1, i64 %indvars.iv
  %22 = getelementptr inbounds i8, ptr %21, i64 24
  %23 = load i64, ptr %22, align 8, !tbaa !23
  %24 = icmp ugt i64 %23, 255
  br i1 %24, label %25, label %27, !prof !26

25:                                               ; preds = %.lr.ph
  %26 = getelementptr inbounds i8, ptr %6, i64 8
  call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef nonnull %26, ptr noundef nonnull %6, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.engine_write, i32 noundef 87, ptr noundef nonnull @.str.1) #12
  unreachable

27:                                               ; preds = %.lr.ph
  %28 = getelementptr inbounds i8, ptr %21, i64 8
  %29 = load i64, ptr %28, align 8, !tbaa !27
  %30 = icmp eq i64 %29, -1
  br i1 %30, label %31, label %35

31:                                               ; preds = %27
  %32 = call zeroext i1 @config_serial()
  br i1 %32, label %33, label %35

33:                                               ; preds = %31
  %34 = call i64 @config_ssn_next()
  store i64 %34, ptr %28, align 8, !tbaa !27
  br label %35

35:                                               ; preds = %33, %31, %27
  %36 = call ptr @log_add(ptr noundef nonnull %4) #13
  %37 = load i64, ptr %28, align 8, !tbaa !27
  %38 = call ptr @engine_lock(ptr noundef %0, i64 noundef %37, i32 noundef 1, i1 noundef zeroext false, i1 noundef zeroext true) #10
  %39 = getelementptr inbounds i8, ptr %36, i64 16
  store ptr %38, ptr %39, align 8, !tbaa !28
  %40 = load ptr, ptr %38, align 8, !tbaa !30
  %41 = getelementptr inbounds i8, ptr %40, i64 48
  %42 = load ptr, ptr %41, align 8, !tbaa !35
  %43 = getelementptr inbounds i8, ptr %42, i64 80
  %44 = call ptr @event_allocate(ptr noundef nonnull %43, ptr noundef nonnull %21)
  call void @log_add_event(ptr noundef nonnull %4, ptr noundef %36, ptr noundef %44) #13
  %45 = call ptr @memtable_set(ptr noundef %42, ptr noundef %44) #10
  %46 = getelementptr inbounds i8, ptr %36, i64 8
  store ptr %45, ptr %46, align 8, !tbaa !46
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !47

47:                                               ; preds = %._crit_edge
  %48 = load ptr, ptr %14, align 8, !tbaa !18
  %49 = getelementptr inbounds i8, ptr %48, i64 16
  %50 = load ptr, ptr %49, align 8, !tbaa !19
  %51 = load ptr, ptr %50, align 8, !tbaa !21
  %52 = getelementptr inbounds i8, ptr %51, i64 2992
  %53 = call i64 @var_int_of(ptr noundef nonnull %52)
  %.not25 = icmp eq i64 %53, 0
  br i1 %.not25, label %56, label %54, !prof !49

54:                                               ; preds = %47
  %55 = getelementptr inbounds i8, ptr %6, i64 8
  call void (ptr, ptr, ptr, ptr, i32, ptr, ...) @error_throw_as(ptr noundef nonnull %55, ptr noundef nonnull %6, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.engine_write, i32 noundef 113, ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3) #12
  unreachable

56:                                               ; preds = %47
  %57 = getelementptr inbounds i8, ptr %0, i64 168
  %58 = load ptr, ptr %57, align 8, !tbaa !50
  %59 = call zeroext i1 @wal_write(ptr noundef %58, ptr noundef nonnull %4) #10
  br i1 %59, label %60, label %66

60:                                               ; preds = %56
  %61 = getelementptr inbounds i8, ptr %0, i64 176
  %62 = load ptr, ptr %61, align 8, !tbaa !57
  call void @service_rotate(ptr noundef %62)
  br label %66

63:                                               ; preds = %._crit_edge
  %64 = call i64 @config_lsn_next()
  %65 = getelementptr inbounds i8, ptr %4, i64 28
  store i64 %64, ptr %65, align 4, !tbaa !58
  br label %66

66:                                               ; preds = %56, %60, %63, %3
  %67 = call zeroext i1 @exception_mgr_leave(ptr noundef nonnull %6, ptr noundef nonnull %5)
  br i1 %67, label %68, label %69

68:                                               ; preds = %66
  call void @engine_rollback(ptr noundef %0, ptr noundef nonnull %4)
  call void @log_free(ptr noundef nonnull %4)
  call void @exception_mgr_throw(ptr noundef nonnull %6) #12
  unreachable

69:                                               ; preds = %66
  call void @engine_commit(ptr noundef %0, ptr noundef nonnull %4) #13
  call void @log_free(ptr noundef nonnull %4)
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %5) #10
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %4) #10
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @log_init(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #3

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @error_throw_as(ptr noundef, ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @config_serial() local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_ssn_next() local_unnamed_addr #2

; Function Attrs: hot inlinehint nounwind uwtable
declare hidden ptr @log_add(ptr noundef) local_unnamed_addr #6

declare ptr @engine_lock(ptr noundef, i64 noundef, i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @event_allocate(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: hot inlinehint nounwind uwtable
declare hidden void @log_add_event(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #6

declare ptr @memtable_set(ptr noundef, ptr noundef) local_unnamed_addr #7

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @var_int_of(ptr noundef) local_unnamed_addr #2

declare zeroext i1 @wal_write(ptr noundef, ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @service_rotate(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @config_lsn_next() local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) local_unnamed_addr #8

; Function Attrs: nounwind uwtable
declare hidden void @engine_rollback(ptr noundef, ptr noundef) local_unnamed_addr #9

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @log_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) local_unnamed_addr #5

; Function Attrs: hot nounwind uwtable
declare hidden void @engine_commit(ptr noundef, ptr noundef) local_unnamed_addr #0

attributes #0 = { hot 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 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { nounwind returns_twice "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 = { inlinehint noreturn 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 #6 = { hot 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 = { "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 = { alwaysinline 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { nounwind returns_twice }
attributes #12 = { noreturn }
attributes #13 = { hot }

!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, !8, i64 0}
!6 = !{!"Runtime", !7, i64 0, !11, i64 8, !8, i64 312}
!7 = !{!"ExceptionMgr", !8, i64 0}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"Error", !9, i64 0, !12, i64 256, !8, i64 264, !8, i64 272, !12, i64 280, !8, i64 288, !8, i64 296}
!12 = !{!"int", !9, i64 0}
!13 = !{!14, !8, i64 0}
!14 = !{!"Exception", !8, i64 0, !15, i64 8, !8, i64 16, !9, i64 24}
!15 = !{!"_Bool", !9, i64 0}
!16 = !{!14, !15, i64 8}
!17 = !{!14, !8, i64 16}
!18 = !{!6, !8, i64 312}
!19 = !{!20, !8, i64 16}
!20 = !{!"Context", !8, i64 0, !8, i64 8, !8, i64 16}
!21 = !{!22, !8, i64 0}
!22 = !{!"Global", !8, i64 0, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !8, i64 40, !8, i64 48}
!23 = !{!24, !25, i64 24}
!24 = !{!"EventArg", !12, i64 0, !25, i64 8, !8, i64 16, !25, i64 24, !8, i64 32, !25, i64 40}
!25 = !{!"long", !9, i64 0}
!26 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!27 = !{!24, !25, i64 8}
!28 = !{!29, !8, i64 16}
!29 = !{!"LogOp", !8, i64 0, !8, i64 8, !8, i64 16}
!30 = !{!31, !8, i64 0}
!31 = !{!"Ref", !8, i64 0, !32, i64 8, !33, i64 56}
!32 = !{!"Lockage", !9, i64 0, !8, i64 32, !8, i64 40}
!33 = !{!"Slice", !25, i64 0, !25, i64 8, !34, i64 16}
!34 = !{!"RbtreeNode", !8, i64 0, !8, i64 8, !8, i64 16, !9, i64 24}
!35 = !{!36, !8, i64 48}
!36 = !{!"Part", !37, i64 0, !12, i64 16, !25, i64 24, !25, i64 32, !15, i64 40, !8, i64 48, !38, i64 56, !38, i64 168, !42, i64 280, !44, i64 336, !45, i64 472, !8, i64 496, !8, i64 504, !8, i64 512, !40, i64 520}
!37 = !{!"Id", !25, i64 0, !25, i64 8}
!38 = !{!"Memtable", !8, i64 0, !39, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !25, i64 32, !25, i64 40, !25, i64 48, !40, i64 56, !12, i64 72, !41, i64 80}
!39 = !{!"Rbtree", !8, i64 0}
!40 = !{!"List", !8, i64 0, !8, i64 8}
!41 = !{!"Heap", !8, i64 0, !8, i64 8, !12, i64 16, !8, i64 24}
!42 = !{!"File", !12, i64 0, !25, i64 8, !43, i64 16, !40, i64 40}
!43 = !{!"Str", !8, i64 0, !8, i64 8, !15, i64 16}
!44 = !{!"Index", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !37, i64 16, !12, i64 32, !12, i64 36, !25, i64 40, !25, i64 48, !25, i64 56, !25, i64 64, !12, i64 72, !25, i64 76, !25, i64 84, !25, i64 92, !12, i64 100, !25, i64 104, !9, i64 112, !9, i64 113, !9, i64 114}
!45 = !{!"Buf", !8, i64 0, !8, i64 8, !8, i64 16}
!46 = !{!29, !8, i64 8}
!47 = distinct !{!47, !48}
!48 = !{!"llvm.loop.mustprogress"}
!49 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!50 = !{!51, !8, i64 168}
!51 = !{!"Engine", !52, i64 0, !53, i64 40, !54, i64 88, !55, i64 104, !56, i64 136, !8, i64 168, !8, i64 176, !8, i64 184}
!52 = !{!"Mutex", !9, i64 0}
!53 = !{!"CondVar", !9, i64 0}
!54 = !{!"Mapping", !39, i64 0, !12, i64 8}
!55 = !{!"Pipeline", !40, i64 0, !12, i64 16, !8, i64 24}
!56 = !{!"StorageMgr", !40, i64 0, !12, i64 16, !8, i64 24}
!57 = !{!51, !8, i64 176}
!58 = !{!59, !25, i64 28}
!59 = !{!"Log", !45, i64 0, !60, i64 24, !61, i64 48}
!60 = !{!"LogWrite", !12, i64 0, !25, i64 4, !9, i64 12, !12, i64 13, !12, i64 17}
!61 = !{!"Iov", !45, i64 0, !12, i64 24, !12, i64 28}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,SROAPass,SimplifyCFGPass