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

; 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_t10 = 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 void @i32_store(ptr noundef, i64 noundef, i32 noundef) #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 noundef, i64 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: noreturn
declare void @wasm_rt_trap(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 i64 @i64_reinterpret_f64(double noundef) #1

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

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

declare void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AtoNumber_RJS0x28hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef, i32 noundef, i32 noundef, i32 noundef) #4

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

54:                                               ; preds = %5
  %55 = load i32, ptr %15, align 4, !tbaa !9
  br label %58

56:                                               ; preds = %5
  %57 = load i32, ptr %16, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %56, %54
  %59 = phi i32 [ %55, %54 ], [ %57, %56 ]
  store i32 %59, ptr %15, align 4, !tbaa !9
  %60 = load ptr, ptr %6, align 8, !tbaa !5
  %61 = load i32, ptr %13, align 4, !tbaa !9
  %62 = load i32, ptr %14, align 4, !tbaa !9
  %63 = load i32, ptr %15, align 4, !tbaa !9
  call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AtoNumber_RJS0x28hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %60, i32 noundef %61, i32 noundef %62, i32 noundef %63)
  %64 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %64, ptr %13, align 4, !tbaa !9
  %65 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %65, ptr %14, align 4, !tbaa !9
  %66 = load ptr, ptr %6, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.w2c_hermes, ptr %66, i32 0, i32 6
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = zext i32 %68 to i64
  %70 = call i32 @i32_load(ptr noundef %67, i64 noundef %69)
  store i32 %70, ptr %14, align 4, !tbaa !9
  %71 = load i32, ptr %14, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %180

73:                                               ; preds = %58
  %74 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %74, ptr %14, align 4, !tbaa !9
  store i64 9221120237041090560, ptr %19, align 8, !tbaa !19
  %75 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %75, ptr %16, align 4, !tbaa !9
  %76 = load ptr, ptr %6, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.w2c_hermes, ptr %76, i32 0, i32 6
  %78 = load i32, ptr %16, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = add i64 %79, 8
  %81 = call double @f64_load(ptr noundef %77, i64 noundef %80)
  store double %81, ptr %21, align 8, !tbaa !11
  %82 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %82, ptr %17, align 4, !tbaa !9
  store i32 2, ptr %18, align 4, !tbaa !9
  %83 = load i32, ptr %18, align 4, !tbaa !9
  %84 = and i32 %83, 31
  %85 = load i32, ptr %17, align 4, !tbaa !9
  %86 = shl i32 %85, %84
  store i32 %86, ptr %17, align 4, !tbaa !9
  store i32 118064, ptr %18, align 4, !tbaa !9
  %87 = load i32, ptr %18, align 4, !tbaa !9
  %88 = load i32, ptr %17, align 4, !tbaa !9
  %89 = add i32 %88, %87
  store i32 %89, ptr %17, align 4, !tbaa !9
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.w2c_hermes, ptr %90, i32 0, i32 6
  %92 = load i32, ptr %17, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = call i32 @i32_load(ptr noundef %91, i64 noundef %93)
  store i32 %94, ptr %17, align 4, !tbaa !9
  %95 = load i32, ptr %17, align 4, !tbaa !9
  %96 = load ptr, ptr %6, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.w2c_hermes, ptr %96, i32 0, i32 7
  %98 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %97, i32 0, i32 2
  %99 = load i32, ptr %98, align 4, !tbaa !20
  %100 = icmp ult i32 %95, %99
  br i1 %100, label %101, label %124

101:                                              ; preds = %73
  %102 = load ptr, ptr %6, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.w2c_hermes, ptr %102, i32 0, i32 7
  %104 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %103, i32 0, i32 0
  %105 = load ptr, ptr %104, align 8, !tbaa !21
  %106 = load i32, ptr %17, align 4, !tbaa !9
  %107 = zext i32 %106 to i64
  %108 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %105, i64 %107
  %109 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %108, i32 0, i32 1
  %110 = load ptr, ptr %109, align 8, !tbaa !22
  %111 = icmp ne ptr %110, null
  br i1 %111, label %112, label %124

112:                                              ; preds = %101
  %113 = load ptr, ptr @w2c_hermes_t10, align 8, !tbaa !5
  %114 = load ptr, ptr %6, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.w2c_hermes, ptr %114, i32 0, i32 7
  %116 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %115, i32 0, i32 0
  %117 = load ptr, ptr %116, align 8, !tbaa !21
  %118 = load i32, ptr %17, align 4, !tbaa !9
  %119 = zext i32 %118 to i64
  %120 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %117, i64 %119
  %121 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %120, i32 0, i32 0
  %122 = load ptr, ptr %121, align 8, !tbaa !24
  %123 = call zeroext i1 @func_types_eq(ptr noundef %113, ptr noundef %122)
  br label %124

124:                                              ; preds = %112, %101, %73
  %125 = phi i1 [ false, %101 ], [ false, %73 ], [ %123, %112 ]
  %126 = xor i1 %125, true
  %127 = xor i1 %126, true
  %128 = zext i1 %127 to i32
  %129 = sext i32 %128 to i64
  %130 = call i64 @llvm.expect.i64(i64 %129, i64 1)
  %131 = icmp ne i64 %130, 0
  br i1 %131, label %134, label %132

132:                                              ; preds = %124
  call void @wasm_rt_trap(i32 noundef 6) #7
  unreachable

133:                                              ; No predecessors!
  br label %134

134:                                              ; preds = %133, %124
  %135 = phi i1 [ true, %124 ], [ false, %133 ]
  %136 = zext i1 %135 to i32
  %137 = load ptr, ptr %6, align 8, !tbaa !5
  %138 = getelementptr inbounds %struct.w2c_hermes, ptr %137, i32 0, i32 7
  %139 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !21
  %141 = load i32, ptr %17, align 4, !tbaa !9
  %142 = zext i32 %141 to i64
  %143 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %140, i64 %142
  %144 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %143, i32 0, i32 1
  %145 = load ptr, ptr %144, align 8, !tbaa !22
  %146 = load ptr, ptr %6, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.w2c_hermes, ptr %146, i32 0, i32 7
  %148 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %147, i32 0, i32 0
  %149 = load ptr, ptr %148, align 8, !tbaa !21
  %150 = load i32, ptr %17, align 4, !tbaa !9
  %151 = zext i32 %150 to i64
  %152 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %149, i64 %151
  %153 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %152, i32 0, i32 2
  %154 = load ptr, ptr %153, align 8, !tbaa !25
  %155 = load double, ptr %21, align 8, !tbaa !11
  %156 = call double %145(ptr noundef %154, double noundef %155)
  store double %156, ptr %21, align 8, !tbaa !11
  %157 = load double, ptr %21, align 8, !tbaa !11
  store double %157, ptr %12, align 8, !tbaa !11
  %158 = load double, ptr %21, align 8, !tbaa !11
  %159 = call i64 @i64_reinterpret_f64(double noundef %158)
  store i64 %159, ptr %20, align 8, !tbaa !19
  %160 = load double, ptr %12, align 8, !tbaa !11
  store double %160, ptr %22, align 8, !tbaa !11
  %161 = load double, ptr %12, align 8, !tbaa !11
  store double %161, ptr %23, align 8, !tbaa !11
  %162 = load double, ptr %22, align 8, !tbaa !11
  %163 = load double, ptr %23, align 8, !tbaa !11
  %164 = fcmp une double %162, %163
  %165 = zext i1 %164 to i32
  store i32 %165, ptr %17, align 4, !tbaa !9
  %166 = load i32, ptr %17, align 4, !tbaa !9
  %167 = icmp ne i32 %166, 0
  br i1 %167, label %168, label %170

168:                                              ; preds = %134
  %169 = load i64, ptr %19, align 8, !tbaa !19
  br label %172

170:                                              ; preds = %134
  %171 = load i64, ptr %20, align 8, !tbaa !19
  br label %172

172:                                              ; preds = %170, %168
  %173 = phi i64 [ %169, %168 ], [ %171, %170 ]
  store i64 %173, ptr %19, align 8, !tbaa !19
  %174 = load ptr, ptr %6, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.w2c_hermes, ptr %174, i32 0, i32 6
  %176 = load i32, ptr %14, align 4, !tbaa !9
  %177 = zext i32 %176 to i64
  %178 = add i64 %177, 8
  %179 = load i64, ptr %19, align 8, !tbaa !19
  call void @i64_store(ptr noundef %175, i64 noundef %178, i64 noundef %179)
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %181

180:                                              ; preds = %58
  store i32 0, ptr %14, align 4, !tbaa !9
  br label %181

181:                                              ; preds = %180, %172
  %182 = load ptr, ptr %6, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.w2c_hermes, ptr %182, i32 0, i32 6
  %184 = load i32, ptr %13, align 4, !tbaa !9
  %185 = zext i32 %184 to i64
  %186 = load i32, ptr %14, align 4, !tbaa !9
  call void @i32_store(ptr noundef %183, i64 noundef %185, i32 noundef %186)
  %187 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %187, ptr %13, align 4, !tbaa !9
  store i32 16, ptr %14, align 4, !tbaa !9
  %188 = load i32, ptr %14, align 4, !tbaa !9
  %189 = load i32, ptr %13, align 4, !tbaa !9
  %190 = add i32 %189, %188
  store i32 %190, ptr %13, align 4, !tbaa !9
  %191 = load i32, ptr %13, align 4, !tbaa !9
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.w2c_hermes, ptr %192, i32 0, i32 3
  store i32 %191, ptr %193, align 8, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  ret void
}

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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { "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 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 #6 = { nounwind }
attributes #7 = { 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, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !10, i64 24}
!14 = !{!"w2c_hermes", !6, i64 0, !6, i64 8, !6, i64 16, !10, i64 24, !10, i64 28, !10, i64 32, !15, i64 40, !18, i64 80}
!15 = !{!"", !6, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !17, i64 32}
!16 = !{!"long", !7, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!"", !6, i64 0, !10, i64 8, !10, i64 12}
!19 = !{!16, !16, i64 0}
!20 = !{!14, !10, i64 92}
!21 = !{!14, !6, i64 80}
!22 = !{!23, !6, i64 8}
!23 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!24 = !{!23, !6, i64 0}
!25 = !{!23, !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_t10 = external local_unnamed_addr constant ptr, align 8

; 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 i32 @i32_load(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @i64_store(ptr noundef, i64 noundef, i64 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 i64 @i64_reinterpret_f64(double 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: inlinehint nounwind uwtable
declare hidden double @f64_load(ptr noundef, i64 noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3ArunContextFunc1Arg0x28void0x2A0x2C0x20hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3ANativeArgs0x29(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #3 {
  %6 = getelementptr inbounds i8, ptr %0, i64 24
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = add i32 %7, -16
  store i32 %8, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 40
  %10 = zext i32 %4 to i64
  %11 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %10)
  %12 = add i32 %11, -8
  %13 = add nuw nsw i64 %10, 4
  %14 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %13)
  %.not = icmp eq i32 %14, 0
  %15 = select i1 %.not, i32 67208, i32 %12
  tail call void @w2c_hermes_hermes0x3A0x3Avm0x3A0x3AtoNumber_RJS0x28hermes0x3A0x3Avm0x3A0x3ARuntime0x260x2C0x20hermes0x3A0x3Avm0x3A0x3AHandle0x3Chermes0x3A0x3Avm0x3A0x3AHermesValue0x3E0x29(ptr noundef %0, i32 noundef %8, i32 noundef %3, i32 noundef %15) #4
  %16 = zext i32 %8 to i64
  %17 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %16)
  %.not70 = icmp eq i32 %17, 0
  br i1 %.not70, label %._crit_edge, label %18

._crit_edge:                                      ; preds = %5
  %.pre = zext i32 %1 to i64
  br label %52

18:                                               ; preds = %5
  %19 = add nuw nsw i64 %16, 8
  %20 = tail call double @f64_load(ptr noundef nonnull %9, i64 noundef %19)
  %21 = shl i32 %2, 2
  %22 = add i32 %21, 118064
  %23 = zext i32 %22 to i64
  %24 = tail call i32 @i32_load(ptr noundef nonnull %9, i64 noundef %23)
  %25 = getelementptr inbounds i8, ptr %0, i64 80
  %26 = getelementptr inbounds i8, ptr %0, i64 92
  %27 = load i32, ptr %26, align 4, !tbaa !15
  %28 = icmp ult i32 %24, %27
  br i1 %28, label %29, label %.critedge, !prof !16

29:                                               ; preds = %18
  %30 = load ptr, ptr %25, align 8, !tbaa !17
  %31 = zext i32 %24 to i64
  %32 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %30, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %.not71 = icmp eq ptr %34, null
  br i1 %.not71, label %.critedge, label %35, !prof !20

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

.critedge:                                        ; preds = %29, %18, %35
  tail call void @wasm_rt_trap(i32 noundef 6) #5
  unreachable

39:                                               ; preds = %35
  %40 = load ptr, ptr %25, align 8, !tbaa !17
  %41 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %40, i64 %31
  %42 = getelementptr inbounds i8, ptr %41, i64 8
  %43 = load ptr, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds i8, ptr %41, i64 16
  %45 = load ptr, ptr %44, align 8, !tbaa !23
  %46 = tail call double %43(ptr noundef %45, double noundef %20) #4
  %47 = tail call i64 @i64_reinterpret_f64(double noundef %46)
  %48 = fcmp uno double %46, 0.000000e+00
  %49 = select i1 %48, i64 9221120237041090560, i64 %47
  %50 = zext i32 %1 to i64
  %51 = add nuw nsw i64 %50, 8
  tail call void @i64_store(ptr noundef nonnull %9, i64 noundef %51, i64 noundef %49)
  br label %52

52:                                               ; preds = %._crit_edge, %39
  %.pre-phi = phi i64 [ %.pre, %._crit_edge ], [ %50, %39 ]
  %.0 = phi i32 [ 0, %._crit_edge ], [ 1, %39 ]
  tail call void @i32_store(ptr noundef nonnull %9, i64 noundef %.pre-phi, i32 noundef %.0)
  store i32 %7, ptr %6, align 8, !tbaa !5
  ret void
}

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 = { "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)"}
!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,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass