; LLVM IR from caryll/otfcc :: lib/support (options)

; 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.otfcc_Options = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @otfcc_Options_optimizeTo(ptr noundef %0, i8 noundef zeroext %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca i8, align 1
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i8 %1, ptr %4, align 1, !tbaa !9
  %5 = load ptr, ptr %3, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.otfcc_Options, ptr %5, i32 0, i32 17
  store i8 0, ptr %6, align 1, !tbaa !10
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds %struct.otfcc_Options, ptr %7, i32 0, i32 7
  store i8 0, ptr %8, align 1, !tbaa !13
  %9 = load ptr, ptr %3, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.otfcc_Options, ptr %9, i32 0, i32 1
  store i8 0, ptr %10, align 1, !tbaa !14
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.otfcc_Options, ptr %11, i32 0, i32 13
  store i8 0, ptr %12, align 1, !tbaa !15
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.otfcc_Options, ptr %13, i32 0, i32 15
  store i8 0, ptr %14, align 1, !tbaa !16
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.otfcc_Options, ptr %15, i32 0, i32 16
  store i8 0, ptr %16, align 8, !tbaa !17
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.otfcc_Options, ptr %17, i32 0, i32 18
  store i8 0, ptr %18, align 2, !tbaa !18
  %19 = load i8, ptr %4, align 1, !tbaa !9
  %20 = zext i8 %19 to i32
  %21 = icmp sge i32 %20, 1
  br i1 %21, label %22, label %27

22:                                               ; preds = %2
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.otfcc_Options, ptr %23, i32 0, i32 17
  store i8 1, ptr %24, align 1, !tbaa !10
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.otfcc_Options, ptr %25, i32 0, i32 13
  store i8 1, ptr %26, align 1, !tbaa !15
  br label %27

27:                                               ; preds = %22, %2
  %28 = load i8, ptr %4, align 1, !tbaa !9
  %29 = zext i8 %28 to i32
  %30 = icmp sge i32 %29, 2
  br i1 %30, label %31, label %38

31:                                               ; preds = %27
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.otfcc_Options, ptr %32, i32 0, i32 7
  store i8 1, ptr %33, align 1, !tbaa !13
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.otfcc_Options, ptr %34, i32 0, i32 18
  store i8 1, ptr %35, align 2, !tbaa !18
  %36 = load ptr, ptr %3, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.otfcc_Options, ptr %36, i32 0, i32 15
  store i8 1, ptr %37, align 1, !tbaa !16
  br label %38

38:                                               ; preds = %31, %27
  %39 = load i8, ptr %4, align 1, !tbaa !9
  %40 = zext i8 %39 to i32
  %41 = icmp sge i32 %40, 3
  br i1 %41, label %42, label %47

42:                                               ; preds = %38
  %43 = load ptr, ptr %3, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.otfcc_Options, ptr %43, i32 0, i32 1
  store i8 1, ptr %44, align 1, !tbaa !14
  %45 = load ptr, ptr %3, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.otfcc_Options, ptr %45, i32 0, i32 16
  store i8 1, ptr %46, align 8, !tbaa !17
  br label %47

47:                                               ; preds = %42, %38
  ret void
}

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }

!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 = !{!7, !7, i64 0}
!10 = !{!11, !12, i64 17}
!11 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !12, i64 22, !6, i64 24, !6, i64 32}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!11, !12, i64 7}
!14 = !{!11, !12, i64 1}
!15 = !{!11, !12, i64 13}
!16 = !{!11, !12, i64 15}
!17 = !{!11, !12, i64 16}
!18 = !{!11, !12, i64 18}


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

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) uwtable
define dso_local void @otfcc_Options_optimizeTo(ptr nocapture noundef writeonly %0, i8 noundef zeroext %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 7
  store i8 0, ptr %3, align 1, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 1
  store i8 0, ptr %4, align 1, !tbaa !11
  %5 = getelementptr inbounds i8, ptr %0, i64 13
  store i8 0, ptr %5, align 1, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %0, i64 15
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = getelementptr inbounds i8, ptr %0, i64 18
  %.not = icmp eq i8 %1, 0
  store i32 0, ptr %6, align 1
  br i1 %.not, label %.thread16, label %9

9:                                                ; preds = %2
  %10 = getelementptr inbounds i8, ptr %0, i64 17
  store i8 1, ptr %10, align 1, !tbaa !13
  store i8 1, ptr %5, align 1, !tbaa !12
  %.not17 = icmp eq i8 %1, 1
  br i1 %.not17, label %.thread16, label %11

11:                                               ; preds = %9
  store i8 1, ptr %3, align 1, !tbaa !5
  store i8 1, ptr %8, align 2, !tbaa !14
  store i8 1, ptr %6, align 1, !tbaa !15
  %12 = icmp ugt i8 %1, 2
  br i1 %12, label %13, label %.thread16

13:                                               ; preds = %11
  store i8 1, ptr %4, align 1, !tbaa !11
  store i8 1, ptr %7, align 8, !tbaa !16
  br label %.thread16

.thread16:                                        ; preds = %2, %9, %13, %11
  ret void
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(argmem: write) 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, !7, i64 7}
!6 = !{!"", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !7, i64 14, !7, i64 15, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22, !10, i64 24, !10, i64 32}
!7 = !{!"_Bool", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 1}
!12 = !{!6, !7, i64 13}
!13 = !{!6, !7, i64 17}
!14 = !{!6, !7, i64 18}
!15 = !{!6, !7, i64 15}
!16 = !{!6, !7, i64 16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InstCombinePass,JumpThreadingPass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass