; LLVM IR from buzz-lang/Buzz :: src/buzz (buzzlex)

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

@.str.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external global ptr, align 8
@.str.36 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local ptr @buzzlex_file_new(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [4096 x i8], align 16
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4096, ptr %4) #6
  %12 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = call ptr @strncpy(ptr noundef %12, ptr noundef %13, i64 noundef 4095) #6
  %15 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 4095
  store i8 0, ptr %15, align 1, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %16 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %17 = call noalias ptr @fopen(ptr noundef %16, ptr noundef @.str.32)
  store ptr %17, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %84, label %20

20:                                               ; preds = %1
  %21 = call ptr @getenv(ptr noundef @.str.33) #6
  %22 = icmp ne ptr %21, null
  br i1 %22, label %24, label %23

23:                                               ; preds = %20
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %157

24:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %25 = call ptr @getenv(ptr noundef @.str.33) #6
  %26 = call noalias ptr @strdup(ptr noundef %25) #6
  store ptr %26, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %27, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %28 = call ptr @strsep(ptr noundef %8, ptr noundef @.str.34) #6
  store ptr %28, ptr %9, align 8, !tbaa !5
  br label %29

29:                                               ; preds = %67, %24
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %36

32:                                               ; preds = %29
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = icmp ne ptr %33, null
  %35 = xor i1 %34, true
  br label %36

36:                                               ; preds = %32, %29
  %37 = phi i1 [ false, %29 ], [ %35, %32 ]
  br i1 %37, label %38, label %69

38:                                               ; preds = %36
  %39 = load ptr, ptr %9, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 0
  %41 = load i8, ptr %40, align 1, !tbaa !9
  %42 = sext i8 %41 to i32
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %67

44:                                               ; preds = %38
  %45 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %46 = load ptr, ptr %9, align 8, !tbaa !5
  %47 = call ptr @strncpy(ptr noundef %45, ptr noundef %46, i64 noundef 4095) #6
  %48 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 4095
  store i8 0, ptr %48, align 1, !tbaa !9
  %49 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %50 = call i64 @strlen(ptr noundef %49) #7
  %51 = sub i64 %50, 1
  %52 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 %51
  %53 = load i8, ptr %52, align 1, !tbaa !9
  %54 = sext i8 %53 to i32
  %55 = icmp ne i32 %54, 47
  br i1 %55, label %56, label %60

56:                                               ; preds = %44
  %57 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %58 = call ptr @strncat(ptr noundef %57, ptr noundef @.str.35, i64 noundef 4095) #6
  %59 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 4095
  store i8 0, ptr %59, align 1, !tbaa !9
  br label %60

60:                                               ; preds = %56, %44
  %61 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %62 = load ptr, ptr %3, align 8, !tbaa !5
  %63 = call ptr @strncat(ptr noundef %61, ptr noundef %62, i64 noundef 4095) #6
  %64 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 4095
  store i8 0, ptr %64, align 1, !tbaa !9
  %65 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %66 = call noalias ptr @fopen(ptr noundef %65, ptr noundef @.str.32)
  store ptr %66, ptr %5, align 8, !tbaa !5
  br label %67

67:                                               ; preds = %60, %38
  %68 = call ptr @strsep(ptr noundef %8, ptr noundef @.str.34) #6
  store ptr %68, ptr %9, align 8, !tbaa !5
  br label %29, !llvm.loop !10

69:                                               ; preds = %36
  %70 = load ptr, ptr %7, align 8, !tbaa !5
  call void @free(ptr noundef %70) #6
  %71 = load ptr, ptr %9, align 8, !tbaa !5
  %72 = icmp ne ptr %71, null
  br i1 %72, label %80, label %73

73:                                               ; preds = %69
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = icmp ne ptr %74, null
  br i1 %75, label %80, label %76

76:                                               ; preds = %73
  %77 = load ptr, ptr @stderr, align 8, !tbaa !5
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %77, ptr noundef @.str.36, ptr noundef %78) #6
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %81

80:                                               ; preds = %73, %69
  store i32 0, ptr %6, align 4
  br label %81

81:                                               ; preds = %80, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %82 = load i32, ptr %6, align 4
  switch i32 %82, label %157 [
    i32 0, label %83
  ]

83:                                               ; preds = %81
  br label %84

84:                                               ; preds = %83, %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %85 = getelementptr inbounds [4096 x i8], ptr %4, i64 0, i64 0
  %86 = call ptr @realpath(ptr noundef %85, ptr noundef null) #6
  store ptr %86, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %87 = call noalias ptr @malloc(i64 noundef 48) #8
  store ptr %87, ptr %11, align 8, !tbaa !5
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = call i32 @fseek(ptr noundef %88, i64 noundef 0, i32 noundef 2)
  %90 = load ptr, ptr %5, align 8, !tbaa !5
  %91 = call i64 @ftell(ptr noundef %90)
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.buzzlex_file_s, ptr %92, i32 0, i32 2
  store i64 %91, ptr %93, align 8, !tbaa !12
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  call void @rewind(ptr noundef %94)
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.buzzlex_file_s, ptr %95, i32 0, i32 2
  %97 = load i64, ptr %96, align 8, !tbaa !12
  %98 = add i64 %97, 2
  %99 = call noalias ptr @malloc(i64 noundef %98) #8
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.buzzlex_file_s, ptr %100, i32 0, i32 4
  store ptr %99, ptr %101, align 8, !tbaa !15
  %102 = load ptr, ptr %11, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.buzzlex_file_s, ptr %102, i32 0, i32 4
  %104 = load ptr, ptr %103, align 8, !tbaa !15
  %105 = load ptr, ptr %11, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.buzzlex_file_s, ptr %105, i32 0, i32 2
  %107 = load i64, ptr %106, align 8, !tbaa !12
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = call i64 @fread(ptr noundef %104, i64 noundef 1, i64 noundef %107, ptr noundef %108)
  %110 = load ptr, ptr %11, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.buzzlex_file_s, ptr %110, i32 0, i32 2
  %112 = load i64, ptr %111, align 8, !tbaa !12
  %113 = icmp ult i64 %109, %112
  br i1 %113, label %114, label %124

114:                                              ; preds = %84
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = call i32 @fclose(ptr noundef %115)
  %117 = load ptr, ptr %11, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.buzzlex_file_s, ptr %117, i32 0, i32 4
  %119 = load ptr, ptr %118, align 8, !tbaa !15
  call void @free(ptr noundef %119) #6
  %120 = load ptr, ptr %11, align 8, !tbaa !5
  call void @free(ptr noundef %120) #6
  %121 = load ptr, ptr @stderr, align 8, !tbaa !5
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %121, ptr noundef @.str.37, ptr noundef %122) #6
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %156

124:                                              ; preds = %84
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.buzzlex_file_s, ptr %125, i32 0, i32 4
  %127 = load ptr, ptr %126, align 8, !tbaa !15
  %128 = load ptr, ptr %11, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.buzzlex_file_s, ptr %128, i32 0, i32 2
  %130 = load i64, ptr %129, align 8, !tbaa !12
  %131 = getelementptr inbounds i8, ptr %127, i64 %130
  store i8 10, ptr %131, align 1, !tbaa !9
  %132 = load ptr, ptr %11, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.buzzlex_file_s, ptr %132, i32 0, i32 4
  %134 = load ptr, ptr %133, align 8, !tbaa !15
  %135 = load ptr, ptr %11, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.buzzlex_file_s, ptr %135, i32 0, i32 2
  %137 = load i64, ptr %136, align 8, !tbaa !12
  %138 = add i64 %137, 1
  %139 = getelementptr inbounds i8, ptr %134, i64 %138
  store i8 0, ptr %139, align 1, !tbaa !9
  %140 = load ptr, ptr %11, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.buzzlex_file_s, ptr %140, i32 0, i32 2
  %142 = load i64, ptr %141, align 8, !tbaa !12
  %143 = add i64 %142, 1
  store i64 %143, ptr %141, align 8, !tbaa !12
  %144 = load ptr, ptr %5, align 8, !tbaa !5
  %145 = call i32 @fclose(ptr noundef %144)
  %146 = load ptr, ptr %10, align 8, !tbaa !5
  %147 = load ptr, ptr %11, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.buzzlex_file_s, ptr %147, i32 0, i32 5
  store ptr %146, ptr %148, align 8, !tbaa !16
  %149 = load ptr, ptr %11, align 8, !tbaa !5
  %150 = getelementptr inbounds %struct.buzzlex_file_s, ptr %149, i32 0, i32 0
  store i64 1, ptr %150, align 8, !tbaa !17
  %151 = load ptr, ptr %11, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.buzzlex_file_s, ptr %151, i32 0, i32 1
  store i64 0, ptr %152, align 8, !tbaa !18
  %153 = load ptr, ptr %11, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.buzzlex_file_s, ptr %153, i32 0, i32 3
  store i64 0, ptr %154, align 8, !tbaa !19
  %155 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %155, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %156

156:                                              ; preds = %124, %114
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %157

157:                                              ; preds = %156, %81, %23
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4096, ptr %4) #6
  %158 = load ptr, ptr %2, align 8
  ret ptr %158
}

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

; Function Attrs: nounwind
declare ptr @strncpy(ptr noundef, ptr noundef, i64 noundef) #2

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #2

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #2

; Function Attrs: nounwind
declare ptr @strsep(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind willreturn memory(read)
declare i64 @strlen(ptr noundef) #4

; Function Attrs: nounwind
declare ptr @strncat(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind
declare void @free(ptr noundef) #2

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

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

; Function Attrs: nounwind
declare ptr @realpath(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #3

declare i64 @ftell(ptr noundef) #3

declare void @rewind(ptr noundef) #3

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

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 = { nounwind "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 = { nounwind willreturn memory(read) "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 #5 = { nounwind allocsize(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 }
attributes #7 = { nounwind willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }

!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 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !14, i64 16}
!13 = !{!"buzzlex_file_s", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !6, i64 32, !6, i64 40}
!14 = !{!"long", !7, i64 0}
!15 = !{!13, !6, i64 32}
!16 = !{!13, !6, i64 40}
!17 = !{!13, !14, i64 0}
!18 = !{!13, !14, i64 8}
!19 = !{!13, !14, i64 24}


; 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.32 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.33 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [2 x i8], align 1
@stderr = external local_unnamed_addr global ptr, align 8
@.str.36 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [18 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local noalias noundef ptr @buzzlex_file_new(ptr noundef %0) local_unnamed_addr #0 {
  %2 = alloca [4096 x i8], align 16
  %3 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 4096, ptr nonnull %2) #10
  %4 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %0, i64 noundef 4095) #10
  %5 = getelementptr inbounds i8, ptr %2, i64 4095
  store i8 0, ptr %5, align 1, !tbaa !5
  %6 = call noalias ptr @fopen(ptr noundef nonnull %2, ptr noundef nonnull @.str.32)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %7, label %33

7:                                                ; preds = %1
  %8 = call ptr @getenv(ptr noundef nonnull @.str.33) #10
  %.not48 = icmp eq ptr %8, null
  br i1 %.not48, label %60, label %9

9:                                                ; preds = %7
  %10 = call noalias ptr @strdup(ptr noundef nonnull %8) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #10
  store ptr %10, ptr %3, align 8, !tbaa !8
  %11 = call ptr @strsep(ptr noundef nonnull %3, ptr noundef nonnull @.str.34) #10
  %.not58 = icmp eq ptr %11, null
  br i1 %.not58, label %._crit_edge.thread, label %.lr.ph

._crit_edge.thread:                               ; preds = %9
  call void @free(ptr noundef %10) #10
  br label %30

.lr.ph:                                           ; preds = %9, %24
  %.04353 = phi ptr [ %25, %24 ], [ %11, %9 ]
  %12 = load i8, ptr %.04353, align 1, !tbaa !5
  %.not49 = icmp eq i8 %12, 0
  br i1 %.not49, label %24, label %13

13:                                               ; preds = %.lr.ph
  %14 = call ptr @strncpy(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %.04353, i64 noundef 4095) #10
  store i8 0, ptr %5, align 1, !tbaa !5
  %15 = call i64 @strlen(ptr noundef nonnull dereferenceable(1) %2) #11
  %16 = add i64 %15, -1
  %17 = getelementptr inbounds [4096 x i8], ptr %2, i64 0, i64 %16
  %18 = load i8, ptr %17, align 1, !tbaa !5
  %.not50 = icmp eq i8 %18, 47
  br i1 %.not50, label %21, label %19

19:                                               ; preds = %13
  %20 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.35, i64 noundef 4095) #10
  store i8 0, ptr %5, align 1, !tbaa !5
  br label %21

21:                                               ; preds = %19, %13
  %22 = call ptr @strncat(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) %0, i64 noundef 4095) #10
  store i8 0, ptr %5, align 1, !tbaa !5
  %23 = call noalias ptr @fopen(ptr noundef nonnull %2, ptr noundef nonnull @.str.32)
  br label %24

24:                                               ; preds = %21, %.lr.ph
  %.141 = phi ptr [ %23, %21 ], [ null, %.lr.ph ]
  %25 = call ptr @strsep(ptr noundef nonnull %3, ptr noundef nonnull @.str.34) #10
  %26 = icmp ne ptr %25, null
  %27 = icmp ne ptr %.141, null
  %not. = xor i1 %26, true
  %28 = or i1 %27, %not.
  br i1 %28, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %24
  %29 = or i1 %26, %27
  call void @free(ptr noundef %10) #10
  br i1 %29, label %.critedge, label %30

30:                                               ; preds = %._crit_edge.thread, %._crit_edge
  %31 = load ptr, ptr @stderr, align 8, !tbaa !8
  %32 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %31, ptr noundef nonnull @.str.36, ptr noundef %0) #12
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %60

.critedge:                                        ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #10
  br label %33

33:                                               ; preds = %.critedge, %1
  %.242 = phi ptr [ %6, %1 ], [ %.141, %.critedge ]
  %34 = call ptr @realpath(ptr noundef nonnull %2, ptr noundef null) #10
  %35 = call noalias dereferenceable_or_null(48) ptr @malloc(i64 noundef 48) #13
  %36 = call i32 @fseek(ptr noundef %.242, i64 noundef 0, i32 noundef 2)
  %37 = call i64 @ftell(ptr noundef %.242)
  %38 = getelementptr inbounds i8, ptr %35, i64 16
  store i64 %37, ptr %38, align 8, !tbaa !12
  call void @rewind(ptr noundef %.242)
  %39 = load i64, ptr %38, align 8, !tbaa !12
  %40 = add i64 %39, 2
  %41 = call noalias ptr @malloc(i64 noundef %40) #13
  %42 = getelementptr inbounds i8, ptr %35, i64 32
  store ptr %41, ptr %42, align 8, !tbaa !15
  %43 = call i64 @fread(ptr noundef %41, i64 noundef 1, i64 noundef %39, ptr noundef %.242)
  %44 = load i64, ptr %38, align 8, !tbaa !12
  %45 = icmp ult i64 %43, %44
  br i1 %45, label %46, label %51

46:                                               ; preds = %33
  %47 = call i32 @fclose(ptr noundef %.242)
  %48 = load ptr, ptr %42, align 8, !tbaa !15
  call void @free(ptr noundef %48) #10
  call void @free(ptr noundef nonnull %35) #10
  %49 = load ptr, ptr @stderr, align 8, !tbaa !8
  %50 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %49, ptr noundef nonnull @.str.37, ptr noundef %0) #12
  br label %60

51:                                               ; preds = %33
  %52 = load ptr, ptr %42, align 8, !tbaa !15
  %53 = getelementptr inbounds i8, ptr %52, i64 %44
  store i8 10, ptr %53, align 1, !tbaa !5
  %54 = getelementptr i8, ptr %53, i64 1
  store i8 0, ptr %54, align 1, !tbaa !5
  %55 = add i64 %44, 1
  store i64 %55, ptr %38, align 8, !tbaa !12
  %56 = call i32 @fclose(ptr noundef %.242)
  %57 = getelementptr inbounds i8, ptr %35, i64 40
  store ptr %34, ptr %57, align 8, !tbaa !16
  store i64 1, ptr %35, align 8, !tbaa !17
  %58 = getelementptr inbounds i8, ptr %35, i64 8
  store i64 0, ptr %58, align 8, !tbaa !18
  %59 = getelementptr inbounds i8, ptr %35, i64 24
  store i64 0, ptr %59, align 8, !tbaa !19
  br label %60

60:                                               ; preds = %30, %46, %51, %7
  %.2 = phi ptr [ null, %30 ], [ null, %7 ], [ null, %46 ], [ %35, %51 ]
  call void @llvm.lifetime.end.p0(i64 4096, ptr nonnull %2) #10
  ret ptr %.2
}

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

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncpy(ptr noalias noundef returned writeonly, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #5

; Function Attrs: nounwind
declare ptr @strsep(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i64 @strlen(ptr nocapture noundef) local_unnamed_addr #7

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite)
declare ptr @strncat(ptr noalias noundef returned, ptr noalias nocapture noundef readonly, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #8

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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

; Function Attrs: nofree nounwind
declare noundef ptr @realpath(ptr nocapture noundef readonly, ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #9

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare void @rewind(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #3

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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite) "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 = { nofree nounwind "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 = { nofree nounwind memory(read) "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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 "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 = { mustprogress nofree nounwind willreturn memory(argmem: read) "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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #9 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #10 = { nounwind }
attributes #11 = { nounwind willreturn memory(read) }
attributes #12 = { cold nounwind }
attributes #13 = { nounwind allocsize(0) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !14, i64 16}
!13 = !{!"buzzlex_file_s", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !9, i64 32, !9, i64 40}
!14 = !{!"long", !6, i64 0}
!15 = !{!13, !9, i64 32}
!16 = !{!13, !9, i64 40}
!17 = !{!13, !14, i64 0}
!18 = !{!13, !14, i64 8}
!19 = !{!13, !14, i64 24}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass