; LLVM IR from paintdream/DontStarveLuaJIT :: src/luajit/src (lj_ctype)

; 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.CTState = type { ptr, i32, i32, ptr, ptr, ptr, ptr, %struct.CCallback, [128 x i16] }
%struct.CCallback = type { [8 x %union.FPRCBArg], [8 x i64], ptr, ptr, ptr, i32, i32, i32 }
%union.FPRCBArg = type { double }
%struct.lua_State = type { %union.anon.4 }
%union.anon.4 = type { %struct.anon.5, [320 x i8] }
%struct.anon.5 = type { %struct.GCRef, i8, i8, i8, i8, %struct.MRef, %struct.GCRef, ptr, ptr, %struct.MRef, %struct.MRef, %struct.GCRef, %struct.GCRef, ptr, i32 }
%struct.MRef = type { i32 }
%struct.GCRef = type { i32 }
%struct.CType = type { i32, i32, i16, i16, %struct.GCRef }
%struct.global_State = type { ptr, i32, i32, ptr, ptr, %struct.GCState, i32, %struct.SBuf, %struct.GCstr, i8, i8, i8, i8, %struct.GCRef, %union.TValue, %union.TValue, %union.TValue, %struct.Node, %struct.GCupval, i32, i32, ptr, ptr, ptr, i32, i32, %struct.GCRef, %struct.MRef, %struct.MRef, [38 x %struct.GCRef] }
%struct.GCState = type { i32, i32, i8, i8, i8, i8, i32, %struct.GCRef, %struct.MRef, %struct.GCRef, %struct.GCRef, %struct.GCRef, %struct.GCRef, i32, i32, i32, i32 }
%struct.SBuf = type { %struct.MRef, %struct.MRef, %struct.MRef, %struct.MRef }
%struct.GCstr = type { %struct.GCRef, i8, i8, i8, i8, i32, i32 }
%union.TValue = type { i64 }
%struct.Node = type { %union.TValue, %union.TValue, %struct.MRef, %struct.MRef }
%struct.GCupval = type { %struct.GCRef, i8, i8, i8, i8, %union.anon.2, %struct.MRef, i32 }
%union.anon.2 = type { %union.TValue }

@.str.1 = external hidden unnamed_addr constant [640 x i8], align 1
@lj_ctype_typeinfo = external hidden global [97 x i32], align 16

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

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

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

declare hidden ptr @lj_str_new(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
define hidden ptr @lj_ctype_init(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #6
  %10 = load ptr, ptr %2, align 8, !tbaa !5
  %11 = call ptr @lj_mem_realloc(ptr noundef %10, ptr noundef null, i32 noundef 0, i32 noundef 472)
  store ptr %11, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = call ptr @lj_mem_realloc(ptr noundef %12, ptr noundef null, i32 noundef 0, i32 noundef 2048)
  store ptr %13, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  store ptr @.str.1, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %14 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 472, i1 false)
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds %struct.CTState, ptr %16, i32 0, i32 0
  store ptr %15, ptr %17, align 8, !tbaa !9
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.CTState, ptr %18, i32 0, i32 2
  store i32 128, ptr %19, align 4, !tbaa !13
  %20 = load ptr, ptr %3, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.CTState, ptr %20, i32 0, i32 1
  store i32 96, ptr %21, align 8, !tbaa !14
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.CTState, ptr %22, i32 0, i32 3
  store ptr null, ptr %23, align 8, !tbaa !15
  %24 = load ptr, ptr %2, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.lua_State, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.anon.5, ptr %25, i32 0, i32 5
  %27 = getelementptr inbounds %struct.MRef, ptr %26, i32 0, i32 0
  %28 = load i32, ptr %27, align 8, !tbaa !16
  %29 = zext i32 %28 to i64
  %30 = inttoptr i64 %29 to ptr
  %31 = load ptr, ptr %3, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.CTState, ptr %31, i32 0, i32 4
  store ptr %30, ptr %32, align 8, !tbaa !17
  store i32 0, ptr %6, align 4, !tbaa !18
  br label %33

33:                                               ; preds = %91, %1
  %34 = load i32, ptr %6, align 4, !tbaa !18
  %35 = zext i32 %34 to i64
  %36 = icmp ult i64 %35, 96
  br i1 %36, label %37, label %96

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %38 = load i32, ptr %6, align 4, !tbaa !18
  %39 = zext i32 %38 to i64
  %40 = getelementptr inbounds [97 x i32], ptr @lj_ctype_typeinfo, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !18
  store i32 %41, ptr %7, align 4, !tbaa !18
  %42 = load i32, ptr %7, align 4, !tbaa !18
  %43 = shl i32 %42, 16
  %44 = ashr i32 %43, 26
  %45 = load ptr, ptr %4, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.CType, ptr %45, i32 0, i32 1
  store i32 %44, ptr %46, align 4, !tbaa !19
  %47 = load i32, ptr %7, align 4, !tbaa !18
  %48 = and i32 %47, -64513
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.CType, ptr %49, i32 0, i32 0
  store i32 %48, ptr %50, align 4, !tbaa !23
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.CType, ptr %51, i32 0, i32 2
  store i16 0, ptr %52, align 4, !tbaa !24
  %53 = load i32, ptr %7, align 4, !tbaa !18
  %54 = lshr i32 %53, 28
  %55 = icmp eq i32 %54, 13
  br i1 %55, label %60, label %56

56:                                               ; preds = %37
  %57 = load i32, ptr %7, align 4, !tbaa !18
  %58 = lshr i32 %57, 28
  %59 = icmp eq i32 %58, 7
  br i1 %59, label %60, label %76

60:                                               ; preds = %56, %37
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %61 = load ptr, ptr %5, align 8, !tbaa !5
  %62 = call i64 @strlen(ptr noundef %61) #7
  store i64 %62, ptr %8, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %63 = load ptr, ptr %2, align 8, !tbaa !5
  %64 = load ptr, ptr %5, align 8, !tbaa !5
  %65 = load i64, ptr %8, align 8, !tbaa !25
  %66 = call ptr @lj_str_new(ptr noundef %63, ptr noundef %64, i64 noundef %65)
  store ptr %66, ptr %9, align 8, !tbaa !5
  %67 = load ptr, ptr %4, align 8, !tbaa !5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ctype_setname(ptr noundef %67, ptr noundef %68)
  %69 = load i64, ptr %8, align 8, !tbaa !25
  %70 = add i64 %69, 1
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = getelementptr inbounds i8, ptr %71, i64 %70
  store ptr %72, ptr %5, align 8, !tbaa !5
  %73 = load ptr, ptr %3, align 8, !tbaa !5
  %74 = load ptr, ptr %4, align 8, !tbaa !5
  %75 = load i32, ptr %6, align 4, !tbaa !18
  call void @lj_ctype_addname(ptr noundef %73, ptr noundef %74, i32 noundef %75)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  br label %90

76:                                               ; preds = %56
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.CType, ptr %77, i32 0, i32 4
  %79 = getelementptr inbounds %struct.GCRef, ptr %78, i32 0, i32 0
  store i32 0, ptr %79, align 4, !tbaa !27
  %80 = load ptr, ptr %4, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.CType, ptr %80, i32 0, i32 3
  store i16 0, ptr %81, align 2, !tbaa !28
  %82 = load i32, ptr %7, align 4, !tbaa !18
  %83 = lshr i32 %82, 28
  %84 = icmp eq i32 %83, 5
  br i1 %84, label %89, label %85

85:                                               ; preds = %76
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = load ptr, ptr %4, align 8, !tbaa !5
  %88 = load i32, ptr %6, align 4, !tbaa !18
  call void @ctype_addtype(ptr noundef %86, ptr noundef %87, i32 noundef %88)
  br label %89

89:                                               ; preds = %85, %76
  br label %90

90:                                               ; preds = %89, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %91

91:                                               ; preds = %90
  %92 = load i32, ptr %6, align 4, !tbaa !18
  %93 = add i32 %92, 1
  store i32 %93, ptr %6, align 4, !tbaa !18
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.CType, ptr %94, i32 1
  store ptr %95, ptr %4, align 8, !tbaa !5
  br label %33, !llvm.loop !29

96:                                               ; preds = %33
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = ptrtoint ptr %97 to i64
  %99 = trunc i64 %98 to i32
  %100 = load ptr, ptr %2, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.lua_State, ptr %100, i32 0, i32 0
  %102 = getelementptr inbounds %struct.anon.5, ptr %101, i32 0, i32 5
  %103 = getelementptr inbounds %struct.MRef, ptr %102, i32 0, i32 0
  %104 = load i32, ptr %103, align 8, !tbaa !16
  %105 = zext i32 %104 to i64
  %106 = inttoptr i64 %105 to ptr
  %107 = getelementptr inbounds %struct.global_State, ptr %106, i32 0, i32 28
  %108 = getelementptr inbounds %struct.MRef, ptr %107, i32 0, i32 0
  store i32 %99, ptr %108, align 8, !tbaa !31
  %109 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #6
  ret ptr %109
}

declare hidden ptr @lj_mem_realloc(ptr noundef, ptr noundef, i32 noundef, i32 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { "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: write) }
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 = { 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 }
attributes #7 = { nounwind willreturn memory(read) }

!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 0}
!10 = !{!"CTState", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !12, i64 48, !7, i64 216}
!11 = !{!"int", !7, i64 0}
!12 = !{!"CCallback", !7, i64 0, !7, i64 64, !6, i64 128, !6, i64 136, !6, i64 144, !11, i64 152, !11, i64 156, !11, i64 160}
!13 = !{!10, !11, i64 12}
!14 = !{!10, !11, i64 8}
!15 = !{!10, !6, i64 16}
!16 = !{!7, !7, i64 0}
!17 = !{!10, !6, i64 24}
!18 = !{!11, !11, i64 0}
!19 = !{!20, !11, i64 4}
!20 = !{!"CType", !11, i64 0, !11, i64 4, !21, i64 8, !21, i64 10, !22, i64 12}
!21 = !{!"short", !7, i64 0}
!22 = !{!"GCRef", !11, i64 0}
!23 = !{!20, !11, i64 0}
!24 = !{!20, !21, i64 8}
!25 = !{!26, !26, i64 0}
!26 = !{!"long", !7, i64 0}
!27 = !{!20, !11, i64 12}
!28 = !{!20, !21, i64 10}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !11, i64 256}
!32 = !{!"global_State", !6, i64 0, !11, i64 8, !11, i64 12, !6, i64 16, !6, i64 24, !33, i64 32, !11, i64 88, !35, i64 92, !36, i64 108, !7, i64 124, !7, i64 125, !7, i64 126, !7, i64 127, !22, i64 128, !7, i64 136, !7, i64 144, !7, i64 152, !37, i64 160, !38, i64 184, !11, i64 208, !11, i64 212, !6, i64 216, !6, i64 224, !6, i64 232, !11, i64 240, !11, i64 244, !22, i64 248, !34, i64 252, !34, i64 256, !7, i64 260}
!33 = !{!"GCState", !11, i64 0, !11, i64 4, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !11, i64 12, !22, i64 16, !34, i64 20, !22, i64 24, !22, i64 28, !22, i64 32, !22, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52}
!34 = !{!"MRef", !11, i64 0}
!35 = !{!"SBuf", !34, i64 0, !34, i64 4, !34, i64 8, !34, i64 12}
!36 = !{!"GCstr", !22, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !11, i64 8, !11, i64 12}
!37 = !{!"Node", !7, i64 0, !7, i64 8, !34, i64 16, !34, i64 20}
!38 = !{!"GCupval", !22, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !34, i64 16, !11, i64 20}


; 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.1 = external hidden unnamed_addr constant [640 x i8], align 1
@lj_ctype_typeinfo = external hidden local_unnamed_addr global [97 x i32], align 16

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

declare hidden ptr @lj_str_new(ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define hidden ptr @lj_ctype_init(ptr noundef %0) local_unnamed_addr #0 {
  %2 = tail call ptr @lj_mem_realloc(ptr noundef %0, ptr noundef null, i32 noundef 0, i32 noundef 472) #5
  %3 = tail call ptr @lj_mem_realloc(ptr noundef %0, ptr noundef null, i32 noundef 0, i32 noundef 2048) #5
  %4 = getelementptr inbounds i8, ptr %2, i64 24
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(472) %4, i8 0, i64 448, i1 false)
  store ptr %3, ptr %2, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %2, i64 12
  store i32 128, ptr %5, align 4, !tbaa !12
  %6 = getelementptr inbounds i8, ptr %2, i64 8
  store i32 96, ptr %6, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr null, ptr %7, align 8, !tbaa !14
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !15
  %10 = zext i32 %9 to i64
  %11 = inttoptr i64 %10 to ptr
  %12 = getelementptr inbounds i8, ptr %2, i64 24
  store ptr %11, ptr %12, align 8, !tbaa !16
  br label %13

13:                                               ; preds = %1, %34
  %indvars.iv = phi i64 [ 0, %1 ], [ %indvars.iv.next, %34 ]
  %.046 = phi ptr [ %3, %1 ], [ %35, %34 ]
  %.04045 = phi ptr [ @.str.1, %1 ], [ %.1, %34 ]
  %14 = getelementptr inbounds [97 x i32], ptr @lj_ctype_typeinfo, i64 0, i64 %indvars.iv
  %15 = load i32, ptr %14, align 4, !tbaa !17
  %16 = shl i32 %15, 16
  %17 = ashr i32 %16, 26
  %18 = getelementptr inbounds i8, ptr %.046, i64 4
  store i32 %17, ptr %18, align 4, !tbaa !18
  %19 = and i32 %15, -64513
  store i32 %19, ptr %.046, align 4, !tbaa !22
  %20 = getelementptr inbounds i8, ptr %.046, i64 8
  store i16 0, ptr %20, align 4, !tbaa !23
  %21 = lshr i32 %15, 28
  switch i32 %21, label %28 [
    i32 13, label %22
    i32 7, label %22
  ]

22:                                               ; preds = %13, %13
  %23 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %.04045) #6
  %24 = tail call ptr @lj_str_new(ptr noundef %0, ptr noundef %.04045, i64 noundef %23) #5
  tail call void @ctype_setname(ptr noundef nonnull %.046, ptr noundef %24)
  %25 = add i64 %23, 1
  %26 = getelementptr inbounds i8, ptr %.04045, i64 %25
  %27 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @lj_ctype_addname(ptr noundef nonnull %2, ptr noundef nonnull %.046, i32 noundef %27)
  br label %34

28:                                               ; preds = %13
  %29 = getelementptr inbounds i8, ptr %.046, i64 12
  store i32 0, ptr %29, align 4, !tbaa !24
  %30 = getelementptr inbounds i8, ptr %.046, i64 10
  store i16 0, ptr %30, align 2, !tbaa !25
  %31 = icmp eq i32 %21, 5
  br i1 %31, label %34, label %32

32:                                               ; preds = %28
  %33 = trunc nuw nsw i64 %indvars.iv to i32
  tail call void @ctype_addtype(ptr noundef nonnull %2, ptr noundef nonnull %.046, i32 noundef %33)
  br label %34

34:                                               ; preds = %28, %32, %22
  %.1 = phi ptr [ %26, %22 ], [ %.04045, %28 ], [ %.04045, %32 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %35 = getelementptr inbounds i8, ptr %.046, i64 16
  %exitcond.not = icmp eq i64 %indvars.iv.next, 96
  br i1 %exitcond.not, label %36, label %13, !llvm.loop !26

36:                                               ; preds = %34
  %37 = ptrtoint ptr %2 to i64
  %38 = trunc i64 %37 to i32
  %39 = load i32, ptr %8, align 8, !tbaa !15
  %40 = zext i32 %39 to i64
  %41 = inttoptr i64 %40 to ptr
  %42 = getelementptr inbounds i8, ptr %41, i64 256
  store i32 %38, ptr %42, align 8, !tbaa !28
  ret ptr %2
}

declare hidden ptr @lj_mem_realloc(ptr noundef, ptr noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

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

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

; Function Attrs: alwaysinline nounwind uwtable
declare hidden void @ctype_setname(ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden void @ctype_addtype(ptr noundef, 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 #4 = { 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 #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!"CTState", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !11, i64 48, !8, i64 216}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"CCallback", !8, i64 0, !8, i64 64, !7, i64 128, !7, i64 136, !7, i64 144, !10, i64 152, !10, i64 156, !10, i64 160}
!12 = !{!6, !10, i64 12}
!13 = !{!6, !10, i64 8}
!14 = !{!6, !7, i64 16}
!15 = !{!8, !8, i64 0}
!16 = !{!6, !7, i64 24}
!17 = !{!10, !10, i64 0}
!18 = !{!19, !10, i64 4}
!19 = !{!"CType", !10, i64 0, !10, i64 4, !20, i64 8, !20, i64 10, !21, i64 12}
!20 = !{!"short", !8, i64 0}
!21 = !{!"GCRef", !10, i64 0}
!22 = !{!19, !10, i64 0}
!23 = !{!19, !20, i64 8}
!24 = !{!19, !10, i64 12}
!25 = !{!19, !20, i64 10}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !10, i64 256}
!29 = !{!"global_State", !7, i64 0, !10, i64 8, !10, i64 12, !7, i64 16, !7, i64 24, !30, i64 32, !10, i64 88, !32, i64 92, !33, i64 108, !8, i64 124, !8, i64 125, !8, i64 126, !8, i64 127, !21, i64 128, !8, i64 136, !8, i64 144, !8, i64 152, !34, i64 160, !35, i64 184, !10, i64 208, !10, i64 212, !7, i64 216, !7, i64 224, !7, i64 232, !10, i64 240, !10, i64 244, !21, i64 248, !31, i64 252, !31, i64 256, !8, i64 260}
!30 = !{!"GCState", !10, i64 0, !10, i64 4, !8, i64 8, !8, i64 9, !8, i64 10, !8, i64 11, !10, i64 12, !21, i64 16, !31, i64 20, !21, i64 24, !21, i64 28, !21, i64 32, !21, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52}
!31 = !{!"MRef", !10, i64 0}
!32 = !{!"SBuf", !31, i64 0, !31, i64 4, !31, i64 8, !31, i64 12}
!33 = !{!"GCstr", !21, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !10, i64 8, !10, i64 12}
!34 = !{!"Node", !8, i64 0, !8, i64 8, !31, i64 16, !31, i64 20}
!35 = !{!"GCupval", !21, i64 0, !8, i64 4, !8, i64 5, !8, i64 6, !8, i64 7, !8, i64 8, !31, i64 16, !10, i64 20}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,SROAPass,SimplifyCFGPass,TailCallElimPass