; LLVM IR from theolundqvist/parallax-voxel-ray-marcher :: src/core/LogView.ll (ZN3Log4View6RenderEv)

; 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.ImVec4 = type { float, float, float, float }
%struct.ImGuiTextFilter = type <{ [256 x i8], %struct.ImVector, i32, [4 x i8] }>
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }
%struct.ImGuiStyle = type { float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, i32, float, float, float, float, %struct.ImVec2, float, float, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, float, float, float, float, float, float, float, float, float, i32, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, %struct.ImVec2, float, i8, i8, i8, float, float, [53 x %struct.ImVec4] }

@_ZN3Log4View7mBufferE = external dso_local global [64 x [512 x i8]], align 16
@_ZN3Log4View4mLenE = external dso_local global [64 x i32], align 16
@_ZN3Log4View5mTypeE = external dso_local global [64 x i32], align 16
@_ZN3Log4View10mBufferPtrE = external dso_local global i32, align 4
@_ZN3Log4View11mAutoScrollE = external dso_local global i8, align 1
@_ZN3Log4View15mScrollToBottomE = external dso_local global i8, align 1
@_ZL16logViewTypeColor = external hidden global [9 x %struct.ImVec4], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@_ZZN3Log4View6RenderEvE6filter = external hidden global %struct.ImGuiTextFilter, align 8
@_ZGVZN3Log4View6RenderEvE6filter = external hidden global i64, align 8
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@__dso_handle = external hidden global i8
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Log4View6RenderEv() #1 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i8, align 1
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca float, align 4
  %7 = alloca %struct.ImVec2, align 4
  %8 = alloca %struct.ImVec2, align 4
  %9 = alloca %struct.ImVec2, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 1, ptr %1) #4
  %12 = call noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef @.str, ptr noundef null, i32 noundef 0)
  %13 = zext i1 %12 to i8
  store i8 %13, ptr %1, align 1, !tbaa !5
  %14 = load i8, ptr %1, align 1, !tbaa !5, !range !9, !noundef !10
  %15 = trunc i8 %14 to i1
  br i1 %15, label %17, label %16

16:                                               ; preds = %0
  call void @_ZN5ImGui3EndEv()
  store i32 1, ptr %2, align 4
  br label %122

17:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #4
  %18 = call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef @.str.1)
  %19 = zext i1 %18 to i8
  store i8 %19, ptr %3, align 1, !tbaa !5
  call void @_ZN5ImGui8SameLineEff(float noundef 0.000000e+00, float noundef -1.000000e+00)
  %20 = load i8, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5, !range !9, !noundef !10
  %21 = trunc i8 %20 to i1
  br i1 %21, label %24, label %22

22:                                               ; preds = %17
  %23 = call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef @.str.2)
  br label %24

24:                                               ; preds = %22, %17
  %25 = phi i1 [ true, %17 ], [ %23, %22 ]
  %26 = zext i1 %25 to i8
  store i8 %26, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5
  call void @_ZN5ImGui8SameLineEff(float noundef 0.000000e+00, float noundef -1.000000e+00)
  %27 = call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef @.str.3)
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  call void @_ZN3Log4View8ClearLogEv()
  br label %29

29:                                               ; preds = %28, %24
  call void @_ZN5ImGui9SeparatorEv()
  %30 = call noundef zeroext i1 @_ZN5ImGui10BeginPopupEPKci(ptr noundef @.str.4, i32 noundef 0)
  br i1 %30, label %31, label %33

31:                                               ; preds = %29
  %32 = call noundef zeroext i1 @_ZN5ImGui8CheckboxEPKcPb(ptr noundef @.str.5, ptr noundef @_ZN3Log4View11mAutoScrollE)
  call void @_ZN5ImGui8EndPopupEv()
  br label %33

33:                                               ; preds = %31, %29
  %34 = load atomic i8, ptr @_ZGVZN3Log4View6RenderEvE6filter acquire, align 8
  %35 = icmp eq i8 %34, 0
  br i1 %35, label %36, label %42, !prof !11

36:                                               ; preds = %33
  %37 = call i32 @__cxa_guard_acquire(ptr @_ZGVZN3Log4View6RenderEvE6filter) #4
  %38 = icmp ne i32 %37, 0
  br i1 %38, label %39, label %42

39:                                               ; preds = %36
  invoke void @_ZN15ImGuiTextFilterC1EPKc(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef @.str.6)
          to label %40 unwind label %57

40:                                               ; preds = %39
  %41 = call i32 @__cxa_atexit(ptr @_ZN15ImGuiTextFilterD2Ev, ptr @_ZZN3Log4View6RenderEvE6filter, ptr @__dso_handle) #4
  call void @__cxa_guard_release(ptr @_ZGVZN3Log4View6RenderEvE6filter) #4
  br label %42

42:                                               ; preds = %40, %36, %33
  %43 = call noundef zeroext i1 @_ZN15ImGuiTextFilter4DrawEPKcf(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef @.str.7, float noundef 1.800000e+02)
  call void @_ZN5ImGui9SeparatorEv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  %44 = call noundef nonnull align 4 dereferenceable(1048) ptr @_ZN5ImGui8GetStyleEv()
  %45 = getelementptr inbounds %struct.ImGuiStyle, ptr %44, i32 0, i32 15
  %46 = getelementptr inbounds %struct.ImVec2, ptr %45, i32 0, i32 1
  %47 = load float, ptr %46, align 4, !tbaa !12
  %48 = call noundef float @_ZN5ImGui25GetFrameHeightWithSpacingEv()
  %49 = fadd float %47, %48
  store float %49, ptr %6, align 4, !tbaa !17
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  %50 = load float, ptr %6, align 4, !tbaa !17
  %51 = fneg float %50
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %7, float noundef 0.000000e+00, float noundef %51)
  %52 = call noundef zeroext i1 @_ZN5ImGui10BeginChildEPKcRK6ImVec2bi(ptr noundef @.str.8, ptr noundef nonnull align 4 dereferenceable(8) %7, i1 noundef zeroext false, i32 noundef 2048)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  %53 = call noundef zeroext i1 @_ZN5ImGui23BeginPopupContextWindowEPKci(ptr noundef null, i32 noundef 1)
  br i1 %53, label %54, label %62

54:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %8, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %55 = call noundef zeroext i1 @_ZN5ImGui10SelectableEPKcbiRK6ImVec2(ptr noundef @.str.3, i1 noundef zeroext false, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(8) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  br i1 %55, label %56, label %61

56:                                               ; preds = %54
  call void @_ZN3Log4View8ClearLogEv()
  br label %61

57:                                               ; preds = %39
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %4, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %5, align 4
  call void @__cxa_guard_abort(ptr @_ZGVZN3Log4View6RenderEvE6filter) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %1) #4
  br label %125

61:                                               ; preds = %56, %54
  call void @_ZN5ImGui8EndPopupEv()
  br label %62

62:                                               ; preds = %61, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef 4.000000e+00, float noundef 1.000000e+00)
  call void @_ZN5ImGui12PushStyleVarEiRK6ImVec2(i32 noundef 14, ptr noundef nonnull align 4 dereferenceable(8) %9)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  %63 = load i8, ptr %3, align 1, !tbaa !5, !range !9, !noundef !10
  %64 = trunc i8 %63 to i1
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  call void @_ZN5ImGui14LogToClipboardEi(i32 noundef -1)
  br label %66

66:                                               ; preds = %65, %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !18
  br label %67

67:                                               ; preds = %103, %66
  %68 = load i32, ptr %10, align 4, !tbaa !18
  %69 = icmp slt i32 %68, 64
  br i1 %69, label %71, label %70

70:                                               ; preds = %67
  store i32 2, ptr %2, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %106

71:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %72 = load i32, ptr @_ZN3Log4View10mBufferPtrE, align 4, !tbaa !18
  %73 = load i32, ptr %10, align 4, !tbaa !18
  %74 = add nsw i32 %72, %73
  %75 = add nsw i32 64, %74
  %76 = srem i32 %75, 64
  store i32 %76, ptr %11, align 4, !tbaa !18
  %77 = load i32, ptr %11, align 4, !tbaa !18
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [64 x i32], ptr @_ZN3Log4View4mLenE, i64 0, i64 %78
  %80 = load i32, ptr %79, align 4, !tbaa !18
  %81 = icmp eq i32 %80, 0
  br i1 %81, label %88, label %82

82:                                               ; preds = %71
  %83 = load i32, ptr %11, align 4, !tbaa !18
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [64 x [512 x i8]], ptr @_ZN3Log4View7mBufferE, i64 0, i64 %84
  %86 = getelementptr inbounds [512 x i8], ptr %85, i64 0, i64 0
  %87 = call noundef zeroext i1 @_ZNK15ImGuiTextFilter10PassFilterEPKcS1_(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef %86, ptr noundef null)
  br i1 %87, label %89, label %88

88:                                               ; preds = %82, %71
  store i32 4, ptr %2, align 4
  br label %100

89:                                               ; preds = %82
  %90 = load i32, ptr %11, align 4, !tbaa !18
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [64 x i32], ptr @_ZN3Log4View5mTypeE, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !19
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds [9 x %struct.ImVec4], ptr @_ZL16logViewTypeColor, i64 0, i64 %94
  call void @_ZN5ImGui14PushStyleColorEiRK6ImVec4(i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(16) %95)
  %96 = load i32, ptr %11, align 4, !tbaa !18
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [64 x [512 x i8]], ptr @_ZN3Log4View7mBufferE, i64 0, i64 %97
  %99 = getelementptr inbounds [512 x i8], ptr %98, i64 0, i64 0
  call void (ptr, ...) @_ZN5ImGui11TextWrappedEPKcz(ptr noundef @.str.9, ptr noundef %99)
  call void @_ZN5ImGui13PopStyleColorEi(i32 noundef 1)
  store i32 0, ptr %2, align 4
  br label %100

100:                                              ; preds = %89, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  %101 = load i32, ptr %2, align 4
  switch i32 %101, label %130 [
    i32 0, label %102
    i32 4, label %103
  ]

102:                                              ; preds = %100
  br label %103

103:                                              ; preds = %102, %100
  %104 = load i32, ptr %10, align 4, !tbaa !18
  %105 = add nsw i32 %104, 1
  store i32 %105, ptr %10, align 4, !tbaa !18
  br label %67, !llvm.loop !21

106:                                              ; preds = %70
  %107 = load i8, ptr %3, align 1, !tbaa !5, !range !9, !noundef !10
  %108 = trunc i8 %107 to i1
  br i1 %108, label %109, label %110

109:                                              ; preds = %106
  call void @_ZN5ImGui9LogFinishEv()
  br label %110

110:                                              ; preds = %109, %106
  %111 = load i8, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5, !range !9, !noundef !10
  %112 = trunc i8 %111 to i1
  br i1 %112, label %120, label %113

113:                                              ; preds = %110
  %114 = load i8, ptr @_ZN3Log4View11mAutoScrollE, align 1, !tbaa !5, !range !9, !noundef !10
  %115 = trunc i8 %114 to i1
  br i1 %115, label %116, label %121

116:                                              ; preds = %113
  %117 = call noundef float @_ZN5ImGui10GetScrollYEv()
  %118 = call noundef float @_ZN5ImGui13GetScrollMaxYEv()
  %119 = fcmp oge float %117, %118
  br i1 %119, label %120, label %121

120:                                              ; preds = %116, %110
  call void @_ZN5ImGui14SetScrollHereYEf(float noundef 1.000000e+00)
  br label %121

121:                                              ; preds = %120, %116, %113
  store i8 0, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5
  call void @_ZN5ImGui11PopStyleVarEi(i32 noundef 1)
  call void @_ZN5ImGui8EndChildEv()
  call void @_ZN5ImGui3EndEv()
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #4
  store i32 0, ptr %2, align 4
  br label %122

