// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/src/vmir_wasm_parser.c
// Function: wasm_parse_section_code
static void
wasm_parse_section_code(ir_unit_t *iu, wasm_bytestream_t *wbs)
{
  uint32_t count = wbs_get_vu32(wbs);
  iu->iu_current_function = TAILQ_FIRST(&iu->iu_functions_with_bodies);

  ir_bb_t *ib = NULL;
  for(uint32_t i = 0; i < count; i++) {
    vstack_clear(iu);
    iu->iu_first_func_value = iu->iu_next_value;

    function_prepare_parse(iu, iu->iu_current_function);

    const uint32_t local_var_base = iu->iu_next_value;

    /* const uint32_t body_size =*/ wbs_get_vu32(wbs);
    const uint32_t local_vars = wbs_get_vu32(wbs);

    ir_bb_t *preamble = bb_add_named(iu->iu_current_function, NULL, "Preamble");
    init_local_vars(iu, preamble, wbs, local_vars, iu->iu_current_function);

    ib = bb_add_named(iu->iu_current_function, preamble, "Func block");

    unconditional_branch(preamble, ib);

    ib = wasm_parse_block(iu, ib, wbs, local_var_base, NULL, 0x02, 0, -1);

    if(ib != NULL)
      wasm_return(iu, ib);

    function_process(iu, iu->iu_current_function);
    value_resize(iu, iu->iu_first_func_value);

    iu->iu_current_function = TAILQ_NEXT(iu->iu_current_function, if_body_link);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1d450
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq 0x1a8(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1c0(%rax)
movq $0x0, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x1e0d0
movq -0x8(%rbp), %rdi
callq 0x1ef90
movq -0x8(%rbp), %rax
movl 0x198(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x19c(%rax)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %rsi
callq 0x1fd80
movq -0x8(%rbp), %rax
movl 0x198(%rax), %eax
movl %eax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x1d450
movq -0x10(%rbp), %rdi
callq 0x1d450
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %rdi
xorl %eax, %eax
movl %eax, %esi
leaq 0x20ef8(%rip), %rdx     # 0x3eede
callq 0x1fe50
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rdi
movq -0x38(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x2c(%rbp), %ecx
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %r8
callq 0x1fea0
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %rdi
movq -0x38(%rbp), %rsi
leaq 0x20ec3(%rip), %rdx     # 0x3eee7
callq 0x1fe50
movq %rax, -0x20(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x20150
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
movl -0x28(%rbp), %ecx
xorl %eax, %eax
movl %eax, %r8d
movl $0x2, %r9d
xorl %eax, %eax
movl $0x0, (%rsp)
movl $0xffffffff, 0x8(%rsp)  # imm = 0xFFFFFFFF
callq 0x201a0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x1e082
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x20830
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %rsi
callq 0x208c0
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movl 0x19c(%rax), %esi
callq 0x1ccd0
movq -0x8(%rbp), %rax
movq 0x1c0(%rax), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x1c0(%rax)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x1df71
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)