; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_ArgsParser (parseArgsFileFlag__)

; 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.string__ = type { ptr, i32 }
%struct.tag_____ArgsParserState__ = type { ptr, ptr, ptr, ptr, ptr, %struct.string__, %struct.string__, i32, %struct.string__, %struct.tag_____IntRange__, ptr }
%struct.tag_____IntRange__ = type { i32, i32 }

@mu_____string0 = external dso_local global %struct.string__, align 8
@mu_____string574 = external dso_local global %struct.string__, align 8

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @string__equals__(ptr, i32, ptr, i32) #0

; Function Attrs: nounwind uwtable
define dso_local void @ArgsParser__parseArgsFileFlag__(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ArgsParser__readToken__(ptr noundef %3)
  %4 = load ptr, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds %struct.tag_____ArgsParserState__, ptr %4, i32 0, i32 8
  %6 = getelementptr inbounds { ptr, i32 }, ptr %5, i32 0, i32 0
  %7 = load ptr, ptr %6, align 8
  %8 = getelementptr inbounds { ptr, i32 }, ptr %5, i32 0, i32 1
  %9 = load i32, ptr %8, align 8
  %10 = load ptr, ptr @mu_____string0, align 8
  %11 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string0, i32 0, i32 1), align 8
  %12 = call zeroext i8 @string__equals__(ptr %7, i32 %9, ptr %10, i32 %11)
  %13 = icmp ne i8 %12, 0
  br i1 %13, label %14, label %18

14:                                               ; preds = %1
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = load ptr, ptr @mu_____string574, align 8
  %17 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string574, i32 0, i32 1), align 8
  call void @ArgsParser__expected__(ptr noundef %15, ptr %16, i32 %17)
  br label %27

18:                                               ; preds = %1
  %19 = load ptr, ptr %2, align 8, !tbaa !5
  %20 = load ptr, ptr %2, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.tag_____ArgsParserState__, ptr %20, i32 0, i32 8
  %22 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 0
  %23 = load ptr, ptr %22, align 8
  %24 = getelementptr inbounds { ptr, i32 }, ptr %21, i32 0, i32 1
  %25 = load i32, ptr %24, align 8
  call void @ArgsParser__parseArgsFileImpl__(ptr noundef %19, ptr %23, i32 %25)
  %26 = load ptr, ptr %2, align 8, !tbaa !5
  call void @ArgsParser__readToken__(ptr noundef %26)
  br label %27

27:                                               ; preds = %18, %14
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__readToken__(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__expected__(ptr noundef, ptr, i32) #0

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__parseArgsFileImpl__(ptr noundef, ptr, i32) #0

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


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

@mu_____string0 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string574 = external dso_local local_unnamed_addr global %struct.string__, align 8

; Function Attrs: nounwind uwtable
declare dso_local zeroext i8 @string__equals__(ptr, i32, ptr, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @ArgsParser__parseArgsFileFlag__(ptr noundef %0) local_unnamed_addr #0 {
  tail call void @ArgsParser__readToken__(ptr noundef %0)
  %2 = getelementptr inbounds i8, ptr %0, i64 80
  %3 = load ptr, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr %0, i64 88
  %5 = load i32, ptr %4, align 8
  %6 = load ptr, ptr @mu_____string0, align 8
  %7 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string0, i64 8), align 8
  %8 = tail call zeroext i8 @string__equals__(ptr %3, i32 %5, ptr %6, i32 %7)
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %12, label %9

9:                                                ; preds = %1
  %10 = load ptr, ptr @mu_____string574, align 8
  %11 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string574, i64 8), align 8
  tail call void @ArgsParser__expected__(ptr noundef nonnull %0, ptr %10, i32 %11)
  br label %15

12:                                               ; preds = %1
  %13 = load ptr, ptr %2, align 8
  %14 = load i32, ptr %4, align 8
  tail call void @ArgsParser__parseArgsFileImpl__(ptr noundef nonnull %0, ptr %13, i32 %14)
  tail call void @ArgsParser__readToken__(ptr noundef nonnull %0)
  br label %15

15:                                               ; preds = %12, %9
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__readToken__(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__expected__(ptr noundef, ptr, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @ArgsParser__parseArgsFileImpl__(ptr noundef, ptr, i32) local_unnamed_addr #0

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


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InstCombinePass,SROAPass,TailCallElimPass