; LLVM IR from Water-Melon/Melon :: src (mln_lex)

; 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.mln_lex_s = type { ptr, ptr, ptr, ptr, %struct.mln_lex_hooks_t, ptr, ptr, ptr, ptr, i64, i64, i32, i8, ptr, ptr }
%struct.mln_lex_hooks_t = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.mln_lex_input_t = type { i32, i32, ptr, ptr, ptr, ptr, i64, i64 }
%struct.mln_string_t = type { ptr, i64, i32 }

@mln_lex_errmsg = external dso_local global [16 x [1024 x i8]], align 16
@error_msg_err = external dso_local global [34 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

; 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

declare void @mln_alloc_free(ptr noundef) #1

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_lex_strerror(ptr noundef nonnull %0) #4 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %8 = load ptr, ptr %3, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.mln_lex_s, ptr %8, i32 0, i32 6
  %10 = load ptr, ptr %9, align 8, !tbaa !9
  %11 = icmp ne ptr %10, null
  br i1 %11, label %12, label %16

12:                                               ; preds = %1
  %13 = load ptr, ptr %3, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.mln_lex_s, ptr %13, i32 0, i32 6
  %15 = load ptr, ptr %14, align 8, !tbaa !9
  call void @mln_alloc_free(ptr noundef %15)
  br label %16

16:                                               ; preds = %12, %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !14
  %17 = load ptr, ptr %3, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.mln_lex_s, ptr %17, i32 0, i32 2
  %19 = load ptr, ptr %18, align 8, !tbaa !15
  %20 = icmp ne ptr %19, null
  br i1 %20, label %21, label %43

21:                                               ; preds = %16
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.mln_lex_s, ptr %22, i32 0, i32 2
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds %struct.mln_lex_input_t, ptr %24, i32 0, i32 0
  %26 = load i32, ptr %25, align 8, !tbaa !16
  %27 = icmp ne i32 %26, 1
  br i1 %27, label %28, label %29

28:                                               ; preds = %21
  br label %37

29:                                               ; preds = %21
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.mln_lex_s, ptr %30, i32 0, i32 2
  %32 = load ptr, ptr %31, align 8, !tbaa !15
  %33 = getelementptr inbounds %struct.mln_lex_input_t, ptr %32, i32 0, i32 2
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds %struct.mln_string_t, ptr %34, i32 0, i32 1
  %36 = load i64, ptr %35, align 8, !tbaa !19
  br label %37

37:                                               ; preds = %29, %28
  %38 = phi i64 [ 0, %28 ], [ %36, %29 ]
  %39 = load i32, ptr %4, align 4, !tbaa !14
  %40 = sext i32 %39 to i64
  %41 = add i64 %40, %38
  %42 = trunc i64 %41 to i32
  store i32 %42, ptr %4, align 4, !tbaa !14
  br label %43

43:                                               ; preds = %37, %16
  %44 = load ptr, ptr %3, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.mln_lex_s, ptr %44, i32 0, i32 11
  %46 = load i32, ptr %45, align 8, !tbaa !21
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [16 x [1024 x i8]], ptr @mln_lex_errmsg, i64 0, i64 %47
  %49 = getelementptr inbounds [1024 x i8], ptr %48, i64 0, i64 0
  %50 = call i64 @strlen(ptr noundef %49) #8
  %51 = load i32, ptr %4, align 4, !tbaa !14
  %52 = sext i32 %51 to i64
  %53 = add i64 %52, %50
  %54 = trunc i64 %53 to i32
  store i32 %54, ptr %4, align 4, !tbaa !14
  %55 = load ptr, ptr %3, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.mln_lex_s, ptr %55, i32 0, i32 11
  %57 = load i32, ptr %56, align 8, !tbaa !21
  %58 = icmp eq i32 %57, 7
  br i1 %58, label %59, label %64

59:                                               ; preds = %43
  %60 = call ptr @__errno_location() #9
  %61 = load i32, ptr %60, align 4, !tbaa !14
  %62 = call ptr @strerror(i32 noundef %61) #7
  %63 = call i64 @strlen(ptr noundef %62) #8
  br label %65

64:                                               ; preds = %43
  br label %65

65:                                               ; preds = %64, %59
  %66 = phi i64 [ %63, %59 ], [ 0, %64 ]
  %67 = load i32, ptr %4, align 4, !tbaa !14
  %68 = sext i32 %67 to i64
  %69 = add i64 %68, %66
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr %4, align 4, !tbaa !14
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.mln_lex_s, ptr %71, i32 0, i32 8
  %73 = load ptr, ptr %72, align 8, !tbaa !22
  %74 = load ptr, ptr %3, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.mln_lex_s, ptr %74, i32 0, i32 7
  %76 = load ptr, ptr %75, align 8, !tbaa !23
  %77 = ptrtoint ptr %73 to i64
  %78 = ptrtoint ptr %76 to i64
  %79 = sub i64 %77, %78
  %80 = add nsw i64 %79, 1
  %81 = load i32, ptr %4, align 4, !tbaa !14
  %82 = sext i32 %81 to i64
  %83 = add nsw i64 %82, %80
  %84 = trunc i64 %83 to i32
  store i32 %84, ptr %4, align 4, !tbaa !14
  %85 = load i32, ptr %4, align 4, !tbaa !14
  %86 = add nsw i32 %85, 256
  store i32 %86, ptr %4, align 4, !tbaa !14
  %87 = load ptr, ptr %3, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.mln_lex_s, ptr %87, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !24
  %90 = load i32, ptr %4, align 4, !tbaa !14
  %91 = add nsw i32 %90, 1
  %92 = sext i32 %91 to i64
  %93 = call ptr @mln_alloc_c(ptr noundef %89, i64 noundef %92)
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.mln_lex_s, ptr %94, i32 0, i32 6
  store ptr %93, ptr %95, align 8, !tbaa !9
  %96 = icmp eq ptr %93, null
  br i1 %96, label %97, label %98

97:                                               ; preds = %65
  store ptr @error_msg_err, ptr %2, align 8
  store i32 1, ptr %5, align 4
  br label %239

98:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !14
  %99 = load ptr, ptr %3, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.mln_lex_s, ptr %99, i32 0, i32 2
  %101 = load ptr, ptr %100, align 8, !tbaa !15
  %102 = icmp ne ptr %101, null
  br i1 %102, label %103, label %131

103:                                              ; preds = %98
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.mln_lex_s, ptr %104, i32 0, i32 2
  %106 = load ptr, ptr %105, align 8, !tbaa !15
  %107 = getelementptr inbounds %struct.mln_lex_input_t, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !25
  %109 = icmp sge i32 %108, 0
  br i1 %109, label %110, label %131

110:                                              ; preds = %103
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.mln_lex_s, ptr %111, i32 0, i32 6
  %113 = load ptr, ptr %112, align 8, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !14
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds i8, ptr %113, i64 %115
  %117 = load i32, ptr %4, align 4, !tbaa !14
  %118 = load i32, ptr %6, align 4, !tbaa !14
  %119 = sub nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = load ptr, ptr %3, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.mln_lex_s, ptr %121, i32 0, i32 2
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %124 = getelementptr inbounds %struct.mln_lex_input_t, ptr %123, i32 0, i32 2
  %125 = load ptr, ptr %124, align 8, !tbaa !18
  %126 = getelementptr inbounds %struct.mln_string_t, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !26
  %128 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %116, i64 noundef %120, ptr noundef @.str.5, ptr noundef %127) #7
  %129 = load i32, ptr %6, align 4, !tbaa !14
  %130 = add nsw i32 %129, %128
  store i32 %130, ptr %6, align 4, !tbaa !14
  br label %131

131:                                              ; preds = %110, %103, %98
  %132 = load ptr, ptr %3, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.mln_lex_s, ptr %132, i32 0, i32 6
  %134 = load ptr, ptr %133, align 8, !tbaa !9
  %135 = load i32, ptr %6, align 4, !tbaa !14
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds i8, ptr %134, i64 %136
  %138 = load i32, ptr %4, align 4, !tbaa !14
  %139 = load i32, ptr %6, align 4, !tbaa !14
  %140 = sub nsw i32 %138, %139
  %141 = sext i32 %140 to i64
  %142 = load ptr, ptr %3, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.mln_lex_s, ptr %142, i32 0, i32 10
  %144 = load i64, ptr %143, align 8, !tbaa !27
  %145 = load ptr, ptr %3, align 8, !tbaa !5
  %146 = getelementptr inbounds %struct.mln_lex_s, ptr %145, i32 0, i32 11
  %147 = load i32, ptr %146, align 8, !tbaa !21
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds [16 x [1024 x i8]], ptr @mln_lex_errmsg, i64 0, i64 %148
  %150 = getelementptr inbounds [1024 x i8], ptr %149, i64 0, i64 0
  %151 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %137, i64 noundef %141, ptr noundef @.str.6, i64 noundef %144, ptr noundef %150) #7
  %152 = load i32, ptr %6, align 4, !tbaa !14
  %153 = add nsw i32 %152, %151
  store i32 %153, ptr %6, align 4, !tbaa !14
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = getelementptr inbounds %struct.mln_lex_s, ptr %154, i32 0, i32 8
  %156 = load ptr, ptr %155, align 8, !tbaa !22
  %157 = load ptr, ptr %3, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.mln_lex_s, ptr %157, i32 0, i32 7
  %159 = load ptr, ptr %158, align 8, !tbaa !23
  %160 = icmp ugt ptr %156, %159
  br i1 %160, label %161, label %207

161:                                              ; preds = %131
  %162 = load ptr, ptr %3, align 8, !tbaa !5
  %163 = getelementptr inbounds %struct.mln_lex_s, ptr %162, i32 0, i32 6
  %164 = load ptr, ptr %163, align 8, !tbaa !9
  %165 = load i32, ptr %6, align 4, !tbaa !14
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %6, align 4, !tbaa !14
  %167 = sext i32 %165 to i64
  %168 = getelementptr inbounds i8, ptr %164, i64 %167
  store i8 32, ptr %168, align 1, !tbaa !28
  %169 = load ptr, ptr %3, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.mln_lex_s, ptr %169, i32 0, i32 6
  %171 = load ptr, ptr %170, align 8, !tbaa !9
  %172 = load i32, ptr %6, align 4, !tbaa !14
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %6, align 4, !tbaa !14
  %174 = sext i32 %172 to i64
  %175 = getelementptr inbounds i8, ptr %171, i64 %174
  store i8 34, ptr %175, align 1, !tbaa !28
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %176 = load ptr, ptr %3, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.mln_lex_s, ptr %176, i32 0, i32 8
  %178 = load ptr, ptr %177, align 8, !tbaa !22
  %179 = load ptr, ptr %3, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.mln_lex_s, ptr %179, i32 0, i32 7
  %181 = load ptr, ptr %180, align 8, !tbaa !23
  %182 = ptrtoint ptr %178 to i64
  %183 = ptrtoint ptr %181 to i64
  %184 = sub i64 %182, %183
  %185 = trunc i64 %184 to i32
  store i32 %185, ptr %7, align 4, !tbaa !14
  %186 = load ptr, ptr %3, align 8, !tbaa !5
  %187 = getelementptr inbounds %struct.mln_lex_s, ptr %186, i32 0, i32 6
  %188 = load ptr, ptr %187, align 8, !tbaa !9
  %189 = load i32, ptr %6, align 4, !tbaa !14
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds i8, ptr %188, i64 %190
  %192 = load ptr, ptr %3, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.mln_lex_s, ptr %192, i32 0, i32 7
  %194 = load ptr, ptr %193, align 8, !tbaa !23
  %195 = load i32, ptr %7, align 4, !tbaa !14
  %196 = zext i32 %195 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %191, ptr align 1 %194, i64 %196, i1 false)
  %197 = load i32, ptr %7, align 4, !tbaa !14
  %198 = load i32, ptr %6, align 4, !tbaa !14
  %199 = add i32 %198, %197
  store i32 %199, ptr %6, align 4, !tbaa !14
  %200 = load ptr, ptr %3, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.mln_lex_s, ptr %200, i32 0, i32 6
  %202 = load ptr, ptr %201, align 8, !tbaa !9
  %203 = load i32, ptr %6, align 4, !tbaa !14
  %204 = add nsw i32 %203, 1
  store i32 %204, ptr %6, align 4, !tbaa !14
  %205 = sext i32 %203 to i64
  %206 = getelementptr inbounds i8, ptr %202, i64 %205
  store i8 34, ptr %206, align 1, !tbaa !28
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %207

207:                                              ; preds = %161, %131
  %208 = load ptr, ptr %3, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.mln_lex_s, ptr %208, i32 0, i32 11
  %210 = load i32, ptr %209, align 8, !tbaa !21
  %211 = icmp eq i32 %210, 7
  br i1 %211, label %212, label %229

212:                                              ; preds = %207
  %213 = load ptr, ptr %3, align 8, !tbaa !5
  %214 = getelementptr inbounds %struct.mln_lex_s, ptr %213, i32 0, i32 6
  %215 = load ptr, ptr %214, align 8, !tbaa !9
  %216 = load i32, ptr %6, align 4, !tbaa !14
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds i8, ptr %215, i64 %217
  %219 = load i32, ptr %4, align 4, !tbaa !14
  %220 = load i32, ptr %6, align 4, !tbaa !14
  %221 = sub nsw i32 %219, %220
  %222 = sext i32 %221 to i64
  %223 = call ptr @__errno_location() #9
  %224 = load i32, ptr %223, align 4, !tbaa !14
  %225 = call ptr @strerror(i32 noundef %224) #7
  %226 = call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %218, i64 noundef %222, ptr noundef @.str.7, ptr noundef %225) #7
  %227 = load i32, ptr %6, align 4, !tbaa !14
  %228 = add nsw i32 %227, %226
  store i32 %228, ptr %6, align 4, !tbaa !14
  br label %229

229:                                              ; preds = %212, %207
  %230 = load ptr, ptr %3, align 8, !tbaa !5
  %231 = getelementptr inbounds %struct.mln_lex_s, ptr %230, i32 0, i32 6
  %232 = load ptr, ptr %231, align 8, !tbaa !9
  %233 = load i32, ptr %6, align 4, !tbaa !14
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds i8, ptr %232, i64 %234
  store i8 0, ptr %235, align 1, !tbaa !28
  %236 = load ptr, ptr %3, align 8, !tbaa !5
  %237 = getelementptr inbounds %struct.mln_lex_s, ptr %236, i32 0, i32 6
  %238 = load ptr, ptr %237, align 8, !tbaa !9
  store ptr %238, ptr %2, align 8
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %239

239:                                              ; preds = %229, %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  %240 = load ptr, ptr %2, align 8
  ret ptr %240
}

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

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

; Function Attrs: nounwind willreturn memory(none)
declare ptr @__errno_location() #6

declare ptr @mln_alloc_c(ptr noundef, i64 noundef) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind willreturn memory(none) "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 = { nounwind }
attributes #8 = { nounwind willreturn memory(read) }
attributes #9 = { nounwind willreturn memory(none) }

!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 552}
!10 = !{!"mln_lex_s", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !6, i64 544, !6, i64 552, !6, i64 560, !6, i64 568, !12, i64 576, !12, i64 584, !13, i64 592, !13, i64 596, !13, i64 596, !6, i64 600, !6, i64 608}
!11 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128, !6, i64 136, !6, i64 144, !6, i64 152, !6, i64 160, !6, i64 168, !6, i64 176, !6, i64 184, !6, i64 192, !6, i64 200, !6, i64 208, !6, i64 216, !6, i64 224, !6, i64 232, !6, i64 240, !6, i64 248, !6, i64 256, !6, i64 264, !6, i64 272, !6, i64 280, !6, i64 288, !6, i64 296, !6, i64 304, !6, i64 312, !6, i64 320, !6, i64 328, !6, i64 336, !6, i64 344, !6, i64 352, !6, i64 360, !6, i64 368, !6, i64 376, !6, i64 384, !6, i64 392, !6, i64 400, !6, i64 408, !6, i64 416, !6, i64 424, !6, i64 432, !6, i64 440, !6, i64 448, !6, i64 456, !6, i64 464, !6, i64 472, !6, i64 480, !6, i64 488, !6, i64 496, !6, i64 504}
!12 = !{!"long", !7, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!10, !6, i64 16}
!16 = !{!17, !13, i64 0}
!17 = !{!"", !13, i64 0, !13, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 48}
!18 = !{!17, !6, i64 8}
!19 = !{!20, !12, i64 8}
!20 = !{!"", !6, i64 0, !12, i64 8, !12, i64 16, !12, i64 16, !12, i64 16}
!21 = !{!10, !13, i64 592}
!22 = !{!10, !6, i64 568}
!23 = !{!10, !6, i64 560}
!24 = !{!10, !6, i64 0}
!25 = !{!17, !13, i64 4}
!26 = !{!20, !6, i64 0}
!27 = !{!10, !12, i64 584}
!28 = !{!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"

@mln_lex_errmsg = external dso_local global [16 x [1024 x i8]], align 16
@error_msg_err = external dso_local global [34 x i8], align 16
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [5 x i8], align 1

declare void @mln_alloc_free(ptr noundef) local_unnamed_addr #0

; Function Attrs: nofree nounwind
declare noundef i32 @snprintf(ptr noalias nocapture noundef writeonly, i64 noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local ptr @mln_lex_strerror(ptr nocapture noundef nonnull %0) local_unnamed_addr #3 {
  %2 = getelementptr inbounds i8, ptr %0, i64 552
  %3 = load ptr, ptr %2, align 8, !tbaa !5
  %.not = icmp eq ptr %3, null
  br i1 %.not, label %5, label %4

4:                                                ; preds = %1
  tail call void @mln_alloc_free(ptr noundef nonnull %3) #7
  br label %5

5:                                                ; preds = %4, %1
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load ptr, ptr %6, align 8, !tbaa !13
  %.not63 = icmp eq ptr %7, null
  br i1 %.not63, label %17, label %8

8:                                                ; preds = %5
  %9 = load i32, ptr %7, align 8, !tbaa !14
  %.not64 = icmp eq i32 %9, 1
  br i1 %.not64, label %10, label %17

10:                                               ; preds = %8
  %11 = getelementptr inbounds i8, ptr %7, i64 8
  %12 = load ptr, ptr %11, align 8, !tbaa !16
  %13 = getelementptr inbounds i8, ptr %12, i64 8
  %14 = load i64, ptr %13, align 8, !tbaa !17
  %sext = shl i64 %14, 32
  %15 = ashr exact i64 %sext, 32
  %16 = add nsw i64 %15, 1
  br label %17

17:                                               ; preds = %10, %8, %5
  %.058 = phi i64 [ 1, %5 ], [ %16, %10 ], [ 1, %8 ]
  %18 = getelementptr inbounds i8, ptr %0, i64 592
  %19 = load i32, ptr %18, align 8, !tbaa !19
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [16 x [1024 x i8]], ptr @mln_lex_errmsg, i64 0, i64 %20
  %22 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %21) #8
  %23 = icmp eq i32 %19, 7
  br i1 %23, label %24, label %29

24:                                               ; preds = %17
  %25 = tail call ptr @__errno_location() #9
  %26 = load i32, ptr %25, align 4, !tbaa !20
  %27 = tail call ptr @strerror(i32 noundef %26) #7
  %28 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %27) #8
  br label %29

29:                                               ; preds = %17, %24
  %30 = phi i64 [ %28, %24 ], [ 0, %17 ]
  %31 = getelementptr inbounds i8, ptr %0, i64 568
  %32 = load ptr, ptr %31, align 8, !tbaa !21
  %33 = getelementptr inbounds i8, ptr %0, i64 560
  %34 = load ptr, ptr %33, align 8, !tbaa !22
  %35 = ptrtoint ptr %32 to i64
  %36 = ptrtoint ptr %34 to i64
  %37 = add i64 %.058, %22
  %38 = add i64 %37, %30
  %39 = add i64 %38, %35
  %40 = sub i64 %39, %36
  %41 = trunc i64 %40 to i32
  %42 = add nsw i32 %41, 256
  %43 = load ptr, ptr %0, align 8, !tbaa !23
  %44 = shl i64 %40, 32
  %sext67 = add i64 %44, 1103806595072
  %45 = ashr exact i64 %sext67, 32
  %46 = tail call ptr @mln_alloc_c(ptr noundef %43, i64 noundef %45) #7
  store ptr %46, ptr %2, align 8, !tbaa !5
  %47 = icmp eq ptr %46, null
  br i1 %47, label %118, label %48

48:                                               ; preds = %29
  %49 = load ptr, ptr %6, align 8, !tbaa !13
  %.not68 = icmp eq ptr %49, null
  br i1 %.not68, label %60, label %50

50:                                               ; preds = %48
  %51 = getelementptr inbounds i8, ptr %49, i64 4
  %52 = load i32, ptr %51, align 4, !tbaa !24
  %53 = icmp sgt i32 %52, -1
  br i1 %53, label %54, label %60

54:                                               ; preds = %50
  %55 = sext i32 %42 to i64
  %56 = getelementptr inbounds i8, ptr %49, i64 8
  %57 = load ptr, ptr %56, align 8, !tbaa !16
  %58 = load ptr, ptr %57, align 8, !tbaa !25
  %59 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef nonnull %46, i64 noundef %55, ptr noundef nonnull @.str.5, ptr noundef %58) #7
  %.pre = load ptr, ptr %2, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %54, %50, %48
  %61 = phi ptr [ %.pre, %54 ], [ %46, %50 ], [ %46, %48 ]
  %.057 = phi i32 [ %59, %54 ], [ 0, %50 ], [ 0, %48 ]
  %62 = sext i32 %.057 to i64
  %63 = getelementptr inbounds i8, ptr %61, i64 %62
  %64 = sub nsw i32 %42, %.057
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds i8, ptr %0, i64 584
  %67 = load i64, ptr %66, align 8, !tbaa !26
  %68 = load i32, ptr %18, align 8, !tbaa !19
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [16 x [1024 x i8]], ptr @mln_lex_errmsg, i64 0, i64 %69
  %71 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %63, i64 noundef %65, ptr noundef nonnull @.str.6, i64 noundef %67, ptr noundef nonnull %70) #7
  %72 = add nsw i32 %71, %.057
  %73 = load ptr, ptr %31, align 8, !tbaa !21
  %74 = load ptr, ptr %33, align 8, !tbaa !22
  %75 = icmp ugt ptr %73, %74
  br i1 %75, label %76, label %99

76:                                               ; preds = %60
  %77 = load ptr, ptr %2, align 8, !tbaa !5
  %78 = sext i32 %72 to i64
  %79 = getelementptr inbounds i8, ptr %77, i64 %78
  store i8 32, ptr %79, align 1, !tbaa !27
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = add nsw i32 %72, 2
  %82 = getelementptr i8, ptr %80, i64 %78
  %83 = getelementptr i8, ptr %82, i64 1
  store i8 34, ptr %83, align 1, !tbaa !27
  %84 = load ptr, ptr %31, align 8, !tbaa !21
  %85 = load ptr, ptr %33, align 8, !tbaa !22
  %86 = ptrtoint ptr %84 to i64
  %87 = ptrtoint ptr %85 to i64
  %88 = sub i64 %86, %87
  %89 = trunc i64 %88 to i32
  %90 = load ptr, ptr %2, align 8, !tbaa !5
  %91 = sext i32 %81 to i64
  %92 = getelementptr inbounds i8, ptr %90, i64 %91
  %93 = and i64 %88, 4294967295
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %92, ptr align 1 %85, i64 %93, i1 false)
  %94 = add i32 %81, %89
  %95 = load ptr, ptr %2, align 8, !tbaa !5
  %96 = add nsw i32 %94, 1
  %97 = sext i32 %94 to i64
  %98 = getelementptr inbounds i8, ptr %95, i64 %97
  store i8 34, ptr %98, align 1, !tbaa !27
  br label %99

99:                                               ; preds = %76, %60
  %.1 = phi i32 [ %96, %76 ], [ %72, %60 ]
  %100 = load i32, ptr %18, align 8, !tbaa !19
  %101 = icmp eq i32 %100, 7
  br i1 %101, label %102, label %113

102:                                              ; preds = %99
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = sext i32 %.1 to i64
  %105 = getelementptr inbounds i8, ptr %103, i64 %104
  %106 = sub nsw i32 %42, %.1
  %107 = sext i32 %106 to i64
  %108 = tail call ptr @__errno_location() #9
  %109 = load i32, ptr %108, align 4, !tbaa !20
  %110 = tail call ptr @strerror(i32 noundef %109) #7
  %111 = tail call i32 (ptr, i64, ptr, ...) @snprintf(ptr noundef %105, i64 noundef %107, ptr noundef nonnull @.str.7, ptr noundef %110) #7
  %112 = add nsw i32 %111, %.1
  br label %113

113:                                              ; preds = %102, %99
  %.2 = phi i32 [ %112, %102 ], [ %.1, %99 ]
  %114 = load ptr, ptr %2, align 8, !tbaa !5
  %115 = sext i32 %.2 to i64
  %116 = getelementptr inbounds i8, ptr %114, i64 %115
  store i8 0, ptr %116, align 1, !tbaa !27
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  br label %118

118:                                              ; preds = %29, %113
  %.0 = phi ptr [ %117, %113 ], [ @error_msg_err, %29 ]
  ret ptr %.0
}

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

; Function Attrs: nounwind
declare ptr @strerror(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress nofree nosync nounwind willreturn memory(none)
declare ptr @__errno_location() local_unnamed_addr #6

declare ptr @mln_alloc_c(ptr noundef, i64 noundef) local_unnamed_addr #0

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

!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 552}
!6 = !{!"mln_lex_s", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !7, i64 544, !7, i64 552, !7, i64 560, !7, i64 568, !11, i64 576, !11, i64 584, !12, i64 592, !12, i64 596, !12, i64 596, !7, i64 600, !7, i64 608}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !7, i64 104, !7, i64 112, !7, i64 120, !7, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !7, i64 160, !7, i64 168, !7, i64 176, !7, i64 184, !7, i64 192, !7, i64 200, !7, i64 208, !7, i64 216, !7, i64 224, !7, i64 232, !7, i64 240, !7, i64 248, !7, i64 256, !7, i64 264, !7, i64 272, !7, i64 280, !7, i64 288, !7, i64 296, !7, i64 304, !7, i64 312, !7, i64 320, !7, i64 328, !7, i64 336, !7, i64 344, !7, i64 352, !7, i64 360, !7, i64 368, !7, i64 376, !7, i64 384, !7, i64 392, !7, i64 400, !7, i64 408, !7, i64 416, !7, i64 424, !7, i64 432, !7, i64 440, !7, i64 448, !7, i64 456, !7, i64 464, !7, i64 472, !7, i64 480, !7, i64 488, !7, i64 496, !7, i64 504}
!11 = !{!"long", !8, i64 0}
!12 = !{!"int", !8, i64 0}
!13 = !{!6, !7, i64 16}
!14 = !{!15, !12, i64 0}
!15 = !{!"", !12, i64 0, !12, i64 4, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !11, i64 40, !11, i64 48}
!16 = !{!15, !7, i64 8}
!17 = !{!18, !11, i64 8}
!18 = !{!"", !7, i64 0, !11, i64 8, !11, i64 16, !11, i64 16, !11, i64 16}
!19 = !{!6, !12, i64 592}
!20 = !{!12, !12, i64 0}
!21 = !{!6, !7, i64 568}
!22 = !{!6, !7, i64 560}
!23 = !{!6, !7, i64 0}
!24 = !{!15, !12, i64 4}
!25 = !{!18, !7, i64 0}
!26 = !{!6, !11, i64 584}
!27 = !{!8, !8, i64 0}


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