; LLVM IR from pmwkaa/monotone :: monotone/main/main (execute)

; 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.Execute = type { ptr, i32 }
%struct.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Str = type { ptr, ptr, i8 }
%struct.Lex = type { ptr, ptr, i8, [4 x %struct.Token], i32 }
%struct.Token = type { i32, %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { %struct.Str, i8 }
%struct.Buf = type { ptr, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }
%struct.Executable = type { ptr, ptr, ptr }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%struct.Cmd = type { i32, ptr }

@cmds = external hidden global [25 x %struct.Execute], align 16
@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @main_execute(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca %struct.Str, align 8
  %8 = alloca %struct.Lex, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca %struct.Buf, align 8
  %13 = alloca %struct.Guard, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %struct.Executable, align 8
  %18 = alloca %struct.Exception, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 24, ptr %7) #8
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  call void @str_set_cstr(ptr noundef %7, ptr noundef %20)
  call void @llvm.lifetime.start.p0(i64 192, ptr %8) #8
  call void @lex_init(ptr noundef %8)
  call void @lex_start(ptr noundef %8, ptr noundef %7)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %21 = call ptr @parse(ptr noundef %8)
  store ptr %21, ptr %9, align 8, !tbaa !5
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %3
  store i32 1, ptr %10, align 4
  br label %102

25:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.Cmd, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !9
  %29 = zext i32 %28 to i64
  %30 = getelementptr inbounds [25 x %struct.Execute], ptr @cmds, i64 0, i64 %29
  store ptr %30, ptr %11, align 8, !tbaa !5
  %31 = load ptr, ptr %11, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.Execute, ptr %31, i32 0, i32 1
  %33 = load i32, ptr %32, align 8, !tbaa !12
  switch i32 %33, label %36 [
    i32 0, label %36
    i32 1, label %34
    i32 2, label %35
  ]

34:                                               ; preds = %25
  call void @control_lock_shared()
  br label %36

35:                                               ; preds = %25
  call void @control_lock_exclusive()
  br label %36

36:                                               ; preds = %35, %34, %25, %25
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #8
  call void @buf_init(ptr noundef %12)
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #8
  %37 = getelementptr inbounds %struct.Guard, ptr %13, i32 0, i32 0
  store ptr @buf_free, ptr %37, align 8, !tbaa !14
  %38 = getelementptr inbounds %struct.Guard, ptr %13, i32 0, i32 1
  store ptr %12, ptr %38, align 8, !tbaa !16
  %39 = getelementptr inbounds %struct.Guard, ptr %13, i32 0, i32 2
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  %40 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %41 = getelementptr inbounds %struct.Runtime, ptr %40, i32 0, i32 0
  %42 = getelementptr inbounds %struct.ExceptionMgr, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !17
  store ptr %43, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %44 = load ptr, ptr %14, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.Exception, ptr %44, i32 0, i32 2
  %46 = load ptr, ptr %45, align 8, !tbaa !21
  store ptr %46, ptr %15, align 8, !tbaa !5
  %47 = load ptr, ptr %14, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Exception, ptr %47, i32 0, i32 2
  store ptr %13, ptr %48, align 8, !tbaa !21
  %49 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %49, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  %50 = load ptr, ptr %16, align 8, !tbaa !5
  store ptr %50, ptr %39, align 8, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #8
  %51 = getelementptr inbounds %struct.Executable, ptr %17, i32 0, i32 0
  %52 = load ptr, ptr %4, align 8, !tbaa !5
  store ptr %52, ptr %51, align 8, !tbaa !25
  %53 = getelementptr inbounds %struct.Executable, ptr %17, i32 0, i32 1
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %54, ptr %53, align 8, !tbaa !27
  %55 = getelementptr inbounds %struct.Executable, ptr %17, i32 0, i32 2
  store ptr %12, ptr %55, align 8, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 224, ptr %18) #8
  %56 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %57 = getelementptr inbounds %struct.Runtime, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.ExceptionMgr, ptr %57, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !17
  %60 = getelementptr inbounds %struct.Exception, ptr %18, i32 0, i32 0
  store ptr %59, ptr %60, align 8, !tbaa !29
  %61 = getelementptr inbounds %struct.Exception, ptr %18, i32 0, i32 1
  store i8 0, ptr %61, align 8, !tbaa !30
  %62 = getelementptr inbounds %struct.Exception, ptr %18, i32 0, i32 2
  store ptr null, ptr %62, align 8, !tbaa !21
  %63 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %64 = getelementptr inbounds %struct.Runtime, ptr %63, i32 0, i32 0
  %65 = getelementptr inbounds %struct.ExceptionMgr, ptr %64, i32 0, i32 0
  store ptr %18, ptr %65, align 8, !tbaa !17
  %66 = getelementptr inbounds %struct.Exception, ptr %18, i32 0, i32 3
  %67 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %66, i64 0, i64 0
  %68 = call i32 @_setjmp(ptr noundef %67) #9
  %69 = icmp eq i32 %68, 0
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %19, align 4, !tbaa !31
  %71 = load i32, ptr %19, align 4, !tbaa !31
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %77

73:                                               ; preds = %36
  %74 = load ptr, ptr %11, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.Execute, ptr %74, i32 0, i32 0
  %76 = load ptr, ptr %75, align 8, !tbaa !32
  call void %76(ptr noundef %17)
  br label %77

77:                                               ; preds = %73, %36
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Execute, ptr %78, i32 0, i32 1
  %80 = load i32, ptr %79, align 8, !tbaa !12
  %81 = icmp ne i32 %80, 0
  br i1 %81, label %82, label %83

82:                                               ; preds = %77
  call void @control_unlock()
  br label %83

83:                                               ; preds = %82, %77
  %84 = load ptr, ptr %9, align 8, !tbaa !5
  call void @cmd_free(ptr noundef %84)
  %85 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %86 = getelementptr inbounds %struct.Runtime, ptr %85, i32 0, i32 0
  %87 = call zeroext i1 @exception_mgr_leave(ptr noundef %86, ptr noundef %18)
  br i1 %87, label %88, label %91

88:                                               ; preds = %83
  %89 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %90 = getelementptr inbounds %struct.Runtime, ptr %89, i32 0, i32 0
  call void @exception_mgr_throw(ptr noundef %90) #10
  unreachable

91:                                               ; preds = %83
  %92 = load ptr, ptr %6, align 8, !tbaa !5
  %93 = icmp ne ptr %92, null
  br i1 %93, label %94, label %101

94:                                               ; preds = %91
  %95 = call i32 @buf_size(ptr noundef %12)
  %96 = icmp sgt i32 %95, 0
  br i1 %96, label %97, label %101

97:                                               ; preds = %94
  call void @buf_write(ptr noundef %12, ptr noundef @.str, i32 noundef 1)
  %98 = call ptr @unguard()
  %99 = call ptr @buf_cstr(ptr noundef %12)
  %100 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %99, ptr %100, align 8, !tbaa !5
  br label %101

101:                                              ; preds = %97, %94, %91
  call void @llvm.lifetime.end.p0(i64 224, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #8
  call void @guard_runner(ptr noundef %13)
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  store i32 0, ptr %10, align 4
  br label %102

102:                                              ; preds = %101, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 192, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %7) #8
  %103 = load i32, ptr %10, align 4
  switch i32 %103, label %105 [
    i32 0, label %104
    i32 1, label %104
  ]

104:                                              ; preds = %102, %102
  ret void

105:                                              ; preds = %102
  unreachable
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @str_set_cstr(ptr noundef, ptr noundef) #2

declare void @lex_init(ptr noundef) #3

declare void @lex_start(ptr noundef, ptr noundef) #3

declare ptr @parse(ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_shared() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_exclusive() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_init(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_free(ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #4

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) #5

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_unlock() #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cmd_free(ptr noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @buf_size(ptr noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_write(ptr noundef, ptr noundef, i32 noundef) #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @unguard() #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @buf_cstr(ptr noundef) #2

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" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { "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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { alwaysinline 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 #6 = { nounwind returns_twice "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 #7 = { inlinehint noreturn 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 #8 = { nounwind }
attributes #9 = { nounwind returns_twice }
attributes #10 = { noreturn }

!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, !11, i64 0}
!10 = !{!"Cmd", !11, i64 0, !6, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 8}
!13 = !{!"Execute", !6, i64 0, !11, i64 8}
!14 = !{!15, !6, i64 0}
!15 = !{!"Guard", !6, i64 0, !6, i64 8, !6, i64 16}
!16 = !{!15, !6, i64 8}
!17 = !{!18, !6, i64 0}
!18 = !{!"Runtime", !19, i64 0, !20, i64 8, !6, i64 312}
!19 = !{!"ExceptionMgr", !6, i64 0}
!20 = !{!"Error", !7, i64 0, !11, i64 256, !6, i64 264, !6, i64 272, !11, i64 280, !6, i64 288, !6, i64 296}
!21 = !{!22, !6, i64 16}
!22 = !{!"Exception", !6, i64 0, !23, i64 8, !6, i64 16, !7, i64 24}
!23 = !{!"_Bool", !7, i64 0}
!24 = !{!15, !6, i64 16}
!25 = !{!26, !6, i64 0}
!26 = !{!"Executable", !6, i64 0, !6, i64 8, !6, i64 16}
!27 = !{!26, !6, i64 8}
!28 = !{!26, !6, i64 16}
!29 = !{!22, !6, i64 0}
!30 = !{!22, !23, i64 8}
!31 = !{!11, !11, i64 0}
!32 = !{!13, !6, 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.Execute = type { ptr, i32 }
%struct.Runtime = type { %struct.ExceptionMgr, %struct.Error, ptr }
%struct.ExceptionMgr = type { ptr }
%struct.Error = type { [256 x i8], i32, ptr, ptr, i32, ptr, ptr }
%struct.Str = type { ptr, ptr, i8 }
%struct.Lex = type { ptr, ptr, i8, [4 x %struct.Token], i32 }
%struct.Token = type { i32, %union.anon }
%union.anon = type { %struct.anon }
%struct.anon = type { %struct.Str, i8 }
%struct.Buf = type { ptr, ptr, ptr }
%struct.Guard = type { ptr, ptr, ptr }
%struct.Executable = type { ptr, ptr, ptr }
%struct.Exception = type { ptr, i8, ptr, [1 x %struct.__jmp_buf_tag] }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@cmds = external hidden local_unnamed_addr global [25 x %struct.Execute], align 16
@mn_runtime = external thread_local global %struct.Runtime, align 8
@.str = external hidden unnamed_addr constant [2 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @main_execute(ptr noundef %0, ptr noundef %1, ptr noundef writeonly %2) local_unnamed_addr #0 {
  %4 = alloca %struct.Str, align 8
  %5 = alloca %struct.Lex, align 8
  %6 = alloca %struct.Buf, align 8
  %7 = alloca %struct.Guard, align 8
  %8 = alloca %struct.Executable, align 8
  %9 = alloca %struct.Exception, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  call void @str_set_cstr(ptr noundef nonnull %4, ptr noundef %1)
  call void @llvm.lifetime.start.p0(i64 192, ptr nonnull %5) #8
  call void @lex_init(ptr noundef nonnull %5) #8
  call void @lex_start(ptr noundef nonnull %5, ptr noundef nonnull %4) #8
  %10 = call ptr @parse(ptr noundef nonnull %5) #8
  %11 = icmp eq ptr %10, null
  br i1 %11, label %50, label %12

12:                                               ; preds = %3
  %13 = load i32, ptr %10, align 8, !tbaa !5
  %14 = zext i32 %13 to i64
  %15 = getelementptr inbounds [25 x %struct.Execute], ptr @cmds, i64 0, i64 %14
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = load i32, ptr %16, align 8, !tbaa !11
  switch i32 %17, label %20 [
    i32 2, label %19
    i32 1, label %18
  ]

18:                                               ; preds = %12
  call void @control_lock_shared()
  br label %20

19:                                               ; preds = %12
  call void @control_lock_exclusive()
  br label %20

20:                                               ; preds = %19, %18, %12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #8
  call void @buf_init(ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #8
  store ptr @buf_free, ptr %7, align 8, !tbaa !13
  %21 = getelementptr inbounds i8, ptr %7, i64 8
  store ptr %6, ptr %21, align 8, !tbaa !15
  %22 = getelementptr inbounds i8, ptr %7, i64 16
  %23 = call align 8 ptr @llvm.threadlocal.address.p0(ptr align 8 @mn_runtime)
  %24 = load ptr, ptr %23, align 8, !tbaa !16
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  %26 = load ptr, ptr %25, align 8, !tbaa !20
  store ptr %7, ptr %25, align 8, !tbaa !20
  store ptr %26, ptr %22, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #8
  store ptr %0, ptr %8, align 8, !tbaa !24
  %27 = getelementptr inbounds i8, ptr %8, i64 8
  store ptr %10, ptr %27, align 8, !tbaa !26
  %28 = getelementptr inbounds i8, ptr %8, i64 16
  store ptr %6, ptr %28, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 224, ptr nonnull %9) #8
  store ptr %24, ptr %9, align 8, !tbaa !28
  %29 = getelementptr inbounds i8, ptr %9, i64 8
  store i8 0, ptr %29, align 8, !tbaa !29
  %30 = getelementptr inbounds i8, ptr %9, i64 16
  store ptr null, ptr %30, align 8, !tbaa !20
  store ptr %9, ptr %23, align 8, !tbaa !16
  %31 = getelementptr inbounds i8, ptr %9, i64 24
  %32 = call i32 @_setjmp(ptr noundef nonnull %31) #9
  %33 = icmp eq i32 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %20
  %35 = load ptr, ptr %15, align 16, !tbaa !30
  call void %35(ptr noundef nonnull %8) #8
  br label %36

36:                                               ; preds = %34, %20
  %37 = load i32, ptr %16, align 8, !tbaa !11
  %.not = icmp eq i32 %37, 0
  br i1 %.not, label %39, label %38

38:                                               ; preds = %36
  call void @control_unlock()
  br label %39

39:                                               ; preds = %38, %36
  call void @cmd_free(ptr noundef nonnull %10)
  %40 = call zeroext i1 @exception_mgr_leave(ptr noundef nonnull %23, ptr noundef nonnull %9)
  br i1 %40, label %41, label %42

41:                                               ; preds = %39
  call void @exception_mgr_throw(ptr noundef nonnull %23) #10
  unreachable

42:                                               ; preds = %39
  %.not16 = icmp eq ptr %2, null
  br i1 %.not16, label %49, label %43

43:                                               ; preds = %42
  %44 = call i32 @buf_size(ptr noundef nonnull %6)
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %46, label %49

46:                                               ; preds = %43
  call void @buf_write(ptr noundef nonnull %6, ptr noundef nonnull @.str, i32 noundef 1)
  %47 = call ptr @unguard()
  %48 = call ptr @buf_cstr(ptr noundef nonnull %6)
  store ptr %48, ptr %2, align 8, !tbaa !31
  br label %49

49:                                               ; preds = %46, %43, %42
  call void @llvm.lifetime.end.p0(i64 224, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #8
  call void @guard_runner(ptr noundef nonnull %7)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #8
  br label %50

50:                                               ; preds = %3, %49
  call void @llvm.lifetime.end.p0(i64 192, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  ret void
}

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @str_set_cstr(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @lex_init(ptr noundef) local_unnamed_addr #3

declare void @lex_start(ptr noundef, ptr noundef) local_unnamed_addr #3

declare ptr @parse(ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_shared() local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_lock_exclusive() local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_init(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_free(ptr noundef) #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare nonnull ptr @llvm.threadlocal.address.p0(ptr nonnull) #4

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @guard_runner(ptr noundef) local_unnamed_addr #5

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #6

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @control_unlock() local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @cmd_free(ptr noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden zeroext i1 @exception_mgr_leave(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint noreturn nounwind uwtable
declare hidden void @exception_mgr_throw(ptr noundef) local_unnamed_addr #7

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @buf_size(ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @buf_write(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline nounwind uwtable
declare hidden ptr @unguard() local_unnamed_addr #5

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @buf_cstr(ptr noundef) local_unnamed_addr #2

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" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint 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 #3 = { "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 #4 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { alwaysinline 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 #6 = { nounwind returns_twice "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 #7 = { inlinehint noreturn 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 #8 = { nounwind }
attributes #9 = { nounwind returns_twice }
attributes #10 = { noreturn }

!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 0}
!6 = !{!"Cmd", !7, i64 0, !10, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 8}
!12 = !{!"Execute", !10, i64 0, !7, i64 8}
!13 = !{!14, !10, i64 0}
!14 = !{!"Guard", !10, i64 0, !10, i64 8, !10, i64 16}
!15 = !{!14, !10, i64 8}
!16 = !{!17, !10, i64 0}
!17 = !{!"Runtime", !18, i64 0, !19, i64 8, !10, i64 312}
!18 = !{!"ExceptionMgr", !10, i64 0}
!19 = !{!"Error", !8, i64 0, !7, i64 256, !10, i64 264, !10, i64 272, !7, i64 280, !10, i64 288, !10, i64 296}
!20 = !{!21, !10, i64 16}
!21 = !{!"Exception", !10, i64 0, !22, i64 8, !10, i64 16, !8, i64 24}
!22 = !{!"_Bool", !8, i64 0}
!23 = !{!14, !10, i64 16}
!24 = !{!25, !10, i64 0}
!25 = !{!"Executable", !10, i64 0, !10, i64 8, !10, i64 16}
!26 = !{!25, !10, i64 8}
!27 = !{!25, !10, i64 16}
!28 = !{!21, !10, i64 0}
!29 = !{!21, !22, i64 8}
!30 = !{!12, !10, i64 0}
!31 = !{!10, !10, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass