; LLVM IR from ERGO-Code/HiGHS :: src/io (HMpsFF)

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

@.str.66 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [45 x i8], align 1

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN18free_format_parser6HMpsFF18cannotParseSectionERK15HighsLogOptionsNS0_8ParsekeyE(ptr noundef nonnull align 8 dereferenceable(1104) %0, ptr noundef nonnull align 8 dereferenceable(89) %1, i32 noundef %2) #1 align 2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %8 = load ptr, ptr %5, align 8
  %9 = load i32, ptr %7, align 4, !tbaa !9
  switch i32 %9, label %26 [
    i32 14, label %10
    i32 15, label %12
    i32 16, label %14
    i32 17, label %16
    i32 20, label %18
    i32 21, label %20
    i32 22, label %22
    i32 23, label %24
  ]

10:                                               ; preds = %3
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %11, i32 noundef 5, ptr noundef @.str.66)
  br label %27

12:                                               ; preds = %3
  %13 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %13, i32 noundef 5, ptr noundef @.str.67)
  br label %27

14:                                               ; preds = %3
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %15, i32 noundef 5, ptr noundef @.str.68)
  br label %27

16:                                               ; preds = %3
  %17 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %17, i32 noundef 5, ptr noundef @.str.69)
  br label %27

18:                                               ; preds = %3
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %19, i32 noundef 5, ptr noundef @.str.70)
  br label %27

20:                                               ; preds = %3
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %21, i32 noundef 5, ptr noundef @.str.71)
  br label %27

22:                                               ; preds = %3
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %23, i32 noundef 5, ptr noundef @.str.72)
  br label %27

24:                                               ; preds = %3
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %25, i32 noundef 5, ptr noundef @.str.73)
  br label %27

26:                                               ; preds = %3
  store i1 false, ptr %4, align 1
  br label %28

27:                                               ; preds = %24, %22, %20, %18, %16, %14, %12, %10
  store i1 true, ptr %4, align 1
  br label %28

28:                                               ; preds = %27, %26
  %29 = load i1, ptr %4, align 1
  ret i1 %29
}

attributes #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 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++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_ZTSN18free_format_parser6HMpsFF8ParsekeyE", !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"

@.str.66 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.67 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.68 = external hidden unnamed_addr constant [47 x i8], align 1
@.str.69 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.70 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.71 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.72 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.73 = external hidden unnamed_addr constant [45 x i8], align 1
@switch.table._ZN18free_format_parser6HMpsFF18cannotParseSectionERK15HighsLogOptionsNS0_8ParsekeyE = private unnamed_addr constant [10 x ptr] [ptr @.str.66, ptr @.str.67, ptr @.str.68, ptr @.str.69, ptr @.str.66, ptr @.str.66, ptr @.str.70, ptr @.str.71, ptr @.str.72, ptr @.str.73], align 8

declare void @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89), i32 noundef, ptr noundef, ...) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN18free_format_parser6HMpsFF18cannotParseSectionERK15HighsLogOptionsNS0_8ParsekeyE(ptr nocapture noundef nonnull readnone align 8 dereferenceable(1104) %0, ptr noundef nonnull align 8 dereferenceable(89) %1, i32 noundef %2) local_unnamed_addr #1 align 2 {
  %switch.tableidx = add i32 %2, -14
  %4 = icmp ult i32 %switch.tableidx, 10
  br i1 %4, label %switch.hole_check, label %6

switch.hole_check:                                ; preds = %3
  %switch.maskindex = trunc nuw i32 %switch.tableidx to i16
  %switch.shifted = lshr i16 975, %switch.maskindex
  %switch.lobit = trunc i16 %switch.shifted to i1
  br i1 %switch.lobit, label %switch.lookup, label %6

switch.lookup:                                    ; preds = %switch.hole_check
  %5 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [10 x ptr], ptr @switch.table._ZN18free_format_parser6HMpsFF18cannotParseSectionERK15HighsLogOptionsNS0_8ParsekeyE, i64 0, i64 %5
  %switch.load = load ptr, ptr %switch.gep, align 8
  tail call void (ptr, i32, ptr, ...) @_Z12highsLogUserRK15HighsLogOptions12HighsLogTypePKcz(ptr noundef nonnull align 8 dereferenceable(89) %1, i32 noundef 5, ptr noundef nonnull %switch.load)
  br label %6

6:                                                ; preds = %switch.hole_check, %3, %switch.lookup
  %.0 = phi i1 [ false, %3 ], [ true, %switch.lookup ], [ false, %switch.hole_check ]
  ret i1 %.0
}

attributes #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 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)"}


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