// File: /workspace/github_c_makefile_star2_O2/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
cmpl $0x3, %esi
jne 0x1a0bf
movl %edx, %ebp
cmpl $0x2, %edx
jbe 0x1a0df
movq %rcx, %r13
pushq $0x1
popq %rdi
pushq $0x20
popq %rsi
callq 0x32f0
movq %rax, %r15
leaq 0x148(%rbx), %rax
movq %rbx, 0x8(%rsp)
movq 0x148(%rbx), %rcx
movq %rcx, (%r15)
testq %rcx, %rcx
je 0x19f07
movq %r15, 0x8(%rcx)
movq %r15, (%rax)
movq %rax, 0x8(%r15)
movdqu (%r13), %xmm0
pshufd $0xe8, %xmm0, %xmm0     # xmm0 = xmm0[0,2,2,3]
movq %xmm0, 0x10(%r15)
addq $0x10, %r13
leaq 0x10(%rsp), %r12
movq %r13, (%r12)
addl $-0x2, %ebp
leaq 0x597a(%rip), %r14      # 0x1f8b0
leaq 0x4(%rsp), %r13
testl %ebp, %ebp
je 0x1a001
movq 0x10(%rsp), %rax
movq (%rax), %r9
leaq 0x8(%rax), %rcx
movq %rcx, 0x10(%rsp)
movl %ebp, %ecx
decl %ecx
movl %ecx, 0x4(%rsp)
je 0x1a010
cmpl $0x4, %r9d
ja 0x1a099
movl %r9d, %ecx
movslq (%r14,%rcx,4), %rcx
addq %r14, %rcx
jmpq *%rcx
movb 0x8(%rax), %cl
pushq $0x1
popq %rdx
shlq %cl, %rdx
orq %rdx, 0x18(%r15)
addq $0x10, %rax
movq %rax, 0x10(%rsp)
addl $-0x2, %ebp
jmp 0x19ff4
movq %r13, %rdi
movq %r12, %rsi
callq 0x1b619
testq %rax, %rax
je 0x1a078
movq %rax, %rdi
jmp 0x19fe1
movq %r13, %rdi
movq %r12, %rsi
callq 0x1b619
testq %rax, %rax
je 0x1a057
movq %rax, %rbp
movq %r13, %rdi
movq %r12, %rsi
callq 0x1b619
movq %rax, %rbx
movq %rbp, %rdi
callq 0x3030
testq %rbx, %rbx
je 0x1a036
movq %rbx, %rdi
callq 0x3030
jmp 0x19ff8
addq $0x18, %rax
movq %rax, 0x10(%rsp)
addl $-0x3, %ebp
movl %ebp, 0x4(%rsp)
movl 0x4(%rsp), %ebp
jmp 0x19f3b
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x8729(%rip), %rsi      # 0x22740
leaq 0x892c(%rip), %rcx      # 0x2294a
leaq 0x88f5(%rip), %r8       # 0x2291a
movq 0x8(%rsp), %rdi
movl $0x122, %edx            # imm = 0x122
xorl %eax, %eax
callq 0xbed2
leaq 0x8703(%rip), %rsi      # 0x22740
leaq 0x8917(%rip), %rcx      # 0x2295b
leaq 0x88cf(%rip), %r8       # 0x2291a
movq 0x8(%rsp), %rdi
movl $0x13f, %edx            # imm = 0x13F
jmp 0x1a02f
leaq 0x86e2(%rip), %rsi      # 0x22740
leaq 0x88f6(%rip), %rcx      # 0x2295b
leaq 0x88ae(%rip), %r8       # 0x2291a
movq 0x8(%rsp), %rdi
movl $0x13b, %edx            # imm = 0x13B
jmp 0x1a02f
leaq 0x86c1(%rip), %rsi      # 0x22740
leaq 0x88d5(%rip), %rcx      # 0x2295b
leaq 0x888d(%rip), %r8       # 0x2291a
movq 0x8(%rsp), %rdi
movl $0x135, %edx            # imm = 0x135
jmp 0x1a02f
leaq 0x86a0(%rip), %rsi      # 0x22740
leaq 0x88c5(%rip), %rcx      # 0x2296c
leaq 0x886c(%rip), %r8       # 0x2291a
movq 0x8(%rsp), %rdi
movl $0x145, %edx            # imm = 0x145
xorl %eax, %eax
callq 0xbed2
movl %esi, %r8d
leaq 0x8677(%rip), %rsi      # 0x22740
leaq 0x88b0(%rip), %rcx      # 0x22980
movq %rbx, %rdi
movl $0x14a, %edx            # imm = 0x14A
xorl %eax, %eax
callq 0xbed2
leaq 0x865a(%rip), %rsi      # 0x22740
leaq 0x8846(%rip), %rcx      # 0x22933
leaq 0x8826(%rip), %r8       # 0x2291a
movq %rbx, %rdi
movl $0x114, %edx            # imm = 0x114
movl %ebp, %r9d
jmp 0x1a0b8