; 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
@.str.36 = 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: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #2

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

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

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

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

20:                                               ; preds = %2
  br label %236

21:                                               ; preds = %2
  %22 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %22, ptr %7, align 4, !tbaa !9
  %23 = load ptr, ptr %3, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.w2c_hermes, ptr %23, i32 0, i32 6
  %25 = load i32, ptr %7, align 4, !tbaa !9
  %26 = zext i32 %25 to i64
  %27 = add i64 %26, 76
  %28 = call i32 @i32_load(ptr noundef %24, i64 noundef %27)
  store i32 %28, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  %29 = load i32, ptr %7, align 4, !tbaa !9
  %30 = load i32, ptr %8, align 4, !tbaa !9
  %31 = icmp sge i32 %29, %30
  %32 = zext i1 %31 to i32
  store i32 %32, ptr %7, align 4, !tbaa !9
  %33 = load i32, ptr %7, align 4, !tbaa !9
  %34 = icmp ne i32 %33, 0
  br i1 %34, label %35, label %40

35:                                               ; preds = %21
  %36 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %36, ptr %7, align 4, !tbaa !9
  %37 = load ptr, ptr %3, align 8, !tbaa !5
  %38 = load i32, ptr %7, align 4, !tbaa !9
  %39 = call i32 @w2c_hermes_0x5F_lockfile(ptr noundef %37, i32 noundef %38)
  store i32 %39, ptr %7, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %35, %21
  %41 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %41, ptr %7, align 4, !tbaa !9
  %42 = load ptr, ptr %3, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.w2c_hermes, ptr %42, i32 0, i32 6
  %44 = load i32, ptr %7, align 4, !tbaa !9
  %45 = zext i32 %44 to i64
  %46 = add i64 %45, 20
  %47 = call i32 @i32_load(ptr noundef %43, i64 noundef %46)
  store i32 %47, ptr %7, align 4, !tbaa !9
  %48 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %48, ptr %8, align 4, !tbaa !9
  %49 = load ptr, ptr %3, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.w2c_hermes, ptr %49, i32 0, i32 6
  %51 = load i32, ptr %8, align 4, !tbaa !9
  %52 = zext i32 %51 to i64
  %53 = add i64 %52, 28
  %54 = call i32 @i32_load(ptr noundef %50, i64 noundef %53)
  store i32 %54, ptr %8, align 4, !tbaa !9
  %55 = load i32, ptr %7, align 4, !tbaa !9
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = icmp ne i32 %55, %56
  %58 = zext i1 %57 to i32
  store i32 %58, ptr %7, align 4, !tbaa !9
  %59 = load i32, ptr %7, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %133

61:                                               ; preds = %40
  %62 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %62, ptr %7, align 4, !tbaa !9
  store i32 0, ptr %8, align 4, !tbaa !9
  store i32 0, ptr %9, align 4, !tbaa !9
  %63 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %63, ptr %10, align 4, !tbaa !9
  %64 = load ptr, ptr %3, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.w2c_hermes, ptr %64, i32 0, i32 6
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = add i64 %67, 36
  %69 = call i32 @i32_load(ptr noundef %65, i64 noundef %68)
  store i32 %69, ptr %10, align 4, !tbaa !9
  %70 = load i32, ptr %10, align 4, !tbaa !9
  %71 = load ptr, ptr %3, align 8, !tbaa !5
  %72 = getelementptr inbounds %struct.w2c_hermes, ptr %71, i32 0, i32 7
  %73 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 4, !tbaa !11
  %75 = icmp ult i32 %70, %74
  br i1 %75, label %76, label %98

76:                                               ; preds = %61
  %77 = load ptr, ptr %3, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.w2c_hermes, ptr %77, i32 0, i32 7
  %79 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !17
  %81 = load i32, ptr %10, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %83, i32 0, i32 1
  %85 = load ptr, ptr %84, align 8, !tbaa !18
  %86 = icmp ne ptr %85, null
  br i1 %86, label %87, label %98

87:                                               ; preds = %76
  %88 = load ptr, ptr %3, align 8, !tbaa !5
  %89 = getelementptr inbounds %struct.w2c_hermes, ptr %88, i32 0, i32 7
  %90 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %89, i32 0, i32 0
  %91 = load ptr, ptr %90, align 8, !tbaa !17
  %92 = load i32, ptr %10, align 4, !tbaa !9
  %93 = zext i32 %92 to i64
  %94 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %91, i64 %93
  %95 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %94, i32 0, i32 0
  %96 = load ptr, ptr %95, align 8, !tbaa !20
  %97 = call zeroext i1 @func_types_eq(ptr noundef @.str.6, ptr noundef %96)
  br label %98

98:                                               ; preds = %87, %76, %61
  %99 = phi i1 [ false, %76 ], [ false, %61 ], [ %97, %87 ]
  %100 = xor i1 %99, true
  %101 = xor i1 %100, true
  %102 = zext i1 %101 to i32
  %103 = sext i32 %102 to i64
  %104 = call i64 @llvm.expect.i64(i64 %103, i64 1)
  %105 = icmp ne i64 %104, 0
  br i1 %105, label %108, label %106

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

107:                                              ; No predecessors!
  br label %108

108:                                              ; preds = %107, %98
  %109 = phi i1 [ true, %98 ], [ false, %107 ]
  %110 = zext i1 %109 to i32
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.w2c_hermes, ptr %111, i32 0, i32 7
  %113 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %112, i32 0, i32 0
  %114 = load ptr, ptr %113, align 8, !tbaa !17
  %115 = load i32, ptr %10, align 4, !tbaa !9
  %116 = zext i32 %115 to i64
  %117 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %114, i64 %116
  %118 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !18
  %120 = load ptr, ptr %3, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.w2c_hermes, ptr %120, i32 0, i32 7
  %122 = getelementptr inbounds %struct.wasm_rt_funcref_table_t, ptr %121, i32 0, i32 0
  %123 = load ptr, ptr %122, align 8, !tbaa !17
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %126, i32 0, i32 2
  %128 = load ptr, ptr %127, align 8, !tbaa !21
  %129 = load i32, ptr %7, align 4, !tbaa !9
  %130 = load i32, ptr %8, align 4, !tbaa !9
  %131 = load i32, ptr %9, align 4, !tbaa !9
  %132 = call i32 %119(ptr noundef %128, i32 noundef %129, i32 noundef %130, i32 noundef %131)
  store i32 %132, ptr %7, align 4, !tbaa !9
  br label %133

133:                                              ; preds = %108, %40
  %134 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %134, ptr %7, align 4, !tbaa !9
  %135 = load ptr, ptr %3, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.w2c_hermes, ptr %135, i32 0, i32 6
  %137 = load i32, ptr %7, align 4, !tbaa !9
  %138 = zext i32 %137 to i64
  %139 = add i64 %138, 4
  %140 = call i32 @i32_load(ptr noundef %136, i64 noundef %139)
  store i32 %140, ptr %7, align 4, !tbaa !9
  %141 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %141, ptr %5, align 4, !tbaa !9
  %142 = load i32, ptr %4, align 4, !tbaa !9
  store i32 %142, ptr %8, align 4, !tbaa !9
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = getelementptr inbounds %struct.w2c_hermes, ptr %143, i32 0, i32 6
  %145 = load i32, ptr %8, align 4, !tbaa !9
  %146 = zext i32 %145 to i64
  %147 = add i64 %146, 8
  %148 = call i32 @i32_load(ptr noundef %144, i64 noundef %147)
  store i32 %148, ptr %8, align 4, !tbaa !9
  %149 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %149, ptr %6, align 4, !tbaa !9
  %150 = load i32, ptr %7, align 4, !tbaa !9
  %151 = load i32, ptr %8, align 4, !tbaa !9
  %152 = icmp eq i32 %150, %151
  %153 = zext i1 %152 to i32
  store i32 %153, ptr %7, align 4, !tbaa !9
  %154 = load i32, ptr %7, align 4, !tbaa !9
  %155 = icmp ne i32 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %133
  br label %236

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

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

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

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

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

210:                                              ; No predecessors!
  br label %211

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

236:                                              ; preds = %211, %156, %20
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, 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
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  ret void
}

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 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #3 = { 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 #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}
!22 = !{!14, !14, i64 0}


; 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
@.str.36 = 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 zeroext i1 @func_types_eq(ptr noundef, ptr 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_lockfile(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @w2c_hermes_close_file(ptr noundef %0, i32 noundef %1) local_unnamed_addr #2 {
  %.not = icmp eq i32 %1, 0
  br i1 %.not, label %72, label %3

3:                                                ; preds = %2
  %4 = getelementptr inbounds i8, ptr %0, i64 40
  %5 = zext i32 %1 to i64
  %6 = add nuw nsw i64 %5, 76
  %7 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %6)
  %8 = icmp sgt i32 %7, -1
  br i1 %8, label %9, label %11

9:                                                ; preds = %3
  %10 = tail call i32 @w2c_hermes_0x5F_lockfile(ptr noundef %0, i32 noundef %1)
  br label %11

11:                                               ; preds = %9, %3
  %12 = add nuw nsw i64 %5, 20
  %13 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %12)
  %14 = add nuw nsw i64 %5, 28
  %15 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %14)
  %.not73 = icmp eq i32 %13, %15
  br i1 %.not73, label %40, label %16

16:                                               ; preds = %11
  %17 = add nuw nsw i64 %5, 36
  %18 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %17)
  %19 = getelementptr inbounds i8, ptr %0, i64 80
  %20 = getelementptr inbounds i8, ptr %0, i64 92
  %21 = load i32, ptr %20, align 4, !tbaa !5
  %22 = icmp ult i32 %18, %21
  br i1 %22, label %23, label %.critedge, !prof !15

23:                                               ; preds = %16
  %24 = load ptr, ptr %19, align 8, !tbaa !16
  %25 = zext i32 %18 to i64
  %26 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %24, i64 %25
  %27 = getelementptr inbounds i8, ptr %26, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !17
  %.not74 = icmp eq ptr %28, null
  br i1 %.not74, label %.critedge, label %29, !prof !19

29:                                               ; preds = %23
  %30 = load ptr, ptr %26, align 8, !tbaa !20
  %31 = tail call zeroext i1 @func_types_eq(ptr noundef nonnull @.str.6, ptr noundef %30)
  br i1 %31, label %32, label %.critedge, !prof !15

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

32:                                               ; preds = %29
  %33 = load ptr, ptr %19, align 8, !tbaa !16
  %34 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %33, i64 %25
  %35 = getelementptr inbounds i8, ptr %34, i64 8
  %36 = load ptr, ptr %35, align 8, !tbaa !17
  %37 = getelementptr inbounds i8, ptr %34, i64 16
  %38 = load ptr, ptr %37, align 8, !tbaa !21
  %39 = tail call i32 %36(ptr noundef %38, i32 noundef %1, i32 noundef 0, i32 noundef 0) #4
  br label %40

40:                                               ; preds = %32, %11
  %41 = add nuw nsw i64 %5, 4
  %42 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %41)
  %43 = add nuw nsw i64 %5, 8
  %44 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %43)
  %45 = icmp eq i32 %42, %44
  br i1 %45, label %72, label %46

46:                                               ; preds = %40
  %47 = sub i32 %42, %44
  %48 = sext i32 %47 to i64
  %49 = add nuw nsw i64 %5, 40
  %50 = tail call i32 @i32_load(ptr noundef nonnull %4, i64 noundef %49)
  %51 = getelementptr inbounds i8, ptr %0, i64 80
  %52 = getelementptr inbounds i8, ptr %0, i64 92
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp ult i32 %50, %53
  br i1 %54, label %55, label %.critedge77, !prof !15

55:                                               ; preds = %46
  %56 = load ptr, ptr %51, align 8, !tbaa !16
  %57 = zext i32 %50 to i64
  %58 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %56, i64 %57
  %59 = getelementptr inbounds i8, ptr %58, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %.not75 = icmp eq ptr %60, null
  br i1 %.not75, label %.critedge77, label %61, !prof !19

61:                                               ; preds = %55
  %62 = load ptr, ptr %58, align 8, !tbaa !20
  %63 = tail call zeroext i1 @func_types_eq(ptr noundef nonnull @.str.36, ptr noundef %62)
  br i1 %63, label %64, label %.critedge77, !prof !15

.critedge77:                                      ; preds = %55, %46, %61
  tail call void @wasm_rt_trap(i32 noundef 6) #3
  unreachable

64:                                               ; preds = %61
  %65 = load ptr, ptr %51, align 8, !tbaa !16
  %66 = getelementptr inbounds %struct.wasm_rt_funcref_t, ptr %65, i64 %57
  %67 = getelementptr inbounds i8, ptr %66, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !17
  %69 = getelementptr inbounds i8, ptr %66, i64 16
  %70 = load ptr, ptr %69, align 8, !tbaa !21
  %71 = tail call i64 %68(ptr noundef %70, i32 noundef %1, i64 noundef %48, i32 noundef 1) #4
  br label %72

72:                                               ; preds = %40, %2, %64
  ret void
}

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


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