// File: /workspace/github_c_makefile_star2_O0/chgzm[P]minic/generator.c
// Function: process_param_list_node
static void process_param_list_node(const ParamListNode* node, int arg_index) {
    const ParamDeclarationNode* param_declaration_node = node->param_declaration_node;
    const DeclaratorNode* declarator_node = param_declaration_node->declarator_node;
    if (declarator_node == NULL) {
        return;
    }

    // create type
    Type* type = NULL;
    for (int i = 0; i < param_declaration_node->decl_spec_nodes->size; ++i) {
        const DeclSpecifierNode* decl_specifier_node = param_declaration_node->decl_spec_nodes->elements[i];
        const TypeSpecifierNode* type_specifier_node = decl_specifier_node->type_specifier_node;
        if (type_specifier_node == NULL) {
            continue;
        }

        type = process_type_specifier_in_local(type_specifier_node);
        break;
    }

    current_offset += 8;

    const DirectDeclaratorNode* direct_declarator_node = declarator_node->direct_declarator_node;
    LocalVar* lv = malloc(sizeof(LocalVar));
    lv->type     = type;
    lv->offset   = current_offset;
    lv->name     = strdup(direct_declarator_node->identifier);
    vector_push_back(localvar_list, lv);

    const PointerNode* pointer_node = declarator_node->pointer_node;
    if (pointer_node != NULL) {
        lv->type->ptr_count = pointer_node->count;
        lv->type->size      = 8;
    } else {
        lv->type->size = lv->type->type_size;
    }

    printf("  mov [rbp-%d], %s\n", lv->offset, arg_registers[arg_index]);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x3ed2
jmp 0x4006
movq $0x0, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq -0x18(%rbp), %rcx
movq (%rcx), %rcx
cmpl 0x8(%rcx), %eax
jge 0x3f34
movq -0x18(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
movslq -0x2c(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x3f1a
jmp 0x3f29
movq -0x40(%rbp), %rdi
callq 0x4010
movq %rax, -0x28(%rbp)
jmp 0x3f34
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x3ee1
movl 0x11236(%rip), %eax     # 0x15170
addl $0x8, %eax
movl %eax, 0x1122d(%rip)     # 0x15170
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x18, %edi
callq 0x10f0
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rcx
movq -0x50(%rbp), %rax
movq %rcx, (%rax)
movl 0x11202(%rip), %ecx     # 0x15170
movq -0x50(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x48(%rbp), %rax
movq (%rax), %rdi
callq 0x1170
movq %rax, %rcx
movq -0x50(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x111d5(%rip), %rdi     # 0x15168
movq -0x50(%rbp), %rsi
callq 0xe610
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
je 0x3fce
movq -0x58(%rbp), %rax
movl (%rax), %ecx
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x10(%rax)
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl $0x8, 0x8(%rax)
jmp 0x3fe2
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl 0x4(%rax), %ecx
movq -0x50(%rbp), %rax
movq (%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x50(%rbp), %rax
movl 0x14(%rax), %esi
movslq -0xc(%rbp), %rcx
leaq 0x110ec(%rip), %rax     # 0x150e0
movq (%rax,%rcx,8), %rdx
leaq 0xb675(%rip), %rdi      # 0xf674
movb $0x0, %al
callq 0x1090
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)