122:                                              ; preds = %121, %16
  call void @llvm.lifetime.end.p0(i64 1, ptr %1) #4
  %123 = load i32, ptr %2, align 4
  switch i32 %123, label %130 [
    i32 0, label %124
    i32 1, label %124
  ]

124:                                              ; preds = %122, %122
  ret void

125:                                              ; preds = %57
  %126 = load ptr, ptr %4, align 8
  %127 = load i32, ptr %5, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129

130:                                              ; preds = %122, %100
  unreachable
}

declare noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef, ptr noundef, i32 noundef) #2

declare void @_ZN5ImGui3EndEv() #2

declare noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef) #2

declare void @_ZN5ImGui8SameLineEff(float noundef, float noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Log4View8ClearLogEv() #3 align 2

declare void @_ZN5ImGui9SeparatorEv() #2

declare noundef zeroext i1 @_ZN5ImGui10BeginPopupEPKci(ptr noundef, i32 noundef) #2

declare noundef zeroext i1 @_ZN5ImGui8CheckboxEPKcPb(ptr noundef, ptr noundef) #2

declare void @_ZN5ImGui8EndPopupEv() #2

; Function Attrs: nounwind
declare i32 @__cxa_guard_acquire(ptr) #4

declare void @_ZN15ImGuiTextFilterC1EPKc(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN15ImGuiTextFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(276)) unnamed_addr #5 align 2

; Function Attrs: nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) #4

; Function Attrs: nounwind
declare void @__cxa_guard_abort(ptr) #4

; Function Attrs: nounwind
declare void @__cxa_guard_release(ptr) #4

declare noundef zeroext i1 @_ZN15ImGuiTextFilter4DrawEPKcf(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef, float noundef) #2

declare noundef nonnull align 4 dereferenceable(1048) ptr @_ZN5ImGui8GetStyleEv() #2

declare noundef float @_ZN5ImGui25GetFrameHeightWithSpacingEv() #2

declare noundef zeroext i1 @_ZN5ImGui10BeginChildEPKcRK6ImVec2bi(ptr noundef, ptr noundef nonnull align 4 dereferenceable(8), i1 noundef zeroext, i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN5ImGui23BeginPopupContextWindowEPKci(ptr noundef, i32 noundef) #2

declare noundef zeroext i1 @_ZN5ImGui10SelectableEPKcbiRK6ImVec2(ptr noundef, i1 noundef zeroext, i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) #2

declare void @_ZN5ImGui12PushStyleVarEiRK6ImVec2(i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) #2

declare void @_ZN5ImGui14LogToClipboardEi(i32 noundef) #2

declare noundef zeroext i1 @_ZNK15ImGuiTextFilter10PassFilterEPKcS1_(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef, ptr noundef) #2

declare void @_ZN5ImGui14PushStyleColorEiRK6ImVec4(i32 noundef, ptr noundef nonnull align 4 dereferenceable(16)) #2

declare void @_ZN5ImGui11TextWrappedEPKcz(ptr noundef, ...) #2

declare void @_ZN5ImGui13PopStyleColorEi(i32 noundef) #2

declare void @_ZN5ImGui9LogFinishEv() #2

declare noundef float @_ZN5ImGui10GetScrollYEv() #2

declare noundef float @_ZN5ImGui13GetScrollMaxYEv() #2

declare void @_ZN5ImGui14SetScrollHereYEf(float noundef) #2

declare void @_ZN5ImGui11PopStyleVarEi(i32 noundef) #2

declare void @_ZN5ImGui8EndChildEv() #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { "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 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 #4 = { nounwind }
attributes #5 = { inlinehint mustprogress 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" }

!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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!"branch_weights", i32 1, i32 1048575}
!12 = !{!13, !14, i64 80}
!13 = !{!"_ZTS10ImGuiStyle", !14, i64 0, !14, i64 4, !15, i64 8, !14, i64 16, !14, i64 20, !15, i64 24, !15, i64 32, !16, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !15, i64 60, !14, i64 68, !14, i64 72, !15, i64 76, !15, i64 84, !15, i64 92, !15, i64 100, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !14, i64 136, !14, i64 140, !14, i64 144, !16, i64 148, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !14, i64 184, !6, i64 188, !6, i64 189, !6, i64 190, !14, i64 192, !14, i64 196, !7, i64 200}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!16 = !{!"int", !7, i64 0}
!17 = !{!14, !14, i64 0}
!18 = !{!16, !16, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"_ZTSN3Log4TypeE", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


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

%struct.ImVec4 = type { float, float, float, float }
%struct.ImGuiTextFilter = type <{ [256 x i8], %struct.ImVector, i32, [4 x i8] }>
%struct.ImVector = type { i32, i32, ptr }
%struct.ImVec2 = type { float, float }

@_ZN3Log4View7mBufferE = external dso_local global [64 x [512 x i8]], align 16
@_ZN3Log4View4mLenE = external dso_local local_unnamed_addr global [64 x i32], align 16
@_ZN3Log4View5mTypeE = external dso_local local_unnamed_addr global [64 x i32], align 16
@_ZN3Log4View10mBufferPtrE = external dso_local local_unnamed_addr global i32, align 4
@_ZN3Log4View11mAutoScrollE = external dso_local global i8, align 1
@_ZN3Log4View15mScrollToBottomE = external dso_local local_unnamed_addr global i8, align 1
@_ZL16logViewTypeColor = external hidden global [9 x %struct.ImVec4], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [12 x i8], align 1
@_ZZN3Log4View6RenderEvE6filter = external hidden global %struct.ImGuiTextFilter, align 8
@_ZGVZN3Log4View6RenderEvE6filter = external hidden global i64, align 8
@.str.6 = external hidden unnamed_addr constant [1 x i8], align 1
@__dso_handle = external hidden global i8
@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3Log4View6RenderEv() local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.ImVec2, align 4
  %2 = alloca %struct.ImVec2, align 4
  %3 = alloca %struct.ImVec2, align 4
  %4 = tail call noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef nonnull @.str, ptr noundef null, i32 noundef 0)
  br i1 %4, label %6, label %5

5:                                                ; preds = %0
  tail call void @_ZN5ImGui3EndEv()
  br label %80

6:                                                ; preds = %0
  %7 = tail call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef nonnull @.str.1)
  tail call void @_ZN5ImGui8SameLineEff(float noundef 0.000000e+00, float noundef -1.000000e+00)
  %8 = load i8, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5, !range !9, !noundef !10
  %9 = trunc nuw i8 %8 to i1
  br i1 %9, label %13, label %10

10:                                               ; preds = %6
  %11 = tail call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef nonnull @.str.2)
  %12 = zext i1 %11 to i8
  br label %13

13:                                               ; preds = %10, %6
  %14 = phi i8 [ 1, %6 ], [ %12, %10 ]
  store i8 %14, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5
  tail call void @_ZN5ImGui8SameLineEff(float noundef 0.000000e+00, float noundef -1.000000e+00)
  %15 = tail call noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef nonnull @.str.3)
  br i1 %15, label %16, label %17

16:                                               ; preds = %13
  tail call void @_ZN3Log4View8ClearLogEv()
  br label %17

17:                                               ; preds = %16, %13
  tail call void @_ZN5ImGui9SeparatorEv()
  %18 = tail call noundef zeroext i1 @_ZN5ImGui10BeginPopupEPKci(ptr noundef nonnull @.str.4, i32 noundef 0)
  br i1 %18, label %19, label %21

19:                                               ; preds = %17
  %20 = tail call noundef zeroext i1 @_ZN5ImGui8CheckboxEPKcPb(ptr noundef nonnull @.str.5, ptr noundef nonnull @_ZN3Log4View11mAutoScrollE)
  tail call void @_ZN5ImGui8EndPopupEv()
  br label %21

21:                                               ; preds = %19, %17
  %22 = load atomic i8, ptr @_ZGVZN3Log4View6RenderEvE6filter acquire, align 8
  %23 = icmp eq i8 %22, 0
  br i1 %23, label %24, label %29, !prof !11

24:                                               ; preds = %21
  %25 = tail call i32 @__cxa_guard_acquire(ptr nonnull @_ZGVZN3Log4View6RenderEvE6filter) #6
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %29, label %26

26:                                               ; preds = %24
  invoke void @_ZN15ImGuiTextFilterC1EPKc(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef nonnull @.str.6)
          to label %27 unwind label %42

27:                                               ; preds = %26
  %28 = tail call i32 @__cxa_atexit(ptr nonnull @_ZN15ImGuiTextFilterD2Ev, ptr nonnull @_ZZN3Log4View6RenderEvE6filter, ptr nonnull @__dso_handle) #6
  tail call void @__cxa_guard_release(ptr nonnull @_ZGVZN3Log4View6RenderEvE6filter) #6
  br label %29

29:                                               ; preds = %27, %24, %21
  %30 = tail call noundef zeroext i1 @_ZN15ImGuiTextFilter4DrawEPKcf(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef nonnull @.str.7, float noundef 1.800000e+02)
  tail call void @_ZN5ImGui9SeparatorEv()
  %31 = tail call noundef nonnull align 4 dereferenceable(1048) ptr @_ZN5ImGui8GetStyleEv()
  %32 = getelementptr inbounds i8, ptr %31, i64 80
  %33 = load float, ptr %32, align 4, !tbaa !12
  %34 = tail call noundef float @_ZN5ImGui25GetFrameHeightWithSpacingEv()
  %35 = fadd float %33, %34
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  %36 = fneg float %35
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %1, float noundef 0.000000e+00, float noundef %36)
  %37 = call noundef zeroext i1 @_ZN5ImGui10BeginChildEPKcRK6ImVec2bi(ptr noundef nonnull @.str.8, ptr noundef nonnull align 4 dereferenceable(8) %1, i1 noundef zeroext false, i32 noundef 2048)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  %38 = call noundef zeroext i1 @_ZN5ImGui23BeginPopupContextWindowEPKci(ptr noundef null, i32 noundef 1)
  br i1 %38, label %39, label %45

39:                                               ; preds = %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %2, float noundef 0.000000e+00, float noundef 0.000000e+00)
  %40 = call noundef zeroext i1 @_ZN5ImGui10SelectableEPKcbiRK6ImVec2(ptr noundef nonnull @.str.3, i1 noundef zeroext false, i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(8) %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br i1 %40, label %41, label %44

41:                                               ; preds = %39
  call void @_ZN3Log4View8ClearLogEv()
  br label %44

42:                                               ; preds = %26
  %43 = landingpad { ptr, i32 }
          cleanup
  tail call void @__cxa_guard_abort(ptr nonnull @_ZGVZN3Log4View6RenderEvE6filter) #6
  resume { ptr, i32 } %43

44:                                               ; preds = %41, %39
  call void @_ZN5ImGui8EndPopupEv()
  br label %45

45:                                               ; preds = %44, %29
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %3, float noundef 4.000000e+00, float noundef 1.000000e+00)
  call void @_ZN5ImGui12PushStyleVarEiRK6ImVec2(i32 noundef 14, ptr noundef nonnull align 4 dereferenceable(8) %3)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br i1 %7, label %46, label %.preheader

.preheader:                                       ; preds = %46, %45
  br label %48

46:                                               ; preds = %45
  call void @_ZN5ImGui14LogToClipboardEi(i32 noundef -1)
  br label %.preheader

47:                                               ; preds = %65
  br i1 %7, label %67, label %68

48:                                               ; preds = %.preheader, %65
  %.012 = phi i32 [ %66, %65 ], [ 0, %.preheader ]
  %49 = load i32, ptr @_ZN3Log4View10mBufferPtrE, align 4, !tbaa !17
  %50 = add nuw nsw i32 %.012, 64
  %51 = add i32 %50, %49
  %52 = srem i32 %51, 64
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [64 x i32], ptr @_ZN3Log4View4mLenE, i64 0, i64 %53
  %55 = load i32, ptr %54, align 4, !tbaa !17
  %56 = icmp eq i32 %55, 0
  br i1 %56, label %65, label %57

57:                                               ; preds = %48
  %58 = getelementptr inbounds [64 x [512 x i8]], ptr @_ZN3Log4View7mBufferE, i64 0, i64 %53
  %59 = call noundef zeroext i1 @_ZNK15ImGuiTextFilter10PassFilterEPKcS1_(ptr noundef nonnull align 8 dereferenceable(276) @_ZZN3Log4View6RenderEvE6filter, ptr noundef nonnull %58, ptr noundef null)
  br i1 %59, label %60, label %65

60:                                               ; preds = %57
  %61 = getelementptr inbounds [64 x i32], ptr @_ZN3Log4View5mTypeE, i64 0, i64 %53
  %62 = load i32, ptr %61, align 4, !tbaa !18
  %63 = zext i32 %62 to i64
  %64 = getelementptr inbounds [9 x %struct.ImVec4], ptr @_ZL16logViewTypeColor, i64 0, i64 %63
  call void @_ZN5ImGui14PushStyleColorEiRK6ImVec4(i32 noundef 0, ptr noundef nonnull align 4 dereferenceable(16) %64)
  call void (ptr, ...) @_ZN5ImGui11TextWrappedEPKcz(ptr noundef nonnull @.str.9, ptr noundef nonnull %58)
  call void @_ZN5ImGui13PopStyleColorEi(i32 noundef 1)
  br label %65

65:                                               ; preds = %48, %57, %60
  %66 = add nuw nsw i32 %.012, 1
  %exitcond.not = icmp eq i32 %66, 64
  br i1 %exitcond.not, label %47, label %48, !llvm.loop !20

67:                                               ; preds = %47
  call void @_ZN5ImGui9LogFinishEv()
  br label %68

68:                                               ; preds = %67, %47
  %69 = load i8, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5, !range !9, !noundef !10
  %70 = trunc nuw i8 %69 to i1
  br i1 %70, label %78, label %71

71:                                               ; preds = %68
  %72 = load i8, ptr @_ZN3Log4View11mAutoScrollE, align 1, !tbaa !5, !range !9, !noundef !10
  %73 = trunc nuw i8 %72 to i1
  br i1 %73, label %74, label %79

74:                                               ; preds = %71
  %75 = call noundef float @_ZN5ImGui10GetScrollYEv()
  %76 = call noundef float @_ZN5ImGui13GetScrollMaxYEv()
  %77 = fcmp ult float %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74, %68
  call void @_ZN5ImGui14SetScrollHereYEf(float noundef 1.000000e+00)
  br label %79

79:                                               ; preds = %78, %74, %71
  store i8 0, ptr @_ZN3Log4View15mScrollToBottomE, align 1, !tbaa !5
  call void @_ZN5ImGui11PopStyleVarEi(i32 noundef 1)
  call void @_ZN5ImGui8EndChildEv()
  call void @_ZN5ImGui3EndEv()
  br label %80

80:                                               ; preds = %79, %5
  ret void
}

declare noundef zeroext i1 @_ZN5ImGui5BeginEPKcPbi(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

declare void @_ZN5ImGui3EndEv() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN5ImGui11SmallButtonEPKc(ptr noundef) local_unnamed_addr #2

declare void @_ZN5ImGui8SameLineEff(float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3Log4View8ClearLogEv() local_unnamed_addr #3 align 2

declare void @_ZN5ImGui9SeparatorEv() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN5ImGui10BeginPopupEPKci(ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN5ImGui8CheckboxEPKcPb(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN5ImGui8EndPopupEv() local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare i32 @__cxa_guard_acquire(ptr) local_unnamed_addr #4

declare void @_ZN15ImGuiTextFilterC1EPKc(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef) unnamed_addr #2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN15ImGuiTextFilterD2Ev(ptr noundef nonnull align 8 dereferenceable(276)) unnamed_addr #5 align 2

; Function Attrs: nofree nounwind
declare i32 @__cxa_atexit(ptr, ptr, ptr) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare void @__cxa_guard_abort(ptr) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare void @__cxa_guard_release(ptr) local_unnamed_addr #4

declare noundef zeroext i1 @_ZN15ImGuiTextFilter4DrawEPKcf(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef, float noundef) local_unnamed_addr #2

declare noundef nonnull align 4 dereferenceable(1048) ptr @_ZN5ImGui8GetStyleEv() local_unnamed_addr #2

declare noundef float @_ZN5ImGui25GetFrameHeightWithSpacingEv() local_unnamed_addr #2

declare noundef zeroext i1 @_ZN5ImGui10BeginChildEPKcRK6ImVec2bi(ptr noundef, ptr noundef nonnull align 4 dereferenceable(8), i1 noundef zeroext, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6ImVec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8), float noundef, float noundef) unnamed_addr #3 align 2

declare noundef zeroext i1 @_ZN5ImGui23BeginPopupContextWindowEPKci(ptr noundef, i32 noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZN5ImGui10SelectableEPKcbiRK6ImVec2(ptr noundef, i1 noundef zeroext, i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

declare void @_ZN5ImGui12PushStyleVarEiRK6ImVec2(i32 noundef, ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #2

declare void @_ZN5ImGui14LogToClipboardEi(i32 noundef) local_unnamed_addr #2

declare noundef zeroext i1 @_ZNK15ImGuiTextFilter10PassFilterEPKcS1_(ptr noundef nonnull align 8 dereferenceable(276), ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN5ImGui14PushStyleColorEiRK6ImVec4(i32 noundef, ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #2

declare void @_ZN5ImGui11TextWrappedEPKcz(ptr noundef, ...) local_unnamed_addr #2

declare void @_ZN5ImGui13PopStyleColorEi(i32 noundef) local_unnamed_addr #2

declare void @_ZN5ImGui9LogFinishEv() local_unnamed_addr #2

declare noundef float @_ZN5ImGui10GetScrollYEv() local_unnamed_addr #2

declare noundef float @_ZN5ImGui13GetScrollMaxYEv() local_unnamed_addr #2

declare void @_ZN5ImGui14SetScrollHereYEf(float noundef) local_unnamed_addr #2

declare void @_ZN5ImGui11PopStyleVarEi(i32 noundef) local_unnamed_addr #2

declare void @_ZN5ImGui8EndChildEv() local_unnamed_addr #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { "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 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 #4 = { nofree nounwind }
attributes #5 = { inlinehint mustprogress 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 = { 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 = !{!"bool", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i8 0, i8 2}
!10 = !{}
!11 = !{!"branch_weights", i32 1, i32 1048575}
!12 = !{!13, !14, i64 80}
!13 = !{!"_ZTS10ImGuiStyle", !14, i64 0, !14, i64 4, !15, i64 8, !14, i64 16, !14, i64 20, !15, i64 24, !15, i64 32, !16, i64 40, !14, i64 44, !14, i64 48, !14, i64 52, !14, i64 56, !15, i64 60, !14, i64 68, !14, i64 72, !15, i64 76, !15, i64 84, !15, i64 92, !15, i64 100, !14, i64 108, !14, i64 112, !14, i64 116, !14, i64 120, !14, i64 124, !14, i64 128, !14, i64 132, !14, i64 136, !14, i64 140, !14, i64 144, !16, i64 148, !15, i64 152, !15, i64 160, !15, i64 168, !15, i64 176, !14, i64 184, !6, i64 188, !6, i64 189, !6, i64 190, !14, i64 192, !14, i64 196, !7, i64 200}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_ZTS6ImVec2", !14, i64 0, !14, i64 4}
!16 = !{!"int", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_ZTSN3Log4TypeE", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass