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

; 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 }
%struct.wasm_rt_funcref_t = type { ptr, ptr, ptr }

@w2c_hermes_t1 = external constant ptr, align 8

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store(ptr noundef, i64 noundef, i32 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: inlinehint nounwind uwtable
declare hidden zeroext i1 @func_types_eq(ptr noundef, ptr noundef) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #2

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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Awrite0x28unsigned0x20char0x29(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
  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
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  %14 = getelementptr inbounds %struct.w2c_hermes, ptr %13, i32 0, i32 3
  %15 = load i32, ptr %14, align 8, !tbaa !11
  store i32 %15, ptr %9, align 4, !tbaa !9
  store i32 16, ptr %10, align 4, !tbaa !9
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = load i32, ptr %9, align 4, !tbaa !9
  %18 = sub i32 %17, %16
  store i32 %18, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %19, ptr %8, align 4, !tbaa !9
  %20 = load i32, ptr %9, align 4, !tbaa !9
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.w2c_hermes, ptr %21, i32 0, i32 3
  store i32 %20, ptr %22, align 8, !tbaa !11
  %23 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %23, ptr %9, align 4, !tbaa !9
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.w2c_hermes, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %9, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = add i64 %27, 12
  %29 = call i32 @i32_load(ptr noundef %25, i64 noundef %28)
  store i32 %29, ptr %9, align 4, !tbaa !9
  %30 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %30, ptr %7, align 4, !tbaa !9
  %31 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %31, ptr %10, align 4, !tbaa !9
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.w2c_hermes, ptr %32, i32 0, i32 6
  %34 = load i32, ptr %10, align 4, !tbaa !9
  %35 = zext i32 %34 to i64
  %36 = add i64 %35, 8
  %37 = call i32 @i32_load(ptr noundef %33, i64 noundef %36)
  store i32 %37, ptr %10, align 4, !tbaa !9
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = load i32, ptr %10, align 4, !tbaa !9
  %40 = icmp ult i32 %38, %39
  %41 = zext i1 %40 to i32
  store i32 %41, ptr %9, align 4, !tbaa !9
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = icmp ne i32 %42, 0
  br i1 %43, label %44, label %45

44:                                               ; preds = %3
  br label %202

45:                                               ; preds = %3
  br label %46

46:                                               ; preds = %188, %45
  %47 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %47, ptr %9, align 4, !tbaa !9
  %48 = load ptr, ptr %4, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.w2c_hermes, ptr %48, i32 0, i32 6
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = zext i32 %50 to i64
  %52 = add i64 %51, 4
  %53 = call i32 @i32_load(ptr noundef %49, i64 noundef %52)
  store i32 %53, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 0
  %56 = xor i1 %55, true
  %57 = zext i1 %56 to i32
  store i32 %57, ptr %9, align 4, !tbaa !9
  %58 = load i32, ptr %9, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %190

60:                                               ; preds = %46
  %61 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %61, ptr %9, 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 %9, align 4, !tbaa !9
  %65 = zext i32 %64 to i64
  %66 = add i64 %65, 16
  %67 = call i32 @i32_load(ptr noundef %63, i64 noundef %66)
  store i32 %67, ptr %9, align 4, !tbaa !9
  %68 = load i32, ptr %9, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  %70 = xor i1 %69, true
  %71 = zext i1 %70 to i32
  store i32 %71, ptr %9, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = icmp ne i32 %72, 0
  br i1 %73, label %74, label %163

74:                                               ; preds = %60
  %75 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %75, ptr %9, align 4, !tbaa !9
  %76 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %76, ptr %10, align 4, !tbaa !9
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.w2c_hermes, ptr %77, i32 0, i32 6
  %79 = load i32, ptr %9, align 4, !tbaa !9
  %80 = zext i32 %79 to i64
  %81 = add i64 %80, 15
  %82 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %78, i64 noundef %81, i32 noundef %82)
  %83 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %83, ptr %9, align 4, !tbaa !9
  %84 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %84, ptr %10, align 4, !tbaa !9
  store i32 15, ptr %11, align 4, !tbaa !9
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  %87 = add i32 %86, %85
  store i32 %87, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  %88 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %88, ptr %12, align 4, !tbaa !9
  %89 = load ptr, ptr %4, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.w2c_hermes, ptr %89, i32 0, i32 6
  %91 = load i32, ptr %12, align 4, !tbaa !9
  %92 = zext i32 %91 to i64
  %93 = call i32 @i32_load(ptr noundef %90, i64 noundef %92)
  store i32 %93, ptr %12, align 4, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = getelementptr inbounds %struct.w2c_hermes, ptr %94, i32 0, i32 6
  %96 = load i32, ptr %12, align 4, !tbaa !9
  %97 = zext i32 %96 to i64
  %98 = add i64 %97, 28
  %99 = call i32 @i32_load(ptr noundef %95, i64 noundef %98)
  store i32 %99, ptr %12, align 4, !tbaa !9
  %100 = load i32, ptr %12, align 4, !tbaa !9
  %101 = load ptr, ptr %4, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.w2c_hermes, ptr %101, i32 0, i32 7
  %103 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %102, i32 0, i32 2
  %104 = load i32, ptr %103, align 4, !tbaa !17
  %105 = icmp ult i32 %100, %104
  br i1 %105, label %106, label %129

106:                                              ; preds = %74
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.w2c_hermes, ptr %107, i32 0, i32 7
  %109 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %108, i32 0, i32 0
  %110 = load ptr, ptr %109, align 8, !tbaa !18
  %111 = load i32, ptr %12, align 4, !tbaa !9
  %112 = zext i32 %111 to i64
  %113 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %110, i64 %112
  %114 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !19
  %116 = icmp ne ptr %115, null
  br i1 %116, label %117, label %129

117:                                              ; preds = %106
  %118 = load ptr, ptr @w2c_hermes_t1, align 8, !tbaa !5
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.w2c_hermes, ptr %119, i32 0, i32 7
  %121 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !18
  %123 = load i32, ptr %12, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %122, i64 %124
  %126 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %125, i32 0, i32 0
  %127 = load ptr, ptr %126, align 8, !tbaa !21
  %128 = call zeroext i1 @func_types_eq(ptr noundef %118, ptr noundef %127)
  br label %129

129:                                              ; preds = %117, %106, %74
  %130 = phi i1 [ false, %106 ], [ false, %74 ], [ %128, %117 ]
  %131 = xor i1 %130, true
  %132 = xor i1 %131, true
  %133 = zext i1 %132 to i32
  %134 = sext i32 %133 to i64
  %135 = call i64 @llvm.expect.i64(i64 %134, i64 1)
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %139, label %137

137:                                              ; preds = %129
  call void @wasm_rt_trap(i32 noundef 6) #6
  unreachable

138:                                              ; No predecessors!
  br label %139

139:                                              ; preds = %138, %129
  %140 = phi i1 [ true, %129 ], [ false, %138 ]
  %141 = zext i1 %140 to i32
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.w2c_hermes, ptr %142, i32 0, i32 7
  %144 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %143, i32 0, i32 0
  %145 = load ptr, ptr %144, align 8, !tbaa !18
  %146 = load i32, ptr %12, align 4, !tbaa !9
  %147 = zext i32 %146 to i64
  %148 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %145, i64 %147
  %149 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %148, i32 0, i32 1
  %150 = load ptr, ptr %149, align 8, !tbaa !19
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.w2c_hermes, ptr %151, i32 0, i32 7
  %153 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %152, i32 0, i32 0
  %154 = load ptr, ptr %153, align 8, !tbaa !18
  %155 = load i32, ptr %12, align 4, !tbaa !9
  %156 = zext i32 %155 to i64
  %157 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %154, i64 %156
  %158 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %157, i32 0, i32 2
  %159 = load ptr, ptr %158, align 8, !tbaa !22
  %160 = load i32, ptr %9, align 4, !tbaa !9
  %161 = load i32, ptr %10, align 4, !tbaa !9
  %162 = load i32, ptr %11, align 4, !tbaa !9
  call void %150(ptr noundef %159, i32 noundef %160, i32 noundef %161, i32 noundef %162)
  br label %221

163:                                              ; preds = %60
  %164 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %164, ptr %9, align 4, !tbaa !9
  %165 = load ptr, ptr %4, align 8, !tbaa !5
  %166 = load i32, ptr %9, align 4, !tbaa !9
  call void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3ASetBuffered0x280x29(ptr noundef %165, i32 noundef %166)
  %167 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %167, ptr %9, align 4, !tbaa !9
  %168 = load ptr, ptr %4, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.w2c_hermes, ptr %168, i32 0, i32 6
  %170 = load i32, ptr %9, align 4, !tbaa !9
  %171 = zext i32 %170 to i64
  %172 = add i64 %171, 12
  %173 = call i32 @i32_load(ptr noundef %169, i64 noundef %172)
  store i32 %173, ptr %9, align 4, !tbaa !9
  %174 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %174, ptr %7, align 4, !tbaa !9
  %175 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %175, ptr %10, align 4, !tbaa !9
  %176 = load ptr, ptr %4, align 8, !tbaa !5
  %177 = getelementptr inbounds %struct.w2c_hermes, ptr %176, i32 0, i32 6
  %178 = load i32, ptr %10, align 4, !tbaa !9
  %179 = zext i32 %178 to i64
  %180 = add i64 %179, 8
  %181 = call i32 @i32_load(ptr noundef %177, i64 noundef %180)
  store i32 %181, ptr %10, align 4, !tbaa !9
  %182 = load i32, ptr %9, align 4, !tbaa !9
  %183 = load i32, ptr %10, align 4, !tbaa !9
  %184 = icmp uge i32 %182, %183
  %185 = zext i1 %184 to i32
  store i32 %185, ptr %9, align 4, !tbaa !9
  %186 = load i32, ptr %9, align 4, !tbaa !9
  %187 = icmp ne i32 %186, 0
  br i1 %187, label %188, label %189

188:                                              ; preds = %163
  br label %46

189:                                              ; preds = %163
  br label %202

190:                                              ; preds = %46
  %191 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %191, ptr %9, align 4, !tbaa !9
  %192 = load ptr, ptr %4, align 8, !tbaa !5
  %193 = load i32, ptr %9, align 4, !tbaa !9
  call void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Aflush_nonempty0x280x29(ptr noundef %192, i32 noundef %193)
  %194 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %194, ptr %9, align 4, !tbaa !9
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.w2c_hermes, ptr %195, i32 0, i32 6
  %197 = load i32, ptr %9, align 4, !tbaa !9
  %198 = zext i32 %197 to i64
  %199 = add i64 %198, 12
  %200 = call i32 @i32_load(ptr noundef %196, i64 noundef %199)
  store i32 %200, ptr %9, align 4, !tbaa !9
  %201 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %201, ptr %7, align 4, !tbaa !9
  br label %202

202:                                              ; preds = %190, %189, %44
  %203 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %203, ptr %9, align 4, !tbaa !9
  %204 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %204, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  %205 = load i32, ptr %11, align 4, !tbaa !9
  %206 = load i32, ptr %10, align 4, !tbaa !9
  %207 = add i32 %206, %205
  store i32 %207, ptr %10, align 4, !tbaa !9
  %208 = load ptr, ptr %4, align 8, !tbaa !5
  %209 = getelementptr inbounds %struct.w2c_hermes, ptr %208, i32 0, i32 6
  %210 = load i32, ptr %9, align 4, !tbaa !9
  %211 = zext i32 %210 to i64
  %212 = add i64 %211, 12
  %213 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %209, i64 noundef %212, i32 noundef %213)
  %214 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %214, ptr %9, align 4, !tbaa !9
  %215 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %215, ptr %10, align 4, !tbaa !9
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.w2c_hermes, ptr %216, i32 0, i32 6
  %218 = load i32, ptr %9, align 4, !tbaa !9
  %219 = zext i32 %218 to i64
  %220 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %217, i64 noundef %219, i32 noundef %220)
  br label %221

221:                                              ; preds = %202, %139
  %222 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %222, ptr %9, align 4, !tbaa !9
  store i32 16, ptr %10, align 4, !tbaa !9
  %223 = load i32, ptr %10, align 4, !tbaa !9
  %224 = load i32, ptr %9, align 4, !tbaa !9
  %225 = add i32 %224, %223
  store i32 %225, ptr %9, align 4, !tbaa !9
  %226 = load i32, ptr %9, align 4, !tbaa !9
  %227 = load ptr, ptr %4, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.w2c_hermes, ptr %227, i32 0, i32 3
  store i32 %226, ptr %228, align 8, !tbaa !11
  %229 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %229, ptr %9, align 4, !tbaa !9
  %230 = load i32, ptr %9, align 4, !tbaa !9
  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 %230
}

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Aflush_nonempty0x280x29(ptr noundef, i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3ASetBuffered0x280x29(ptr noundef, i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { 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 #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}
!11 = !{!12, !10, i64 24}
!12 = !{!"w2c_hermes", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !13, i64 40, !16, i64 80}
!13 = !{!"", !6, i64 0, !14, i64 8, !14, i64 16, !14, i64 24, !15, i64 32}
!14 = !{!"long", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!17 = !{!12, !10, i64 92}
!18 = !{!12, !6, i64 80}
!19 = !{!20, !6, i64 8}
!20 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!20, !6, i64 0}
!22 = !{!20, !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"

%struct.wasm_rt_funcref_t = type { ptr, ptr, ptr }

@w2c_hermes_t1 = external local_unnamed_addr constant ptr, align 8

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden zeroext i1 @func_types_eq(ptr noundef, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Awrite0x28unsigned0x20char0x29(ptr noundef %0, i32 noundef returned %1, i32 noundef %2) local_unnamed_addr #2 {
  %4 = getelementptr inbounds i8, ptr %0, i64 24
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = add i32 %5, -16
  store i32 %6, ptr %4, align 8, !tbaa !5
  %7 = getelementptr inbounds i8, ptr %0, i64 40
  %8 = zext i32 %1 to i64
  %9 = add nuw nsw i64 %8, 12
  %10 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %9)
  %11 = add nuw nsw i64 %8, 8
  %12 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %11)
  %13 = icmp ult i32 %10, %12
  br i1 %13, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %3
  %14 = add nuw nsw i64 %8, 4
  %15 = add nuw nsw i64 %8, 16
  br label %16

16:                                               ; preds = %.preheader, %49
  %17 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %14)
  %.not = icmp eq i32 %17, 0
  br i1 %.not, label %18, label %52

18:                                               ; preds = %16
  %19 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %15)
  %.not94 = icmp eq i32 %19, 0
  br i1 %.not94, label %20, label %49

20:                                               ; preds = %18
  %21 = zext i32 %6 to i64
  %22 = add nuw nsw i64 %21, 15
  tail call void @i32_store8(ptr noundef nonnull %7, i64 noundef %22, i32 noundef %2)
  %23 = add i32 %5, -1
  %24 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %8)
  %25 = zext i32 %24 to i64
  %26 = add nuw nsw i64 %25, 28
  %27 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %26)
  %28 = getelementptr inbounds i8, ptr %0, i64 80
  %29 = getelementptr inbounds i8, ptr %0, i64 92
  %30 = load i32, ptr %29, align 4, !tbaa !15
  %31 = icmp ult i32 %27, %30
  br i1 %31, label %32, label %.critedge, !prof !16

32:                                               ; preds = %20
  %33 = load ptr, ptr %28, align 8, !tbaa !17
  %34 = zext i32 %27 to i64
  %35 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %33, i64 %34
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = load ptr, ptr %36, align 8, !tbaa !18
  %.not96 = icmp eq ptr %37, null
  br i1 %.not96, label %.critedge, label %38, !prof !20

38:                                               ; preds = %32
  %39 = load ptr, ptr @w2c_hermes_t1, align 8, !tbaa !21
  %40 = load ptr, ptr %35, align 8, !tbaa !22
  %41 = tail call zeroext i1 @func_types_eq(ptr noundef %39, ptr noundef %40)
  br i1 %41, label %42, label %.critedge, !prof !16

.critedge:                                        ; preds = %32, %20, %38
  tail call void @wasm_rt_trap(i32 noundef 6) #3
  unreachable

42:                                               ; preds = %38
  %43 = load ptr, ptr %28, align 8, !tbaa !17
  %44 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %43, i64 %34
  %45 = getelementptr inbounds i8, ptr %44, i64 8
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %47 = getelementptr inbounds i8, ptr %44, i64 16
  %48 = load ptr, ptr %47, align 8, !tbaa !23
  tail call void %46(ptr noundef %48, i32 noundef %1, i32 noundef %23, i32 noundef 1) #4
  br label %56

49:                                               ; preds = %18
  tail call void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3ASetBuffered0x280x29(ptr noundef %0, i32 noundef %1)
  %50 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %9)
  %51 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %11)
  %.not95 = icmp ult i32 %50, %51
  br i1 %.not95, label %.loopexit, label %16

52:                                               ; preds = %16
  tail call void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Aflush_nonempty0x280x29(ptr noundef %0, i32 noundef %1)
  %53 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %9)
  br label %.loopexit

.loopexit:                                        ; preds = %49, %3, %52
  %.0 = phi i32 [ %10, %3 ], [ %53, %52 ], [ %50, %49 ]
  %54 = add i32 %.0, 1
  tail call void @i32_store(ptr noundef nonnull %7, i64 noundef %9, i32 noundef %54)
  %55 = zext i32 %.0 to i64
  tail call void @i32_store8(ptr noundef nonnull %7, i64 noundef %55, i32 noundef %2)
  br label %56

56:                                               ; preds = %.loopexit, %42
  store i32 %5, ptr %4, align 8, !tbaa !5
  ret i32 %1
}

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3Aflush_nonempty0x280x29(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @w2c_hermes_llvh0x3A0x3Araw_ostream0x3A0x3ASetBuffered0x280x29(ptr noundef, i32 noundef) local_unnamed_addr #2

attributes #0 = { 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 #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 = { 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 = { noreturn nounwind }
attributes #4 = { 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, !10, i64 24}
!6 = !{!"w2c_hermes", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !11, i64 40, !14, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"", !7, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !13, i64 32}
!12 = !{!"long", !8, i64 0}
!13 = !{!"_Bool", !8, i64 0}
!14 = !{!"", !7, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!6, !10, i64 92}
!16 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!17 = !{!6, !7, i64 80}
!18 = !{!19, !7, i64 8}
!19 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!20 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!21 = !{!7, !7, i64 0}
!22 = !{!19, !7, i64 0}
!23 = !{!19, !7, i64 16}


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