; LLVM IR from nickmqb/muon :: bootstrap/mu.ll_Parser (parseOpenBrace__)

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

@mu_____string314 = external dso_local global %struct.string__, align 8
@mu_____string312 = external dso_local global %struct.string__, align 8

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @Parser__readToken__(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local ptr @Parser__parseOpenBrace__(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca i8, align 1
  %9 = alloca i8, align 1
  %10 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %11 = load ptr, ptr %4, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.tag_____ParserState__, ptr %11, i32 0, i32 15
  store ptr null, ptr %12, align 8, !tbaa !9
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.tag_____ParserState__, ptr %13, i32 0, i32 3
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = getelementptr inbounds %struct.tag_____Token__, ptr %15, i32 0, i32 0
  %17 = load i32, ptr %16, align 8, !tbaa !15
  %18 = icmp eq i32 %17, 7
  br i1 %18, label %19, label %106

19:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #2
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.tag_____ParserState__, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !14
  store ptr %22, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #2
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.tag_____ParserState__, ptr %23, i32 0, i32 3
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds %struct.tag_____Token__, ptr %25, i32 0, i32 4
  %27 = load i32, ptr %26, align 8, !tbaa !17
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.tag_____ParserState__, ptr %28, i32 0, i32 5
  %30 = load i32, ptr %29, align 4, !tbaa !18
  %31 = icmp eq i32 %27, %30
  %32 = zext i1 %31 to i32
  %33 = trunc i32 %32 to i8
  store i8 %33, ptr %7, align 1, !tbaa !19
  %34 = load i8, ptr %7, align 1, !tbaa !19
  %35 = icmp ne i8 %34, 0
  br i1 %35, label %45, label %36

36:                                               ; preds = %19
  %37 = load ptr, ptr %4, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.tag_____ParserState__, ptr %37, i32 0, i32 3
  %39 = load ptr, ptr %38, align 8, !tbaa !14
  %40 = getelementptr inbounds %struct.tag_____Token__, ptr %39, i32 0, i32 4
  %41 = load i32, ptr %40, align 8, !tbaa !17
  %42 = icmp eq i32 %41, 2147483647
  %43 = zext i1 %42 to i32
  %44 = trunc i32 %43 to i8
  store i8 %44, ptr %7, align 1, !tbaa !19
  br label %45

45:                                               ; preds = %36, %19
  %46 = load i8, ptr %7, align 1, !tbaa !19
  %47 = icmp ne i8 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %45
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  call void @Parser__readToken__(ptr noundef %49)
  br label %54

50:                                               ; preds = %45
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = load ptr, ptr @mu_____string312, align 8
  %53 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string312, i32 0, i32 1), align 8
  call void @Parser__badToken__(ptr noundef %51, ptr %52, i32 %53)
  br label %54

54:                                               ; preds = %50, %48
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #2
  %55 = load ptr, ptr %4, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.tag_____ParserState__, ptr %55, i32 0, i32 3
  %57 = load ptr, ptr %56, align 8, !tbaa !14
  %58 = getelementptr inbounds %struct.tag_____Token__, ptr %57, i32 0, i32 0
  %59 = load i32, ptr %58, align 8, !tbaa !15
  %60 = icmp eq i32 %59, 8
  %61 = zext i1 %60 to i32
  %62 = trunc i32 %61 to i8
  store i8 %62, ptr %8, align 1, !tbaa !19
  %63 = load i8, ptr %8, align 1, !tbaa !19
  %64 = icmp ne i8 %63, 0
  br i1 %64, label %65, label %90

65:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #2
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.tag_____ParserState__, ptr %66, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !14
  %69 = getelementptr inbounds %struct.tag_____Token__, ptr %68, i32 0, i32 4
  %70 = load i32, ptr %69, align 8, !tbaa !17
  %71 = load ptr, ptr %4, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.tag_____ParserState__, ptr %71, i32 0, i32 5
  %73 = load i32, ptr %72, align 4, !tbaa !18
  %74 = icmp eq i32 %70, %73
  %75 = zext i1 %74 to i32
  %76 = trunc i32 %75 to i8
  store i8 %76, ptr %9, align 1, !tbaa !19
  %77 = load i8, ptr %9, align 1, !tbaa !19
  %78 = icmp ne i8 %77, 0
  br i1 %78, label %88, label %79

79:                                               ; preds = %65
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.tag_____ParserState__, ptr %80, i32 0, i32 3
  %82 = load ptr, ptr %81, align 8, !tbaa !14
  %83 = getelementptr inbounds %struct.tag_____Token__, ptr %82, i32 0, i32 4
  %84 = load i32, ptr %83, align 8, !tbaa !17
  %85 = icmp eq i32 %84, 2147483647
  %86 = zext i1 %85 to i32
  %87 = trunc i32 %86 to i8
  store i8 %87, ptr %9, align 1, !tbaa !19
  br label %88

88:                                               ; preds = %79, %65
  %89 = load i8, ptr %9, align 1, !tbaa !19
  store i8 %89, ptr %8, align 1, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #2
  br label %90

90:                                               ; preds = %88, %54
  %91 = load i8, ptr %8, align 1, !tbaa !19
  %92 = icmp ne i8 %91, 0
  br i1 %92, label %93, label %101

93:                                               ; preds = %90
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.tag_____ParserState__, ptr %94, i32 0, i32 3
  %96 = load ptr, ptr %95, align 8, !tbaa !14
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.tag_____ParserState__, ptr %97, i32 0, i32 15
  store ptr %96, ptr %98, align 8, !tbaa !9
  %99 = load ptr, ptr %4, align 8, !tbaa !5
  call void @Parser__readToken__(ptr noundef %99)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %100, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %105

101:                                              ; preds = %90
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  call void @Parser__endLine__(ptr noundef %102, ptr noundef %103)
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %104, ptr %3, align 8
  store i32 1, ptr %10, align 4
  br label %105

105:                                              ; preds = %101, %93
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #2
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #2
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #2
  br label %110

106:                                              ; preds = %2
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = load ptr, ptr @mu_____string314, align 8
  %109 = load i32, ptr getelementptr inbounds ({ ptr, i32 }, ptr @mu_____string314, i32 0, i32 1), align 8
  call void @Parser__expected__(ptr noundef %107, ptr %108, i32 %109)
  store ptr null, ptr %3, align 8
  br label %110

110:                                              ; preds = %106, %105
  %111 = load ptr, ptr %3, align 8
  ret ptr %111
}

; Function Attrs: nounwind uwtable
declare dso_local void @Parser__endLine__(ptr noundef, ptr noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 = { 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/C++ TBAA"}
!9 = !{!10, !6, i64 104}
!10 = !{!"tag_____ParserState__", !11, i64 0, !12, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !6, i64 64, !13, i64 72, !12, i64 80, !12, i64 84, !6, i64 88, !12, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"", !6, i64 0, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"tag_____IntRange__", !12, i64 0, !12, i64 4}
!14 = !{!10, !6, i64 32}
!15 = !{!16, !12, i64 0}
!16 = !{!"tag_____Token__", !12, i64 0, !11, i64 8, !13, i64 24, !13, i64 32, !12, i64 40}
!17 = !{!16, !12, i64 40}
!18 = !{!10, !12, i64 44}
!19 = !{!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.string__ = type { ptr, i32 }

@mu_____string314 = external dso_local local_unnamed_addr global %struct.string__, align 8
@mu_____string312 = external dso_local local_unnamed_addr global %struct.string__, align 8

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

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @Parser__parseOpenBrace__(ptr noundef %0, ptr noundef %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %0, i64 104
  store ptr null, ptr %3, align 8, !tbaa !5
  %4 = getelementptr inbounds i8, ptr %0, i64 32
  %5 = load ptr, ptr %4, align 8, !tbaa !13
  %6 = load i32, ptr %5, align 8, !tbaa !14
  %7 = icmp eq i32 %6, 7
  br i1 %7, label %8, label %30

8:                                                ; preds = %2
  %9 = getelementptr inbounds i8, ptr %5, i64 40
  %10 = load i32, ptr %9, align 8, !tbaa !16
  %11 = getelementptr inbounds i8, ptr %0, i64 44
  %12 = load i32, ptr %11, align 4, !tbaa !17
  %13 = icmp ne i32 %10, %12
  %14 = icmp ne i32 %10, 2147483647
  %spec.select = and i1 %14, %13
  br i1 %spec.select, label %16, label %15

15:                                               ; preds = %8
  tail call void @Parser__readToken__(ptr noundef nonnull %0)
  br label %19

16:                                               ; preds = %8
  %17 = load ptr, ptr @mu_____string312, align 8
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string312, i64 8), align 8
  tail call void @Parser__badToken__(ptr noundef nonnull %0, ptr %17, i32 %18)
  br label %19

19:                                               ; preds = %16, %15
  %20 = load ptr, ptr %4, align 8, !tbaa !13
  %21 = load i32, ptr %20, align 8, !tbaa !14
  %22 = icmp eq i32 %21, 8
  br i1 %22, label %23, label %.critedge

23:                                               ; preds = %19
  %24 = getelementptr inbounds i8, ptr %20, i64 40
  %25 = load i32, ptr %24, align 8, !tbaa !16
  %26 = load i32, ptr %11, align 4, !tbaa !17
  %27 = icmp ne i32 %25, %26
  %28 = icmp ne i32 %25, 2147483647
  %spec.select32 = and i1 %28, %27
  br i1 %spec.select32, label %.critedge, label %29

29:                                               ; preds = %23
  store ptr %20, ptr %3, align 8, !tbaa !5
  tail call void @Parser__readToken__(ptr noundef nonnull %0)
  br label %33

.critedge:                                        ; preds = %19, %23
  tail call void @Parser__endLine__(ptr noundef nonnull %0, ptr noundef %1)
  br label %33

30:                                               ; preds = %2
  %31 = load ptr, ptr @mu_____string314, align 8
  %32 = load i32, ptr getelementptr inbounds (i8, ptr @mu_____string314, i64 8), align 8
  tail call void @Parser__expected__(ptr noundef nonnull %0, ptr %31, i32 %32)
  br label %33

33:                                               ; preds = %29, %.critedge, %30
  %.1 = phi ptr [ null, %30 ], [ %5, %.critedge ], [ %5, %29 ]
  ret ptr %.1
}

; Function Attrs: nounwind uwtable
declare dso_local void @Parser__endLine__(ptr noundef, ptr noundef) 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)"}
!5 = !{!6, !8, i64 104}
!6 = !{!"tag_____ParserState__", !7, i64 0, !11, i64 16, !8, i64 24, !8, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !8, i64 64, !12, i64 72, !11, i64 80, !11, i64 84, !8, i64 88, !11, i64 96, !8, i64 104, !8, i64 112, !8, i64 120}
!7 = !{!"", !8, i64 0, !11, i64 8}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"int", !9, i64 0}
!12 = !{!"tag_____IntRange__", !11, i64 0, !11, i64 4}
!13 = !{!6, !8, i64 32}
!14 = !{!15, !11, i64 0}
!15 = !{!"tag_____Token__", !11, i64 0, !7, i64 8, !12, i64 24, !12, i64 32, !11, i64 40}
!16 = !{!15, !11, i64 40}
!17 = !{!6, !11, i64 44}


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