; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_compiled_4)

; 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.w2c_hermes = type { ptr, ptr, ptr, i32, i32, i32, %struct.wasm_rt_memory_t, %struct.wasm_rt_funcref_table_t }
%struct.wasm_rt_memory_t = type { ptr, i64, i64, i64, i8 }
%struct.wasm_rt_funcref_table_t = type { ptr, i32, i32 }

; 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: noreturn
declare void @wasm_rt_trap(i32 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) #2

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

declare void @w2c_hermes_0x5F_assert_fail(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

declare void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

declare i32 @w2c_hermes_0x5F_memcpy(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ASmallXString0x3Cchar16_t0x2C0x2032u0x3E0x3A0x3Aappend0x28char16_t0x20const0x2A0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2) #4 {
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !9
  store i32 %2, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %16 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %16, ptr %11, align 4, !tbaa !9
  %17 = load ptr, ptr %4, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.w2c_hermes, ptr %17, i32 0, i32 6
  %19 = load i32, ptr %11, align 4, !tbaa !9
  %20 = zext i32 %19 to i64
  %21 = call i32 @i32_load16_u(ptr noundef %18, i64 noundef %20)
  store i32 %21, ptr %11, align 4, !tbaa !9
  %22 = load i32, ptr %11, align 4, !tbaa !9
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %108

24:                                               ; preds = %3
  %25 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %25, ptr %11, align 4, !tbaa !9
  %26 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %26, ptr %7, align 4, !tbaa !9
  br label %27

27:                                               ; preds = %49, %24
  %28 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %28, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  %29 = load i32, ptr %12, align 4, !tbaa !9
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = add i32 %30, %29
  store i32 %31, ptr %11, align 4, !tbaa !9
  %32 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %32, ptr %8, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %33, ptr %11, align 4, !tbaa !9
  %34 = load ptr, ptr %4, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.w2c_hermes, ptr %34, i32 0, i32 6
  %36 = load i32, ptr %11, align 4, !tbaa !9
  %37 = zext i32 %36 to i64
  %38 = add i64 %37, 2
  %39 = call i32 @i32_load16_u(ptr noundef %35, i64 noundef %38)
  store i32 %39, ptr %11, align 4, !tbaa !9
  %40 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %40, ptr %9, align 4, !tbaa !9
  %41 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %41, ptr %11, align 4, !tbaa !9
  store i32 2, ptr %12, align 4, !tbaa !9
  %42 = load i32, ptr %12, align 4, !tbaa !9
  %43 = load i32, ptr %11, align 4, !tbaa !9
  %44 = add i32 %43, %42
  store i32 %44, ptr %11, align 4, !tbaa !9
  %45 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %45, ptr %7, align 4, !tbaa !9
  %46 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %46, ptr %11, align 4, !tbaa !9
  %47 = load i32, ptr %11, align 4, !tbaa !9
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %27
  br label %27

50:                                               ; preds = %27
  %51 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %51, ptr %11, align 4, !tbaa !9
  store i32 4, ptr %12, align 4, !tbaa !9
  %52 = load i32, ptr %12, align 4, !tbaa !9
  %53 = load i32, ptr %11, align 4, !tbaa !9
  %54 = add i32 %53, %52
  store i32 %54, ptr %11, align 4, !tbaa !9
  %55 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %55, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %56, ptr %11, align 4, !tbaa !9
  store i32 8, ptr %12, align 4, !tbaa !9
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = load i32, ptr %11, align 4, !tbaa !9
  %59 = add i32 %58, %57
  store i32 %59, ptr %11, align 4, !tbaa !9
  %60 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %60, ptr %9, align 4, !tbaa !9
  %61 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %61, ptr %11, align 4, !tbaa !9
  %62 = load ptr, ptr %4, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.w2c_hermes, ptr %62, i32 0, i32 6
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = zext i32 %64 to i64
  %66 = add i64 %65, 8
  %67 = call i32 @i32_load(ptr noundef %63, i64 noundef %66)
  store i32 %67, ptr %11, align 4, !tbaa !9
  %68 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %68, ptr %12, align 4, !tbaa !9
  %69 = load ptr, ptr %4, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.w2c_hermes, ptr %69, i32 0, i32 6
  %71 = load i32, ptr %12, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = add i64 %72, 4
  %74 = call i32 @i32_load(ptr noundef %70, i64 noundef %73)
  store i32 %74, ptr %12, align 4, !tbaa !9
  %75 = load i32, ptr %12, align 4, !tbaa !9
  store i32 %75, ptr %10, align 4, !tbaa !9
  %76 = load i32, ptr %12, align 4, !tbaa !9
  %77 = load i32, ptr %11, align 4, !tbaa !9
  %78 = sub i32 %77, %76
  store i32 %78, ptr %11, align 4, !tbaa !9
  %79 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %79, ptr %12, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = load i32, ptr %12, align 4, !tbaa !9
  %82 = icmp ult i32 %80, %81
  %83 = zext i1 %82 to i32
  store i32 %83, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %102

86:                                               ; preds = %50
  %87 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %87, ptr %11, align 4, !tbaa !9
  %88 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %88, ptr %12, align 4, !tbaa !9
  store i32 12, ptr %13, align 4, !tbaa !9
  %89 = load i32, ptr %13, align 4, !tbaa !9
  %90 = load i32, ptr %12, align 4, !tbaa !9
  %91 = add i32 %90, %89
  store i32 %91, ptr %12, align 4, !tbaa !9
  %92 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %92, ptr %13, align 4, !tbaa !9
  %93 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %93, ptr %14, align 4, !tbaa !9
  %94 = load i32, ptr %14, align 4, !tbaa !9
  %95 = load i32, ptr %13, align 4, !tbaa !9
  %96 = add i32 %95, %94
  store i32 %96, ptr %13, align 4, !tbaa !9
  store i32 2, ptr %14, align 4, !tbaa !9
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = load i32, ptr %11, align 4, !tbaa !9
  %99 = load i32, ptr %12, align 4, !tbaa !9
  %100 = load i32, ptr %13, align 4, !tbaa !9
  %101 = load i32, ptr %14, align 4, !tbaa !9
  call void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef %97, i32 noundef %98, i32 noundef %99, i32 noundef %100, i32 noundef %101)
  br label %121

102:                                              ; preds = %50
  %103 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %103, ptr %11, align 4, !tbaa !9
  %104 = load i32, ptr %11, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %107

106:                                              ; preds = %102
  br label %121

107:                                              ; preds = %102
  br label %119

108:                                              ; preds = %3
  %109 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %109, ptr %11, align 4, !tbaa !9
  store i32 4, ptr %12, align 4, !tbaa !9
  %110 = load i32, ptr %12, align 4, !tbaa !9
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = add i32 %111, %110
  store i32 %112, ptr %11, align 4, !tbaa !9
  %113 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %113, ptr %7, align 4, !tbaa !9
  %114 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %114, ptr %11, align 4, !tbaa !9
  store i32 8, ptr %12, align 4, !tbaa !9
  %115 = load i32, ptr %12, align 4, !tbaa !9
  %116 = load i32, ptr %11, align 4, !tbaa !9
  %117 = add i32 %116, %115
  store i32 %117, ptr %11, align 4, !tbaa !9
  %118 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %118, ptr %9, align 4, !tbaa !9
  br label %119

119:                                              ; preds = %108, %107
  store i32 0, ptr %11, align 4, !tbaa !9
  %120 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %120, ptr %8, align 4, !tbaa !9
  br label %153

121:                                              ; preds = %106, %86
  %122 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %122, ptr %11, align 4, !tbaa !9
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.w2c_hermes, ptr %123, i32 0, i32 6
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = zext i32 %125 to i64
  %127 = call i32 @i32_load(ptr noundef %124, i64 noundef %126)
  store i32 %127, ptr %11, align 4, !tbaa !9
  %128 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %128, ptr %12, align 4, !tbaa !9
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.w2c_hermes, ptr %129, i32 0, i32 6
  %131 = load i32, ptr %12, align 4, !tbaa !9
  %132 = zext i32 %131 to i64
  %133 = add i64 %132, 4
  %134 = call i32 @i32_load(ptr noundef %130, i64 noundef %133)
  store i32 %134, ptr %12, align 4, !tbaa !9
  store i32 1, ptr %13, align 4, !tbaa !9
  %135 = load i32, ptr %13, align 4, !tbaa !9
  %136 = and i32 %135, 31
  %137 = load i32, ptr %12, align 4, !tbaa !9
  %138 = shl i32 %137, %136
  store i32 %138, ptr %12, align 4, !tbaa !9
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %11, align 4, !tbaa !9
  %141 = add i32 %140, %139
  store i32 %141, ptr %11, align 4, !tbaa !9
  %142 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %142, ptr %12, align 4, !tbaa !9
  %143 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %143, ptr %13, align 4, !tbaa !9
  store i32 1, ptr %14, align 4, !tbaa !9
  %144 = load i32, ptr %14, align 4, !tbaa !9
  %145 = and i32 %144, 31
  %146 = load i32, ptr %13, align 4, !tbaa !9
  %147 = shl i32 %146, %145
  store i32 %147, ptr %13, align 4, !tbaa !9
  %148 = load ptr, ptr %4, align 8, !tbaa !5
  %149 = load i32, ptr %11, align 4, !tbaa !9
  %150 = load i32, ptr %12, align 4, !tbaa !9
  %151 = load i32, ptr %13, align 4, !tbaa !9
  %152 = call i32 @w2c_hermes_0x5F_memcpy(ptr noundef %148, i32 noundef %149, i32 noundef %150, i32 noundef %151)
  store i32 %152, ptr %11, align 4, !tbaa !9
  br label %153

153:                                              ; preds = %121, %119
  %154 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %154, ptr %11, align 4, !tbaa !9
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.w2c_hermes, ptr %155, i32 0, i32 6
  %157 = load i32, ptr %11, align 4, !tbaa !9
  %158 = zext i32 %157 to i64
  %159 = call i32 @i32_load(ptr noundef %156, i64 noundef %158)
  store i32 %159, ptr %11, align 4, !tbaa !9
  %160 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %160, ptr %12, align 4, !tbaa !9
  %161 = load i32, ptr %12, align 4, !tbaa !9
  %162 = load i32, ptr %11, align 4, !tbaa !9
  %163 = add i32 %162, %161
  store i32 %163, ptr %11, align 4, !tbaa !9
  %164 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %164, ptr %7, align 4, !tbaa !9
  %165 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %165, ptr %12, align 4, !tbaa !9
  %166 = load ptr, ptr %4, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.w2c_hermes, ptr %166, i32 0, i32 6
  %168 = load i32, ptr %12, align 4, !tbaa !9
  %169 = zext i32 %168 to i64
  %170 = call i32 @i32_load(ptr noundef %167, i64 noundef %169)
  store i32 %170, ptr %12, align 4, !tbaa !9
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %12, align 4, !tbaa !9
  %173 = icmp ule i32 %171, %172
  %174 = zext i1 %173 to i32
  store i32 %174, ptr %11, align 4, !tbaa !9
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = icmp ne i32 %175, 0
  br i1 %176, label %177, label %187

177:                                              ; preds = %153
  %178 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %178, ptr %11, align 4, !tbaa !9
  %179 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %179, ptr %12, align 4, !tbaa !9
  %180 = load ptr, ptr %4, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.w2c_hermes, ptr %180, i32 0, i32 6
  %182 = load i32, ptr %11, align 4, !tbaa !9
  %183 = zext i32 %182 to i64
  %184 = add i64 %183, 4
  %185 = load i32, ptr %12, align 4, !tbaa !9
  call void @i32_store(ptr noundef %181, i64 noundef %184, i32 noundef %185)
  %186 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %186, ptr %11, align 4, !tbaa !9
  br label %205

187:                                              ; preds = %153
  store i32 0, ptr %11, align 4, !tbaa !9
  %188 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %188, ptr %7, align 4, !tbaa !9
  store i32 117789, ptr %12, align 4, !tbaa !9
  %189 = load i32, ptr %12, align 4, !tbaa !9
  %190 = load i32, ptr %11, align 4, !tbaa !9
  %191 = add i32 %190, %189
  store i32 %191, ptr %11, align 4, !tbaa !9
  %192 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %192, ptr %12, align 4, !tbaa !9
  store i32 79572, ptr %13, align 4, !tbaa !9
  %193 = load i32, ptr %13, align 4, !tbaa !9
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = add i32 %194, %193
  store i32 %195, ptr %12, align 4, !tbaa !9
  store i32 74, ptr %13, align 4, !tbaa !9
  %196 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %196, ptr %14, align 4, !tbaa !9
  store i32 88407, ptr %15, align 4, !tbaa !9
  %197 = load i32, ptr %15, align 4, !tbaa !9
  %198 = load i32, ptr %14, align 4, !tbaa !9
  %199 = add i32 %198, %197
  store i32 %199, ptr %14, align 4, !tbaa !9
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  %201 = load i32, ptr %11, align 4, !tbaa !9
  %202 = load i32, ptr %12, align 4, !tbaa !9
  %203 = load i32, ptr %13, align 4, !tbaa !9
  %204 = load i32, ptr %14, align 4, !tbaa !9
  call void @w2c_hermes_0x5F_assert_fail(ptr noundef %200, i32 noundef %201, i32 noundef %202, i32 noundef %203, i32 noundef %204)
  call void @wasm_rt_trap(i32 noundef 5) #6
  unreachable

205:                                              ; preds = %177
  %206 = load i32, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret i32 %206
}

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

!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 = !{!"int", !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"

; Function Attrs: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @w2c_hermes_0x5F_assert_fail(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load16_u(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

declare i32 @w2c_hermes_0x5F_memcpy(ptr noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ASmallXString0x3Cchar16_t0x2C0x2032u0x3E0x3A0x3Aappend0x28char16_t0x20const0x2A0x29(ptr noundef %0, i32 noundef returned %1, i32 noundef %2) local_unnamed_addr #3 {
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %2 to i64
  %6 = tail call i32 @i32_load16_u(ptr noundef nonnull %4, i64 noundef %5)
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %31, label %.preheader

.preheader:                                       ; preds = %3, %.preheader
  %.0118 = phi i32 [ %7, %.preheader ], [ 0, %3 ]
  %.0 = phi i32 [ %11, %.preheader ], [ %2, %3 ]
  %7 = add i32 %.0118, 1
  %8 = zext i32 %.0 to i64
  %9 = add nuw nsw i64 %8, 2
  %10 = tail call i32 @i32_load16_u(ptr noundef nonnull %4, i64 noundef %9)
  %11 = add i32 %.0, 2
  %.not123 = icmp eq i32 %10, 0
  br i1 %.not123, label %12, label %.preheader

12:                                               ; preds = %.preheader
  %13 = zext i32 %1 to i64
  %14 = add nuw nsw i64 %13, 8
  %15 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %14)
  %16 = add nuw nsw i64 %13, 4
  %17 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %16)
  %18 = sub i32 %15, %17
  %19 = icmp ult i32 %18, %7
  br i1 %19, label %20, label %23

20:                                               ; preds = %12
  %21 = add i32 %1, 12
  %22 = add i32 %17, %7
  tail call void @w2c_hermes_llvh0x3A0x3ASmallVectorBase0x3A0x3Agrow_pod0x28void0x2A0x2C0x20unsigned0x20long0x2C0x20unsigned0x20long0x29(ptr noundef %0, i32 noundef %1, i32 noundef %21, i32 noundef %22, i32 noundef 2) #4
  br label %24

23:                                               ; preds = %12
  %.not124 = icmp eq i32 %7, 0
  br i1 %.not124, label %31, label %24

24:                                               ; preds = %23, %20
  %25 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %13)
  %26 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %16)
  %27 = shl i32 %26, 1
  %28 = add i32 %27, %25
  %29 = shl i32 %7, 1
  %30 = tail call i32 @w2c_hermes_0x5F_memcpy(ptr noundef %0, i32 noundef %28, i32 noundef %2, i32 noundef %29) #4
  br label %31

31:                                               ; preds = %3, %23, %24
  %.1119 = phi i32 [ %7, %24 ], [ 0, %23 ], [ 0, %3 ]
  %.2 = add i32 %1, 4
  %.1117 = add i32 %1, 8
  %32 = zext i32 %.2 to i64
  %33 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %32)
  %34 = add i32 %33, %.1119
  %35 = zext i32 %.1117 to i64
  %36 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %35)
  %.not125 = icmp ugt i32 %34, %36
  br i1 %.not125, label %40, label %37

37:                                               ; preds = %31
  %38 = zext i32 %1 to i64
  %39 = add nuw nsw i64 %38, 4
  tail call void @i32_store(ptr noundef nonnull %4, i64 noundef %39, i32 noundef %34)
  ret i32 %1

40:                                               ; preds = %31
  tail call void @w2c_hermes_0x5F_assert_fail(ptr noundef %0, i32 noundef 117789, i32 noundef 79572, i32 noundef 74, i32 noundef 88407) #4
  tail call void @wasm_rt_trap(i32 noundef 5) #5
  unreachable
}

attributes #0 = { noreturn "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 = { 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { 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 #4 = { nounwind }
attributes #5 = { 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)"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass