// File: /workspace/github_c_makefile_star2_O0/cogbee[P]vmir-latest/src/vmir_bitcode_parser.c
// Function: paramattr_group_rec_handler
static void
paramattr_group_rec_handler(ir_unit_t *iu, int op,
                            unsigned int argc, const int64_t *argv)
{
  char *key, *value;
  const char *ctx = "PARAMATTR_GRP_CODE_ENTRY";
  switch(op) {
  case 3: // PARAMATTR_GRP_CODE_ENTRY
    if(argc < 3)
      parser_error(iu, "%s: Short (%d records)", ctx, argc);

    ir_attr_t *ia = calloc(1, sizeof(ir_attr_t));
    LIST_INSERT_HEAD(&iu->iu_attribute_groups, ia, ia_link);

    ia->ia_group_id = argv[0];
    ia->ia_index    = argv[1];
    argv += 2;
    argc -= 2;
    while(argc > 0) {
      int type = argv[0];
      argv++;
      argc--;
      if(argc == 0)
        parser_error(iu, "%s: Short record", ctx);

      switch(type) {
      case 0:
        // ENUM attribute
        ia->ia_flags |= (1ULL << argv[0]);
        argv++;
        argc--;
        break;
      case 1:
        if(argc < 1)
          parser_error(iu, "%s: Missing int-arg", ctx);
        // Integer attribute
        argv += 2;
        argc -= 2;
        break;
      case 3:
        key = read_zstr_from_argv(&argc, &argv);
        if(key == NULL)
          parser_error(iu, "%s: short string", ctx);
        free(key);
        break;
      case 4:
        key = read_zstr_from_argv(&argc, &argv);
        if(key == NULL)
          parser_error(iu, "%s: short string", ctx);
        value = read_zstr_from_argv(&argc, &argv);
        if(value == NULL) {
          free(key);
          parser_error(iu, "%s: short string", ctx);
        }
        free(key);
        free(value);
        break;
      default:
        parser_error(iu, "%s: Unknown attr %d", ctx, type);
      }
    }
    break;
  default:
    parser_error(iu, "Unknown op %d in paramattr_group", op);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
leaq 0xc994(%rip), %rax      # 0x40a41
movq %rax, -0x30(%rbp)
movl -0xc(%rbp), %eax
subl $0x3, %eax
jne 0x34377
jmp 0x340bf
cmpl $0x3, -0x10(%rbp)
jae 0x340eb
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
movl -0x10(%rbp), %r9d
leaq 0xc78c(%rip), %rsi      # 0x40864
movl $0x114, %edx            # imm = 0x114
leaq 0xc976(%rip), %rcx      # 0x40a5a
movb $0x0, %al
callq 0x18220
movl $0x1, %edi
movl $0x20, %esi
callq 0x32c0
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rax
movq -0x38(%rbp), %rcx
movq %rax, (%rcx)
cmpq $0x0, %rax
je 0x34129
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq 0x148(%rax), %rax
movq %rcx, 0x8(%rax)
movq -0x38(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x148(%rax)
movq -0x8(%rbp), %rcx
addq $0x148, %rcx            # imm = 0x148
movq -0x38(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x10(%rax)
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jbe 0x34375
movq -0x18(%rbp), %rax
movq (%rax), %rax
movl %eax, -0x3c(%rbp)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
jne 0x341d2
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
leaq 0xc6a5(%rip), %rsi      # 0x40864
movl $0x122, %edx            # imm = 0x122
leaq 0xc8a6(%rip), %rcx      # 0x40a71
movb $0x0, %al
callq 0x18220
movl -0x3c(%rbp), %eax
movq %rax, -0x48(%rbp)
subq $0x4, %rax
ja 0x3434a
movq -0x48(%rbp), %rax
leaq 0x9b76(%rip), %rcx      # 0x3dd64
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x18(%rbp), %rax
movq (%rax), %rcx
movl $0x1, %eax
shlq %cl, %rax
movq %rax, %rcx
movq -0x38(%rbp), %rax
orq 0x18(%rax), %rcx
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x34370
cmpl $0x1, -0x10(%rbp)
jae 0x34257
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
leaq 0xc620(%rip), %rsi      # 0x40864
movl $0x12d, %edx            # imm = 0x12D
leaq 0xc832(%rip), %rcx      # 0x40a82
movb $0x0, %al
callq 0x18220
movq -0x18(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x18(%rbp)
movl -0x10(%rbp), %eax
subl $0x2, %eax
movl %eax, -0x10(%rbp)
jmp 0x34370
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x35e90
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x342ab
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
leaq 0xc5cc(%rip), %rsi      # 0x40864
movl $0x135, %edx            # imm = 0x135
leaq 0xc7f2(%rip), %rcx      # 0x40a96
movb $0x0, %al
callq 0x18220
movq -0x20(%rbp), %rdi
callq 0x3030
jmp 0x34370
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x35e90
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x342f3
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
leaq 0xc584(%rip), %rsi      # 0x40864
movl $0x13b, %edx            # imm = 0x13B
leaq 0xc7aa(%rip), %rcx      # 0x40a96
movb $0x0, %al
callq 0x18220
leaq -0x10(%rbp), %rdi
leaq -0x18(%rbp), %rsi
callq 0x35e90
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x34336
movq -0x20(%rbp), %rdi
callq 0x3030
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
leaq 0xc541(%rip), %rsi      # 0x40864
movl $0x13f, %edx            # imm = 0x13F
leaq 0xc767(%rip), %rcx      # 0x40a96
movb $0x0, %al
callq 0x18220
movq -0x20(%rbp), %rdi
callq 0x3030
movq -0x28(%rbp), %rdi
callq 0x3030
jmp 0x34370
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %r8
movl -0x3c(%rbp), %r9d
leaq 0xc507(%rip), %rsi      # 0x40864
movl $0x145, %edx            # imm = 0x145
leaq 0xc73e(%rip), %rcx      # 0x40aa7
movb $0x0, %al
callq 0x18220
jmp 0x34181
jmp 0x34399
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %r8d
leaq 0xc4de(%rip), %rsi      # 0x40864
movl $0x14a, %edx            # imm = 0x14A
leaq 0xc729(%rip), %rcx      # 0x40abb
movb $0x0, %al
callq 0x18220
addq $0x50, %rsp
popq %rbp
retq
nop