; LLVM IR from facebook/hermes :: API/hermes_sandbox/external (hermes_sandbox_impl_opt_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_t3 = 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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @w2c_hermes_llvh0x3A0x3ASourceMgr0x3A0x3ASrcBuffer0x3A0x3A0x7ESrcBuffer0x280x29(ptr noundef %0, i32 noundef %1) #5 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %11 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %11, ptr %9, align 4, !tbaa !9
  %12 = load ptr, ptr %3, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.w2c_hermes, ptr %12, i32 0, i32 6
  %14 = load i32, ptr %9, align 4, !tbaa !9
  %15 = zext i32 %14 to i64
  %16 = add i64 %15, 4
  %17 = call i32 @i32_load(ptr noundef %13, i64 noundef %16)
  store i32 %17, ptr %9, align 4, !tbaa !9
  %18 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %18, ptr %5, align 4, !tbaa !9
  store i32 4, ptr %10, align 4, !tbaa !9
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = load i32, ptr %10, align 4, !tbaa !9
  %21 = icmp uge i32 %19, %20
  %22 = zext i1 %21 to i32
  store i32 %22, ptr %9, align 4, !tbaa !9
  %23 = load i32, ptr %9, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 0
  br i1 %24, label %25, label %139

25:                                               ; preds = %2
  %26 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %26, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %10, align 4, !tbaa !9
  %27 = load i32, ptr %10, align 4, !tbaa !9
  %28 = and i32 %27, 31
  %29 = load i32, ptr %9, align 4, !tbaa !9
  %30 = lshr i32 %29, %28
  store i32 %30, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %10, align 4, !tbaa !9
  %31 = load i32, ptr %10, align 4, !tbaa !9
  %32 = load i32, ptr %9, align 4, !tbaa !9
  %33 = and i32 %32, %31
  store i32 %33, ptr %9, align 4, !tbaa !9
  %34 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %34, ptr %6, align 4, !tbaa !9
  %35 = load i32, ptr %9, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 0
  %37 = xor i1 %36, true
  %38 = zext i1 %37 to i32
  store i32 %38, ptr %9, align 4, !tbaa !9
  %39 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %39, ptr %7, align 4, !tbaa !9
  %40 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %40, ptr %9, align 4, !tbaa !9
  store i32 1, ptr %10, align 4, !tbaa !9
  %41 = load i32, ptr %10, align 4, !tbaa !9
  %42 = load i32, ptr %9, align 4, !tbaa !9
  %43 = and i32 %42, %41
  store i32 %43, ptr %9, align 4, !tbaa !9
  %44 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %44, ptr %8, align 4, !tbaa !9
  %45 = load i32, ptr %9, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 0
  br i1 %46, label %47, label %48

47:                                               ; preds = %25
  br label %67

48:                                               ; preds = %25
  %49 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %49, ptr %9, align 4, !tbaa !9
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = icmp ne i32 %50, 0
  %52 = xor i1 %51, true
  %53 = zext i1 %52 to i32
  store i32 %53, ptr %9, align 4, !tbaa !9
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp ne i32 %54, 0
  br i1 %55, label %56, label %57

56:                                               ; preds = %48
  br label %67

57:                                               ; preds = %48
  %58 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %58, ptr %9, align 4, !tbaa !9
  store i32 -4, ptr %10, align 4, !tbaa !9
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = and i32 %60, %59
  store i32 %61, ptr %9, align 4, !tbaa !9
  %62 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %62, ptr %5, align 4, !tbaa !9
  %63 = load i32, ptr %9, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 0
  br i1 %64, label %65, label %66

65:                                               ; preds = %57
  br label %105

66:                                               ; preds = %57
  br label %131

67:                                               ; preds = %56, %47
  %68 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %68, ptr %9, align 4, !tbaa !9
  %69 = load i32, ptr %9, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %72

71:                                               ; preds = %67
  br label %91

72:                                               ; preds = %67
  %73 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %73, ptr %9, align 4, !tbaa !9
  %74 = load i32, ptr %9, align 4, !tbaa !9
  %75 = icmp ne i32 %74, 0
  %76 = xor i1 %75, true
  %77 = zext i1 %76 to i32
  store i32 %77, ptr %9, align 4, !tbaa !9
  %78 = load i32, ptr %9, align 4, !tbaa !9
  %79 = icmp ne i32 %78, 0
  br i1 %79, label %80, label %81

80:                                               ; preds = %72
  br label %91

81:                                               ; preds = %72
  %82 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %82, ptr %9, align 4, !tbaa !9
  store i32 -4, ptr %10, align 4, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %9, align 4, !tbaa !9
  %85 = and i32 %84, %83
  store i32 %85, ptr %9, align 4, !tbaa !9
  %86 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %86, ptr %5, align 4, !tbaa !9
  %87 = load i32, ptr %9, align 4, !tbaa !9
  %88 = icmp ne i32 %87, 0
  br i1 %88, label %89, label %90

89:                                               ; preds = %81
  br label %105

90:                                               ; preds = %81
  br label %131

91:                                               ; preds = %80, %71
  %92 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %92, ptr %9, align 4, !tbaa !9
  store i32 -4, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = load i32, ptr %9, align 4, !tbaa !9
  %95 = and i32 %94, %93
  store i32 %95, ptr %9, align 4, !tbaa !9
  %96 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %96, ptr %5, align 4, !tbaa !9
  %97 = load i32, ptr %9, align 4, !tbaa !9
  %98 = icmp ne i32 %97, 0
  %99 = xor i1 %98, true
  %100 = zext i1 %99 to i32
  store i32 %100, ptr %9, align 4, !tbaa !9
  %101 = load i32, ptr %9, align 4, !tbaa !9
  %102 = icmp ne i32 %101, 0
  br i1 %102, label %103, label %104

103:                                              ; preds = %91
  br label %131

104:                                              ; preds = %91
  br label %105

105:                                              ; preds = %104, %89, %65
  %106 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %106, ptr %9, align 4, !tbaa !9
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.w2c_hermes, ptr %107, i32 0, i32 6
  %109 = load i32, ptr %9, align 4, !tbaa !9
  %110 = zext i32 %109 to i64
  %111 = call i32 @i32_load(ptr noundef %108, i64 noundef %110)
  store i32 %111, ptr %9, align 4, !tbaa !9
  %112 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %112, ptr %6, align 4, !tbaa !9
  %113 = load i32, ptr %9, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %127

115:                                              ; preds = %105
  %116 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %116, ptr %9, align 4, !tbaa !9
  %117 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %117, ptr %10, align 4, !tbaa !9
  %118 = load ptr, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds %struct.w2c_hermes, ptr %118, i32 0, i32 6
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = zext i32 %120 to i64
  %122 = add i64 %121, 4
  %123 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %119, i64 noundef %122, i32 noundef %123)
  %124 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %124, ptr %9, align 4, !tbaa !9
  %125 = load ptr, ptr %3, align 8, !tbaa !5
  %126 = load i32, ptr %9, align 4, !tbaa !9
  call void @w2c_hermes_dlfree(ptr noundef %125, i32 noundef %126)
  br label %127

127:                                              ; preds = %115, %105
  %128 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %128, ptr %9, align 4, !tbaa !9
  %129 = load ptr, ptr %3, align 8, !tbaa !5
  %130 = load i32, ptr %9, align 4, !tbaa !9
  call void @w2c_hermes_dlfree(ptr noundef %129, i32 noundef %130)
  br label %131

131:                                              ; preds = %127, %103, %90, %66
  %132 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %132, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %133 = load ptr, ptr %3, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.w2c_hermes, ptr %133, i32 0, i32 6
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = zext i32 %135 to i64
  %137 = add i64 %136, 4
  %138 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %134, i64 noundef %137, i32 noundef %138)
  br label %139

139:                                              ; preds = %131, %2
  %140 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %140, ptr %9, align 4, !tbaa !9
  %141 = load ptr, ptr %3, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.w2c_hermes, ptr %141, i32 0, i32 6
  %143 = load i32, ptr %9, align 4, !tbaa !9
  %144 = zext i32 %143 to i64
  %145 = call i32 @i32_load(ptr noundef %142, i64 noundef %144)
  store i32 %145, ptr %9, align 4, !tbaa !9
  %146 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %146, ptr %5, align 4, !tbaa !9
  %147 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %147, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.w2c_hermes, ptr %148, i32 0, i32 6
  %150 = load i32, ptr %9, align 4, !tbaa !9
  %151 = zext i32 %150 to i64
  %152 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %149, i64 noundef %151, i32 noundef %152)
  %153 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %153, ptr %9, align 4, !tbaa !9
  %154 = load i32, ptr %9, align 4, !tbaa !9
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %231

156:                                              ; preds = %139
  %157 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %157, ptr %9, align 4, !tbaa !9
  %158 = load i32, ptr %5, align 4, !tbaa !9
  store i32 %158, ptr %10, align 4, !tbaa !9
  %159 = load ptr, ptr %3, align 8, !tbaa !5
  %160 = getelementptr inbounds %struct.w2c_hermes, ptr %159, i32 0, i32 6
  %161 = load i32, ptr %10, align 4, !tbaa !9
  %162 = zext i32 %161 to i64
  %163 = call i32 @i32_load(ptr noundef %160, i64 noundef %162)
  store i32 %163, ptr %10, align 4, !tbaa !9
  %164 = load ptr, ptr %3, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.w2c_hermes, ptr %164, i32 0, i32 6
  %166 = load i32, ptr %10, align 4, !tbaa !9
  %167 = zext i32 %166 to i64
  %168 = add i64 %167, 4
  %169 = call i32 @i32_load(ptr noundef %165, i64 noundef %168)
  store i32 %169, ptr %10, align 4, !tbaa !9
  %170 = load i32, ptr %10, align 4, !tbaa !9
  %171 = load ptr, ptr %3, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.w2c_hermes, ptr %171, i32 0, i32 7
  %173 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 4, !tbaa !11
  %175 = icmp ult i32 %170, %174
  br i1 %175, label %176, label %199

176:                                              ; preds = %156
  %177 = load ptr, ptr %3, align 8, !tbaa !5
  %178 = getelementptr inbounds %struct.w2c_hermes, ptr %177, i32 0, i32 7
  %179 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %178, i32 0, i32 0
  %180 = load ptr, ptr %179, align 8, !tbaa !17
  %181 = load i32, ptr %10, align 4, !tbaa !9
  %182 = zext i32 %181 to i64
  %183 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %180, i64 %182
  %184 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %183, i32 0, i32 1
  %185 = load ptr, ptr %184, align 8, !tbaa !18
  %186 = icmp ne ptr %185, null
  br i1 %186, label %187, label %199

187:                                              ; preds = %176
  %188 = load ptr, ptr @w2c_hermes_t3, align 8, !tbaa !5
  %189 = load ptr, ptr %3, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.w2c_hermes, ptr %189, i32 0, i32 7
  %191 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %190, i32 0, i32 0
  %192 = load ptr, ptr %191, align 8, !tbaa !17
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %192, i64 %194
  %196 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %195, i32 0, i32 0
  %197 = load ptr, ptr %196, align 8, !tbaa !20
  %198 = call zeroext i1 @func_types_eq(ptr noundef %188, ptr noundef %197)
  br label %199

199:                                              ; preds = %187, %176, %156
  %200 = phi i1 [ false, %176 ], [ false, %156 ], [ %198, %187 ]
  %201 = xor i1 %200, true
  %202 = xor i1 %201, true
  %203 = zext i1 %202 to i32
  %204 = sext i32 %203 to i64
  %205 = call i64 @llvm.expect.i64(i64 %204, i64 1)
  %206 = icmp ne i64 %205, 0
  br i1 %206, label %209, label %207

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

208:                                              ; No predecessors!
  br label %209

209:                                              ; preds = %208, %199
  %210 = phi i1 [ true, %199 ], [ false, %208 ]
  %211 = zext i1 %210 to i32
  %212 = load ptr, ptr %3, align 8, !tbaa !5
  %213 = getelementptr inbounds %struct.w2c_hermes, ptr %212, i32 0, i32 7
  %214 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %213, i32 0, i32 0
  %215 = load ptr, ptr %214, align 8, !tbaa !17
  %216 = load i32, ptr %10, align 4, !tbaa !9
  %217 = zext i32 %216 to i64
  %218 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %215, i64 %217
  %219 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %218, i32 0, i32 1
  %220 = load ptr, ptr %219, align 8, !tbaa !18
  %221 = load ptr, ptr %3, align 8, !tbaa !5
  %222 = getelementptr inbounds %struct.w2c_hermes, ptr %221, i32 0, i32 7
  %223 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %222, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !17
  %225 = load i32, ptr %10, align 4, !tbaa !9
  %226 = zext i32 %225 to i64
  %227 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %224, i64 %226
  %228 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %227, i32 0, i32 2
  %229 = load ptr, ptr %228, align 8, !tbaa !21
  %230 = load i32, ptr %9, align 4, !tbaa !9
  call void %220(ptr noundef %229, i32 noundef %230)
  br label %231

231:                                              ; preds = %209, %139
  %232 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %232, ptr %9, align 4, !tbaa !9
  %233 = load i32, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  ret i32 %233
}

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 = { "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, !10, i64 92}
!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, !6, i64 80}
!18 = !{!19, !6, i64 8}
!19 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16}
!20 = !{!19, !6, i64 0}
!21 = !{!19, !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_t3 = 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

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @w2c_hermes_llvh0x3A0x3ASourceMgr0x3A0x3ASrcBuffer0x3A0x3A0x7ESrcBuffer0x280x29(ptr noundef %0, i32 noundef returned %1) local_unnamed_addr #3 {
  %3 = getelementptr inbounds i8, ptr %0, i64 40
  %4 = zext i32 %1 to i64
  %5 = add nuw nsw i64 %4, 4
  %6 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %5)
  %7 = icmp ugt i32 %6, 3
  br i1 %7, label %8, label %21

8:                                                ; preds = %2
  %9 = and i32 %6, 3
  switch i32 %9, label %12 [
    i32 0, label %14
    i32 2, label %10
  ]

10:                                               ; preds = %8
  %11 = and i32 %6, -4
  %.not99 = icmp eq i32 %11, 0
  br i1 %.not99, label %20, label %14

12:                                               ; preds = %8
  %13 = and i32 %6, -4
  %.not100 = icmp eq i32 %13, 0
  br i1 %.not100, label %20, label %14

14:                                               ; preds = %8, %12, %10
  %.0 = phi i32 [ %13, %12 ], [ %11, %10 ], [ %6, %8 ]
  %15 = zext i32 %.0 to i64
  %16 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %15)
  %.not101 = icmp eq i32 %16, 0
  br i1 %.not101, label %19, label %17

17:                                               ; preds = %14
  %18 = add nuw nsw i64 %15, 4
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %18, i32 noundef %16)
  tail call void @w2c_hermes_dlfree(ptr noundef %0, i32 noundef %16) #4
  br label %19

19:                                               ; preds = %17, %14
  tail call void @w2c_hermes_dlfree(ptr noundef %0, i32 noundef %.0) #4
  br label %20

20:                                               ; preds = %12, %10, %19
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %5, i32 noundef 0)
  br label %21

21:                                               ; preds = %20, %2
  %22 = tail call i32 @i32_load(ptr noundef nonnull %3, i64 noundef %4)
  tail call void @i32_store(ptr noundef nonnull %3, i64 noundef %4, i32 noundef 0)
  %.not102 = icmp eq i32 %22, 0
  br i1 %.not102, label %50, label %23

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

33:                                               ; preds = %23
  %34 = load ptr, ptr %29, align 8, !tbaa !16
  %35 = zext i32 %28 to i64
  %36 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %34, i64 %35
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  %38 = load ptr, ptr %37, align 8, !tbaa !17
  %.not103 = icmp eq ptr %38, null
  br i1 %.not103, label %.critedge, label %39, !prof !19

39:                                               ; preds = %33
  %40 = load ptr, ptr @w2c_hermes_t3, align 8, !tbaa !20
  %41 = load ptr, ptr %36, align 8, !tbaa !21
  %42 = tail call zeroext i1 @func_types_eq(ptr noundef %40, ptr noundef %41)
  br i1 %42, label %43, label %.critedge, !prof !15

.critedge:                                        ; preds = %33, %23, %39
  tail call void @wasm_rt_trap(i32 noundef 6) #5
  unreachable

43:                                               ; preds = %39
  %44 = load ptr, ptr %29, align 8, !tbaa !16
  %45 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %44, i64 %35
  %46 = getelementptr inbounds i8, ptr %45, i64 8
  %47 = load ptr, ptr %46, align 8, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %45, i64 16
  %49 = load ptr, ptr %48, align 8, !tbaa !22
  tail call void %47(ptr noundef %49, i32 noundef %22) #4
  br label %50

50:                                               ; preds = %43, %21
  ret i32 %1
}

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 92}
!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 = !{!"branch_weights", !"expected", i32 2000, i32 1}
!16 = !{!6, !7, i64 80}
!17 = !{!18, !7, i64 8}
!18 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16}
!19 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!20 = !{!7, !7, i64 0}
!21 = !{!18, !7, i64 0}
!22 = !{!18, !7, i64 16}


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