; LLVM IR from ClementineAccount/Albuquerque :: src/HelloSDL (main)

; 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.nk_context = type { %struct.nk_input, %struct.nk_style, %struct.nk_buffer, %struct.nk_clipboard, i32, i32, %struct.nk_configuration_stacks, float, %struct.nk_draw_list, %struct.nk_text_edit, %struct.nk_command_buffer, i32, i32, %struct.nk_pool, ptr, ptr, ptr, ptr, ptr, i32, i32 }
%struct.nk_input = type { %struct.nk_keyboard, %struct.nk_mouse }
%struct.nk_keyboard = type { [30 x %struct.nk_key], [16 x i8], i32 }
%struct.nk_key = type { i32, i32 }
%struct.nk_mouse = type { [4 x %struct.nk_mouse_button], %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, i8, i8, i8 }
%struct.nk_mouse_button = type { i32, i32, %struct.nk_vec2 }
%struct.nk_vec2 = type { float, float }
%struct.nk_style = type { ptr, [7 x ptr], ptr, ptr, i32, %struct.nk_style_text, %struct.nk_style_button, %struct.nk_style_button, %struct.nk_style_button, %struct.nk_style_toggle, %struct.nk_style_toggle, %struct.nk_style_selectable, %struct.nk_style_slider, %struct.nk_style_progress, %struct.nk_style_property, %struct.nk_style_edit, %struct.nk_style_chart, %struct.nk_style_scrollbar, %struct.nk_style_scrollbar, %struct.nk_style_tab, %struct.nk_style_combo, %struct.nk_style_window }
%struct.nk_style_text = type { %struct.nk_color, %struct.nk_vec2 }
%struct.nk_color = type { i8, i8, i8, i8 }
%struct.nk_style_button = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, i32, float, float, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %union.nk_handle, ptr, ptr }
%struct.nk_style_item = type { i32, %union.nk_style_item_data }
%union.nk_style_item_data = type { %struct.nk_nine_slice }
%struct.nk_nine_slice = type { %struct.nk_image, i16, i16, i16, i16 }
%struct.nk_image = type { %union.nk_handle, i16, i16, [4 x i16] }
%union.nk_handle = type { ptr }
%struct.nk_style_toggle = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, i32, %struct.nk_vec2, %struct.nk_vec2, float, float, %union.nk_handle, ptr, ptr }
%struct.nk_style_selectable = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, i32, float, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %union.nk_handle, ptr, ptr }
%struct.nk_style_slider = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, float, float, float, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, i32, %struct.nk_style_button, %struct.nk_style_button, i32, i32, %union.nk_handle, ptr, ptr }
%struct.nk_style_progress = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, float, float, float, float, %struct.nk_vec2, %union.nk_handle, ptr, ptr }
%struct.nk_style_property = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, i32, i32, float, float, %struct.nk_vec2, %struct.nk_style_edit, %struct.nk_style_button, %struct.nk_style_button, %union.nk_handle, ptr, ptr }
%struct.nk_style_edit = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_style_scrollbar, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, float, float, float, %struct.nk_vec2, %struct.nk_vec2, float }
%struct.nk_style_chart = type { %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, float, float, %struct.nk_vec2 }
%struct.nk_style_scrollbar = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, float, float, float, float, %struct.nk_vec2, i32, %struct.nk_style_button, %struct.nk_style_button, i32, i32, %union.nk_handle, ptr, ptr }
%struct.nk_style_tab = type { %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_style_button, %struct.nk_style_button, %struct.nk_style_button, %struct.nk_style_button, i32, i32, float, float, float, %struct.nk_vec2, %struct.nk_vec2 }
%struct.nk_style_combo = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_style_button, i32, i32, i32, float, float, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2 }
%struct.nk_style_window = type { %struct.nk_style_window_header, %struct.nk_style_item, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_color, %struct.nk_style_item, float, float, float, float, float, float, float, float, float, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2 }
%struct.nk_style_window_header = type { %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_item, %struct.nk_style_button, %struct.nk_style_button, i32, i32, i32, %struct.nk_color, %struct.nk_color, %struct.nk_color, i32, %struct.nk_vec2, %struct.nk_vec2, %struct.nk_vec2 }
%struct.nk_buffer = type { [2 x %struct.nk_buffer_marker], %struct.nk_allocator, i32, %struct.nk_memory, float, i64, i64, i64, i64 }
%struct.nk_buffer_marker = type { i32, i64 }
%struct.nk_allocator = type { %union.nk_handle, ptr, ptr }
%struct.nk_memory = type { ptr, i64 }
%struct.nk_clipboard = type { %union.nk_handle, ptr, ptr }
%struct.nk_configuration_stacks = type { %struct.nk_config_stack_style_item, %struct.nk_config_stack_float, %struct.nk_config_stack_vec2, %struct.nk_config_stack_flags, %struct.nk_config_stack_color, %struct.nk_config_stack_user_font, %struct.nk_config_stack_button_behavior }
%struct.nk_config_stack_style_item = type { i32, [16 x %struct.nk_config_stack_style_item_element] }
%struct.nk_config_stack_style_item_element = type { ptr, %struct.nk_style_item }
%struct.nk_config_stack_float = type { i32, [32 x %struct.nk_config_stack_float_element] }
%struct.nk_config_stack_float_element = type { ptr, float }
%struct.nk_config_stack_vec2 = type { i32, [16 x %struct.nk_config_stack_vec2_element] }
%struct.nk_config_stack_vec2_element = type { ptr, %struct.nk_vec2 }
%struct.nk_config_stack_flags = type { i32, [32 x %struct.nk_config_stack_flags_element] }
%struct.nk_config_stack_flags_element = type { ptr, i32 }
%struct.nk_config_stack_color = type { i32, [32 x %struct.nk_config_stack_color_element] }
%struct.nk_config_stack_color_element = type { ptr, %struct.nk_color }
%struct.nk_config_stack_user_font = type { i32, [8 x %struct.nk_config_stack_user_font_element] }
%struct.nk_config_stack_user_font_element = type { ptr, ptr }
%struct.nk_config_stack_button_behavior = type { i32, [8 x %struct.nk_config_stack_button_behavior_element] }
%struct.nk_config_stack_button_behavior_element = type { ptr, i32 }
%struct.nk_draw_list = type { %struct.nk_rect, [12 x %struct.nk_vec2], %struct.nk_convert_config, ptr, ptr, ptr, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.nk_rect = type { float, float, float, float }
%struct.nk_convert_config = type { float, i32, i32, i32, i32, i32, %struct.nk_draw_null_texture, ptr, i64, i64 }
%struct.nk_draw_null_texture = type { %union.nk_handle, %struct.nk_vec2 }
%struct.nk_text_edit = type { %struct.nk_clipboard, %struct.nk_str, ptr, %struct.nk_vec2, i32, i32, i32, i8, i8, i8, i8, i8, i8, i8, float, %struct.nk_text_undo_state }
%struct.nk_str = type { %struct.nk_buffer, i32 }
%struct.nk_text_undo_state = type { [99 x %struct.nk_text_undo_record], [999 x i32], i16, i16, i16, i16 }
%struct.nk_text_undo_record = type { i32, i16, i16, i16 }
%struct.nk_command_buffer = type { ptr, %struct.nk_rect, i32, %union.nk_handle, i64, i64, i64 }
%struct.nk_pool = type { %struct.nk_allocator, i32, i32, ptr, ptr, i32, i64, i64 }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__.nk_style_pop_color = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

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

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

9:                                                ; preds = %1
  br label %12

10:                                               ; preds = %1
  call void @__assert_fail(ptr noundef @.str.32, ptr noundef @.str.1, i32 noundef 18825, ptr noundef @__PRETTY_FUNCTION__.nk_style_pop_color) #5
  unreachable

11:                                               ; No predecessors!
  br label %12

12:                                               ; preds = %11, %9
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = icmp ne ptr %13, null
  br i1 %14, label %16, label %15

15:                                               ; preds = %12
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %47

16:                                               ; preds = %12
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.nk_context, ptr %17, i32 0, i32 6
  %19 = getelementptr inbounds %struct.nk_configuration_stacks, ptr %18, i32 0, i32 4
  store ptr %19, ptr %4, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.nk_config_stack_color, ptr %20, i32 0, i32 0
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %16
  br label %27

25:                                               ; preds = %16
  call void @__assert_fail(ptr noundef @.str.73, ptr noundef @.str.1, i32 noundef 18825, ptr noundef @__PRETTY_FUNCTION__.nk_style_pop_color) #5
  unreachable

26:                                               ; No predecessors!
  br label %27

27:                                               ; preds = %26, %24
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.nk_config_stack_color, ptr %28, i32 0, i32 0
  %30 = load i32, ptr %29, align 8, !tbaa !9
  %31 = icmp slt i32 %30, 1
  br i1 %31, label %32, label %33

32:                                               ; preds = %27
  store i32 0, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %47

33:                                               ; preds = %27
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.nk_config_stack_color, ptr %34, i32 0, i32 1
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.nk_config_stack_color, ptr %36, i32 0, i32 0
  %38 = load i32, ptr %37, align 8, !tbaa !9
  %39 = add nsw i32 %38, -1
  store i32 %39, ptr %37, align 8, !tbaa !9
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [32 x %struct.nk_config_stack_color_element], ptr %35, i64 0, i64 %40
  store ptr %41, ptr %5, align 8, !tbaa !5
  %42 = load ptr, ptr %5, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.nk_config_stack_color_element, ptr %42, i32 0, i32 1
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.nk_config_stack_color_element, ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %46, ptr align 8 %43, i64 4, i1 false), !tbaa.struct !15
  store i32 1, ptr %2, align 4
  store i32 1, ptr %6, align 4
  br label %47

47:                                               ; preds = %33, %32, %15
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #4
  %48 = load i32, ptr %2, align 4
  ret i32 %48
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { noreturn 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 = { 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 = { noreturn 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++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTS21nk_config_stack_color", !11, i64 0, !7, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !6, i64 0}
!13 = !{!"_ZTS29nk_config_stack_color_element", !6, i64 0, !14, i64 8}
!14 = !{!"_ZTS8nk_color", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!15 = !{i64 0, i64 1, !16, i64 1, i64 1, !16, i64 2, i64 1, !16, i64 3, i64 1, !16}
!16 = !{!7, !7, 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"

%struct.nk_config_stack_color_element = type { ptr, %struct.nk_color }
%struct.nk_color = type { i8, i8, i8, i8 }

@.str.1 = external hidden unnamed_addr constant [86 x i8], align 1
@.str.32 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__.nk_style_pop_color = external hidden unnamed_addr constant [48 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef i32 @nk_style_pop_color(ptr noundef %0) local_unnamed_addr #1 {
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %2, label %3

2:                                                ; preds = %1
  tail call void @__assert_fail(ptr noundef nonnull @.str.32, ptr noundef nonnull @.str.1, i32 noundef 18825, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_style_pop_color) #2
  unreachable

3:                                                ; preds = %1
  %4 = getelementptr inbounds i8, ptr %0, i64 11232
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = icmp sgt i32 %5, 0
  br i1 %6, label %8, label %7

7:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.73, ptr noundef nonnull @.str.1, i32 noundef 18825, ptr noundef nonnull @__PRETTY_FUNCTION__.nk_style_pop_color) #2
  unreachable

8:                                                ; preds = %3
  %9 = getelementptr inbounds i8, ptr %0, i64 11240
  %10 = add nsw i32 %5, -1
  store i32 %10, ptr %4, align 8, !tbaa !5
  %11 = zext nneg i32 %10 to i64
  %12 = getelementptr inbounds [32 x %struct.nk_config_stack_color_element], ptr %9, i64 0, i64 %11
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load ptr, ptr %12, align 8, !tbaa !10
  %15 = load i32, ptr %13, align 8
  store i32 %15, ptr %14, align 1
  ret i32 1
}

attributes #0 = { noreturn 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 #1 = { 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 #2 = { noreturn nounwind }

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

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


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