; LLVM IR from gunrock/gunrock :: include/gunrock/io/detail (mmio)

; 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"

@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [12 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: mustprogress nounwind uwtable
define dso_local ptr @mm_typecode_to_str(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca ptr, align 8
  %4 = alloca [1025 x i8], align 16
  %5 = alloca [4 x ptr], align 16
  %6 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1025, ptr %4) #3
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #3
  %7 = load ptr, ptr %3, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %7, i64 0
  %9 = load i8, ptr %8, align 1, !tbaa !9
  %10 = sext i8 %9 to i32
  %11 = icmp eq i32 %10, 77
  br i1 %11, label %12, label %14

12:                                               ; preds = %1
  %13 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 0
  store ptr @.str.10, ptr %13, align 16, !tbaa !5
  br label %15

14:                                               ; preds = %1
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %118

15:                                               ; preds = %12
  %16 = load ptr, ptr %3, align 8, !tbaa !5
  %17 = getelementptr inbounds i8, ptr %16, i64 1
  %18 = load i8, ptr %17, align 1, !tbaa !9
  %19 = sext i8 %18 to i32
  %20 = icmp eq i32 %19, 67
  br i1 %20, label %21, label %23

21:                                               ; preds = %15
  %22 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 1
  store ptr @.str.11, ptr %22, align 8, !tbaa !5
  br label %33

23:                                               ; preds = %15
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 1
  %26 = load i8, ptr %25, align 1, !tbaa !9
  %27 = sext i8 %26 to i32
  %28 = icmp eq i32 %27, 65
  br i1 %28, label %29, label %31

29:                                               ; preds = %23
  %30 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 1
  store ptr @.str.12, ptr %30, align 8, !tbaa !5
  br label %32

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

32:                                               ; preds = %29
  br label %33

33:                                               ; preds = %32, %21
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %34, i64 2
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 82
  br i1 %38, label %39, label %41

39:                                               ; preds = %33
  %40 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 2
  store ptr @.str.13, ptr %40, align 16, !tbaa !5
  br label %69

41:                                               ; preds = %33
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 2
  %44 = load i8, ptr %43, align 1, !tbaa !9
  %45 = sext i8 %44 to i32
  %46 = icmp eq i32 %45, 67
  br i1 %46, label %47, label %49

47:                                               ; preds = %41
  %48 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 2
  store ptr @.str.14, ptr %48, align 16, !tbaa !5
  br label %68

49:                                               ; preds = %41
  %50 = load ptr, ptr %3, align 8, !tbaa !5
  %51 = getelementptr inbounds i8, ptr %50, i64 2
  %52 = load i8, ptr %51, align 1, !tbaa !9
  %53 = sext i8 %52 to i32
  %54 = icmp eq i32 %53, 80
  br i1 %54, label %55, label %57

55:                                               ; preds = %49
  %56 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 2
  store ptr @.str.15, ptr %56, align 16, !tbaa !5
  br label %67

57:                                               ; preds = %49
  %58 = load ptr, ptr %3, align 8, !tbaa !5
  %59 = getelementptr inbounds i8, ptr %58, i64 2
  %60 = load i8, ptr %59, align 1, !tbaa !9
  %61 = sext i8 %60 to i32
  %62 = icmp eq i32 %61, 73
  br i1 %62, label %63, label %65

63:                                               ; preds = %57
  %64 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 2
  store ptr @.str.16, ptr %64, align 16, !tbaa !5
  br label %66

65:                                               ; preds = %57
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %118

66:                                               ; preds = %63
  br label %67

67:                                               ; preds = %66, %55
  br label %68

68:                                               ; preds = %67, %47
  br label %69

69:                                               ; preds = %68, %39
  %70 = load ptr, ptr %3, align 8, !tbaa !5
  %71 = getelementptr inbounds i8, ptr %70, i64 3
  %72 = load i8, ptr %71, align 1, !tbaa !9
  %73 = sext i8 %72 to i32
  %74 = icmp eq i32 %73, 71
  br i1 %74, label %75, label %77

75:                                               ; preds = %69
  %76 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 3
  store ptr @.str.17, ptr %76, align 8, !tbaa !5
  br label %105

77:                                               ; preds = %69
  %78 = load ptr, ptr %3, align 8, !tbaa !5
  %79 = getelementptr inbounds i8, ptr %78, i64 3
  %80 = load i8, ptr %79, align 1, !tbaa !9
  %81 = sext i8 %80 to i32
  %82 = icmp eq i32 %81, 83
  br i1 %82, label %83, label %85

83:                                               ; preds = %77
  %84 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 3
  store ptr @.str.18, ptr %84, align 8, !tbaa !5
  br label %104

85:                                               ; preds = %77
  %86 = load ptr, ptr %3, align 8, !tbaa !5
  %87 = getelementptr inbounds i8, ptr %86, i64 3
  %88 = load i8, ptr %87, align 1, !tbaa !9
  %89 = sext i8 %88 to i32
  %90 = icmp eq i32 %89, 72
  br i1 %90, label %91, label %93

91:                                               ; preds = %85
  %92 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 3
  store ptr @.str.19, ptr %92, align 8, !tbaa !5
  br label %103

93:                                               ; preds = %85
  %94 = load ptr, ptr %3, align 8, !tbaa !5
  %95 = getelementptr inbounds i8, ptr %94, i64 3
  %96 = load i8, ptr %95, align 1, !tbaa !9
  %97 = sext i8 %96 to i32
  %98 = icmp eq i32 %97, 75
  br i1 %98, label %99, label %101

99:                                               ; preds = %93
  %100 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 3
  store ptr @.str.20, ptr %100, align 8, !tbaa !5
  br label %102

101:                                              ; preds = %93
  store ptr null, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %118

102:                                              ; preds = %99
  br label %103

103:                                              ; preds = %102, %91
  br label %104

104:                                              ; preds = %103, %83
  br label %105

105:                                              ; preds = %104, %75
  %106 = getelementptr inbounds [1025 x i8], ptr %4, i64 0, i64 0
  %107 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 0
  %108 = load ptr, ptr %107, align 16, !tbaa !5
  %109 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 1
  %110 = load ptr, ptr %109, align 8, !tbaa !5
  %111 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 2
  %112 = load ptr, ptr %111, align 16, !tbaa !5
  %113 = getelementptr inbounds [4 x ptr], ptr %5, i64 0, i64 3
  %114 = load ptr, ptr %113, align 8, !tbaa !5
  %115 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %106, ptr noundef @.str.37, ptr noundef %108, ptr noundef %110, ptr noundef %112, ptr noundef %114) #3
  %116 = getelementptr inbounds [1025 x i8], ptr %4, i64 0, i64 0
  %117 = call noundef ptr @_Z9mm_strdupPKc(ptr noundef %116)
  store ptr %117, ptr %2, align 8
  store i32 1, ptr %6, align 4
  br label %118

