; LLVM IR from snowballstem/snowball :: compiler (generator)

; 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.node = type { ptr, ptr, ptr, ptr, ptr, i8, i8, i8, ptr, ptr, ptr, i32, i32, i32 }
%struct.name = type { ptr, ptr, i8, i8, i8, i8, i8, i8, i8, ptr, i32, ptr, ptr, ptr, i32 }

@.str.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @write_comment_content(ptr noundef %0, ptr noundef %1) #0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds %struct.node, ptr %5, i32 0, i32 5
  %7 = load i8, ptr %6, align 8, !tbaa !9
  %8 = zext i8 %7 to i32
  switch i32 %8, label %51 [
    i32 84, label %9
    i32 59, label %9
    i32 51, label %9
    i32 53, label %9
    i32 27, label %9
    i32 4, label %31
    i32 5, label %31
    i32 0, label %31
    i32 2, label %31
    i32 3, label %31
    i32 1, label %31
    i32 24, label %40
  ]

9:                                                ; preds = %2, %2, %2, %2, %2
  %10 = load ptr, ptr %4, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.node, ptr %10, i32 0, i32 9
  %12 = load ptr, ptr %11, align 8, !tbaa !12
  %13 = icmp ne ptr %12, null
  br i1 %13, label %14, label %23

14:                                               ; preds = %9
  %15 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_char(ptr noundef %15, i32 noundef 36)
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.node, ptr %17, i32 0, i32 9
  %19 = load ptr, ptr %18, align 8, !tbaa !12
  %20 = getelementptr inbounds %struct.name, ptr %19, i32 0, i32 1
  %21 = load ptr, ptr %20, align 8, !tbaa !13
  call void @write_s(ptr noundef %16, ptr noundef %21)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_char(ptr noundef %22, i32 noundef 32)
  br label %23

23:                                               ; preds = %14, %9
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.node, ptr %25, i32 0, i32 5
  %27 = load i8, ptr %26, align 8, !tbaa !9
  %28 = zext i8 %27 to i32
  %29 = call ptr @name_of_token(i32 noundef %28)
  call void @write_string(ptr noundef %24, ptr noundef %29)
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %30, ptr noundef @.str.7)
  br label %71

31:                                               ; preds = %2, %2, %2, %2, %2, %2
  %32 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %32, ptr noundef @.str.8)
  %33 = load ptr, ptr %3, align 8, !tbaa !5
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.node, ptr %34, i32 0, i32 5
  %36 = load i8, ptr %35, align 8, !tbaa !9
  %37 = zext i8 %36 to i32
  %38 = call ptr @name_of_token(i32 noundef %37)
  call void @write_string(ptr noundef %33, ptr noundef %38)
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %39, ptr noundef @.str.9)
  br label %71

40:                                               ; preds = %2
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.node, ptr %41, i32 0, i32 6
  %43 = load i8, ptr %42, align 1, !tbaa !15
  %44 = zext i8 %43 to i32
  %45 = icmp eq i32 %44, 0
  br i1 %45, label %46, label %48

46:                                               ; preds = %40
  %47 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %47, ptr noundef @.str.10)
  br label %50

48:                                               ; preds = %40
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %49, ptr noundef @.str.11)
  br label %50

50:                                               ; preds = %48, %46
  br label %51

51:                                               ; preds = %50, %2
  %52 = load ptr, ptr %3, align 8, !tbaa !5
  %53 = load ptr, ptr %4, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.node, ptr %53, i32 0, i32 5
  %55 = load i8, ptr %54, align 8, !tbaa !9
  %56 = zext i8 %55 to i32
  %57 = call ptr @name_of_token(i32 noundef %56)
  call void @write_string(ptr noundef %52, ptr noundef %57)
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.node, ptr %58, i32 0, i32 9
  %60 = load ptr, ptr %59, align 8, !tbaa !12
  %61 = icmp ne ptr %60, null
  br i1 %61, label %62, label %70

62:                                               ; preds = %51
  %63 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_char(ptr noundef %63, i32 noundef 32)
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = load ptr, ptr %4, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.node, ptr %65, i32 0, i32 9
  %67 = load ptr, ptr %66, align 8, !tbaa !12
  %68 = getelementptr inbounds %struct.name, ptr %67, i32 0, i32 1
  %69 = load ptr, ptr %68, align 8, !tbaa !13
  call void @write_s(ptr noundef %64, ptr noundef %69)
  br label %70

70:                                               ; preds = %62, %51
  br label %71

71:                                               ; preds = %70, %31, %23
  %72 = load ptr, ptr %3, align 8, !tbaa !5
  call void @write_string(ptr noundef %72, ptr noundef @.str.12)
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.node, ptr %74, i32 0, i32 12
  %76 = load i32, ptr %75, align 4, !tbaa !16
  call void @write_int(ptr noundef %73, i32 noundef %76)
  ret void
}

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

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

declare ptr @name_of_token(i32 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local void @write_int(ptr noundef, i32 noundef) #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" }
attributes #1 = { "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"}
!9 = !{!10, !7, i64 40}
!10 = !{!"node", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !7, i64 40, !7, i64 41, !7, i64 42, !6, i64 48, !6, i64 56, !6, i64 64, !11, i64 72, !11, i64 76, !11, i64 80}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 56}
!13 = !{!14, !6, i64 8}
!14 = !{!"name", !6, i64 0, !6, i64 8, !7, i64 16, !7, i64 17, !7, i64 18, !7, i64 19, !7, i64 20, !7, i64 21, !7, i64 22, !6, i64 24, !11, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !11, i64 64}
!15 = !{!10, !7, i64 41}
!16 = !{!10, !11, i64 76}


; 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.7 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [24 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [8 x i8], align 1

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

; Function Attrs: nounwind uwtable
define dso_local void @write_comment_content(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #0 {
  %3 = getelementptr inbounds i8, ptr %1, i64 40
  %4 = load i8, ptr %3, align 8, !tbaa !5
  switch i8 %4, label %23 [
    i8 84, label %5
    i8 59, label %5
    i8 51, label %5
    i8 53, label %5
    i8 27, label %5
    i8 4, label %16
    i8 5, label %16
    i8 0, label %16
    i8 2, label %16
    i8 3, label %16
    i8 1, label %16
    i8 24, label %.sink.split
  ]

5:                                                ; preds = %2, %2, %2, %2, %2
  %6 = getelementptr inbounds i8, ptr %1, i64 56
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %12, label %8

8:                                                ; preds = %5
  tail call void @write_char(ptr noundef %0, i32 noundef 36)
  %9 = load ptr, ptr %6, align 8, !tbaa !11
  %10 = getelementptr inbounds i8, ptr %9, i64 8
  %11 = load ptr, ptr %10, align 8, !tbaa !12
  tail call void @write_s(ptr noundef %0, ptr noundef %11)
  tail call void @write_char(ptr noundef %0, i32 noundef 32)
  %.pre = load i8, ptr %3, align 8, !tbaa !5
  br label %12

12:                                               ; preds = %8, %5
  %13 = phi i8 [ %.pre, %8 ], [ %4, %5 ]
  %14 = zext i8 %13 to i32
  %15 = tail call ptr @name_of_token(i32 noundef %14) #2
  tail call void @write_string(ptr noundef %0, ptr noundef %15)
  tail call void @write_string(ptr noundef %0, ptr noundef nonnull @.str.7)
  br label %33

16:                                               ; preds = %2, %2, %2, %2, %2, %2
  tail call void @write_string(ptr noundef %0, ptr noundef nonnull @.str.8)
  %17 = load i8, ptr %3, align 8, !tbaa !5
  %18 = zext i8 %17 to i32
  %19 = tail call ptr @name_of_token(i32 noundef %18) #2
  tail call void @write_string(ptr noundef %0, ptr noundef %19)
  tail call void @write_string(ptr noundef %0, ptr noundef nonnull @.str.9)
  br label %33

.sink.split:                                      ; preds = %2
  %20 = getelementptr inbounds i8, ptr %1, i64 41
  %21 = load i8, ptr %20, align 1, !tbaa !14
  %22 = icmp eq i8 %21, 0
  %.str.10..str.11 = select i1 %22, ptr @.str.10, ptr @.str.11
  tail call void @write_string(ptr noundef %0, ptr noundef nonnull %.str.10..str.11)
  br label %23

23:                                               ; preds = %.sink.split, %2
  %24 = load i8, ptr %3, align 8, !tbaa !5
  %25 = zext i8 %24 to i32
  %26 = tail call ptr @name_of_token(i32 noundef %25) #2
  tail call void @write_string(ptr noundef %0, ptr noundef %26)
  %27 = getelementptr inbounds i8, ptr %1, i64 56
  %28 = load ptr, ptr %27, align 8, !tbaa !11
  %.not25 = icmp eq ptr %28, null
  br i1 %.not25, label %33, label %29

29:                                               ; preds = %23
  tail call void @write_char(ptr noundef %0, i32 noundef 32)
  %30 = load ptr, ptr %27, align 8, !tbaa !11
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !12
  tail call void @write_s(ptr noundef %0, ptr noundef %32)
  br label %33

33:                                               ; preds = %23, %29, %16, %12
  tail call void @write_string(ptr noundef %0, ptr noundef nonnull @.str.12)
  %34 = getelementptr inbounds i8, ptr %1, i64 76
  %35 = load i32, ptr %34, align 4, !tbaa !15
  tail call void @write_int(ptr noundef %0, i32 noundef %35)
  ret void
}

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

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

declare ptr @name_of_token(i32 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local void @write_int(ptr noundef, i32 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" }
attributes #1 = { "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, !8, i64 40}
!6 = !{!"node", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !8, i64 40, !8, i64 41, !8, i64 42, !7, i64 48, !7, i64 56, !7, i64 64, !10, i64 72, !10, i64 76, !10, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 56}
!12 = !{!13, !7, i64 8}
!13 = !{!"name", !7, i64 0, !7, i64 8, !8, i64 16, !8, i64 17, !8, i64 18, !8, i64 19, !8, i64 20, !8, i64 21, !8, i64 22, !7, i64 24, !10, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !10, i64 64}
!14 = !{!6, !8, i64 41}
!15 = !{!6, !10, i64 76}


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