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

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

@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

; Function Attrs: 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: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

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

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

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

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

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

46:                                               ; preds = %3
  store i32 -1, ptr %10, align 4, !tbaa !9
  %47 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %47, ptr %7, align 4, !tbaa !9
  %48 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %48, ptr %10, align 4, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !5
  %50 = load i32, ptr %10, align 4, !tbaa !9
  %51 = call i32 @w2c_hermes_0x5F_towrite(ptr noundef %49, i32 noundef %50)
  store i32 %51, ptr %10, align 4, !tbaa !9
  %52 = load i32, ptr %10, align 4, !tbaa !9
  %53 = icmp ne i32 %52, 0
  br i1 %53, label %54, label %55

54:                                               ; preds = %46
  br label %213

55:                                               ; preds = %46
  %56 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %56, ptr %10, align 4, !tbaa !9
  %57 = load ptr, ptr %4, align 8, !tbaa !5
  %58 = getelementptr inbounds %struct.w2c_hermes, ptr %57, i32 0, i32 6
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = add i64 %60, 16
  %62 = call i32 @i32_load(ptr noundef %58, i64 noundef %61)
  store i32 %62, ptr %10, align 4, !tbaa !9
  %63 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %63, ptr %7, align 4, !tbaa !9
  br label %64

64:                                               ; preds = %55, %3
  %65 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %65, ptr %10, align 4, !tbaa !9
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.w2c_hermes, ptr %66, i32 0, i32 6
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = add i64 %69, 20
  %71 = call i32 @i32_load(ptr noundef %67, i64 noundef %70)
  store i32 %71, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %72, ptr %9, align 4, !tbaa !9
  %73 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %73, ptr %11, align 4, !tbaa !9
  %74 = load i32, ptr %10, align 4, !tbaa !9
  %75 = load i32, ptr %11, align 4, !tbaa !9
  %76 = icmp eq i32 %74, %75
  %77 = zext i1 %76 to i32
  store i32 %77, ptr %10, align 4, !tbaa !9
  %78 = load i32, ptr %10, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %64
  br label %120

81:                                               ; preds = %64
  %82 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %82, ptr %10, align 4, !tbaa !9
  store i32 255, ptr %11, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = load i32, ptr %10, align 4, !tbaa !9
  %85 = and i32 %84, %83
  store i32 %85, ptr %10, align 4, !tbaa !9
  %86 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %86, ptr %7, align 4, !tbaa !9
  %87 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %87, ptr %11, align 4, !tbaa !9
  %88 = load ptr, ptr %4, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.w2c_hermes, ptr %88, i32 0, i32 6
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = add i64 %91, 80
  %93 = call i32 @i32_load(ptr noundef %89, i64 noundef %92)
  store i32 %93, ptr %11, align 4, !tbaa !9
  %94 = load i32, ptr %10, align 4, !tbaa !9
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = icmp eq i32 %94, %95
  %97 = zext i1 %96 to i32
  store i32 %97, ptr %10, align 4, !tbaa !9
  %98 = load i32, ptr %10, align 4, !tbaa !9
  %99 = icmp ne i32 %98, 0
  br i1 %99, label %100, label %101

100:                                              ; preds = %81
  br label %120

101:                                              ; preds = %81
  %102 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %102, ptr %10, align 4, !tbaa !9
  %103 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %103, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = add i32 %105, %104
  store i32 %106, ptr %11, align 4, !tbaa !9
  %107 = load ptr, ptr %4, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.w2c_hermes, ptr %107, i32 0, i32 6
  %109 = load i32, ptr %10, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = add i64 %110, 20
  %112 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store(ptr noundef %108, i64 noundef %111, i32 noundef %112)
  %113 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %113, ptr %10, align 4, !tbaa !9
  %114 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %114, ptr %11, align 4, !tbaa !9
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.w2c_hermes, ptr %115, i32 0, i32 6
  %117 = load i32, ptr %10, align 4, !tbaa !9
  %118 = zext i32 %117 to i64
  %119 = load i32, ptr %11, align 4, !tbaa !9
  call void @i32_store8(ptr noundef %116, i64 noundef %118, i32 noundef %119)
  br label %213

120:                                              ; preds = %100, %80
  store i32 -1, ptr %10, align 4, !tbaa !9
  %121 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %121, ptr %7, align 4, !tbaa !9
  %122 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %122, ptr %10, align 4, !tbaa !9
  %123 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %123, ptr %11, align 4, !tbaa !9
  store i32 15, ptr %12, align 4, !tbaa !9
  %124 = load i32, ptr %12, align 4, !tbaa !9
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = add i32 %125, %124
  store i32 %126, ptr %11, align 4, !tbaa !9
  store i32 1, ptr %12, align 4, !tbaa !9
  %127 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %127, ptr %13, align 4, !tbaa !9
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.w2c_hermes, ptr %128, i32 0, i32 6
  %130 = load i32, ptr %13, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = add i64 %131, 36
  %133 = call i32 @i32_load(ptr noundef %129, i64 noundef %132)
  store i32 %133, ptr %13, align 4, !tbaa !9
  %134 = load i32, ptr %13, align 4, !tbaa !9
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.w2c_hermes, ptr %135, i32 0, i32 7
  %137 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %136, i32 0, i32 2
  %138 = load i32, ptr %137, align 4, !tbaa !17
  %139 = icmp ult i32 %134, %138
  br i1 %139, label %140, label %162

140:                                              ; preds = %120
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.w2c_hermes, ptr %141, i32 0, i32 7
  %143 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %142, i32 0, i32 0
  %144 = load ptr, ptr %143, align 8, !tbaa !18
  %145 = load i32, ptr %13, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %144, i64 %146
  %148 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !19
  %150 = icmp ne ptr %149, null
  br i1 %150, label %151, label %162

151:                                              ; preds = %140
  %152 = load ptr, ptr %4, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.w2c_hermes, ptr %152, i32 0, i32 7
  %154 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %153, i32 0, i32 0
  %155 = load ptr, ptr %154, align 8, !tbaa !18
  %156 = load i32, ptr %13, align 4, !tbaa !9
  %157 = zext i32 %156 to i64
  %158 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %155, i64 %157
  %159 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %158, i32 0, i32 0
  %160 = load ptr, ptr %159, align 8, !tbaa !21
  %161 = call zeroext i1 @func_types_eq(ptr noundef @.str.6, ptr noundef %160)
  br label %162

162:                                              ; preds = %151, %140, %120
  %163 = phi i1 [ false, %140 ], [ false, %120 ], [ %161, %151 ]
  %164 = xor i1 %163, true
  %165 = xor i1 %164, true
  %166 = zext i1 %165 to i32
  %167 = sext i32 %166 to i64
  %168 = call i64 @llvm.expect.i64(i64 %167, i64 1)
  %169 = icmp ne i64 %168, 0
  br i1 %169, label %172, label %170

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

171:                                              ; No predecessors!
  br label %172

172:                                              ; preds = %171, %162
  %173 = phi i1 [ true, %162 ], [ false, %171 ]
  %174 = zext i1 %173 to i32
  %175 = load ptr, ptr %4, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.w2c_hermes, ptr %175, i32 0, i32 7
  %177 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %176, i32 0, i32 0
  %178 = load ptr, ptr %177, align 8, !tbaa !18
  %179 = load i32, ptr %13, align 4, !tbaa !9
  %180 = zext i32 %179 to i64
  %181 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %178, i64 %180
  %182 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %181, i32 0, i32 1
  %183 = load ptr, ptr %182, align 8, !tbaa !19
  %184 = load ptr, ptr %4, align 8, !tbaa !5
  %185 = getelementptr inbounds %struct.w2c_hermes, ptr %184, i32 0, i32 7
  %186 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %185, i32 0, i32 0
  %187 = load ptr, ptr %186, align 8, !tbaa !18
  %188 = load i32, ptr %13, align 4, !tbaa !9
  %189 = zext i32 %188 to i64
  %190 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %187, i64 %189
  %191 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %190, i32 0, i32 2
  %192 = load ptr, ptr %191, align 8, !tbaa !22
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = load i32, ptr %11, align 4, !tbaa !9
  %195 = load i32, ptr %12, align 4, !tbaa !9
  %196 = call i32 %183(ptr noundef %192, i32 noundef %193, i32 noundef %194, i32 noundef %195)
  store i32 %196, ptr %10, align 4, !tbaa !9
  store i32 1, ptr %11, align 4, !tbaa !9
  %197 = load i32, ptr %10, align 4, !tbaa !9
  %198 = load i32, ptr %11, align 4, !tbaa !9
  %199 = icmp ne i32 %197, %198
  %200 = zext i1 %199 to i32
  store i32 %200, ptr %10, align 4, !tbaa !9
  %201 = load i32, ptr %10, align 4, !tbaa !9
  %202 = icmp ne i32 %201, 0
  br i1 %202, label %203, label %204

203:                                              ; preds = %172
  br label %213

204:                                              ; preds = %172
  %205 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %205, ptr %10, align 4, !tbaa !9
  %206 = load ptr, ptr %4, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.w2c_hermes, ptr %206, i32 0, i32 6
  %208 = load i32, ptr %10, align 4, !tbaa !9
  %209 = zext i32 %208 to i64
  %210 = add i64 %209, 15
  %211 = call i32 @i32_load8_u(ptr noundef %207, i64 noundef %210)
  store i32 %211, ptr %10, align 4, !tbaa !9
  %212 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %212, ptr %7, align 4, !tbaa !9
  br label %213

213:                                              ; preds = %204, %203, %101, %54
  %214 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %214, ptr %10, align 4, !tbaa !9
  store i32 16, ptr %11, align 4, !tbaa !9
  %215 = load i32, ptr %11, align 4, !tbaa !9
  %216 = load i32, ptr %10, align 4, !tbaa !9
  %217 = add i32 %216, %215
  store i32 %217, ptr %10, align 4, !tbaa !9
  %218 = load i32, ptr %10, align 4, !tbaa !9
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.w2c_hermes, ptr %219, i32 0, i32 3
  store i32 %218, ptr %220, align 8, !tbaa !11
  %221 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %221, ptr %10, align 4, !tbaa !9
  %222 = load i32, ptr %10, align 4, !tbaa !9
  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 %222
}

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 = { nocallback nofree nosync nounwind willreturn memory(none) }
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 }

@.str.6 = external hidden unnamed_addr constant [33 x i8], align 1

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i32_store8(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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_0x5F_overflow(ptr noundef %0, i32 noundef %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 %6 to i64
  %9 = add nuw nsw i64 %8, 15
  tail call void @i32_store8(ptr noundef nonnull %7, i64 noundef %9, i32 noundef %2)
  %10 = zext i32 %1 to i64
  %11 = add nuw nsw i64 %10, 16
  %12 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %11)
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %13, label %17

13:                                               ; preds = %3
  %14 = tail call i32 @w2c_hermes_0x5F_towrite(ptr noundef nonnull %0, i32 noundef %1)
  %.not93 = icmp eq i32 %14, 0
  br i1 %.not93, label %15, label %56

15:                                               ; preds = %13
  %16 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %11)
  br label %17

17:                                               ; preds = %15, %3
  %.0 = phi i32 [ %16, %15 ], [ %12, %3 ]
  %18 = add nuw nsw i64 %10, 20
  %19 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %18)
  %20 = icmp eq i32 %19, %.0
  br i1 %20, label %29, label %21

21:                                               ; preds = %17
  %22 = and i32 %2, 255
  %23 = add nuw nsw i64 %10, 80
  %24 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %23)
  %25 = icmp eq i32 %22, %24
  br i1 %25, label %29, label %26

26:                                               ; preds = %21
  %27 = add i32 %19, 1
  tail call void @i32_store(ptr noundef nonnull %7, i64 noundef %18, i32 noundef %27)
  %28 = zext i32 %19 to i64
  tail call void @i32_store8(ptr noundef nonnull %7, i64 noundef %28, i32 noundef %2)
  br label %56

29:                                               ; preds = %21, %17
  %30 = add i32 %5, -1
  %31 = add nuw nsw i64 %10, 36
  %32 = tail call i32 @i32_load(ptr noundef nonnull %7, i64 noundef %31)
  %33 = getelementptr inbounds i8, ptr %0, i64 80
  %34 = getelementptr inbounds i8, ptr %0, i64 92
  %35 = load i32, ptr %34, align 4, !tbaa !15
  %36 = icmp ult i32 %32, %35
  br i1 %36, label %37, label %.critedge, !prof !16

37:                                               ; preds = %29
  %38 = load ptr, ptr %33, align 8, !tbaa !17
  %39 = zext i32 %32 to i64
  %40 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %38, i64 %39
  %41 = getelementptr inbounds i8, ptr %40, i64 8
  %42 = load ptr, ptr %41, align 8, !tbaa !18
  %.not94 = icmp eq ptr %42, null
  br i1 %.not94, label %.critedge, label %43, !prof !20

43:                                               ; preds = %37
  %44 = load ptr, ptr %40, align 8, !tbaa !21
  %45 = tail call zeroext i1 @func_types_eq(ptr noundef nonnull @.str.6, ptr noundef %44)
  br i1 %45, label %46, label %.critedge, !prof !16

.critedge:                                        ; preds = %37, %29, %43
  tail call void @wasm_rt_trap(i32 noundef 6) #3
  unreachable

46:                                               ; preds = %43
  %47 = load ptr, ptr %33, align 8, !tbaa !17
  %48 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %47, i64 %39
  %49 = getelementptr inbounds i8, ptr %48, i64 8
  %50 = load ptr, ptr %49, align 8, !tbaa !18
  %51 = getelementptr inbounds i8, ptr %48, i64 16
  %52 = load ptr, ptr %51, align 8, !tbaa !22
  %53 = tail call i32 %50(ptr noundef %52, i32 noundef %1, i32 noundef %30, i32 noundef 1) #4
  %.not95 = icmp eq i32 %53, 1
  br i1 %.not95, label %54, label %56

54:                                               ; preds = %46
  %55 = tail call i32 @i32_load8_u(ptr noundef nonnull %7, i64 noundef %9)
  br label %56

56:                                               ; preds = %46, %13, %54, %26
  %.1 = phi i32 [ -1, %13 ], [ -1, %46 ], [ %55, %54 ], [ %22, %26 ]
  store i32 %5, ptr %4, align 8, !tbaa !5
  ret i32 %.1
}

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 = { 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 = !{!19, !7, i64 0}
!22 = !{!19, !7, i64 16}


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