// File: /workspace/github_c_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movl %edx, 0x4(%rsp)
movq %rcx, 0x8(%rsp)
cmpl $0x3, %esi
jne 0x1e1ee
movl %edx, %ebp
cmpl $0x2, %edx
jbe 0x1e20e
movq %rcx, %r15
movl $0x1, %edi
movl $0x20, %esi
callq 0x32f0
movq %rax, %r14
leaq 0x148(%rbx), %rax
movq %rbx, 0x10(%rsp)
movq 0x148(%rbx), %rcx
movq %rcx, (%r14)
testq %rcx, %rcx
je 0x1e030
movq %r14, 0x8(%rcx)
movq %r14, (%rax)
movq %rax, 0x8(%r14)
movl (%r15), %eax
movl %eax, 0x10(%r14)
movl 0x8(%r15), %eax
movl %eax, 0x14(%r14)
addq $0x10, %r15
movq %r15, 0x8(%rsp)
addl $-0x2, %ebp
movl %ebp, 0x4(%rsp)
je 0x1e130
leaq 0x666d(%rip), %rbx      # 0x246d0
leaq 0x4(%rsp), %r15
leaq 0x8(%rsp), %r12
movq 0x8(%rsp), %rax
movq (%rax), %r9
leaq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movl %ebp, %ecx
decl %ecx
movl %ecx, 0x4(%rsp)
je 0x1e13f
cmpl $0x4, %r9d
ja 0x1e1c8
movl %r9d, %ecx
movslq (%rbx,%rcx,4), %rcx
addq %rbx, %rcx
jmpq *%rcx
movb 0x8(%rax), %cl
movl $0x1, %edx
shlq %cl, %rdx
orq %rdx, 0x18(%r14)
addq $0x10, %rax
movq %rax, 0x8(%rsp)
addl $-0x2, %ebp
jmp 0x1e120
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ff7c
testq %rax, %rax
je 0x1e1a7
movq %rax, %rdi
jmp 0x1e10d
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ff7c
testq %rax, %rax
je 0x1e186
movq %rax, %r13
movq %r15, %rdi
movq %r12, %rsi
callq 0x1ff7c
movq %rax, %rbp
movq %r13, %rdi
callq 0x3030
testq %rbp, %rbp
je 0x1e165
movq %rbp, %rdi
callq 0x3030
jmp 0x1e124
addq $0x18, %rax
movq %rax, 0x8(%rsp)
addl $-0x3, %ebp
movl %ebp, 0x4(%rsp)
movl 0x4(%rsp), %ebp
testl %ebp, %ebp
jne 0x1e06d
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9445(%rip), %rsi      # 0x2758b
leaq 0x9648(%rip), %rcx      # 0x27795
leaq 0x9611(%rip), %r8       # 0x27765
movq 0x10(%rsp), %rdi
movl $0x122, %edx            # imm = 0x122
xorl %eax, %eax
callq 0xca73
leaq 0x941f(%rip), %rsi      # 0x2758b
leaq 0x9633(%rip), %rcx      # 0x277a6
leaq 0x95eb(%rip), %r8       # 0x27765
movq 0x10(%rsp), %rdi
movl $0x13f, %edx            # imm = 0x13F
jmp 0x1e15e
leaq 0x93fe(%rip), %rsi      # 0x2758b
leaq 0x9612(%rip), %rcx      # 0x277a6
leaq 0x95ca(%rip), %r8       # 0x27765
movq 0x10(%rsp), %rdi
movl $0x13b, %edx            # imm = 0x13B
jmp 0x1e15e
leaq 0x93dd(%rip), %rsi      # 0x2758b
leaq 0x95f1(%rip), %rcx      # 0x277a6
leaq 0x95a9(%rip), %r8       # 0x27765
movq 0x10(%rsp), %rdi
movl $0x135, %edx            # imm = 0x135
jmp 0x1e15e
leaq 0x93bc(%rip), %rsi      # 0x2758b
leaq 0x95e1(%rip), %rcx      # 0x277b7
leaq 0x9588(%rip), %r8       # 0x27765
movq 0x10(%rsp), %rdi
movl $0x145, %edx            # imm = 0x145
xorl %eax, %eax
callq 0xca73
movl %esi, %r8d
leaq 0x9393(%rip), %rsi      # 0x2758b
leaq 0x95cc(%rip), %rcx      # 0x277cb
movq %rbx, %rdi
movl $0x14a, %edx            # imm = 0x14A
xorl %eax, %eax
callq 0xca73
leaq 0x9376(%rip), %rsi      # 0x2758b
leaq 0x9562(%rip), %rcx      # 0x2777e
leaq 0x9542(%rip), %r8       # 0x27765
movq %rbx, %rdi
movl $0x114, %edx            # imm = 0x114
movl %ebp, %r9d
jmp 0x1e1e7