118:                                              ; preds = %105, %101, %65, %31, %14
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #3
  call void @llvm.lifetime.end.p0(i64 1025, ptr %4) #3
  %119 = load ptr, ptr %2, align 8
  ret ptr %119
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z9mm_strdupPKc(ptr noundef) #1

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 = { 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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!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"

@.str.10 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.37 = external hidden unnamed_addr constant [12 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef ptr @mm_typecode_to_str(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = alloca [1025 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1025, ptr nonnull %2) #3
  %3 = load i8, ptr %0, align 1, !tbaa !5
  %4 = icmp eq i8 %3, 77
  br i1 %4, label %5, label %24

5:                                                ; preds = %1
  %6 = getelementptr inbounds i8, ptr %0, i64 1
  %7 = load i8, ptr %6, align 1, !tbaa !5
  switch i8 %7, label %24 [
    i8 67, label %9
    i8 65, label %8
  ]

8:                                                ; preds = %5
  br label %9

9:                                                ; preds = %5, %8
  %.sroa.4.0 = phi ptr [ @.str.12, %8 ], [ @.str.11, %5 ]
  %10 = getelementptr inbounds i8, ptr %0, i64 2
  %11 = load i8, ptr %10, align 1, !tbaa !5
  switch i8 %11, label %24 [
    i8 82, label %15
    i8 67, label %12
    i8 80, label %13
    i8 73, label %14
  ]

12:                                               ; preds = %9
  br label %15

13:                                               ; preds = %9
  br label %15

14:                                               ; preds = %9
  br label %15

15:                                               ; preds = %9, %12, %14, %13
  %.sroa.7.0 = phi ptr [ @.str.14, %12 ], [ @.str.15, %13 ], [ @.str.16, %14 ], [ @.str.13, %9 ]
  %16 = getelementptr inbounds i8, ptr %0, i64 3
  %17 = load i8, ptr %16, align 1, !tbaa !5
  switch i8 %17, label %24 [
    i8 71, label %21
    i8 83, label %18
    i8 72, label %19
    i8 75, label %20
  ]

18:                                               ; preds = %15
  br label %21

19:                                               ; preds = %15
  br label %21

20:                                               ; preds = %15
  br label %21

21:                                               ; preds = %15, %18, %20, %19
  %.sroa.12.0 = phi ptr [ @.str.18, %18 ], [ @.str.19, %19 ], [ @.str.20, %20 ], [ @.str.17, %15 ]
  %22 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.37, ptr noundef nonnull @.str.10, ptr noundef nonnull %.sroa.4.0, ptr noundef nonnull %.sroa.7.0, ptr noundef nonnull %.sroa.12.0) #3
  %23 = call noundef ptr @_Z9mm_strdupPKc(ptr noundef nonnull %2)
  br label %24

24:                                               ; preds = %15, %9, %5, %1, %21
  %.0 = phi ptr [ %23, %21 ], [ null, %1 ], [ null, %5 ], [ null, %9 ], [ null, %15 ]
  call void @llvm.lifetime.end.p0(i64 1025, ptr nonnull %2) #3
  ret ptr %.0
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_Z9mm_strdupPKc(ptr noundef) local_unnamed_addr #1

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { 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, !6, i64 0}
!6 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


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