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

; 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_t0 = 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: 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 i32 @i32_load8_u(ptr noundef, i64 noundef) #1

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

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

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3ASourceErrorManager0x3A0x3AgetBufferFileName0x28unsigned0x20int0x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 {
  %5 = alloca ptr, align 8
  %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 %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, 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
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %14 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %14, ptr %9, align 4, !tbaa !9
  store i32 0, ptr %10, align 4, !tbaa !9
  %15 = load i32, ptr %9, align 4, !tbaa !9
  %16 = load i32, ptr %10, align 4, !tbaa !9
  %17 = icmp slt i32 %15, %16
  %18 = zext i1 %17 to i32
  store i32 %18, ptr %9, align 4, !tbaa !9
  %19 = load i32, ptr %9, align 4, !tbaa !9
  %20 = icmp ne i32 %19, 0
  br i1 %20, label %21, label %157

21:                                               ; preds = %4
  %22 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %22, ptr %9, align 4, !tbaa !9
  %23 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %23, ptr %10, align 4, !tbaa !9
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = getelementptr inbounds %struct.w2c_hermes, ptr %24, i32 0, i32 6
  %26 = load i32, ptr %10, align 4, !tbaa !9
  %27 = zext i32 %26 to i64
  %28 = add i64 %27, 92
  %29 = call i32 @i32_load(ptr noundef %25, i64 noundef %28)
  store i32 %29, ptr %10, align 4, !tbaa !9
  %30 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %30, ptr %11, align 4, !tbaa !9
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.w2c_hermes, ptr %31, i32 0, i32 6
  %33 = load i32, ptr %11, align 4, !tbaa !9
  %34 = zext i32 %33 to i64
  %35 = add i64 %34, 104
  %36 = call i32 @i32_load(ptr noundef %32, i64 noundef %35)
  store i32 %36, ptr %11, align 4, !tbaa !9
  %37 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %37, ptr %12, align 4, !tbaa !9
  store i32 2147483647, ptr %13, align 4, !tbaa !9
  %38 = load i32, ptr %13, align 4, !tbaa !9
  %39 = load i32, ptr %12, align 4, !tbaa !9
  %40 = and i32 %39, %38
  store i32 %40, ptr %12, align 4, !tbaa !9
  %41 = load i32, ptr %12, align 4, !tbaa !9
  %42 = load i32, ptr %11, align 4, !tbaa !9
  %43 = add i32 %42, %41
  store i32 %43, ptr %11, align 4, !tbaa !9
  %44 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %44, ptr %7, align 4, !tbaa !9
  store i32 341, ptr %12, align 4, !tbaa !9
  %45 = load i32, ptr %12, align 4, !tbaa !9
  %46 = icmp eq i32 %45, 0
  %47 = xor i1 %46, true
  %48 = xor i1 %47, true
  %49 = zext i1 %48 to i32
  %50 = sext i32 %49 to i64
  %51 = call i64 @llvm.expect.i64(i64 %50, i64 0)
  %52 = icmp ne i64 %51, 0
  br i1 %52, label %53, label %55

53:                                               ; preds = %21
  call void @wasm_rt_trap(i32 noundef 3) #6
  unreachable

54:                                               ; No predecessors!
  br label %59

55:                                               ; preds = %21
  %56 = load i32, ptr %11, align 4, !tbaa !9
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = udiv i32 %56, %57
  br label %59

59:                                               ; preds = %55, %54
  %60 = phi i32 [ 0, %54 ], [ %58, %55 ]
  store i32 %60, ptr %11, align 4, !tbaa !9
  %61 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %61, ptr %8, align 4, !tbaa !9
  store i32 2, ptr %12, align 4, !tbaa !9
  %62 = load i32, ptr %12, align 4, !tbaa !9
  %63 = and i32 %62, 31
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = shl i32 %64, %63
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %11, align 4, !tbaa !9
  %67 = load i32, ptr %10, align 4, !tbaa !9
  %68 = add i32 %67, %66
  store i32 %68, ptr %10, align 4, !tbaa !9
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.w2c_hermes, ptr %69, i32 0, i32 6
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = zext i32 %71 to i64
  %73 = call i32 @i32_load(ptr noundef %70, i64 noundef %72)
  store i32 %73, ptr %10, align 4, !tbaa !9
  %74 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %74, ptr %11, align 4, !tbaa !9
  %75 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %75, ptr %12, align 4, !tbaa !9
  store i32 341, ptr %13, align 4, !tbaa !9
  %76 = load i32, ptr %13, align 4, !tbaa !9
  %77 = load i32, ptr %12, align 4, !tbaa !9
  %78 = mul i32 %77, %76
  store i32 %78, ptr %12, align 4, !tbaa !9
  %79 = load i32, ptr %12, align 4, !tbaa !9
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = sub i32 %80, %79
  store i32 %81, ptr %11, align 4, !tbaa !9
  store i32 12, ptr %12, align 4, !tbaa !9
  %82 = load i32, ptr %12, align 4, !tbaa !9
  %83 = load i32, ptr %11, align 4, !tbaa !9
  %84 = mul i32 %83, %82
  store i32 %84, 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
  %88 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %88, ptr %7, align 4, !tbaa !9
  %89 = load ptr, ptr %5, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.w2c_hermes, ptr %89, i32 0, i32 6
  %91 = load i32, ptr %10, 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 %10, align 4, !tbaa !9
  %94 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %94, ptr %11, align 4, !tbaa !9
  %95 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %95, ptr %12, align 4, !tbaa !9
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.w2c_hermes, ptr %96, i32 0, i32 6
  %98 = load i32, ptr %12, align 4, !tbaa !9
  %99 = zext i32 %98 to i64
  %100 = add i64 %99, 11
  %101 = call i32 @i32_load8_s(ptr noundef %97, i64 noundef %100)
  store i32 %101, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  %102 = load i32, ptr %12, align 4, !tbaa !9
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = icmp slt i32 %102, %103
  %105 = zext i1 %104 to i32
  store i32 %105, ptr %12, align 4, !tbaa !9
  %106 = load i32, ptr %12, align 4, !tbaa !9
  %107 = icmp ne i32 %106, 0
  br i1 %107, label %108, label %110

108:                                              ; preds = %59
  %109 = load i32, ptr %10, align 4, !tbaa !9
  br label %112

110:                                              ; preds = %59
  %111 = load i32, ptr %11, align 4, !tbaa !9
  br label %112

112:                                              ; preds = %110, %108
  %113 = phi i32 [ %109, %108 ], [ %111, %110 ]
  store i32 %113, ptr %10, align 4, !tbaa !9
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  %115 = getelementptr inbounds %struct.w2c_hermes, ptr %114, i32 0, i32 6
  %116 = load i32, ptr %9, align 4, !tbaa !9
  %117 = zext i32 %116 to i64
  %118 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %115, i64 noundef %117, i32 noundef %118)
  %119 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %119, ptr %9, align 4, !tbaa !9
  %120 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %120, ptr %10, align 4, !tbaa !9
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.w2c_hermes, ptr %121, i32 0, i32 6
  %123 = load i32, ptr %10, align 4, !tbaa !9
  %124 = zext i32 %123 to i64
  %125 = add i64 %124, 4
  %126 = call i32 @i32_load(ptr noundef %122, i64 noundef %125)
  store i32 %126, ptr %10, align 4, !tbaa !9
  %127 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %127, ptr %11, align 4, !tbaa !9
  %128 = load ptr, ptr %5, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.w2c_hermes, ptr %128, i32 0, i32 6
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = zext i32 %130 to i64
  %132 = add i64 %131, 11
  %133 = call i32 @i32_load8_u(ptr noundef %129, i64 noundef %132)
  store i32 %133, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %134, ptr %6, align 4, !tbaa !9
  %135 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %135, ptr %12, align 4, !tbaa !9
  %136 = load i32, ptr %12, align 4, !tbaa !9
  %137 = trunc i32 %136 to i8
  %138 = sext i8 %137 to i32
  store i32 %138, ptr %12, align 4, !tbaa !9
  store i32 0, ptr %13, align 4, !tbaa !9
  %139 = load i32, ptr %12, align 4, !tbaa !9
  %140 = load i32, ptr %13, align 4, !tbaa !9
  %141 = icmp slt i32 %139, %140
  %142 = zext i1 %141 to i32
  store i32 %142, ptr %12, align 4, !tbaa !9
  %143 = load i32, ptr %12, align 4, !tbaa !9
  %144 = icmp ne i32 %143, 0
  br i1 %144, label %145, label %147

145:                                              ; preds = %112
  %146 = load i32, ptr %10, align 4, !tbaa !9
  br label %149

147:                                              ; preds = %112
  %148 = load i32, ptr %11, align 4, !tbaa !9
  br label %149

149:                                              ; preds = %147, %145
  %150 = phi i32 [ %146, %145 ], [ %148, %147 ]
  store i32 %150, ptr %10, align 4, !tbaa !9
  %151 = load ptr, ptr %5, align 8, !tbaa !5
  %152 = getelementptr inbounds %struct.w2c_hermes, ptr %151, i32 0, i32 6
  %153 = load i32, ptr %9, align 4, !tbaa !9
  %154 = zext i32 %153 to i64
  %155 = add i64 %154, 4
  %156 = load i32, ptr %10, align 4, !tbaa !9
  call void @i32_store(ptr noundef %152, i64 noundef %155, i32 noundef %156)
  br label %255

157:                                              ; preds = %4
  %158 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %158, ptr %9, align 4, !tbaa !9
  %159 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %159, ptr %10, align 4, !tbaa !9
  %160 = load ptr, ptr %5, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.w2c_hermes, ptr %160, i32 0, i32 6
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = zext i32 %162 to i64
  %164 = call i32 @i32_load(ptr noundef %161, i64 noundef %163)
  store i32 %164, ptr %10, align 4, !tbaa !9
  %165 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %165, ptr %11, align 4, !tbaa !9
  store i32 12, ptr %12, align 4, !tbaa !9
  %166 = load i32, ptr %12, align 4, !tbaa !9
  %167 = load i32, ptr %11, align 4, !tbaa !9
  %168 = mul i32 %167, %166
  store i32 %168, ptr %11, align 4, !tbaa !9
  %169 = load i32, ptr %11, align 4, !tbaa !9
  %170 = load i32, ptr %10, align 4, !tbaa !9
  %171 = add i32 %170, %169
  store i32 %171, ptr %10, align 4, !tbaa !9
  store i32 12, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %11, align 4, !tbaa !9
  %173 = load i32, ptr %10, align 4, !tbaa !9
  %174 = sub i32 %173, %172
  store i32 %174, ptr %10, align 4, !tbaa !9
  %175 = load ptr, ptr %5, align 8, !tbaa !5
  %176 = getelementptr inbounds %struct.w2c_hermes, ptr %175, i32 0, i32 6
  %177 = load i32, ptr %10, align 4, !tbaa !9
  %178 = zext i32 %177 to i64
  %179 = call i32 @i32_load(ptr noundef %176, i64 noundef %178)
  store i32 %179, ptr %10, align 4, !tbaa !9
  %180 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %180, ptr %6, align 4, !tbaa !9
  %181 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %181, ptr %11, align 4, !tbaa !9
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.w2c_hermes, ptr %182, i32 0, i32 6
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = zext i32 %184 to i64
  %186 = call i32 @i32_load(ptr noundef %183, i64 noundef %185)
  store i32 %186, ptr %11, align 4, !tbaa !9
  %187 = load ptr, ptr %5, align 8, !tbaa !5
  %188 = getelementptr inbounds %struct.w2c_hermes, ptr %187, i32 0, i32 6
  %189 = load i32, ptr %11, align 4, !tbaa !9
  %190 = zext i32 %189 to i64
  %191 = add i64 %190, 8
  %192 = call i32 @i32_load(ptr noundef %188, i64 noundef %191)
  store i32 %192, ptr %11, align 4, !tbaa !9
  %193 = load i32, ptr %11, align 4, !tbaa !9
  %194 = load ptr, ptr %5, align 8, !tbaa !5
  %195 = getelementptr inbounds %struct.w2c_hermes, ptr %194, i32 0, i32 7
  %196 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %195, i32 0, i32 2
  %197 = load i32, ptr %196, align 4, !tbaa !11
  %198 = icmp ult i32 %193, %197
  br i1 %198, label %199, label %222

199:                                              ; preds = %157
  %200 = load ptr, ptr %5, align 8, !tbaa !5
  %201 = getelementptr inbounds %struct.w2c_hermes, ptr %200, i32 0, i32 7
  %202 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %201, i32 0, i32 0
  %203 = load ptr, ptr %202, align 8, !tbaa !17
  %204 = load i32, ptr %11, align 4, !tbaa !9
  %205 = zext i32 %204 to i64
  %206 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %203, i64 %205
  %207 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %206, i32 0, i32 1
  %208 = load ptr, ptr %207, align 8, !tbaa !18
  %209 = icmp ne ptr %208, null
  br i1 %209, label %210, label %222

210:                                              ; preds = %199
  %211 = load ptr, ptr @w2c_hermes_t0, align 8, !tbaa !5
  %212 = load ptr, ptr %5, 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 %11, 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 0
  %220 = load ptr, ptr %219, align 8, !tbaa !20
  %221 = call zeroext i1 @func_types_eq(ptr noundef %211, ptr noundef %220)
  br label %222

222:                                              ; preds = %210, %199, %157
  %223 = phi i1 [ false, %199 ], [ false, %157 ], [ %221, %210 ]
  %224 = xor i1 %223, true
  %225 = xor i1 %224, true
  %226 = zext i1 %225 to i32
  %227 = sext i32 %226 to i64
  %228 = call i64 @llvm.expect.i64(i64 %227, i64 1)
  %229 = icmp ne i64 %228, 0
  br i1 %229, label %232, label %230

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

231:                                              ; No predecessors!
  br label %232

232:                                              ; preds = %231, %222
  %233 = phi i1 [ true, %222 ], [ false, %231 ]
  %234 = zext i1 %233 to i32
  %235 = load ptr, ptr %5, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.w2c_hermes, ptr %235, i32 0, i32 7
  %237 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %236, i32 0, i32 0
  %238 = load ptr, ptr %237, align 8, !tbaa !17
  %239 = load i32, ptr %11, align 4, !tbaa !9
  %240 = zext i32 %239 to i64
  %241 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %238, i64 %240
  %242 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %241, i32 0, i32 1
  %243 = load ptr, ptr %242, align 8, !tbaa !18
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.w2c_hermes, ptr %244, i32 0, i32 7
  %246 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %245, i32 0, i32 0
  %247 = load ptr, ptr %246, align 8, !tbaa !17
  %248 = load i32, ptr %11, align 4, !tbaa !9
  %249 = zext i32 %248 to i64
  %250 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %247, i64 %249
  %251 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %250, i32 0, i32 2
  %252 = load ptr, ptr %251, align 8, !tbaa !21
  %253 = load i32, ptr %9, align 4, !tbaa !9
  %254 = load i32, ptr %10, align 4, !tbaa !9
  call void %243(ptr noundef %252, i32 noundef %253, i32 noundef %254)
  br label %255

255:                                              ; preds = %232, %149
  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
  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 = { 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 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_t0 = 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: noreturn
declare void @wasm_rt_trap(i32 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden i32 @i32_load8_s(ptr noundef, i64 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: nounwind uwtable
define dso_local void @w2c_hermes_hermes0x3A0x3ASourceErrorManager0x3A0x3AgetBufferFileName0x28unsigned0x20int0x290x20const(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #2 {
  %5 = icmp slt i32 %3, 0
  %6 = getelementptr inbounds i8, ptr %0, i64 40
  %7 = zext i32 %2 to i64
  br i1 %5, label %8, label %35

8:                                                ; preds = %4
  %9 = add nuw nsw i64 %7, 92
  %10 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %9)
  %11 = add nuw nsw i64 %7, 104
  %12 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %11)
  %13 = and i32 %3, 2147483647
  %14 = add i32 %12, %13
  %15 = udiv i32 %14, 341
  %16 = shl nuw nsw i32 %15, 2
  %17 = add i32 %16, %10
  %18 = zext i32 %17 to i64
  %19 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %18)
  %.neg = mul i32 %15, -341
  %20 = add i32 %.neg, %14
  %21 = mul i32 %20, 12
  %22 = add i32 %21, %19
  %23 = zext i32 %22 to i64
  %24 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %23)
  %25 = add nuw nsw i64 %23, 11
  %26 = tail call i32 @i32_load8_s(ptr noundef nonnull %6, i64 noundef %25)
  %27 = icmp slt i32 %26, 0
  %28 = select i1 %27, i32 %24, i32 %22
  %29 = zext i32 %1 to i64
  tail call void @i32_store(ptr noundef nonnull %6, i64 noundef %29, i32 noundef %28)
  %30 = add nuw nsw i64 %23, 4
  %31 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %30)
  %32 = tail call i32 @i32_load8_u(ptr noundef nonnull %6, i64 noundef %25)
  %sext.mask = and i32 %32, 128
  %.not101 = icmp eq i32 %sext.mask, 0
  %33 = select i1 %.not101, i32 %32, i32 %31
  %34 = add nuw nsw i64 %29, 4
  tail call void @i32_store(ptr noundef nonnull %6, i64 noundef %34, i32 noundef %33)
  br label %68

35:                                               ; preds = %4
  %36 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %7)
  %37 = mul i32 %3, 12
  %38 = add i32 %37, -12
  %39 = add i32 %38, %36
  %40 = zext i32 %39 to i64
  %41 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %40)
  %42 = zext i32 %41 to i64
  %43 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %42)
  %44 = zext i32 %43 to i64
  %45 = add nuw nsw i64 %44, 8
  %46 = tail call i32 @i32_load(ptr noundef nonnull %6, i64 noundef %45)
  %47 = getelementptr inbounds i8, ptr %0, i64 80
  %48 = getelementptr inbounds i8, ptr %0, i64 92
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp ult i32 %46, %49
  br i1 %50, label %51, label %.critedge, !prof !15

51:                                               ; preds = %35
  %52 = load ptr, ptr %47, align 8, !tbaa !16
  %53 = zext i32 %46 to i64
  %54 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %52, i64 %53
  %55 = getelementptr inbounds i8, ptr %54, i64 8
  %56 = load ptr, ptr %55, align 8, !tbaa !17
  %.not = icmp eq ptr %56, null
  br i1 %.not, label %.critedge, label %57, !prof !19

57:                                               ; preds = %51
  %58 = load ptr, ptr @w2c_hermes_t0, align 8, !tbaa !20
  %59 = load ptr, ptr %54, align 8, !tbaa !21
  %60 = tail call zeroext i1 @func_types_eq(ptr noundef %58, ptr noundef %59)
  br i1 %60, label %61, label %.critedge, !prof !15

.critedge:                                        ; preds = %51, %35, %57
  tail call void @wasm_rt_trap(i32 noundef 6) #3
  unreachable

61:                                               ; preds = %57
  %62 = load ptr, ptr %47, align 8, !tbaa !16
  %63 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %62, i64 %53
  %64 = getelementptr inbounds i8, ptr %63, i64 8
  %65 = load ptr, ptr %64, align 8, !tbaa !17
  %66 = getelementptr inbounds i8, ptr %63, i64 16
  %67 = load ptr, ptr %66, align 8, !tbaa !22
  tail call void %65(ptr noundef %67, i32 noundef %1, i32 noundef %41) #4
  br label %68

68:                                               ; preds = %61, %8
  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 = { 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 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,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,LowerExpectIntrinsicPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass