; LLVM IR from caryll/otfcc :: lib/table (name)

; 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.table_name = type { i64, i64, ptr }
%struct.otfcc_NameRecord = type { i16, i16, i16, i16, ptr }
%struct.caryll_Buffer = type { i64, i64, i64, ptr }

@.str.12 = external hidden unnamed_addr constant [24 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: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsBytes(ptr noundef) #1

; 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 zeroext i1 @shouldDecodeAsUTF16(ptr noundef) #1

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

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) #3

declare ptr @sdsempty() #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @sdslen(ptr noundef) #4

; Function Attrs: nounwind uwtable
define dso_local ptr @otfcc_buildName(ptr noundef %0, ptr noundef %1) #1 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i16, align 2
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i64, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = icmp ne ptr %18, null
  br i1 %19, label %21, label %20

20:                                               ; preds = %2
  store ptr null, ptr %3, align 8
  br label %136

21:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %22 = call ptr (...) @bufnew()
  store ptr %22, ptr %6, align 8, !tbaa !5
  %23 = load ptr, ptr %6, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %23, i16 noundef zeroext 0)
  %24 = load ptr, ptr %6, align 8, !tbaa !5
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.table_name, ptr %25, i32 0, i32 0
  %27 = load i64, ptr %26, align 8, !tbaa !9
  %28 = trunc i64 %27 to i16
  call void @bufwrite16b(ptr noundef %24, i16 noundef zeroext %28)
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  call void @bufwrite16b(ptr noundef %29, i16 noundef zeroext 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %30 = call ptr (...) @bufnew()
  store ptr %30, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 2, ptr %8) #5
  store i16 0, ptr %8, align 2, !tbaa !12
  br label %31

31:                                               ; preds = %114, %21
  %32 = load i16, ptr %8, align 2, !tbaa !12
  %33 = zext i16 %32 to i64
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.table_name, ptr %34, i32 0, i32 0
  %36 = load i64, ptr %35, align 8, !tbaa !9
  %37 = icmp ult i64 %33, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 2, ptr %8) #5
  br label %117

39:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %40 = load ptr, ptr %4, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.table_name, ptr %40, i32 0, i32 2
  %42 = load ptr, ptr %41, align 8, !tbaa !14
  %43 = load i16, ptr %8, align 2, !tbaa !12
  %44 = zext i16 %43 to i64
  %45 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %42, i64 %44
  store ptr %45, ptr %9, align 8, !tbaa !5
  %46 = load ptr, ptr %6, align 8, !tbaa !5
  %47 = load ptr, ptr %9, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %47, i32 0, i32 0
  %49 = load i16, ptr %48, align 8, !tbaa !15
  call void @bufwrite16b(ptr noundef %46, i16 noundef zeroext %49)
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %51, i32 0, i32 1
  %53 = load i16, ptr %52, align 2, !tbaa !17
  call void @bufwrite16b(ptr noundef %50, i16 noundef zeroext %53)
  %54 = load ptr, ptr %6, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %55, i32 0, i32 2
  %57 = load i16, ptr %56, align 4, !tbaa !18
  call void @bufwrite16b(ptr noundef %54, i16 noundef zeroext %57)
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %59, i32 0, i32 3
  %61 = load i16, ptr %60, align 2, !tbaa !19
  call void @bufwrite16b(ptr noundef %58, i16 noundef zeroext %61)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %62 = load ptr, ptr %7, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.caryll_Buffer, ptr %62, i32 0, i32 0
  %64 = load i64, ptr %63, align 8, !tbaa !20
  store i64 %64, ptr %10, align 8, !tbaa !22
  %65 = load ptr, ptr %9, align 8, !tbaa !5
  %66 = call zeroext i1 @shouldDecodeAsUTF16(ptr noundef %65)
  br i1 %66, label %67, label %76

67:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %68, i32 0, i32 4
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = call ptr @utf8toutf16be(ptr noundef %70, ptr noundef %11)
  store ptr %71, ptr %12, align 8, !tbaa !5
  %72 = load ptr, ptr %7, align 8, !tbaa !5
  %73 = load i64, ptr %11, align 8, !tbaa !22
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  call void @bufwrite_bytes(ptr noundef %72, i64 noundef %73, ptr noundef %74)
  %75 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %75) #5
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  br label %102

76:                                               ; preds = %39
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = call zeroext i1 @shouldDecodeAsBytes(ptr noundef %77)
  br i1 %78, label %79, label %88

79:                                               ; preds = %76
  %80 = load ptr, ptr %7, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %81, i32 0, i32 4
  %83 = load ptr, ptr %82, align 8, !tbaa !23
  %84 = call i64 @sdslen(ptr noundef %83)
  %85 = load ptr, ptr %9, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %85, i32 0, i32 4
  %87 = load ptr, ptr %86, align 8, !tbaa !23
  call void @bufwrite_bytes(ptr noundef %80, i64 noundef %84, ptr noundef %87)
  br label %101

88:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %89 = load ptr, ptr %9, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %89, i32 0, i32 4
  %91 = load ptr, ptr %90, align 8, !tbaa !23
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %92, i32 0, i32 4
  %94 = load ptr, ptr %93, align 8, !tbaa !23
  %95 = call i64 @sdslen(ptr noundef %94)
  %96 = call ptr @base64_decode(ptr noundef %91, i64 noundef %95, ptr noundef %13)
  store ptr %96, ptr %14, align 8, !tbaa !5
  %97 = load ptr, ptr %7, align 8, !tbaa !5
  %98 = load i64, ptr %13, align 8, !tbaa !22
  %99 = load ptr, ptr %14, align 8, !tbaa !5
  call void @bufwrite_bytes(ptr noundef %97, i64 noundef %98, ptr noundef %99)
  %100 = load ptr, ptr %14, align 8, !tbaa !5
  call void @free(ptr noundef %100) #5
  store ptr null, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  br label %101

101:                                              ; preds = %88, %79
  br label %102

102:                                              ; preds = %101, %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %103 = load ptr, ptr %7, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.caryll_Buffer, ptr %103, i32 0, i32 0
  %105 = load i64, ptr %104, align 8, !tbaa !20
  store i64 %105, ptr %15, align 8, !tbaa !22
  %106 = load ptr, ptr %6, align 8, !tbaa !5
  %107 = load i64, ptr %15, align 8, !tbaa !22
  %108 = load i64, ptr %10, align 8, !tbaa !22
  %109 = sub i64 %107, %108
  %110 = trunc i64 %109 to i16
  call void @bufwrite16b(ptr noundef %106, i16 noundef zeroext %110)
  %111 = load ptr, ptr %6, align 8, !tbaa !5
  %112 = load i64, ptr %10, align 8, !tbaa !22
  %113 = trunc i64 %112 to i16
  call void @bufwrite16b(ptr noundef %111, i16 noundef zeroext %113)
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %114

114:                                              ; preds = %102
  %115 = load i16, ptr %8, align 2, !tbaa !12
  %116 = add i16 %115, 1
  store i16 %116, ptr %8, align 2, !tbaa !12
  br label %31, !llvm.loop !24

117:                                              ; preds = %38
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %118 = call ptr @sdsempty()
  %119 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %118, ptr noundef @.str.12, i32 noundef 0, i32 noundef 0, i32 noundef 0)
  store ptr %119, ptr %16, align 8, !tbaa !5
  %120 = load ptr, ptr %16, align 8, !tbaa !5
  %121 = call ptr @sdsgrowzero(ptr noundef %120, i64 noundef 32)
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = load ptr, ptr %16, align 8, !tbaa !5
  call void @bufwrite_bytes(ptr noundef %122, i64 noundef 32, ptr noundef %123)
  %124 = load ptr, ptr %16, align 8, !tbaa !5
  call void @sdsfree(ptr noundef %124)
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %125 = load ptr, ptr %6, align 8, !tbaa !5
  %126 = getelementptr inbounds %struct.caryll_Buffer, ptr %125, i32 0, i32 0
  %127 = load i64, ptr %126, align 8, !tbaa !20
  store i64 %127, ptr %17, align 8, !tbaa !22
  %128 = load ptr, ptr %6, align 8, !tbaa !5
  %129 = load ptr, ptr %7, align 8, !tbaa !5
  call void @bufwrite_buf(ptr noundef %128, ptr noundef %129)
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  call void @bufseek(ptr noundef %130, i64 noundef 4)
  %131 = load ptr, ptr %6, align 8, !tbaa !5
  %132 = load i64, ptr %17, align 8, !tbaa !22
  %133 = trunc i64 %132 to i16
  call void @bufwrite16b(ptr noundef %131, i16 noundef zeroext %133)
  %134 = load ptr, ptr %7, align 8, !tbaa !5
  call void @buffree(ptr noundef %134)
  %135 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %135, ptr %3, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %136

136:                                              ; preds = %117, %20
  %137 = load ptr, ptr %3, align 8
  ret ptr %137
}

declare ptr @bufnew(...) #3

declare void @bufwrite16b(ptr noundef, i16 noundef zeroext) #3

declare ptr @utf8toutf16be(ptr noundef, ptr noundef) #3

declare void @bufwrite_bytes(ptr noundef, i64 noundef, ptr noundef) #3

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

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

declare void @sdsfree(ptr noundef) #3

declare void @bufwrite_buf(ptr noundef, ptr noundef) #3

declare void @bufseek(ptr noundef, i64 noundef) #3

declare void @buffree(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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"", !11, i64 0, !11, i64 8, !6, i64 16}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!16, !13, i64 0}
!16 = !{!"", !13, i64 0, !13, i64 2, !13, i64 4, !13, i64 6, !6, i64 8}
!17 = !{!16, !13, i64 2}
!18 = !{!16, !13, i64 4}
!19 = !{!16, !13, i64 6}
!20 = !{!21, !11, i64 0}
!21 = !{!"caryll_Buffer", !11, i64 0, !11, i64 8, !11, i64 16, !6, i64 24}
!22 = !{!11, !11, i64 0}
!23 = !{!16, !6, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}


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

%struct.otfcc_NameRecord = type { i16, i16, i16, i16, ptr }

@.str.12 = external hidden unnamed_addr constant [24 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: nounwind uwtable
declare hidden zeroext i1 @shouldDecodeAsBytes(ptr noundef) local_unnamed_addr #1

; 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 zeroext i1 @shouldDecodeAsUTF16(ptr noundef) local_unnamed_addr #1

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

declare ptr @sdscatprintf(ptr noundef, ptr noundef, ...) local_unnamed_addr #3

declare ptr @sdsempty() local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden i64 @sdslen(ptr noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @otfcc_buildName(ptr noundef readonly %0, ptr nocapture noundef readnone %1) local_unnamed_addr #1 {
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %57, label %5

5:                                                ; preds = %2
  %6 = tail call ptr (...) @bufnew() #5
  tail call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext 0) #5
  %7 = load i64, ptr %0, align 8, !tbaa !5
  %8 = trunc i64 %7 to i16
  tail call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %8) #5
  tail call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext 0) #5
  %9 = tail call ptr (...) @bufnew() #5
  %10 = load i64, ptr %0, align 8, !tbaa !5
  %.not55 = icmp eq i64 %10, 0
  br i1 %.not55, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %11 = getelementptr inbounds i8, ptr %0, i64 16
  br label %17

._crit_edge:                                      ; preds = %48, %5
  %12 = call ptr @sdsempty() #5
  %13 = call ptr (ptr, ptr, ...) @sdscatprintf(ptr noundef %12, ptr noundef nonnull @.str.12, i32 noundef 0, i32 noundef 0, i32 noundef 0) #5
  %14 = call ptr @sdsgrowzero(ptr noundef %13, i64 noundef 32) #5
  call void @bufwrite_bytes(ptr noundef %9, i64 noundef 32, ptr noundef %13) #5
  call void @sdsfree(ptr noundef %13) #5
  %15 = load i64, ptr %6, align 8, !tbaa !11
  call void @bufwrite_buf(ptr noundef nonnull %6, ptr noundef %9) #5
  call void @bufseek(ptr noundef nonnull %6, i64 noundef 4) #5
  %16 = trunc i64 %15 to i16
  call void @bufwrite16b(ptr noundef nonnull %6, i16 noundef zeroext %16) #5
  call void @buffree(ptr noundef %9) #5
  br label %57

17:                                               ; preds = %.lr.ph, %48
  %18 = phi i64 [ 0, %.lr.ph ], [ %54, %48 ]
  %.05154 = phi i16 [ 0, %.lr.ph ], [ %53, %48 ]
  %19 = load ptr, ptr %11, align 8, !tbaa !13
  %20 = getelementptr inbounds %struct.otfcc_NameRecord, ptr %19, i64 %18
  %21 = load i16, ptr %20, align 8, !tbaa !14
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %21) #5
  %22 = getelementptr inbounds i8, ptr %20, i64 2
  %23 = load i16, ptr %22, align 2, !tbaa !17
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %23) #5
  %24 = getelementptr inbounds i8, ptr %20, i64 4
  %25 = load i16, ptr %24, align 4, !tbaa !18
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %25) #5
  %26 = getelementptr inbounds i8, ptr %20, i64 6
  %27 = load i16, ptr %26, align 2, !tbaa !19
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %27) #5
  %28 = load i64, ptr %9, align 8, !tbaa !11
  %29 = call zeroext i1 @shouldDecodeAsUTF16(ptr noundef nonnull %20)
  br i1 %29, label %30, label %35

30:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #5
  %31 = getelementptr inbounds i8, ptr %20, i64 8
  %32 = load ptr, ptr %31, align 8, !tbaa !20
  %33 = call ptr @utf8toutf16be(ptr noundef %32, ptr noundef nonnull %3) #5
  %34 = load i64, ptr %3, align 8, !tbaa !21
  call void @bufwrite_bytes(ptr noundef nonnull %9, i64 noundef %34, ptr noundef %33) #5
  call void @free(ptr noundef %33) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #5
  br label %48

35:                                               ; preds = %17
  %36 = call zeroext i1 @shouldDecodeAsBytes(ptr noundef nonnull %20)
  br i1 %36, label %37, label %42

37:                                               ; preds = %35
  %38 = getelementptr inbounds i8, ptr %20, i64 8
  %39 = load ptr, ptr %38, align 8, !tbaa !20
  %40 = call i64 @sdslen(ptr noundef %39)
  %41 = load ptr, ptr %38, align 8, !tbaa !20
  call void @bufwrite_bytes(ptr noundef nonnull %9, i64 noundef %40, ptr noundef %41) #5
  br label %48

42:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %43 = getelementptr inbounds i8, ptr %20, i64 8
  %44 = load ptr, ptr %43, align 8, !tbaa !20
  %45 = call i64 @sdslen(ptr noundef %44)
  %46 = call ptr @base64_decode(ptr noundef %44, i64 noundef %45, ptr noundef nonnull %4) #5
  %47 = load i64, ptr %4, align 8, !tbaa !21
  call void @bufwrite_bytes(ptr noundef nonnull %9, i64 noundef %47, ptr noundef %46) #5
  call void @free(ptr noundef %46) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  br label %48

48:                                               ; preds = %37, %42, %30
  %49 = load i64, ptr %9, align 8, !tbaa !11
  %50 = sub i64 %49, %28
  %51 = trunc i64 %50 to i16
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %51) #5
  %52 = trunc i64 %28 to i16
  call void @bufwrite16b(ptr noundef %6, i16 noundef zeroext %52) #5
  %53 = add i16 %.05154, 1
  %54 = zext i16 %53 to i64
  %55 = load i64, ptr %0, align 8, !tbaa !5
  %56 = icmp ugt i64 %55, %54
  br i1 %56, label %17, label %._crit_edge, !llvm.loop !22

57:                                               ; preds = %2, %._crit_edge
  %.0 = phi ptr [ %6, %._crit_edge ], [ null, %2 ]
  ret ptr %.0
}

declare ptr @bufnew(...) local_unnamed_addr #3

declare void @bufwrite16b(ptr noundef, i16 noundef zeroext) local_unnamed_addr #3

declare ptr @utf8toutf16be(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @bufwrite_bytes(ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #3

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

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

declare void @sdsfree(ptr noundef) local_unnamed_addr #3

declare void @bufwrite_buf(ptr noundef, ptr noundef) local_unnamed_addr #3

declare void @bufseek(ptr noundef, i64 noundef) local_unnamed_addr #3

declare void @buffree(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 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 #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, !7, i64 0}
!6 = !{!"", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!12, !7, i64 0}
!12 = !{!"caryll_Buffer", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24}
!13 = !{!6, !10, i64 16}
!14 = !{!15, !16, i64 0}
!15 = !{!"", !16, i64 0, !16, i64 2, !16, i64 4, !16, i64 6, !10, i64 8}
!16 = !{!"short", !8, i64 0}
!17 = !{!15, !16, i64 2}
!18 = !{!15, !16, i64 4}
!19 = !{!15, !16, i64 6}
!20 = !{!15, !10, i64 8}
!21 = !{!7, !7, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass