; LLVM IR from humz2k/sugaryc :: ext/bdwgc/cord (cordbscs)

; 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.CordRep = type { %struct.Generic, %union.ConcatOrFunc }
%struct.Generic = type { i8, i8, i8, i8, i64 }
%union.ConcatOrFunc = type { %struct.Concatenation }
%struct.Concatenation = type { ptr, ptr }

@stderr = external global ptr, align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @CORD__call_oom_fn() #0

; Function Attrs: nounwind uwtable
define dso_local ptr @CORD_cat_char_star(ptr noundef %0, ptr noundef %1, i64 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i64, align 8
  %17 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i64 %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  %18 = load ptr, ptr %5, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %22

20:                                               ; preds = %3
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %21, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %225

22:                                               ; preds = %3
  %23 = load i64, ptr %7, align 8, !tbaa !9
  %24 = icmp eq i64 %23, 0
  br i1 %24, label %25, label %27

25:                                               ; preds = %22
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %26, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %225

27:                                               ; preds = %22
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = load i8, ptr %28, align 1, !tbaa !11
  %30 = sext i8 %29 to i32
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %64

32:                                               ; preds = %27
  %33 = load ptr, ptr %5, align 8, !tbaa !5
  %34 = call i64 @strlen(ptr noundef %33) #9
  store i64 %34, ptr %9, align 8, !tbaa !9
  %35 = load i64, ptr %9, align 8, !tbaa !9
  %36 = load i64, ptr %7, align 8, !tbaa !9
  %37 = add i64 %35, %36
  store i64 %37, ptr %8, align 8, !tbaa !9
  %38 = load i64, ptr %8, align 8, !tbaa !9
  %39 = icmp ule i64 %38, 31
  br i1 %39, label %40, label %62

40:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %41 = load i64, ptr %8, align 8, !tbaa !9
  %42 = add i64 %41, 1
  %43 = call noalias ptr @GC_malloc_atomic(i64 noundef %42) #10
  store ptr %43, ptr %12, align 8, !tbaa !5
  %44 = load ptr, ptr %12, align 8, !tbaa !5
  %45 = icmp eq ptr null, %44
  br i1 %45, label %46, label %49

46:                                               ; preds = %40
  call void @CORD__call_oom_fn()
  %47 = load ptr, ptr @stderr, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %47, ptr noundef @.str, ptr noundef @.str.1) #8
  call void @abort() #11
  unreachable

49:                                               ; preds = %40
  %50 = load ptr, ptr %12, align 8, !tbaa !5
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %50, ptr align 1 %51, i64 %52, i1 false)
  %53 = load ptr, ptr %12, align 8, !tbaa !5
  %54 = load i64, ptr %9, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %53, i64 %54
  %56 = load ptr, ptr %6, align 8, !tbaa !5
  %57 = load i64, ptr %7, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %55, ptr align 1 %56, i64 %57, i1 false)
  %58 = load ptr, ptr %12, align 8, !tbaa !5
  %59 = load i64, ptr %8, align 8, !tbaa !9
  %60 = getelementptr inbounds i8, ptr %58, i64 %59
  store i8 0, ptr %60, align 1, !tbaa !11
  %61 = load ptr, ptr %12, align 8, !tbaa !5
  store ptr %61, ptr %4, align 8
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %225

62:                                               ; preds = %32
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %63

63:                                               ; preds = %62
  br label %179

64:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.CordRep, ptr %65, i32 0, i32 0
  %67 = getelementptr inbounds %struct.Generic, ptr %66, i32 0, i32 4
  %68 = load i64, ptr %67, align 8, !tbaa !14
  store i64 %68, ptr %9, align 8, !tbaa !9
  %69 = load i64, ptr %7, align 8, !tbaa !9
  %70 = icmp ule i64 %69, 15
  br i1 %70, label %71, label %168

71:                                               ; preds = %64
  %72 = load ptr, ptr %5, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.CordRep, ptr %72, i32 0, i32 0
  %74 = getelementptr inbounds %struct.Generic, ptr %73, i32 0, i32 1
  %75 = load i8, ptr %74, align 1, !tbaa !17
  %76 = sext i8 %75 to i32
  %77 = icmp eq i32 %76, 1
  br i1 %77, label %78, label %168

78:                                               ; preds = %71
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.CordRep, ptr %79, i32 0, i32 1
  %81 = getelementptr inbounds %struct.Concatenation, ptr %80, i32 0, i32 1
  %82 = load ptr, ptr %81, align 8, !tbaa !11
  store ptr %82, ptr %13, align 8, !tbaa !5
  %83 = load i8, ptr %82, align 1, !tbaa !11
  %84 = sext i8 %83 to i32
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %168

86:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.CordRep, ptr %87, i32 0, i32 1
  %89 = getelementptr inbounds %struct.Concatenation, ptr %88, i32 0, i32 0
  %90 = load ptr, ptr %89, align 8, !tbaa !11
  store ptr %90, ptr %14, align 8, !tbaa !5
  %91 = load ptr, ptr %14, align 8, !tbaa !5
  %92 = load i8, ptr %91, align 1, !tbaa !11
  %93 = sext i8 %92 to i32
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %102, label %95

95:                                               ; preds = %86
  %96 = load i64, ptr %9, align 8, !tbaa !9
  %97 = load ptr, ptr %14, align 8, !tbaa !5
  %98 = getelementptr inbounds %struct.CordRep, ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.Generic, ptr %98, i32 0, i32 4
  %100 = load i64, ptr %99, align 8, !tbaa !14
  %101 = sub i64 %96, %100
  store i64 %101, ptr %16, align 8, !tbaa !9
  br label %121

102:                                              ; preds = %86
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.CordRep, ptr %103, i32 0, i32 0
  %105 = getelementptr inbounds %struct.Generic, ptr %104, i32 0, i32 3
  %106 = load i8, ptr %105, align 1, !tbaa !18
  %107 = zext i8 %106 to i32
  %108 = icmp ne i32 %107, 0
  br i1 %108, label %109, label %117

109:                                              ; preds = %102
  %110 = load i64, ptr %9, align 8, !tbaa !9
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.CordRep, ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.Generic, ptr %112, i32 0, i32 3
  %114 = load i8, ptr %113, align 1, !tbaa !18
  %115 = zext i8 %114 to i64
  %116 = sub i64 %110, %115
  store i64 %116, ptr %16, align 8, !tbaa !9
  br label %120

117:                                              ; preds = %102
  %118 = load ptr, ptr %13, align 8, !tbaa !5
  %119 = call i64 @strlen(ptr noundef %118) #9
  store i64 %119, ptr %16, align 8, !tbaa !9
  br label %120

120:                                              ; preds = %117, %109
  br label %121

121:                                              ; preds = %120, %95
  %122 = load i64, ptr %16, align 8, !tbaa !9
  %123 = load i64, ptr %7, align 8, !tbaa !9
  %124 = add i64 %122, %123
  store i64 %124, ptr %8, align 8, !tbaa !9
  %125 = load i64, ptr %8, align 8, !tbaa !9
  %126 = icmp ule i64 %125, 31
  br i1 %126, label %127, label %154

127:                                              ; preds = %121
  %128 = load i64, ptr %8, align 8, !tbaa !9
  %129 = add i64 %128, 1
  %130 = call noalias ptr @GC_malloc_atomic(i64 noundef %129) #10
  store ptr %130, ptr %15, align 8, !tbaa !5
  %131 = load ptr, ptr %15, align 8, !tbaa !5
  %132 = icmp eq ptr %131, null
  br i1 %132, label %133, label %136

133:                                              ; preds = %127
  call void @CORD__call_oom_fn()
  %134 = load ptr, ptr @stderr, align 8, !tbaa !5
  %135 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %134, ptr noundef @.str, ptr noundef @.str.1) #8
  call void @abort() #11
  unreachable

136:                                              ; preds = %127
  %137 = load ptr, ptr %15, align 8, !tbaa !5
  %138 = load ptr, ptr %13, align 8, !tbaa !5
  %139 = load i64, ptr %16, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %137, ptr align 1 %138, i64 %139, i1 false)
  %140 = load ptr, ptr %15, align 8, !tbaa !5
  %141 = load i64, ptr %16, align 8, !tbaa !9
  %142 = getelementptr inbounds i8, ptr %140, i64 %141
  %143 = load ptr, ptr %6, align 8, !tbaa !5
  %144 = load i64, ptr %7, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %142, ptr align 1 %143, i64 %144, i1 false)
  %145 = load ptr, ptr %15, align 8, !tbaa !5
  %146 = load i64, ptr %8, align 8, !tbaa !9
  %147 = getelementptr inbounds i8, ptr %145, i64 %146
  store i8 0, ptr %147, align 1, !tbaa !11
  %148 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %148, ptr %6, align 8, !tbaa !5
  %149 = load i64, ptr %8, align 8, !tbaa !9
  store i64 %149, ptr %7, align 8, !tbaa !9
  %150 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %150, ptr %5, align 8, !tbaa !5
  %151 = load i64, ptr %16, align 8, !tbaa !9
  %152 = load i64, ptr %9, align 8, !tbaa !9
  %153 = sub i64 %152, %151
  store i64 %153, ptr %9, align 8, !tbaa !9
  br label %154

154:                                              ; preds = %136, %121
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = load i8, ptr %155, align 1, !tbaa !11
  %157 = sext i8 %156 to i32
  %158 = icmp ne i32 %157, 0
  br i1 %158, label %159, label %160

159:                                              ; preds = %154
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %167

160:                                              ; preds = %154
  %161 = load ptr, ptr %5, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.CordRep, ptr %161, i32 0, i32 0
  %163 = getelementptr inbounds %struct.Generic, ptr %162, i32 0, i32 2
  %164 = load i8, ptr %163, align 2, !tbaa !19
  %165 = sext i8 %164 to i32
  %166 = add nsw i32 %165, 1
  store i32 %166, ptr %10, align 4, !tbaa !12
  br label %167

167:                                              ; preds = %160, %159
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  br label %175

168:                                              ; preds = %78, %71, %64
  %169 = load ptr, ptr %5, align 8, !tbaa !5
  %170 = getelementptr inbounds %struct.CordRep, ptr %169, i32 0, i32 0
  %171 = getelementptr inbounds %struct.Generic, ptr %170, i32 0, i32 2
  %172 = load i8, ptr %171, align 2, !tbaa !19
  %173 = sext i8 %172 to i32
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %10, align 4, !tbaa !12
  br label %175

175:                                              ; preds = %168, %167
  %176 = load i64, ptr %9, align 8, !tbaa !9
  %177 = load i64, ptr %7, align 8, !tbaa !9
  %178 = add i64 %176, %177
  store i64 %178, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  br label %179

179:                                              ; preds = %175, %63
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  %180 = call noalias ptr @GC_malloc(i64 noundef 32) #10
  store ptr %180, ptr %17, align 8, !tbaa !5
  %181 = load ptr, ptr %17, align 8, !tbaa !5
  %182 = icmp eq ptr null, %181
  br i1 %182, label %183, label %186

183:                                              ; preds = %179
  call void @CORD__call_oom_fn()
  %184 = load ptr, ptr @stderr, align 8, !tbaa !5
  %185 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %184, ptr noundef @.str, ptr noundef @.str.1) #8
  call void @abort() #11
  unreachable

186:                                              ; preds = %179
  %187 = load ptr, ptr %17, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.CordRep, ptr %187, i32 0, i32 0
  %189 = getelementptr inbounds %struct.Generic, ptr %188, i32 0, i32 1
  store i8 1, ptr %189, align 1, !tbaa !17
  %190 = load i32, ptr %10, align 4, !tbaa !12
  %191 = trunc i32 %190 to i8
  %192 = load ptr, ptr %17, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.CordRep, ptr %192, i32 0, i32 0
  %194 = getelementptr inbounds %struct.Generic, ptr %193, i32 0, i32 2
  store i8 %191, ptr %194, align 2, !tbaa !19
  %195 = load i64, ptr %9, align 8, !tbaa !9
  %196 = icmp ule i64 %195, 255
  br i1 %196, label %197, label %203

197:                                              ; preds = %186
  %198 = load i64, ptr %9, align 8, !tbaa !9
  %199 = trunc i64 %198 to i8
  %200 = load ptr, ptr %17, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.CordRep, ptr %200, i32 0, i32 0
  %202 = getelementptr inbounds %struct.Generic, ptr %201, i32 0, i32 3
  store i8 %199, ptr %202, align 1, !tbaa !18
  br label %203

203:                                              ; preds = %197, %186
  %204 = load i64, ptr %8, align 8, !tbaa !9
  %205 = load ptr, ptr %17, align 8, !tbaa !5
  %206 = getelementptr inbounds %struct.CordRep, ptr %205, i32 0, i32 0
  %207 = getelementptr inbounds %struct.Generic, ptr %206, i32 0, i32 4
  store i64 %204, ptr %207, align 8, !tbaa !14
  %208 = load ptr, ptr %5, align 8, !tbaa !5
  %209 = load ptr, ptr %17, align 8, !tbaa !5
  %210 = getelementptr inbounds %struct.CordRep, ptr %209, i32 0, i32 1
  %211 = getelementptr inbounds %struct.Concatenation, ptr %210, i32 0, i32 0
  store ptr %208, ptr %211, align 8, !tbaa !11
  %212 = load ptr, ptr %17, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.CordRep, ptr %212, i32 0, i32 1
  %214 = getelementptr inbounds %struct.Concatenation, ptr %213, i32 0, i32 1
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  call void @GC_ptr_store_and_dirty(ptr noundef %214, ptr noundef %215)
  %216 = load ptr, ptr %5, align 8, !tbaa !5
  call void asm sideeffect " ", "X,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr %216) #8, !srcloc !20
  %217 = load i32, ptr %10, align 4, !tbaa !12
  %218 = icmp sge i32 %217, 48
  br i1 %218, label %219, label %222

219:                                              ; preds = %203
  %220 = load ptr, ptr %17, align 8, !tbaa !5
  %221 = call ptr @CORD_balance(ptr noundef %220)
  store ptr %221, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %224

222:                                              ; preds = %203
  %223 = load ptr, ptr %17, align 8, !tbaa !5
  store ptr %223, ptr %4, align 8
  store i32 1, ptr %11, align 4
  br label %224

224:                                              ; preds = %222, %219
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %225

225:                                              ; preds = %224, %49, %25, %20
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  %226 = load ptr, ptr %4, align 8
  ret ptr %226
}

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

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

; Function Attrs: allocsize(0)
declare noalias ptr @GC_malloc_atomic(i64 noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @abort() #5

; 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) #6

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

; Function Attrs: allocsize(0)
declare noalias ptr @GC_malloc(i64 noundef) #3

declare void @GC_ptr_store_and_dirty(ptr noundef, ptr noundef) #7

; Function Attrs: nounwind uwtable
declare dso_local ptr @CORD_balance(ptr noundef) #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { allocsize(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 = { 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 = { noreturn 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { "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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { allocsize(0) }
attributes #11 = { noreturn 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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !10, i64 8}
!15 = !{!"", !16, i64 0, !7, i64 16}
!16 = !{!"Generic", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !10, i64 8}
!17 = !{!15, !7, i64 1}
!18 = !{!15, !7, i64 3}
!19 = !{!15, !7, i64 2}
!20 = !{i64 2148058692}


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

@stderr = external local_unnamed_addr global ptr, align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @CORD__call_oom_fn() local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local ptr @CORD_cat_char_star(ptr noundef %0, ptr noundef %1, i64 noundef %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %93, label %5

5:                                                ; preds = %3
  %6 = icmp eq i64 %2, 0
  br i1 %6, label %93, label %7

7:                                                ; preds = %5
  %8 = load i8, ptr %0, align 1, !tbaa !5
  %.not = icmp eq i8 %8, 0
  br i1 %.not, label %23, label %9

9:                                                ; preds = %7
  %10 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %0) #7
  %11 = add i64 %10, %2
  %12 = icmp ult i64 %11, 32
  br i1 %12, label %13, label %72

13:                                               ; preds = %9
  %14 = add nuw nsw i64 %11, 1
  %15 = tail call noalias ptr @GC_malloc_atomic(i64 noundef %14) #8
  %16 = icmp eq ptr %15, null
  br i1 %16, label %17, label %20

17:                                               ; preds = %13
  tail call void @CORD__call_oom_fn()
  %18 = load ptr, ptr @stderr, align 8, !tbaa !8
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %18, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #9
  tail call void @abort() #10
  unreachable

20:                                               ; preds = %13
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %15, ptr nonnull align 1 %0, i64 %10, i1 false)
  %21 = getelementptr inbounds i8, ptr %15, i64 %10
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %21, ptr align 1 %1, i64 %2, i1 false)
  %22 = getelementptr inbounds i8, ptr %15, i64 %11
  store i8 0, ptr %22, align 1, !tbaa !5
  br label %93

23:                                               ; preds = %7
  %24 = getelementptr inbounds i8, ptr %0, i64 8
  %25 = load i64, ptr %24, align 8, !tbaa !10
  %26 = icmp ult i64 %2, 16
  br i1 %26, label %27, label %.sink.split

27:                                               ; preds = %23
  %28 = getelementptr inbounds i8, ptr %0, i64 1
  %29 = load i8, ptr %28, align 1, !tbaa !14
  %30 = icmp eq i8 %29, 1
  br i1 %30, label %31, label %.sink.split

31:                                               ; preds = %27
  %32 = getelementptr inbounds i8, ptr %0, i64 24
  %33 = load ptr, ptr %32, align 8, !tbaa !5
  %34 = load i8, ptr %33, align 1, !tbaa !5
  %.not97 = icmp eq i8 %34, 0
  br i1 %.not97, label %.sink.split, label %35

35:                                               ; preds = %31
  %36 = getelementptr inbounds i8, ptr %0, i64 16
  %37 = load ptr, ptr %36, align 8, !tbaa !5
  %38 = load i8, ptr %37, align 1, !tbaa !5
  %.not98 = icmp eq i8 %38, 0
  br i1 %.not98, label %39, label %43

39:                                               ; preds = %35
  %40 = getelementptr inbounds i8, ptr %37, i64 8
  %41 = load i64, ptr %40, align 8, !tbaa !10
  %42 = sub i64 %25, %41
  br label %51

43:                                               ; preds = %35
  %44 = getelementptr inbounds i8, ptr %0, i64 3
  %45 = load i8, ptr %44, align 1, !tbaa !15
  %.not99 = icmp eq i8 %45, 0
  br i1 %.not99, label %49, label %46

46:                                               ; preds = %43
  %47 = zext i8 %45 to i64
  %48 = sub i64 %25, %47
  br label %51

49:                                               ; preds = %43
  %50 = tail call i64 @strlen(ptr noundef nonnull dereferenceable(1) %33) #7
  br label %51

51:                                               ; preds = %46, %49, %39
  %.074 = phi i64 [ %48, %46 ], [ %50, %49 ], [ %42, %39 ]
  %52 = add i64 %.074, %2
  %53 = icmp ult i64 %52, 32
  br i1 %53, label %54, label %.sink.split

54:                                               ; preds = %51
  %55 = add nuw nsw i64 %52, 1
  %56 = tail call noalias ptr @GC_malloc_atomic(i64 noundef %55) #8
  %57 = icmp eq ptr %56, null
  br i1 %57, label %58, label %61

58:                                               ; preds = %54
  tail call void @CORD__call_oom_fn()
  %59 = load ptr, ptr @stderr, align 8, !tbaa !8
  %60 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %59, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #9
  tail call void @abort() #10
  unreachable

61:                                               ; preds = %54
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %56, ptr nonnull align 1 %33, i64 %.074, i1 false)
  %62 = getelementptr inbounds i8, ptr %56, i64 %.074
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %62, ptr align 1 %1, i64 %2, i1 false)
  %63 = getelementptr inbounds i8, ptr %56, i64 %52
  store i8 0, ptr %63, align 1, !tbaa !5
  %64 = sub i64 %25, %.074
  %.pre = load i8, ptr %37, align 1, !tbaa !5
  %65 = icmp eq i8 %.pre, 0
  br i1 %65, label %.sink.split, label %70

.sink.split:                                      ; preds = %23, %27, %31, %61, %51
  %.075109.sink = phi ptr [ %37, %61 ], [ %0, %51 ], [ %0, %31 ], [ %0, %27 ], [ %0, %23 ]
  %.187.ph = phi i64 [ %64, %61 ], [ %25, %51 ], [ %25, %31 ], [ %25, %27 ], [ %25, %23 ]
  %.181.ph = phi i64 [ %52, %61 ], [ %2, %51 ], [ %2, %31 ], [ %2, %27 ], [ %2, %23 ]
  %.178.ph = phi ptr [ %56, %61 ], [ %1, %51 ], [ %1, %31 ], [ %1, %27 ], [ %1, %23 ]
  %66 = getelementptr inbounds i8, ptr %.075109.sink, i64 2
  %67 = load i8, ptr %66, align 2, !tbaa !16
  %68 = sext i8 %67 to i32
  %69 = add nsw i32 %68, 1
  br label %70

70:                                               ; preds = %.sink.split, %61
  %.187 = phi i64 [ %64, %61 ], [ %.187.ph, %.sink.split ]
  %.184 = phi i32 [ 1, %61 ], [ %69, %.sink.split ]
  %.181 = phi i64 [ %52, %61 ], [ %.181.ph, %.sink.split ]
  %.178 = phi ptr [ %56, %61 ], [ %.178.ph, %.sink.split ]
  %.176 = phi ptr [ %37, %61 ], [ %.075109.sink, %.sink.split ]
  %71 = add i64 %.181, %.187
  br label %72

72:                                               ; preds = %9, %70
  %.288 = phi i64 [ %.187, %70 ], [ %10, %9 ]
  %.285 = phi i32 [ %.184, %70 ], [ 1, %9 ]
  %.082 = phi i64 [ %71, %70 ], [ %11, %9 ]
  %.279 = phi ptr [ %.178, %70 ], [ %1, %9 ]
  %.2 = phi ptr [ %.176, %70 ], [ %0, %9 ]
  %73 = tail call noalias dereferenceable_or_null(32) ptr @GC_malloc(i64 noundef 32) #8
  %74 = icmp eq ptr %73, null
  br i1 %74, label %75, label %78

75:                                               ; preds = %72
  tail call void @CORD__call_oom_fn()
  %76 = load ptr, ptr @stderr, align 8, !tbaa !8
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %76, ptr noundef nonnull @.str, ptr noundef nonnull @.str.1) #9
  tail call void @abort() #10
  unreachable

78:                                               ; preds = %72
  %79 = getelementptr inbounds i8, ptr %73, i64 1
  store i8 1, ptr %79, align 1, !tbaa !14
  %80 = trunc i32 %.285 to i8
  %81 = getelementptr inbounds i8, ptr %73, i64 2
  store i8 %80, ptr %81, align 2, !tbaa !16
  %82 = icmp ult i64 %.288, 256
  br i1 %82, label %83, label %86

83:                                               ; preds = %78
  %84 = trunc nuw i64 %.288 to i8
  %85 = getelementptr inbounds i8, ptr %73, i64 3
  store i8 %84, ptr %85, align 1, !tbaa !15
  br label %86

86:                                               ; preds = %83, %78
  %87 = getelementptr inbounds i8, ptr %73, i64 8
  store i64 %.082, ptr %87, align 8, !tbaa !10
  %88 = getelementptr inbounds i8, ptr %73, i64 16
  store ptr %.2, ptr %88, align 8, !tbaa !5
  %89 = getelementptr inbounds i8, ptr %73, i64 24
  tail call void @GC_ptr_store_and_dirty(ptr noundef nonnull %89, ptr noundef %.279) #11
  tail call void asm sideeffect " ", "X,~{memory},~{dirflag},~{fpsr},~{flags}"(ptr nonnull %.2) #11, !srcloc !17
  %90 = icmp sgt i32 %.285, 47
  br i1 %90, label %91, label %93

91:                                               ; preds = %86
  %92 = tail call ptr @CORD_balance(ptr noundef nonnull %73)
  br label %93

93:                                               ; preds = %91, %86, %5, %3, %20
  %.1 = phi ptr [ %15, %20 ], [ %1, %3 ], [ %0, %5 ], [ %92, %91 ], [ %73, %86 ]
  ret ptr %.1
}

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

; Function Attrs: allocsize(0)
declare noalias ptr @GC_malloc_atomic(i64 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #4

; 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) #5

; Function Attrs: allocsize(0)
declare noalias ptr @GC_malloc(i64 noundef) local_unnamed_addr #2

declare void @GC_ptr_store_and_dirty(ptr noundef, ptr noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare dso_local ptr @CORD_balance(ptr 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 = { 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 #2 = { allocsize(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 = { 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 #4 = { noreturn 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 willreturn memory(read) }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { cold nounwind }
attributes #10 = { noreturn nounwind }
attributes #11 = { 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/C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"any pointer", !6, i64 0}
!10 = !{!11, !13, i64 8}
!11 = !{!"", !12, i64 0, !6, i64 16}
!12 = !{!"Generic", !6, i64 0, !6, i64 1, !6, i64 2, !6, i64 3, !13, i64 8}
!13 = !{!"long", !6, i64 0}
!14 = !{!11, !6, i64 1}
!15 = !{!11, !6, i64 3}
!16 = !{!11, !6, i64 2}
!17 = !{i64 2148058692}


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