; LLVM IR from matz/streem :: src (value)

; 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.strm_io = type { i32, i32, i32, ptr, ptr }
%struct.strm_genfunc = type { i32, ptr, i64 }

@.str.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = 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

; Function Attrs: nounwind uwtable
declare hidden ptr @strm_ptr(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local i32 @strm_float_p(i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @strm_to_int(i64 noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @strm_to_float(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local ptr @strm_value_cfunc(i64 noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i64 @strm_inspect(i64 noundef) #1

declare i32 @strm_string_p(i64 noundef) #3

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

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

18:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %19 = load ptr, ptr %6, align 8, !tbaa !9
  %20 = call i64 @strm_str_intern_static(ptr noundef @.str.8, i32 noundef 6)
  %21 = call i32 @strm_var_get(ptr noundef %19, i64 noundef %20, ptr noundef %7)
  store i32 %21, ptr %5, align 4, !tbaa !11
  %22 = load i32, ptr %5, align 4, !tbaa !11
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %36

24:                                               ; preds = %18
  %25 = load i64, ptr %7, align 8, !tbaa !5
  %26 = call i32 @strm_funcall(ptr noundef null, i64 noundef %25, i32 noundef 1, ptr noundef %3, ptr noundef %7)
  store i32 %26, ptr %5, align 4, !tbaa !11
  %27 = load i32, ptr %5, align 4, !tbaa !11
  %28 = icmp eq i32 %27, 0
  br i1 %28, label %29, label %35

29:                                               ; preds = %24
  %30 = load i64, ptr %7, align 8, !tbaa !5
  %31 = call i32 @strm_string_p(i64 noundef %30)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %35

33:                                               ; preds = %29
  %34 = load i64, ptr %7, align 8, !tbaa !5
  store i64 %34, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %37

35:                                               ; preds = %29, %24
  br label %36

36:                                               ; preds = %35, %18
  store i32 0, ptr %8, align 4
  br label %37

37:                                               ; preds = %36, %33
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %38 = load i32, ptr %8, align 4
  switch i32 %38, label %149 [
    i32 0, label %39
  ]

39:                                               ; preds = %37
  br label %40

40:                                               ; preds = %39, %1
  %41 = load i64, ptr %3, align 8, !tbaa !5
  %42 = and i64 %41, -281474976710656
  switch i64 %42, label %128 [
    i64 -3940649673949184, label %43
    i64 -4222124650659840, label %51
    i64 -1407374883553280, label %62
    i64 -2533274790395904, label %70
    i64 -2251799813685248, label %70
    i64 -1970324836974592, label %70
    i64 -1688849860263936, label %70
    i64 -3377699720527872, label %72
    i64 -3096224743817216, label %72
    i64 -844424930131968, label %75
  ]

43:                                               ; preds = %40
  %44 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %45 = load i64, ptr %3, align 8, !tbaa !5
  %46 = call i32 @strm_to_int(i64 noundef %45)
  %47 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %44, ptr noundef @.str.9, i32 noundef %46) #5
  store i32 %47, ptr %5, align 4, !tbaa !11
  %48 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %49 = load i32, ptr %5, align 4, !tbaa !11
  %50 = call i64 @strm_str_new(ptr noundef %48, i32 noundef %49)
  store i64 %50, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

51:                                               ; preds = %40
  %52 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %53 = load i64, ptr %3, align 8, !tbaa !5
  %54 = call i32 @strm_to_int(i64 noundef %53)
  %55 = icmp ne i32 %54, 0
  %56 = zext i1 %55 to i64
  %57 = select i1 %55, ptr @.str.10, ptr @.str.11
  %58 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %52, ptr noundef %57) #5
  store i32 %58, ptr %5, align 4, !tbaa !11
  %59 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %60 = load i32, ptr %5, align 4, !tbaa !11
  %61 = call i64 @strm_str_new(ptr noundef %59, i32 noundef %60)
  store i64 %61, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

62:                                               ; preds = %40
  %63 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %64 = load i64, ptr %3, align 8, !tbaa !5
  %65 = call ptr @strm_value_cfunc(i64 noundef %64)
  %66 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %63, ptr noundef @.str.12, ptr noundef %65) #5
  store i32 %66, ptr %5, align 4, !tbaa !11
  %67 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %68 = load i32, ptr %5, align 4, !tbaa !11
  %69 = call i64 @strm_str_new(ptr noundef %67, i32 noundef %68)
  store i64 %69, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

70:                                               ; preds = %40, %40, %40, %40
  %71 = load i64, ptr %3, align 8, !tbaa !5
  store i64 %71, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

72:                                               ; preds = %40, %40
  %73 = load i64, ptr %3, align 8, !tbaa !5
  %74 = call i64 @strm_inspect(i64 noundef %73)
  store i64 %74, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

75:                                               ; preds = %40
  %76 = load i64, ptr %3, align 8, !tbaa !5
  %77 = and i64 %76, 281474976710655
  %78 = icmp eq i64 %77, 0
  br i1 %78, label %79, label %81

79:                                               ; preds = %75
  %80 = call i64 @strm_str_static(ptr noundef @.str.13, i32 noundef 3)
  store i64 %80, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

81:                                               ; preds = %75
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %82 = load i64, ptr %3, align 8, !tbaa !5
  %83 = call ptr @strm_ptr(i64 noundef %82)
  store ptr %83, ptr %9, align 8, !tbaa !9
  %84 = load ptr, ptr %9, align 8, !tbaa !9
  %85 = call i32 @strm_ptr_type(ptr noundef %84)
  switch i32 %85, label %124 [
    i32 0, label %86
    i32 3, label %90
    i32 1, label %107
    i32 2, label %111
    i32 4, label %120
  ]

86:                                               ; preds = %81
  %87 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %88 = load ptr, ptr %9, align 8, !tbaa !9
  %89 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %87, ptr noundef @.str.14, ptr noundef %88) #5
  store i32 %89, ptr %5, align 4, !tbaa !11
  br label %124

90:                                               ; preds = %81
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %91 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %91, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %92 = load ptr, ptr %10, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.strm_io, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 8, !tbaa !13
  %95 = and i32 %94, 3
  switch i32 %95, label %99 [
    i32 1, label %96
    i32 2, label %97
    i32 3, label %98
  ]

96:                                               ; preds = %90
  store ptr @.str.15, ptr %11, align 8, !tbaa !9
  br label %100

97:                                               ; preds = %90
  store ptr @.str.16, ptr %11, align 8, !tbaa !9
  br label %100

98:                                               ; preds = %90
  store ptr @.str.17, ptr %11, align 8, !tbaa !9
  br label %100

99:                                               ; preds = %90
  store ptr @.str.18, ptr %11, align 8, !tbaa !9
  br label %100

100:                                              ; preds = %99, %98, %97, %96
  %101 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %102 = load ptr, ptr %10, align 8, !tbaa !9
  %103 = getelementptr inbounds %struct.strm_io, ptr %102, i32 0, i32 1
  %104 = load i32, ptr %103, align 4, !tbaa !15
  %105 = load ptr, ptr %11, align 8, !tbaa !9
  %106 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %101, ptr noundef @.str.19, i32 noundef %104, ptr noundef %105) #5
  store i32 %106, ptr %5, align 4, !tbaa !11
  store i32 3, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %124

107:                                              ; preds = %81
  %108 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %109 = load ptr, ptr %9, align 8, !tbaa !9
  %110 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %108, ptr noundef @.str.20, ptr noundef %109) #5
  store i32 %110, ptr %5, align 4, !tbaa !11
  br label %124

111:                                              ; preds = %81
  call void @llvm.lifetime.start.p0(i64 7, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %112 = load ptr, ptr %9, align 8, !tbaa !9
  store ptr %112, ptr %13, align 8, !tbaa !9
  %113 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %114 = load ptr, ptr %13, align 8, !tbaa !9
  %115 = getelementptr inbounds %struct.strm_genfunc, ptr %114, i32 0, i32 2
  %116 = load i64, ptr %115, align 8, !tbaa !16
  %117 = getelementptr inbounds [7 x i8], ptr %12, i64 0, i64 0
  %118 = call ptr @strm_str_cstr(i64 noundef %116, ptr noundef %117)
  %119 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %113, ptr noundef @.str.21, ptr noundef %118) #5
  store i32 %119, ptr %5, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 7, ptr %12) #5
  br label %124

120:                                              ; preds = %81
  %121 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %122 = load ptr, ptr %9, align 8, !tbaa !9
  %123 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %121, ptr noundef @.str.22, ptr noundef %122) #5
  store i32 %123, ptr %5, align 4, !tbaa !11
  br label %124

124:                                              ; preds = %120, %111, %107, %100, %86, %81
  %125 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %126 = load i32, ptr %5, align 4, !tbaa !11
  %127 = call i64 @strm_str_new(ptr noundef %125, i32 noundef %126)
  store i64 %127, ptr %2, align 8
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %149

128:                                              ; preds = %40
  %129 = load i64, ptr %3, align 8, !tbaa !5
  %130 = call i32 @strm_float_p(i64 noundef %129)
  %131 = icmp ne i32 %130, 0
  br i1 %131, label %132, label %140

132:                                              ; preds = %128
  %133 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %134 = load i64, ptr %3, align 8, !tbaa !5
  %135 = call double @strm_to_float(i64 noundef %134)
  %136 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %133, ptr noundef @.str.23, double noundef %135) #5
  store i32 %136, ptr %5, align 4, !tbaa !11
  %137 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %138 = load i32, ptr %5, align 4, !tbaa !11
  %139 = call i64 @strm_str_new(ptr noundef %137, i32 noundef %138)
  store i64 %139, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

140:                                              ; preds = %128
  %141 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %142 = load i64, ptr %3, align 8, !tbaa !5
  %143 = and i64 %142, 281474976710655
  %144 = inttoptr i64 %143 to ptr
  %145 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %141, ptr noundef @.str.24, ptr noundef %144) #5
  store i32 %145, ptr %5, align 4, !tbaa !11
  %146 = getelementptr inbounds [32 x i8], ptr %4, i64 0, i64 0
  %147 = load i32, ptr %5, align 4, !tbaa !11
  %148 = call i64 @strm_str_new(ptr noundef %146, i32 noundef %147)
  store i64 %148, ptr %2, align 8
  store i32 1, ptr %8, align 4
  br label %149

149:                                              ; preds = %140, %132, %124, %79, %72, %70, %62, %51, %43, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #5
  %150 = load i64, ptr %2, align 8
  ret i64 %150
}

; Function Attrs: nounwind uwtable
declare dso_local ptr @strm_value_ns(i64 noundef) #1

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

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

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

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

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

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

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 = { inlinehint 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 #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 "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 }

!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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 8}
!14 = !{!"strm_io", !12, i64 0, !12, i64 4, !12, i64 8, !10, i64 16, !10, i64 24}
!15 = !{!14, !12, i64 4}
!16 = !{!17, !6, i64 16}
!17 = !{!"strm_genfunc", !12, i64 0, !10, i64 8, !6, i64 16}


; 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.8 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.19 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [5 x i8], align 1
@switch.table.strm_to_str = private unnamed_addr constant [4 x ptr] [ptr @.str.18, ptr @.str.15, ptr @.str.16, ptr @.str.17], align 8

; 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 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 ptr @strm_ptr(i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @strm_ptr_type(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @strm_float_p(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @strm_to_int(i64 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden double @strm_to_float(i64 noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @strm_inspect(i64 noundef) local_unnamed_addr #1

declare i32 @strm_string_p(i64 noundef) local_unnamed_addr #3

declare i64 @strm_str_new(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local i64 @strm_to_str(i64 noundef %0) local_unnamed_addr #1 {
  %2 = alloca i64, align 8
  %3 = alloca [32 x i8], align 16
  %4 = alloca i64, align 8
  %5 = alloca [7 x i8], align 1
  store i64 %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #5
  %6 = tail call ptr @strm_value_ns(i64 noundef %0)
  %.not = icmp eq ptr %6, null
  br i1 %.not, label %19, label %7

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %8 = tail call i64 @strm_str_intern_static(ptr noundef nonnull @.str.8, i32 noundef 6) #5
  %9 = call i32 @strm_var_get(ptr noundef nonnull %6, i64 noundef %8, ptr noundef nonnull %4) #5
  %10 = icmp eq i32 %9, 0
  br i1 %10, label %11, label %.thread

11:                                               ; preds = %7
  %12 = load i64, ptr %4, align 8, !tbaa !5
  %13 = call i32 @strm_funcall(ptr noundef null, i64 noundef %12, i32 noundef 1, ptr noundef nonnull %2, ptr noundef nonnull %4) #5
  %14 = icmp eq i32 %13, 0
  br i1 %14, label %15, label %.thread

.thread:                                          ; preds = %11, %7
  %.123.ph = phi i32 [ %9, %7 ], [ %13, %11 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %19

15:                                               ; preds = %11
  %16 = load i64, ptr %4, align 8, !tbaa !5
  %17 = call i32 @strm_string_p(i64 noundef %16) #5
  %.not29 = icmp eq i32 %17, 0
  %18 = load i64, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br i1 %.not29, label %19, label %78

19:                                               ; preds = %.thread, %15, %1
  %.2 = phi i32 [ 0, %15 ], [ undef, %1 ], [ %.123.ph, %.thread ]
  %20 = load i64, ptr %2, align 8, !tbaa !5
  %21 = add i64 %20, 4222124650659840
  %22 = lshr i64 %21, 48
  %trunc = trunc nuw i64 %22 to i16
  switch i16 %trunc, label %66 [
    i16 1, label %23
    i16 0, label %27
    i16 10, label %32
    i16 6, label %78
    i16 7, label %78
    i16 8, label %78
    i16 9, label %78
    i16 3, label %36
    i16 4, label %36
    i16 12, label %38
  ]

23:                                               ; preds = %19
  %24 = call i32 @strm_to_int(i64 noundef %20)
  %25 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.9, i32 noundef %24) #5
  %26 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %25) #5
  br label %78

27:                                               ; preds = %19
  %28 = call i32 @strm_to_int(i64 noundef %20)
  %.not30 = icmp eq i32 %28, 0
  %29 = select i1 %.not30, ptr @.str.11, ptr @.str.10
  %30 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) %29) #5
  %31 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %30) #5
  br label %78

32:                                               ; preds = %19
  %33 = call ptr @strm_value_cfunc(i64 noundef %20)
  %34 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.12, ptr noundef %33) #5
  %35 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %34) #5
  br label %78

36:                                               ; preds = %19, %19
  %37 = call i64 @strm_inspect(i64 noundef %20)
  br label %78

38:                                               ; preds = %19
  %39 = and i64 %20, 281474976710655
  %40 = icmp eq i64 %39, 0
  br i1 %40, label %41, label %43

41:                                               ; preds = %38
  %42 = call i64 @strm_str_static(ptr noundef nonnull @.str.13, i32 noundef 3) #5
  br label %78

43:                                               ; preds = %38
  %44 = call ptr @strm_ptr(i64 noundef %20)
  %45 = call i32 @strm_ptr_type(ptr noundef %44)
  switch i32 %45, label %64 [
    i32 0, label %46
    i32 3, label %switch.lookup
    i32 1, label %55
    i32 2, label %57
    i32 4, label %62
  ]

46:                                               ; preds = %43
  %47 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef %44) #5
  br label %64

switch.lookup:                                    ; preds = %43
  %48 = getelementptr inbounds i8, ptr %44, i64 8
  %49 = load i32, ptr %48, align 8, !tbaa !9
  %50 = and i32 %49, 3
  %51 = zext nneg i32 %50 to i64
  %switch.gep = getelementptr inbounds [4 x ptr], ptr @switch.table.strm_to_str, i64 0, i64 %51
  %switch.load = load ptr, ptr %switch.gep, align 8
  %52 = getelementptr inbounds i8, ptr %44, i64 4
  %53 = load i32, ptr %52, align 4, !tbaa !13
  %54 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.19, i32 noundef %53, ptr noundef nonnull %switch.load) #5
  br label %64

55:                                               ; preds = %43
  %56 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.20, ptr noundef %44) #5
  br label %64

57:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 7, ptr nonnull %5) #5
  %58 = getelementptr inbounds i8, ptr %44, i64 16
  %59 = load i64, ptr %58, align 8, !tbaa !14
  %60 = call ptr @strm_str_cstr(i64 noundef %59, ptr noundef nonnull %5) #5
  %61 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.21, ptr noundef %60) #5
  call void @llvm.lifetime.end.p0(i64 7, ptr nonnull %5) #5
  br label %64

62:                                               ; preds = %43
  %63 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.22, ptr noundef %44) #5
  br label %64

64:                                               ; preds = %62, %57, %55, %switch.lookup, %46, %43
  %.3 = phi i32 [ %.2, %43 ], [ %63, %62 ], [ %61, %57 ], [ %56, %55 ], [ %54, %switch.lookup ], [ %47, %46 ]
  %65 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %.3) #5
  br label %78

66:                                               ; preds = %19
  %67 = call i32 @strm_float_p(i64 noundef %20)
  %.not31 = icmp eq i32 %67, 0
  %68 = load i64, ptr %2, align 8, !tbaa !5
  br i1 %.not31, label %73, label %69

69:                                               ; preds = %66
  %70 = call double @strm_to_float(i64 noundef %68)
  %71 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.23, double noundef %70) #5
  %72 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %71) #5
  br label %78

73:                                               ; preds = %66
  %74 = and i64 %68, 281474976710655
  %75 = inttoptr i64 %74 to ptr
  %76 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.24, ptr noundef %75) #5
  %77 = call i64 @strm_str_new(ptr noundef nonnull %3, i32 noundef %76) #5
  br label %78

78:                                               ; preds = %19, %19, %19, %19, %15, %73, %69, %64, %41, %36, %32, %27, %23
  %.1 = phi i64 [ %72, %69 ], [ %77, %73 ], [ %42, %41 ], [ %65, %64 ], [ %37, %36 ], [ %35, %32 ], [ %31, %27 ], [ %26, %23 ], [ %18, %15 ], [ %20, %19 ], [ %20, %19 ], [ %20, %19 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #5
  ret i64 %.1
}

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

declare i32 @strm_var_get(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

declare i64 @strm_str_intern_static(ptr noundef, i32 noundef) local_unnamed_addr #3

declare i32 @strm_funcall(ptr noundef, i64 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

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

declare i64 @strm_str_static(ptr noundef, i32 noundef) local_unnamed_addr #3

declare ptr @strm_str_cstr(i64 noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress 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 = { inlinehint 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 #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 = { 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 #5 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"strm_io", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 16, !12, i64 24}
!11 = !{!"int", !7, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!10, !11, i64 4}
!14 = !{!15, !6, i64 16}
!15 = !{!"strm_genfunc", !11, i64 0, !12, i64 8, !6, i64 16}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass