; LLVM IR from gburlet/dbn-guitar-transcribe :: lbfgsb/program.ll (ZN7Program14initStructuresEv)

; 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"

%class.Program = type { ptr, i32, ptr, ptr, ptr, ptr, i8, double, ptr, i32, i32, i32, double, double, i32, i32, i32, i32, ptr, ptr, [60 x i8], [60 x i8], [4 x i8], [44 x i32], [29 x double] }

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN7Program14initStructuresEv(ptr noundef nonnull align 8 dereferenceable(672) %0) #0 align 2 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 7
  store double 0.000000e+00, ptr %4, align 8, !tbaa !9
  %5 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 1
  %6 = load i32, ptr %5, align 8, !tbaa !15
  %7 = sext i32 %6 to i64
  %8 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %7, i64 8)
  %9 = extractvalue { i64, i1 } %8, 1
  %10 = extractvalue { i64, i1 } %8, 0
  %11 = select i1 %9, i64 -1, i64 %10
  %12 = call noalias noundef nonnull ptr @_Znam(i64 noundef %11) #3
  %13 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 8
  store ptr %12, ptr %13, align 8, !tbaa !16
  %14 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 14
  %15 = load i32, ptr %14, align 8, !tbaa !17
  %16 = mul nsw i32 2, %15
  %17 = add nsw i32 %16, 4
  %18 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 1
  %19 = load i32, ptr %18, align 8, !tbaa !15
  %20 = mul nsw i32 %17, %19
  %21 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 14
  %22 = load i32, ptr %21, align 8, !tbaa !17
  %23 = mul nsw i32 12, %22
  %24 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 14
  %25 = load i32, ptr %24, align 8, !tbaa !17
  %26 = add nsw i32 %25, 1
  %27 = mul nsw i32 %23, %26
  %28 = add nsw i32 %20, %27
  %29 = sext i32 %28 to i64
  %30 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %29, i64 8)
  %31 = extractvalue { i64, i1 } %30, 1
  %32 = extractvalue { i64, i1 } %30, 0
  %33 = select i1 %31, i64 -1, i64 %32
  %34 = call noalias noundef nonnull ptr @_Znam(i64 noundef %33) #3
  %35 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 18
  store ptr %34, ptr %35, align 8, !tbaa !18
  %36 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 1
  %37 = load i32, ptr %36, align 8, !tbaa !15
  %38 = mul nsw i32 3, %37
  %39 = sext i32 %38 to i64
  %40 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %39, i64 4)
  %41 = extractvalue { i64, i1 } %40, 1
  %42 = extractvalue { i64, i1 } %40, 0
  %43 = select i1 %41, i64 -1, i64 %42
  %44 = call noalias noundef nonnull ptr @_Znam(i64 noundef %43) #3
  %45 = getelementptr inbounds %class.Program, ptr %3, i32 0, i32 19
  store ptr %44, ptr %45, align 8, !tbaa !19
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #1

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #2

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nobuiltin allocsize(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 = { builtin allocsize(0) }

!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, !13, i64 56}
!10 = !{!"_ZTS7Program", !11, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !13, i64 56, !6, i64 64, !11, i64 72, !11, i64 76, !11, i64 80, !13, i64 88, !13, i64 96, !11, i64 104, !11, i64 108, !11, i64 112, !14, i64 116, !6, i64 120, !6, i64 128, !7, i64 136, !7, i64 196, !7, i64 256, !7, i64 260, !7, i64 440}
!11 = !{!"int", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!"double", !7, i64 0}
!14 = !{!"_ZTS16SolverExitStatus", !7, i64 0}
!15 = !{!10, !11, i64 8}
!16 = !{!10, !6, i64 64}
!17 = !{!10, !11, i64 104}
!18 = !{!10, !6, i64 120}
!19 = !{!10, !6, i64 128}


; 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 uwtable
define dso_local void @_ZN7Program14initStructuresEv(ptr nocapture noundef nonnull align 8 dereferenceable(672) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 56
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  %3 = getelementptr inbounds i8, ptr %0, i64 8
  %4 = load i32, ptr %3, align 8, !tbaa !14
  %5 = sext i32 %4 to i64
  %6 = icmp slt i32 %4, 0
  %7 = shl nsw i64 %5, 3
  %8 = select i1 %6, i64 -1, i64 %7
  %9 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %8) #2
  %10 = getelementptr inbounds i8, ptr %0, i64 64
  store ptr %9, ptr %10, align 8, !tbaa !15
  %11 = getelementptr inbounds i8, ptr %0, i64 104
  %12 = load i32, ptr %11, align 8, !tbaa !16
  %13 = shl nsw i32 %12, 1
  %14 = add nsw i32 %13, 4
  %15 = mul nsw i32 %14, %4
  %16 = mul nsw i32 %12, 12
  %17 = add nsw i32 %12, 1
  %18 = mul nsw i32 %16, %17
  %19 = add nsw i32 %15, %18
  %20 = sext i32 %19 to i64
  %21 = icmp slt i32 %19, 0
  %22 = shl nsw i64 %20, 3
  %23 = select i1 %21, i64 -1, i64 %22
  %24 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %23) #2
  %25 = getelementptr inbounds i8, ptr %0, i64 120
  store ptr %24, ptr %25, align 8, !tbaa !17
  %26 = mul nsw i32 %4, 3
  %27 = sext i32 %26 to i64
  %28 = shl nsw i64 %27, 2
  %29 = select i1 %6, i64 -1, i64 %28
  %30 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %29) #2
  %31 = getelementptr inbounds i8, ptr %0, i64 128
  store ptr %30, ptr %31, align 8, !tbaa !18
  ret void
}

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { nobuiltin allocsize(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 = { builtin allocsize(0) }

!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, !12, i64 56}
!6 = !{!"_ZTS7Program", !7, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !11, i64 48, !12, i64 56, !10, i64 64, !7, i64 72, !7, i64 76, !7, i64 80, !12, i64 88, !12, i64 96, !7, i64 104, !7, i64 108, !7, i64 112, !13, i64 116, !10, i64 120, !10, i64 128, !8, i64 136, !8, i64 196, !8, i64 256, !8, i64 260, !8, i64 440}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"bool", !8, i64 0}
!12 = !{!"double", !8, i64 0}
!13 = !{!"_ZTS16SolverExitStatus", !8, i64 0}
!14 = !{!6, !7, i64 8}
!15 = !{!6, !10, i64 64}
!16 = !{!6, !7, i64 104}
!17 = !{!6, !10, i64 120}
!18 = !{!6, !10, i64 128}


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