package wasmtime

  1. Overview
  2. Docs

Source file wasmtime_generated.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
module CI = Cstubs_internals

external caml__1_wasm_byte_vec_new
  : _ CI.fatptr -> Unsigned.size_t -> _ CI.fatptr -> unit
  = "caml__1_wasm_byte_vec_new" 

external caml__2_wasm_byte_vec_new_uninitialized
  : _ CI.fatptr -> Unsigned.size_t -> unit
  = "caml__2_wasm_byte_vec_new_uninitialized" 

external caml__3_wasm_byte_vec_copy : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__3_wasm_byte_vec_copy" 

external caml__4_wasm_byte_vec_delete : _ CI.fatptr -> unit
  = "caml__4_wasm_byte_vec_delete" 

external caml__5_wasm_engine_new : unit -> CI.voidp
  = "caml__5_wasm_engine_new" 

external caml__6_wasm_engine_delete : _ CI.fatptr -> unit
  = "caml__6_wasm_engine_delete" 

external caml__7_wasm_store_new : _ CI.fatptr -> CI.voidp
  = "caml__7_wasm_store_new" 

external caml__8_wasm_store_delete : _ CI.fatptr -> unit
  = "caml__8_wasm_store_delete" 

external caml__9_wasm_trap_new : _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__9_wasm_trap_new" 

external caml__10_wasm_trap_message : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__10_wasm_trap_message" 

external caml__11_wasm_trap_delete : _ CI.fatptr -> unit
  = "caml__11_wasm_trap_delete" 

external caml__12_wasm_val_delete : _ CI.fatptr -> unit
  = "caml__12_wasm_val_delete" 

external caml__13_wasmtime_externref_new : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__13_wasmtime_externref_new" 

external caml__14_wasmtime_externref_new_with_finalizer
  : _ CI.fatptr -> _ CI.fatfunptr -> _ CI.fatptr -> unit
  = "caml__14_wasmtime_externref_new_with_finalizer" 

external caml__15_wasm_val_vec_delete : _ CI.fatptr -> unit
  = "caml__15_wasm_val_vec_delete" 

external caml__16_wasm_valtype_new : Unsigned.uint8 -> CI.voidp
  = "caml__16_wasm_valtype_new" 

external caml__17_wasm_valtype_delete : _ CI.fatptr -> unit
  = "caml__17_wasm_valtype_delete" 

external caml__18_wasm_valtype_vec_new
  : _ CI.fatptr -> Unsigned.size_t -> _ CI.fatptr -> unit
  = "caml__18_wasm_valtype_vec_new" 

external caml__19_wasm_valtype_vec_delete : _ CI.fatptr -> unit
  = "caml__19_wasm_valtype_vec_delete" 

external caml__20_wasm_memory_data : _ CI.fatptr -> CI.voidp
  = "caml__20_wasm_memory_data" 

external caml__21_wasm_memory_grow : _ CI.fatptr -> Unsigned.uint32 -> bool
  = "caml__21_wasm_memory_grow" 

external caml__22_wasm_memory_size : _ CI.fatptr -> Unsigned.size_t
  = "caml__22_wasm_memory_size" 

external caml__23_wasm_memory_data_size : _ CI.fatptr -> Unsigned.size_t
  = "caml__23_wasm_memory_data_size" 

external caml__24_wasm_memory_delete : _ CI.fatptr -> unit
  = "caml__24_wasm_memory_delete" 

external caml__25_wasm_functype_new : _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__25_wasm_functype_new" 

external caml__26_wasm_functype_new_0_0 : unit -> CI.voidp
  = "caml__26_wasm_functype_new_0_0" 

external caml__27_wasm_functype_delete : _ CI.fatptr -> unit
  = "caml__27_wasm_functype_delete" 

external caml__28_wasm_func_new
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatfunptr -> CI.voidp
  = "caml__28_wasm_func_new" 

external caml__29_wasm_func_delete : _ CI.fatptr -> unit
  = "caml__29_wasm_func_delete" 

external caml__30_wasm_global_get : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__30_wasm_global_get" 

external caml__31_wasm_global_set : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__31_wasm_global_set" 

external caml__32_wasm_global_delete : _ CI.fatptr -> unit
  = "caml__32_wasm_global_delete" 

external caml__33_wasm_ref_delete : _ CI.fatptr -> unit
  = "caml__33_wasm_ref_delete" 

external caml__34_wasm_table_get : _ CI.fatptr -> Unsigned.uint32 -> CI.voidp
  = "caml__34_wasm_table_get" 

external caml__35_wasm_table_set
  : _ CI.fatptr -> Unsigned.uint32 -> _ CI.fatptr -> unit
  = "caml__35_wasm_table_set" 

external caml__36_wasm_table_size : _ CI.fatptr -> Unsigned.uint32
  = "caml__36_wasm_table_size" 

external caml__37_wasm_table_delete : _ CI.fatptr -> unit
  = "caml__37_wasm_table_delete" 

external caml__38_wasm_extern_delete : _ CI.fatptr -> unit
  = "caml__38_wasm_extern_delete" 

external caml__39_wasm_extern_as_func : _ CI.fatptr -> CI.voidp
  = "caml__39_wasm_extern_as_func" 

external caml__40_wasm_func_as_extern : _ CI.fatptr -> CI.voidp
  = "caml__40_wasm_func_as_extern" 

external caml__41_wasm_extern_as_memory : _ CI.fatptr -> CI.voidp
  = "caml__41_wasm_extern_as_memory" 

external caml__42_wasm_extern_as_table : _ CI.fatptr -> CI.voidp
  = "caml__42_wasm_extern_as_table" 

external caml__43_wasm_extern_as_global : _ CI.fatptr -> CI.voidp
  = "caml__43_wasm_extern_as_global" 

external caml__44_wasm_extern_vec_delete : _ CI.fatptr -> unit
  = "caml__44_wasm_extern_vec_delete" 

external caml__45_wasm_module_delete : _ CI.fatptr -> unit
  = "caml__45_wasm_module_delete" 

external caml__46_wasm_instance_delete : _ CI.fatptr -> unit
  = "caml__46_wasm_instance_delete" 

external caml__47_wasm_instance_new
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__47_wasm_instance_new" 

external caml__48_wasm_instance_exports : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__48_wasm_instance_exports" 

external caml__49_wasmtime_error_message : _ CI.fatptr -> _ CI.fatptr -> unit
  = "caml__49_wasmtime_error_message" 

external caml__50_wasmtime_error_delete : _ CI.fatptr -> unit
  = "caml__50_wasmtime_error_delete" 

external caml__51_wasi_config_new : unit -> CI.voidp
  = "caml__51_wasi_config_new" 

external caml__52_wasi_config_delete : _ CI.fatptr -> unit
  = "caml__52_wasi_config_delete" 

external caml__53_wasi_config_inherit_argv : _ CI.fatptr -> unit
  = "caml__53_wasi_config_inherit_argv" 

external caml__54_wasi_config_inherit_env : _ CI.fatptr -> unit
  = "caml__54_wasi_config_inherit_env" 

external caml__55_wasi_config_inherit_stdin : _ CI.fatptr -> unit
  = "caml__55_wasi_config_inherit_stdin" 

external caml__56_wasi_config_inherit_stdout : _ CI.fatptr -> unit
  = "caml__56_wasi_config_inherit_stdout" 

external caml__57_wasi_config_inherit_stderr : _ CI.fatptr -> unit
  = "caml__57_wasi_config_inherit_stderr" 

external caml__58_wasi_config_preopen_dir
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> bool
  = "caml__58_wasi_config_preopen_dir" 

external caml__59_wasi_instance_new
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__59_wasi_instance_new" 

external caml__60_wasi_instance_delete : _ CI.fatptr -> unit
  = "caml__60_wasi_instance_delete" 

external caml__61_wasmtime_linker_new : _ CI.fatptr -> CI.voidp
  = "caml__61_wasmtime_linker_new" 

external caml__62_wasmtime_linker_delete : _ CI.fatptr -> unit
  = "caml__62_wasmtime_linker_delete" 

external caml__63_wasmtime_linker_define_wasi
  : _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__63_wasmtime_linker_define_wasi" 

external caml__64_wasmtime_linker_define_instance
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__64_wasmtime_linker_define_instance" 

external caml__65_wasmtime_linker_instantiate
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__65_wasmtime_linker_instantiate" 

external caml__66_wasmtime_linker_module
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__66_wasmtime_linker_module" 

external caml__67_wasmtime_linker_get_default
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__67_wasmtime_linker_get_default" 

external caml__68_wasmtime_wat2wasm : _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__68_wasmtime_wat2wasm" 

external caml__69_wasmtime_module_new
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__69_wasmtime_module_new" 

external caml__70_wasmtime_func_call
  : _ CI.fatptr -> _ CI.fatptr -> Unsigned.size_t -> _ CI.fatptr ->
    Unsigned.size_t -> _ CI.fatptr -> CI.voidp
  = "caml__70_wasmtime_func_call_byte6" "caml__70_wasmtime_func_call" 

external caml__71_wasmtime_instance_new
  : _ CI.fatptr -> _ CI.fatptr -> _ CI.fatptr -> Unsigned.size_t ->
    _ CI.fatptr -> _ CI.fatptr -> CI.voidp
  = "caml__71_wasmtime_instance_new_byte6" "caml__71_wasmtime_instance_new" 

type 'a result = 'a
type 'a return = 'a
type 'a fn =
 | Returns  : 'a CI.typ   -> 'a return fn
 | Function : 'a CI.typ * 'b fn  -> ('a -> 'b) fn
let map_result f x = f x
let returning t = Returns t
let (@->) f p = Function (f, p)
let foreign : type a b. string -> (a -> b) fn -> (a -> b) =
  fun name t -> match t, name with
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _,
           Function
             (CI.Primitive CI.Size_t,
              Function
                (CI.Pointer _,
                 Function (CI.Pointer _, Returns (CI.Pointer x12))))))),
  "wasmtime_instance_new" ->
  (fun x1 x3 x5 x7 x8 x10 ->
    let CI.CPointer x11 = x10 in
    let CI.CPointer x9 = x8 in
    let CI.CPointer x6 = x5 in
    let CI.CPointer x4 = x3 in
    let CI.CPointer x2 = x1 in
    CI.make_ptr x12 (caml__71_wasmtime_instance_new x2 x4 x6 x7 x9 x11))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Primitive CI.Size_t,
           Function
             (CI.Pointer _,
              Function
                (CI.Primitive CI.Size_t,
                 Function (CI.Pointer _, Returns (CI.Pointer x23))))))),
  "wasmtime_func_call" ->
  (fun x13 x15 x17 x18 x20 x21 ->
    let CI.CPointer x22 = x21 in
    let CI.CPointer x19 = x18 in
    let CI.CPointer x16 = x15 in
    let CI.CPointer x14 = x13 in
    CI.make_ptr x23 (caml__70_wasmtime_func_call x14 x16 x17 x19 x20 x22))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x30)))),
  "wasmtime_module_new" ->
  (fun x24 x26 x28 ->
    let CI.CPointer x29 = x28 in
    let CI.CPointer x27 = x26 in
    let CI.CPointer x25 = x24 in
    CI.make_ptr x30 (caml__69_wasmtime_module_new x25 x27 x29))
| Function (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x35))),
  "wasmtime_wat2wasm" ->
  (fun x31 x33 ->
    let CI.CPointer x34 = x33 in
    let CI.CPointer x32 = x31 in
    CI.make_ptr x35 (caml__68_wasmtime_wat2wasm x32 x34))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x42)))),
  "wasmtime_linker_get_default" ->
  (fun x36 x38 x40 ->
    let CI.CPointer x41 = x40 in
    let CI.CPointer x39 = x38 in
    let CI.CPointer x37 = x36 in
    CI.make_ptr x42 (caml__67_wasmtime_linker_get_default x37 x39 x41))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x49)))),
  "wasmtime_linker_module" ->
  (fun x43 x45 x47 ->
    let CI.CPointer x48 = x47 in
    let CI.CPointer x46 = x45 in
    let CI.CPointer x44 = x43 in
    CI.make_ptr x49 (caml__66_wasmtime_linker_module x44 x46 x48))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x58))))),
  "wasmtime_linker_instantiate" ->
  (fun x50 x52 x54 x56 ->
    let CI.CPointer x57 = x56 in
    let CI.CPointer x55 = x54 in
    let CI.CPointer x53 = x52 in
    let CI.CPointer x51 = x50 in
    CI.make_ptr x58 (caml__65_wasmtime_linker_instantiate x51 x53 x55 x57))
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x65)))),
  "wasmtime_linker_define_instance" ->
  (fun x59 x61 x63 ->
    let CI.CPointer x64 = x63 in
    let CI.CPointer x62 = x61 in
    let CI.CPointer x60 = x59 in
    CI.make_ptr x65 (caml__64_wasmtime_linker_define_instance x60 x62 x64))
| Function (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x70))),
  "wasmtime_linker_define_wasi" ->
  (fun x66 x68 ->
    let CI.CPointer x69 = x68 in
    let CI.CPointer x67 = x66 in
    CI.make_ptr x70 (caml__63_wasmtime_linker_define_wasi x67 x69))
| Function (CI.Pointer _, Returns CI.Void), "wasmtime_linker_delete" ->
  (fun x71 ->
    let CI.CPointer x72 = x71 in caml__62_wasmtime_linker_delete x72)
| Function (CI.Pointer _, Returns (CI.Pointer x75)), "wasmtime_linker_new" ->
  (fun x73 ->
    let CI.CPointer x74 = x73 in
    CI.make_ptr x75 (caml__61_wasmtime_linker_new x74))
| Function (CI.Pointer _, Returns CI.Void), "wasi_instance_delete" ->
  (fun x76 -> let CI.CPointer x77 = x76 in caml__60_wasi_instance_delete x77)
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x81; _},
        Function
          (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x88))))),
  "wasi_instance_new" ->
  (fun x78 x80 x84 x86 ->
    let CI.CPointer x87 = x86 in
    let CI.CPointer x85 = x84 in
    let CI.CPointer x83 = x81 x80 in
    let CI.CPointer x79 = x78 in
    let x82 = x83 in
    CI.make_ptr x88 (caml__59_wasi_instance_new x79 x82 x85 x87))
| Function
    (CI.Pointer _,
     Function
       (CI.View {CI.ty = CI.Pointer _; write = x92; _},
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x96; _},
           Returns (CI.Primitive CI.Bool)))),
  "wasi_config_preopen_dir" ->
  (fun x89 x91 x95 ->
    let CI.CPointer x98 = x96 x95 in
    let CI.CPointer x94 = x92 x91 in
    let CI.CPointer x90 = x89 in
    let x93 = x94 in
    let x97 = x98 in caml__58_wasi_config_preopen_dir x90 x93 x97)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_inherit_stderr" ->
  (fun x99 ->
    let CI.CPointer x100 = x99 in caml__57_wasi_config_inherit_stderr x100)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_inherit_stdout" ->
  (fun x101 ->
    let CI.CPointer x102 = x101 in caml__56_wasi_config_inherit_stdout x102)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_inherit_stdin" ->
  (fun x103 ->
    let CI.CPointer x104 = x103 in caml__55_wasi_config_inherit_stdin x104)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_inherit_env" ->
  (fun x105 ->
    let CI.CPointer x106 = x105 in caml__54_wasi_config_inherit_env x106)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_inherit_argv" ->
  (fun x107 ->
    let CI.CPointer x108 = x107 in caml__53_wasi_config_inherit_argv x108)
| Function (CI.Pointer _, Returns CI.Void), "wasi_config_delete" ->
  (fun x109 ->
    let CI.CPointer x110 = x109 in caml__52_wasi_config_delete x110)
| Function (CI.Void, Returns (CI.Pointer x112)), "wasi_config_new" ->
  (fun x111 -> CI.make_ptr x112 (caml__51_wasi_config_new x111))
| Function (CI.Pointer _, Returns CI.Void), "wasmtime_error_delete" ->
  (fun x113 ->
    let CI.CPointer x114 = x113 in caml__50_wasmtime_error_delete x114)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasmtime_error_message" ->
  (fun x115 x117 ->
    let CI.CPointer x118 = x117 in
    let CI.CPointer x116 = x115 in caml__49_wasmtime_error_message x116 x118)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasm_instance_exports" ->
  (fun x119 x121 ->
    let CI.CPointer x122 = x121 in
    let CI.CPointer x120 = x119 in caml__48_wasm_instance_exports x120 x122)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _,
        Function
          (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x131))))),
  "wasm_instance_new" ->
  (fun x123 x125 x127 x129 ->
    let CI.CPointer x130 = x129 in
    let CI.CPointer x128 = x127 in
    let CI.CPointer x126 = x125 in
    let CI.CPointer x124 = x123 in
    CI.make_ptr x131 (caml__47_wasm_instance_new x124 x126 x128 x130))
| Function (CI.Pointer _, Returns CI.Void), "wasm_instance_delete" ->
  (fun x132 ->
    let CI.CPointer x133 = x132 in caml__46_wasm_instance_delete x133)
| Function (CI.Pointer _, Returns CI.Void), "wasm_module_delete" ->
  (fun x134 ->
    let CI.CPointer x135 = x134 in caml__45_wasm_module_delete x135)
| Function (CI.Pointer _, Returns CI.Void), "wasm_extern_vec_delete" ->
  (fun x136 ->
    let CI.CPointer x137 = x136 in caml__44_wasm_extern_vec_delete x137)
| Function (CI.Pointer _, Returns (CI.Pointer x140)), "wasm_extern_as_global" ->
  (fun x138 ->
    let CI.CPointer x139 = x138 in
    CI.make_ptr x140 (caml__43_wasm_extern_as_global x139))
| Function (CI.Pointer _, Returns (CI.Pointer x143)), "wasm_extern_as_table" ->
  (fun x141 ->
    let CI.CPointer x142 = x141 in
    CI.make_ptr x143 (caml__42_wasm_extern_as_table x142))
| Function (CI.Pointer _, Returns (CI.Pointer x146)), "wasm_extern_as_memory" ->
  (fun x144 ->
    let CI.CPointer x145 = x144 in
    CI.make_ptr x146 (caml__41_wasm_extern_as_memory x145))
| Function (CI.Pointer _, Returns (CI.Pointer x149)), "wasm_func_as_extern" ->
  (fun x147 ->
    let CI.CPointer x148 = x147 in
    CI.make_ptr x149 (caml__40_wasm_func_as_extern x148))
| Function (CI.Pointer _, Returns (CI.Pointer x152)), "wasm_extern_as_func" ->
  (fun x150 ->
    let CI.CPointer x151 = x150 in
    CI.make_ptr x152 (caml__39_wasm_extern_as_func x151))
| Function (CI.Pointer _, Returns CI.Void), "wasm_extern_delete" ->
  (fun x153 ->
    let CI.CPointer x154 = x153 in caml__38_wasm_extern_delete x154)
| Function (CI.Pointer _, Returns CI.Void), "wasm_table_delete" ->
  (fun x155 ->
    let CI.CPointer x156 = x155 in caml__37_wasm_table_delete x156)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Uint32_t)),
  "wasm_table_size" ->
  (fun x157 -> let CI.CPointer x158 = x157 in caml__36_wasm_table_size x158)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Uint32_t, Function (CI.Pointer _, Returns CI.Void))),
  "wasm_table_set" ->
  (fun x159 x161 x162 ->
    let CI.CPointer x163 = x162 in
    let CI.CPointer x160 = x159 in caml__35_wasm_table_set x160 x161 x163)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Uint32_t, Returns (CI.Pointer x167))),
  "wasm_table_get" ->
  (fun x164 x166 ->
    let CI.CPointer x165 = x164 in
    CI.make_ptr x167 (caml__34_wasm_table_get x165 x166))
| Function (CI.Pointer _, Returns CI.Void), "wasm_ref_delete" ->
  (fun x168 -> let CI.CPointer x169 = x168 in caml__33_wasm_ref_delete x169)
| Function (CI.Pointer _, Returns CI.Void), "wasm_global_delete" ->
  (fun x170 ->
    let CI.CPointer x171 = x170 in caml__32_wasm_global_delete x171)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasm_global_set" ->
  (fun x172 x174 ->
    let CI.CPointer x175 = x174 in
    let CI.CPointer x173 = x172 in caml__31_wasm_global_set x173 x175)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasm_global_get" ->
  (fun x176 x178 ->
    let CI.CPointer x179 = x178 in
    let CI.CPointer x177 = x176 in caml__30_wasm_global_get x177 x179)
| Function (CI.Pointer _, Returns CI.Void), "wasm_func_delete" ->
  (fun x180 -> let CI.CPointer x181 = x180 in caml__29_wasm_func_delete x181)
| Function
    (CI.Pointer _,
     Function
       (CI.Pointer _, Function (CI.Funptr _, Returns (CI.Pointer x188)))),
  "wasm_func_new" ->
  (fun x182 x184 x186 ->
    let CI.Static_funptr x187 = x186 in
    let CI.CPointer x185 = x184 in
    let CI.CPointer x183 = x182 in
    CI.make_ptr x188 (caml__28_wasm_func_new x183 x185 x187))
| Function (CI.Pointer _, Returns CI.Void), "wasm_functype_delete" ->
  (fun x189 ->
    let CI.CPointer x190 = x189 in caml__27_wasm_functype_delete x190)
| Function (CI.Void, Returns (CI.Pointer x192)), "wasm_functype_new_0_0" ->
  (fun x191 -> CI.make_ptr x192 (caml__26_wasm_functype_new_0_0 x191))
| Function (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x197))),
  "wasm_functype_new" ->
  (fun x193 x195 ->
    let CI.CPointer x196 = x195 in
    let CI.CPointer x194 = x193 in
    CI.make_ptr x197 (caml__25_wasm_functype_new x194 x196))
| Function (CI.Pointer _, Returns CI.Void), "wasm_memory_delete" ->
  (fun x198 ->
    let CI.CPointer x199 = x198 in caml__24_wasm_memory_delete x199)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Size_t)),
  "wasm_memory_data_size" ->
  (fun x200 ->
    let CI.CPointer x201 = x200 in caml__23_wasm_memory_data_size x201)
| Function (CI.Pointer _, Returns (CI.Primitive CI.Size_t)),
  "wasm_memory_size" ->
  (fun x202 -> let CI.CPointer x203 = x202 in caml__22_wasm_memory_size x203)
| Function
    (CI.Pointer _,
     Function (CI.Primitive CI.Uint32_t, Returns (CI.Primitive CI.Bool))),
  "wasm_memory_grow" ->
  (fun x204 x206 ->
    let CI.CPointer x205 = x204 in caml__21_wasm_memory_grow x205 x206)
| Function (CI.Pointer _, Returns (CI.Pointer x209)), "wasm_memory_data" ->
  (fun x207 ->
    let CI.CPointer x208 = x207 in
    CI.make_ptr x209 (caml__20_wasm_memory_data x208))
| Function (CI.Pointer _, Returns CI.Void), "wasm_valtype_vec_delete" ->
  (fun x210 ->
    let CI.CPointer x211 = x210 in caml__19_wasm_valtype_vec_delete x211)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Size_t, Function (CI.Pointer _, Returns CI.Void))),
  "wasm_valtype_vec_new" ->
  (fun x212 x214 x215 ->
    let CI.CPointer x216 = x215 in
    let CI.CPointer x213 = x212 in
    caml__18_wasm_valtype_vec_new x213 x214 x216)
| Function (CI.Pointer _, Returns CI.Void), "wasm_valtype_delete" ->
  (fun x217 ->
    let CI.CPointer x218 = x217 in caml__17_wasm_valtype_delete x218)
| Function (CI.Primitive CI.Uint8_t, Returns (CI.Pointer x220)),
  "wasm_valtype_new" ->
  (fun x219 -> CI.make_ptr x220 (caml__16_wasm_valtype_new x219))
| Function (CI.Pointer _, Returns CI.Void), "wasm_val_vec_delete" ->
  (fun x221 ->
    let CI.CPointer x222 = x221 in caml__15_wasm_val_vec_delete x222)
| Function
    (CI.Pointer _,
     Function (CI.Funptr _, Function (CI.Pointer _, Returns CI.Void))),
  "wasmtime_externref_new_with_finalizer" ->
  (fun x223 x225 x227 ->
    let CI.CPointer x228 = x227 in
    let CI.Static_funptr x226 = x225 in
    let CI.CPointer x224 = x223 in
    caml__14_wasmtime_externref_new_with_finalizer x224 x226 x228)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasmtime_externref_new" ->
  (fun x229 x231 ->
    let CI.CPointer x232 = x231 in
    let CI.CPointer x230 = x229 in caml__13_wasmtime_externref_new x230 x232)
| Function (CI.Pointer _, Returns CI.Void), "wasm_val_delete" ->
  (fun x233 -> let CI.CPointer x234 = x233 in caml__12_wasm_val_delete x234)
| Function (CI.Pointer _, Returns CI.Void), "wasm_trap_delete" ->
  (fun x235 -> let CI.CPointer x236 = x235 in caml__11_wasm_trap_delete x236)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasm_trap_message" ->
  (fun x237 x239 ->
    let CI.CPointer x240 = x239 in
    let CI.CPointer x238 = x237 in caml__10_wasm_trap_message x238 x240)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns (CI.Pointer x245))),
  "wasm_trap_new" ->
  (fun x241 x243 ->
    let CI.CPointer x244 = x243 in
    let CI.CPointer x242 = x241 in
    CI.make_ptr x245 (caml__9_wasm_trap_new x242 x244))
| Function (CI.Pointer _, Returns CI.Void), "wasm_store_delete" ->
  (fun x246 -> let CI.CPointer x247 = x246 in caml__8_wasm_store_delete x247)
| Function (CI.Pointer _, Returns (CI.Pointer x250)), "wasm_store_new" ->
  (fun x248 ->
    let CI.CPointer x249 = x248 in
    CI.make_ptr x250 (caml__7_wasm_store_new x249))
| Function (CI.Pointer _, Returns CI.Void), "wasm_engine_delete" ->
  (fun x251 ->
    let CI.CPointer x252 = x251 in caml__6_wasm_engine_delete x252)
| Function (CI.Void, Returns (CI.Pointer x254)), "wasm_engine_new" ->
  (fun x253 -> CI.make_ptr x254 (caml__5_wasm_engine_new x253))
| Function (CI.Pointer _, Returns CI.Void), "wasm_byte_vec_delete" ->
  (fun x255 ->
    let CI.CPointer x256 = x255 in caml__4_wasm_byte_vec_delete x256)
| Function (CI.Pointer _, Function (CI.Pointer _, Returns CI.Void)),
  "wasm_byte_vec_copy" ->
  (fun x257 x259 ->
    let CI.CPointer x260 = x259 in
    let CI.CPointer x258 = x257 in caml__3_wasm_byte_vec_copy x258 x260)
| Function (CI.Pointer _, Function (CI.Primitive CI.Size_t, Returns CI.Void)),
  "wasm_byte_vec_new_uninitialized" ->
  (fun x261 x263 ->
    let CI.CPointer x262 = x261 in
    caml__2_wasm_byte_vec_new_uninitialized x262 x263)
| Function
    (CI.Pointer _,
     Function
       (CI.Primitive CI.Size_t,
        Function
          (CI.View {CI.ty = CI.Pointer _; write = x268; _}, Returns CI.Void))),
  "wasm_byte_vec_new" ->
  (fun x264 x266 x267 ->
    let CI.CPointer x270 = x268 x267 in
    let CI.CPointer x265 = x264 in
    let x269 = x270 in caml__1_wasm_byte_vec_new x265 x266 x269)
| _, s ->  Printf.ksprintf failwith "No match for %s" s


let foreign_value : type a. string -> a Ctypes.typ -> a Ctypes.ptr =
  fun name t -> match t, name with
| _, s ->  Printf.ksprintf failwith "No match for %s" s