LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_string.c
// Function: dx_string_add
void dx_string_add(Dex* dx, char* str) {
  uint32_t index;

  if (dx == NULL || str == NULL) return;

  index = dx_string_find_index(dx,str);

  dx_string_add_stringid(dx,index);
  dx_string_add_stringdata(dx,index,str);
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
je 0x86b2
retq
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
callq 0x47f0
movl %eax, %ebp
movq %r14, %rdi
movl %eax, %esi
callq 0x42b0
movq %r14, %rdi
movl %ebp, %esi
movq %rbx, %rdx
popq %rbx
popq %r14
popq %rbp
jmp 0x4490
nop
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: add_shift
void add_shift(dx_shift* shift, uint32_t base, int32_t delta) {
  dx_shift* next;
  dx_shift* last;

  printf("Shift Added.\n");

  if (shift == NULL) return;

  next = (dx_shift*) malloc_s(sizeof(dx_shift));

  next->base = base;
  next->delta = delta;
  next->next = NULL;
  
  last = shift;
  while (last->next != NULL) last = last->next;
  
  last->next = next;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %edx, %ebp
movl %esi, %r14d
movq %rdi, %rbx
leaq 0x1afe(%rip), %rdi      # 0xa1f1
callq 0x40e0
testq %rbx, %rbx
je 0x8725
movl $0x10, %edi
callq 0x4600
movl %r14d, (%rax)
movl %ebp, 0x4(%rax)
movq $0x0, 0x8(%rax)
movq %rbx, %rcx
movq 0x8(%rbx), %rbx
testq %rbx, %rbx
jne 0x8715
movq %rax, 0x8(%rcx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_header
void dxo_header(DexHeaderItem* obj, dx_shift* shift) {
  UPDATE(obj->meta.offset);

  UPDATE(obj->link_off);
  UPDATE(obj->map_off);
  UPDATE(obj->string_ids_off);
  UPDATE(obj->type_ids_off);
  UPDATE(obj->proto_ids_off);
  UPDATE(obj->field_ids_off);
  UPDATE(obj->method_ids_off);
  UPDATE(obj->class_defs_off);
  UPDATE(obj->data_off);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8739
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x38(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8746
addl 0x4(%rsi), %ecx
movl %ecx, 0x38(%rdi)
movl 0x3c(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8753
addl 0x4(%rsi), %ecx
movl %ecx, 0x3c(%rdi)
movl 0x44(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8760
addl 0x4(%rsi), %ecx
movl %ecx, 0x44(%rdi)
movl 0x4c(%rdi), %ecx
cmpl %eax, %ecx
jb 0x876d
addl 0x4(%rsi), %ecx
movl %ecx, 0x4c(%rdi)
movl 0x54(%rdi), %ecx
cmpl %eax, %ecx
jb 0x877a
addl 0x4(%rsi), %ecx
movl %ecx, 0x54(%rdi)
movl 0x5c(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8787
addl 0x4(%rsi), %ecx
movl %ecx, 0x5c(%rdi)
movl 0x64(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8794
addl 0x4(%rsi), %ecx
movl %ecx, 0x64(%rdi)
movl 0x6c(%rdi), %ecx
cmpl %eax, %ecx
jb 0x87a1
addl 0x4(%rsi), %ecx
movl %ecx, 0x6c(%rdi)
movl 0x74(%rdi), %ecx
cmpl %eax, %ecx
jb 0x87ae
addl 0x4(%rsi), %ecx
movl %ecx, 0x74(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_classdef
void dxo_classdef(DexClassDefItem* obj, dx_shift* shift) {
  UPDATE(obj->meta.offset);

  UPDATE(obj->interfaces_off);
  UPDATE(obj->annotations_off);
  UPDATE(obj->class_data_off);
  UPDATE(obj->static_values_off);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8822
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x14(%rdi), %ecx
cmpl %eax, %ecx
jb 0x882f
addl 0x4(%rsi), %ecx
movl %ecx, 0x14(%rdi)
movl 0x1c(%rdi), %ecx
cmpl %eax, %ecx
jb 0x883c
addl 0x4(%rsi), %ecx
movl %ecx, 0x1c(%rdi)
movl 0x20(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8849
addl 0x4(%rsi), %ecx
movl %ecx, 0x20(%rdi)
movl 0x24(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8856
addl 0x4(%rsi), %ecx
movl %ecx, 0x24(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_encodedmethod
void dxo_encodedmethod(DexEncodedMethodItem* obj, dx_shift* shift) {
  size_t old_size;

  UPDATE(obj->meta.offset);
  
  old_size = obj->code_off.size;
  
  UPDATE_ULEB(obj->code_off);

  if (obj->code_off.size != old_size)
    add_shift(shift,obj->meta.offset + 1,obj->code_off.size - old_size);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x888e
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movl 0x28(%r14), %ebp
movq 0x20(%r14), %rdi
movl %ebp, %esi
callq 0x4170
cmpl (%rbx), %eax
jb 0x88bf
leaq 0x20(%r14), %r15
movq 0x20(%r14), %rdi
movl 0x28(%r14), %esi
callq 0x4170
addl 0x4(%rbx), %eax
movq %r15, %rdi
movl %eax, %esi
callq 0x4450
movl 0x28(%r14), %edx
subl %ebp, %edx
jne 0x88d2
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movl 0x4(%r14), %esi
incl %esi
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4230
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_classdata
void dxo_classdata(DexClassDataItem* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<ul128toui(obj->static_fields_size); i++)
    dxo_encodedfield(obj->static_fields[i],shift);

  for (i=0; i<ul128toui(obj->instance_fields_size); i++)
    dxo_encodedfield(obj->instance_fields[i],shift);

  for (i=0; i<ul128toui(obj->direct_methods_size); i++)
    dxo_encodedmethod(obj->direct_methods[i],shift);

  for (i=0; i<ul128toui(obj->virtual_methods_size); i++)
    dxo_encodedmethod(obj->virtual_methods[i],shift);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x8903
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x8943
xorl %r15d, %r15d
movq 0x38(%r14), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %ecx
cmpl (%rbx), %ecx
jb 0x892c
addl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
incq %r15
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8917
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x8983
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %ecx
cmpl (%rbx), %ecx
jb 0x896c
addl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
incq %r15
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8957
movq 0x20(%r14), %rdi
movl 0x28(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x89be
xorl %r15d, %r15d
movq 0x48(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x46b0
incq %r15
movq 0x20(%r14), %rdi
movl 0x28(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8997
movq 0x2c(%r14), %rdi
movl 0x34(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x89f9
xorl %r15d, %r15d
movq 0x50(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x46b0
incq %r15
movq 0x2c(%r14), %rdi
movl 0x34(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x89d2
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_typelist
void dxo_typelist(DexTypeList* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<obj->size; i++)
    dxo_typeitem(obj->list[i],shift);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8a1c
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x8a47
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
movl 0x4(%r8), %r9d
cmpl %eax, %r9d
jb 0x8a3f
addl 0x4(%rsi), %r9d
movl %r9d, 0x4(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x8a2a
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_encodedcatchhandler
void dxo_encodedcatchhandler(DexEncodedCatchHandler* obj, dx_shift* shift) {
  int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<abs(sl128toi(obj->size)); i++)
    dxo_encodedtypeaddrpair(obj->handlers[i],shift);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x8a7d
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x44e0
testl %eax, %eax
je 0x8ac2
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %ecx
cmpl (%rbx), %ecx
jb 0x8aa6
addl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
incq %r15
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x44e0
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
cmpq %rcx, %r15
jb 0x8a91
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_encodedcatchhandlerlist
void dxo_encodedcatchhandlerlist(DexEncodedCatchHandlerList* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<ul128toui(obj->size); i++)
    dxo_encodedcatchhandler(obj->list[i],shift);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x8ae1
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x8b1c
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x44f0
incq %r15
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8af5
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_codeitem
void dxo_codeitem(DexCodeItem* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  UPDATE(obj->debug_info_off);

  if (obj->tries_size > 0) {
    for (i=0; i<obj->tries_size; i++)
      dxo_tryitem(obj->tries[i],shift);

    dxo_encodedcatchhandlerlist(obj->handlers,shift);    
  }
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8b31
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x10(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8b3e
addl 0x4(%rsi), %ecx
movl %ecx, 0x10(%rdi)
movzwl 0xe(%rdi), %ecx
testq %rcx, %rcx
je 0x8b74
movq 0x28(%rdi), %rdx
xorl %r8d, %r8d
movq (%rdx,%r8,8), %r9
movl 0x4(%r9), %r10d
cmpl %eax, %r10d
jb 0x8b63
addl 0x4(%rsi), %r10d
movl %r10d, 0x4(%r9)
incq %r8
cmpq %r8, %rcx
jne 0x8b4e
movq 0x30(%rdi), %rdi
jmp 0x4070
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_maplist
void dxo_maplist(DexMapList* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<obj->size; i++)
    dxo_mapitem(obj->list[i],shift);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8baf
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x8beb
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
movl 0x4(%r8), %r9d
cmpl %eax, %r9d
jb 0x8bd2
addl 0x4(%rsi), %r9d
movl %r9d, 0x4(%r8)
movl 0x10(%r8), %r9d
cmpl %eax, %r9d
jb 0x8be3
addl 0x4(%rsi), %r9d
movl %r9d, 0x10(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x8bbd
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_encodedarray
void dxo_encodedarray(DexEncodedArray* obj, dx_shift* shift) {
  unsigned int i;
  
  UPDATE(obj->meta.offset);

  for (i=0; i<ul128toui(obj->size); i++)
    dxo_encodedvalue(obj->values[i],shift);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x8c36
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x8c71
xorl %r15d, %r15d
movq 0x18(%r14), %rax
movq (%rax,%r15,8), %rdi
movq %rbx, %rsi
callq 0x4180
incq %r15
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8c4a
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_encodedannotation
void dxo_encodedannotation(DexEncodedAnnotation* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<ul128toui(obj->size); i++)
    dxo_annotationelement(obj->elements[i],shift);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
movl 0x4(%rdi), %eax
cmpl (%rsi), %eax
jb 0x8c90
addl 0x4(%rbx), %eax
movl %eax, 0x4(%r14)
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x8cdc
xorl %r15d, %r15d
movq 0x20(%r14), %rax
movq (%rax,%r15,8), %rax
movl 0x4(%rax), %ecx
cmpl (%rbx), %ecx
jb 0x8cb9
addl 0x4(%rbx), %ecx
movl %ecx, 0x4(%rax)
movq 0x18(%rax), %rdi
movq %rbx, %rsi
callq 0x4180
incq %r15
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
movl %eax, %eax
cmpq %rax, %r15
jb 0x8ca4
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_annotationdirectoryitem
void dxo_annotationdirectoryitem(DexAnnotationDirectoryItem* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  UPDATE(obj->class_annotations_off);

  for (i=0; i<obj->fields_size; i++)
    dxo_fieldannotation(obj->field_annotations[i],shift);

  for (i=0; i<obj->annotated_methods_size; i++)
    dxo_methodannotation(obj->method_annotations[i],shift);
  
  for (i=0; i<obj->annotated_parameters_size; i++)
    dxo_parameterannotation(obj->parameter_annotations[i],shift);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8d5e
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rdi), %ecx
cmpl %eax, %ecx
jb 0x8d6b
addl 0x4(%rsi), %ecx
movl %ecx, 0x8(%rdi)
movl 0xc(%rdi), %ecx
testq %rcx, %rcx
je 0x8da8
movq 0x18(%rdi), %rdx
xorl %r8d, %r8d
movq (%rdx,%r8,8), %r9
movl 0x4(%r9), %r10d
cmpl %eax, %r10d
jb 0x8d8f
addl 0x4(%rsi), %r10d
movl %r10d, 0x4(%r9)
movl 0xc(%r9), %r10d
cmpl %eax, %r10d
jb 0x8da0
addl 0x4(%rsi), %r10d
movl %r10d, 0xc(%r9)
incq %r8
cmpq %r8, %rcx
jne 0x8d7a
movl 0x10(%rdi), %ecx
testq %rcx, %rcx
je 0x8de5
movq 0x20(%rdi), %rdx
xorl %r8d, %r8d
movq (%rdx,%r8,8), %r9
movl 0x4(%r9), %r10d
cmpl %eax, %r10d
jb 0x8dcc
addl 0x4(%rsi), %r10d
movl %r10d, 0x4(%r9)
movl 0xc(%r9), %r10d
cmpl %eax, %r10d
jb 0x8ddd
addl 0x4(%rsi), %r10d
movl %r10d, 0xc(%r9)
incq %r8
cmpq %r8, %rcx
jne 0x8db7
movl 0x14(%rdi), %ecx
testq %rcx, %rcx
je 0x8e21
movq 0x28(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
movl 0x4(%r8), %r9d
cmpl %eax, %r9d
jb 0x8e08
addl 0x4(%rsi), %r9d
movl %r9d, 0x4(%r8)
movl 0xc(%r8), %r9d
cmpl %eax, %r9d
jb 0x8e19
addl 0x4(%rsi), %r9d
movl %r9d, 0xc(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x8df3
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_annotationsetreflist
void dxo_annotationsetreflist(DexAnnotationSetRefList* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<obj->size; i++)
    dxo_annotationsetrefitem(obj->list[i],shift);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8e4e
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x8e8a
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
movl 0x4(%r8), %r9d
cmpl %eax, %r9d
jb 0x8e71
addl 0x4(%rsi), %r9d
movl %r9d, 0x4(%r8)
movl 0x8(%r8), %r9d
cmpl %eax, %r9d
jb 0x8e82
addl 0x4(%rsi), %r9d
movl %r9d, 0x8(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x8e5c
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_offset.c
// Function: dxo_annotationsetitem
void dxo_annotationsetitem(DexAnnotationSetItem* obj, dx_shift* shift) {
  unsigned int i;

  UPDATE(obj->meta.offset);

  for (i=0; i<obj->size; i++)
    dxo_annotationoffitem(obj->entries[i],shift);
}

// Assembly:
movl 0x4(%rdi), %ecx
movl (%rsi), %eax
cmpl %eax, %ecx
jb 0x8eb7
addl 0x4(%rsi), %ecx
movl %ecx, 0x4(%rdi)
movl 0x8(%rdi), %ecx
testq %rcx, %rcx
je 0x8ef3
movq 0x10(%rdi), %rdx
xorl %edi, %edi
movq (%rdx,%rdi,8), %r8
movl 0x4(%r8), %r9d
cmpl %eax, %r9d
jb 0x8eda
addl 0x4(%rsi), %r9d
movl %r9d, 0x4(%r8)
movl 0x8(%r8), %r9d
cmpl %eax, %r9d
jb 0x8eeb
addl 0x4(%rsi), %r9d
movl %r9d, 0x8(%r8)
incq %rdi
cmpq %rdi, %rcx
jne 0x8ec5
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_stringid.c
// Function: dxsi_debuginfo
void dxsi_debuginfo(DexDebugInfo* obj, dx_shift* shift) {
  unsigned int i;
  size_t old_size;

  for (i=0; i<ul128toui(obj->parameters_size); i++) {
    old_size = obj->parameter_names[i].size;

    UPDATE_ULEBP1(obj->parameter_names[i]);
    
    if (obj->parameter_names[i].size != old_size)
      add_shift(shift,obj->meta.offset + 1,obj->parameter_names[i].size - old_size);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movq 0x14(%rdi), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
testl %eax, %eax
je 0x93d3
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x20(%r14), %rax
movl 0x8(%rax,%r12), %ebp
movq (%rax,%r12), %rdi
movl %ebp, %esi
callq 0x44a0
cmpl (%rbx), %eax
jl 0x939d
movq 0x20(%r14), %rax
leaq (%rax,%r12), %r15
movq (%rax,%r12), %rdi
movl 0x8(%rax,%r12), %esi
callq 0x44a0
addl 0x4(%rbx), %eax
movq %r15, %rdi
movl %eax, %esi
callq 0x45f0
movq 0x20(%r14), %rax
movl 0x8(%rax,%r12), %edx
subl %ebp, %edx
je 0x93b8
movl 0x4(%r14), %esi
incl %esi
movq %rbx, %rdi
callq 0x4230
incq %r13
movq 0x14(%r14), %rdi
movl 0x1c(%r14), %esi
callq 0x4170
movl %eax, %eax
addq $0xc, %r12
cmpq %rax, %r13
jb 0x9362
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_stringid.c
// Function: dxsi_encodedvalue
void dxsi_encodedvalue(DexEncodedValue* obj, dx_shift* shift) {
  uint8_t value_type;

  value_type = (obj->argtype & 0x1f);
	       
  switch (value_type) {
  case 0x17:
    UPDATE(*((uint32_t*)obj->value));
    break;
  case 0x1C:
    dxsi_encodedarray((DexEncodedArray*) obj->value,shift);
    break;
  case 0x1d:
    dxsi_encodedannotation((DexEncodedAnnotation*)obj->value,shift);
    break;
  default:
    break;
  }
}

// Assembly:
movzbl 0x8(%rdi), %eax
andl $0x1f, %eax
cmpl $0x1d, %eax
je 0x9411
cmpl $0x1c, %eax
je 0x9408
cmpl $0x17, %eax
jne 0x9407
movq 0x10(%rdi), %rax
movl (%rax), %ecx
cmpl (%rsi), %ecx
jb 0x9407
addl 0x4(%rsi), %ecx
movl %ecx, (%rax)
retq
movq 0x10(%rdi), %rdi
jmp 0x42f0
movq 0x10(%rdi), %rdi
jmp 0x46d0
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/dex_stringid.c
// Function: dxsi_annotationelement
void dxsi_annotationelement(DexAnnotationElement* obj, dx_shift* shift) {
  size_t old_size;
 
  old_size = obj->name_idx.size;

  UPDATE_ULEB(obj->name_idx);
  
  if (obj->name_idx.size != old_size)
    add_shift(shift,obj->meta.offset + 1,obj->name_idx.size - old_size);

  dxsi_encodedvalue(obj->value,shift);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %ebp
movq 0x8(%rdi), %rdi
movl %ebp, %esi
callq 0x4170
cmpl (%rbx), %eax
jb 0x94ef
leaq 0x8(%r14), %r15
movq 0x8(%r14), %rdi
movl 0x10(%r14), %esi
callq 0x4170
addl 0x4(%rbx), %eax
movq %r15, %rdi
movl %eax, %esi
callq 0x4450
movl 0x10(%r14), %edx
subl %ebp, %edx
je 0x9505
movl 0x4(%r14), %esi
incl %esi
movq %rbx, %rdi
callq 0x4230
movq 0x18(%r14), %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
jmp 0x4680
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: l128size
unsigned int l128size(ByteStream* bs) {
  int32_t offset;
  unsigned int len = 0;
  uint8_t cbyte = 0x0;

  if (bs == NULL) return 0;

  offset = bs->offset;

  bsread(bs,&cbyte,1);

  if (!bs->exhausted) {
    len = 1;

    while (!bs->exhausted && len < 5 && (cbyte & 0x80) != 0x0) {
      len++;
      bsread(bs,&cbyte,1);
    }      
  }  
  
  bsseek(bs,offset);  

  return len;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movb $0x0, 0xf(%rsp)
testq %rdi, %rdi
je 0x975c
movq %rdi, %rbx
movl 0x18(%rdi), %ebp
leaq 0xf(%rsp), %rsi
movl $0x1, %edx
callq 0x4420
xorl %r14d, %r14d
cmpl $0x0, 0x1c(%rbx)
je 0x976f
movq %rbx, %rdi
movl %ebp, %esi
callq 0x4410
jmp 0x975f
xorl %r14d, %r14d
movl %r14d, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c(%rbx)
movl $0x1, %r14d
jne 0x9750
cmpb $0x0, 0xf(%rsp)
jns 0x9750
movl $0x1, %r12d
leaq 0xf(%rsp), %r15
leal 0x1(%r12), %r14d
movl $0x1, %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x4420
cmpl $0x0, 0x1c(%rbx)
jne 0x9750
cmpl $0x3, %r12d
ja 0x9750
cmpb $0x0, 0xf(%rsp)
movl %r14d, %r12d
js 0x978d
jmp 0x9750
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: l128read
int l128read(ByteStream* bs, leb128_t* leb) {
  unsigned int ret;

  if (bs == NULL || leb == NULL) return -1;

  leb->size = l128size(bs);

  ret = bsread(bs,leb->data,leb->size);

  return ret != leb->size;
}

// Assembly:
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jne 0x97ff
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4260
movl %eax, 0x8(%rbx)
movl %eax, %edx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x4420
movl %eax, %ecx
xorl %eax, %eax
cmpl 0x8(%rbx), %ecx
setne %al
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: ul128toui
uint32_t ul128toui(leb128_t uleb) {
  uint32_t val = 0;
  int i;
  
  for (i=uleb.size-1; i>=0; i--) {
    val = val * 128 + (uleb.data[i] & 0x7f);
  }  

  return val;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movl %esi, -0x8(%rsp)
decl %esi
js 0x98b4
movl %esi, %ecx
incq %rcx
xorl %eax, %eax
shll $0x7, %eax
movzbl -0x11(%rsp,%rcx), %edx
andl $0x7f, %edx
orl %edx, %eax
decq %rcx
jg 0x98a1
retq
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: sl128toi
int32_t sl128toi(leb128_t sleb) {
  int32_t val = 0;
  
  val = ul128toui(sleb);

  if ((sleb.size != 5) && (sleb.data[sleb.size-1] & 0x40) != 0) {
    val = val | ~((1 << (sleb.size*7))-1);
  }

  return val;
}

// Assembly:
movq %rdi, -0x20(%rsp)
movl %esi, -0x18(%rsp)
movq %rdi, -0x10(%rsp)
movl %esi, -0x8(%rsp)
movl %esi, %eax
decl %eax
movl %eax, %ecx
js 0x991c
leaq 0x1(%rcx), %rdx
xorl %eax, %eax
shll $0x7, %eax
movzbl -0x11(%rsp,%rdx), %edi
andl $0x7f, %edi
orl %edi, %eax
decq %rdx
jg 0x9908
jmp 0x991e
xorl %eax, %eax
cmpl $0x5, %esi
je 0x993c
testb $0x40, -0x20(%rsp,%rcx)
je 0x993c
leal (,%rsi,8), %ecx
subl %esi, %ecx
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
shll %cl, %edx
orl %edx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: uitoul128
void uitoul128(leb128_t* leb, uint32_t num) {
  unsigned int i;

  for (i=0; i<5; i++) {
    if (i == 4)
      leb->data[i] = num & 0x4f;
    else
      leb->data[i] = num & 0x7f;

    num /= 128;
    
    if (num == 0) break;

    leb->data[i] |= 0x80;
  }

  leb->size = i+1;
}

// Assembly:
xorl %eax, %eax
movl %esi, %ecx
cmpq $0x4, %rax
jne 0x994f
andb $0x4f, %cl
movb %cl, 0x4(%rdi)
jmp 0x9955
andb $0x7f, %cl
movb %cl, (%rdi,%rax)
cmpl $0x80, %esi
jb 0x9972
orb $-0x80, (%rdi,%rax)
shrl $0x7, %esi
incq %rax
cmpq $0x5, %rax
jne 0x993f
movl $0x5, %eax
incl %eax
movl %eax, 0x8(%rdi)
retq
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/leb128.c
// Function: itosl128
void itosl128(leb128_t* leb, int32_t num) {
  unsigned int i;

  leb->data[0] = ((num >> 00) & 0x7f) | 0x80;
  leb->data[1] = ((num >> 07) & 0x7f) | 0x80;
  leb->data[2] = ((num >> 14) & 0x7f) | 0x80;
  leb->data[3] = ((num >> 21) & 0x7f) | 0x80;
  leb->data[4] = ((num >> 28) & 0x4f) | 0x00;

  leb->size = 5;

  if (leb->data[4] == 0x00 || leb->data[4] == 0x4f) {
    leb->size--;

    for (i=3; i>0; i--) {
      if (leb->data[i] == 0x80 || leb->data[i] == 0xff)
	leb->size--;
      else 
	break;
    }
  }

  if (num > 0 && (leb->data[leb->size-1] & 0x40) != 0x0) {
    leb->size++;
  } 

  if (num < 0 && (leb->data[leb->size-1] & 0x40) == 0x0) {
    leb->size++;
  } 

  leb->data[leb->size-1] &= 0x7f;
}

// Assembly:
movl %esi, %eax
orb $-0x80, %al
movb %al, (%rdi)
movl %esi, %eax
shrl $0x7, %eax
orb $-0x80, %al
movb %al, 0x1(%rdi)
movl %esi, %eax
shrl $0xe, %eax
orb $-0x80, %al
movb %al, 0x2(%rdi)
movl %esi, %eax
shrl $0x15, %eax
orb $-0x80, %al
movb %al, 0x3(%rdi)
movl %esi, %eax
sarl $0x1c, %eax
movl %eax, %ecx
andb $0x4f, %cl
movb %cl, 0x4(%rdi)
movl $0x5, 0x8(%rdi)
andl $0x4f, %eax
cmpl $0x4f, %eax
je 0x99fb
testl %eax, %eax
jne 0x9a23
movl $0x4, 0x8(%rdi)
movl $0x3, %eax
movzbl (%rdi,%rax), %ecx
cmpl $0xff, %ecx
je 0x9a1b
cmpl $0x80, %ecx
jne 0x9a23
decl 0x8(%rdi)
decq %rax
jne 0x9a07
testl %esi, %esi
jle 0x9a38
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ecx
testb $0x40, (%rdi,%rcx)
je 0x9a38
incl %eax
movl %eax, 0x8(%rdi)
testl %esi, %esi
jns 0x9a4d
movl 0x8(%rdi), %eax
leal -0x1(%rax), %ecx
testb $0x40, (%rdi,%rcx)
jne 0x9a4d
incl %eax
movl %eax, 0x8(%rdi)
movl 0x8(%rdi), %eax
decl %eax
andb $0x7f, (%rdi,%rax)
retq
nop
// File: /workspace/github_c_makefile_star2_O1/rchiossi[P]dexterity/lib/malloc_s.c
// Function: malloc_s
void *malloc_s(size_t size) {
	if (!size)
		return NULL;

	void *new_mem = malloc(size);

	if (!new_mem) {
		fprintf(stderr, "fatal: memory exhausted (malloc of %zu bytes)\n", size);
		exit(-1);
	}

	return new_mem;
}

// Assembly:
pushq %rbx
testq %rdi, %rdi
je 0x9a73
movq %rdi, %rbx
callq 0x44b0
testq %rax, %rax
jne 0x9a75
movq %rbx, %rdi
callq 0x4850
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/vector.c
// Function: construct_vector
vector_t *construct_vector() {
    vector_t *vector = (vector_t*)calloc(1, sizeof(vector_t));
    vector->memory = 1;
    vector->size = 0;
    vector->elements = calloc(1, sizeof(void*));
    vector->remaining = 0;

    return vector;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x18, %esi
callq 0x3340
movq %rax, %rbx
movq $0x1, 0x8(%rax)
movl $0x1, %edi
movl $0x8, %esi
callq 0x3340
movq %rax, (%rbx)
movl $0x0, 0x10(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/vector.c
// Function: vector_iterator
void *vector_iterator(vector_t *vector) {
    if (!vector->remaining) {
        vector->remaining = vector->size;
        return NULL;
    }

    unsigned int index = (vector->size - vector->remaining);
    vector->remaining--;

    return get_from_vector(vector, index);
}

// Assembly:
movl 0xc(%rdi), %eax
movl 0x10(%rdi), %ecx
testl %ecx, %ecx
je 0x386d
leal -0x1(%rcx), %edx
movl %edx, 0x10(%rdi)
subl %ecx, %eax
jb 0x3870
movq (%rdi), %rcx
movq (%rcx,%rax,8), %rax
retq
movl %eax, 0x10(%rdi)
xorl %eax, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/vector.c
// Function: push_to_vector
void push_to_vector(vector_t *vector, void *data) {
    if (vector->size == vector->memory) {
        vector->memory *= 2;
        vector->elements = realloc(vector->elements,
            sizeof(void*) * (vector->memory + 1));
    }

    vector->elements[vector->size++] = (void*)data;
    vector->remaining++;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0x8(%rdi), %eax
cmpl %eax, 0xc(%rdi)
jne 0x38b6
addl %eax, %eax
movl %eax, 0x8(%rbx)
movq (%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x34a0
movq %rax, (%rbx)
movq (%rbx), %rax
movl 0xc(%rbx), %ecx
leal 0x1(%rcx), %edx
movl %edx, 0xc(%rbx)
movq %r14, (%rax,%rcx,8)
incl 0x10(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/vector.c
// Function: pull_from_vector
void pull_from_vector(vector_t *vector, unsigned int index) {
    if (index >= vector->size)
        return;

    for (; index < vector->size; index++)
        vector->elements[index] = vector->elements[index + 1];

    vector->elements[vector->size--] = NULL;
    vector->remaining--;

    if ((vector->size * 2) == vector->memory) {
        vector->memory /= 2;
        vector->elements = realloc(vector->elements,
            sizeof(void *) * (vector->memory + 1));
    }
}

// Assembly:
movl 0xc(%rdi), %eax
cmpl %esi, %eax
jbe 0x3931
pushq %rbx
movq %rdi, %rbx
movl %esi, %ecx
movq (%rbx), %rdx
movq 0x8(%rdx,%rcx,8), %rsi
movq %rsi, (%rdx,%rcx,8)
leaq 0x1(%rcx), %rdx
movq %rdx, %rcx
cmpq %rdx, %rax
jne 0x38de
movq (%rbx), %rcx
leal -0x1(%rax), %edx
movl %edx, 0xc(%rbx)
movq $0x0, (%rcx,%rax,8)
decl 0x10(%rbx)
leal -0x2(,%rax,2), %ecx
movl 0x8(%rbx), %eax
cmpl %eax, %ecx
jne 0x3930
shrl %eax
movl %eax, 0x8(%rbx)
movq (%rbx), %rdi
leaq 0x8(,%rax,8), %rsi
callq 0x34a0
movq %rax, (%rbx)
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/controller.c
// Function: controller
int controller(int argc, char** argv) {
    log_debug("Instance became controller");

    socket_mode = CONTROLLER;

    if (!initialize_socket())
        return EXIT_FAILURE;

    char* input_feed = calloc(1024, sizeof(char));

    for (int index = 2; index < argc; index++) {
        strcat(input_feed, argv[index]);
        input_feed[strlen(input_feed)] = '\31';
    }
    input_feed[strlen(input_feed) - 1] = '\0';

    write_to_socket(input_feed);
    free(input_feed);

    finalize_socket();

    return EXIT_SUCCESS;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x4683(%rip), %rsi      # 0x8006
leaq 0x46a1(%rip), %rdx      # 0x802b
leaq 0x468a(%rip), %r8       # 0x801b
movl $0x3, %edi
movl $0x12, %ecx
xorl %eax, %eax
callq 0x5206
leaq 0x8f13(%rip), %rax      # 0xc8bc
movl $0x1, (%rax)
callq 0x48d8
testw %ax, %ax
je 0x3a21
movl $0x400, %edi            # imm = 0x400
movl $0x1, %esi
callq 0x3340
movq %rax, %r14
cmpl $0x3, %ebp
jl 0x39fa
movl %ebp, %r15d
movl $0x2, %r12d
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
callq 0x35f0
movq %r14, %rdi
callq 0x31f0
movb $0x19, (%r14,%rax)
incq %r12
cmpq %r12, %r15
jne 0x39d9
movq %r14, %rdi
callq 0x31f0
movb $0x0, -0x1(%r14,%rax)
movq %r14, %rdi
callq 0x4aca
movq %r14, %rdi
callq 0x3060
callq 0x4a9a
xorl %eax, %eax
jmp 0x3a26
movl $0x1, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_process_input
void ipc_process_input(char *feed) {
    unsigned short update = 0;
    vector_t *input = construct_vector();

    char *token;
    while ((token = strsep(&feed, "\31")))
        push_to_vector(input, token);

    char *qualifier = vector_iterator(input);

    if (!strcmp(qualifier, "halt")) {
        custard_is_running = 0;
    } else if (!strcmp(qualifier, "configure"))
        ipc_command_configure(input, &update);
    else if (!strcmp(qualifier, "geometry"))
        ipc_command_geometry(input, &update);
    else if (!strcmp(qualifier, "match"))
        ipc_command_match(input, &update);
    else if (!strcmp(qualifier, "window"))
        ipc_command_window(input, &update);
    else if (!strcmp(qualifier, "workspace"))
        ipc_command_workspace(input, &update);
    else if (!strcmp(qualifier, "focus"))
        ipc_command_focus(input, &update);

    if (update) {
        apply();
        update = 0;
    }

    deconstruct_vector(input);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x8(%rsp), %r14
movq %rdi, (%r14)
movw $0x0, 0x6(%rsp)
callq 0x3818
movq %rax, %rbx
leaq 0x45df(%rip), %rsi      # 0x8036
movq %r14, %rdi
callq 0x3440
testq %rax, %rax
je 0x3a8b
leaq 0x45cb(%rip), %r14      # 0x8036
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %rax, %rsi
callq 0x388c
movq %r15, %rdi
movq %r14, %rsi
callq 0x3440
testq %rax, %rax
jne 0x3a70
movq %rbx, %rdi
callq 0x3851
movq %rax, %r14
leaq 0x459b(%rip), %rsi      # 0x8038
movq %rax, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b27
leaq 0x458d(%rip), %rsi      # 0x803d
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b35
leaq 0x4ed8(%rip), %rsi      # 0x899b
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b44
leaq 0x4571(%rip), %rsi      # 0x8047
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b4e
leaq 0x462b(%rip), %rsi      # 0x8114
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b58
leaq 0x4551(%rip), %rsi      # 0x804d
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
je 0x3b67
leaq 0x4548(%rip), %rsi      # 0x8057
movq %r14, %rdi
callq 0x3370
testl %eax, %eax
jne 0x3b74
leaq 0x6(%rsp), %rsi
callq 0x43a9
jmp 0x3b74
leaq 0x8da2(%rip), %rax      # 0xc8d0
movw $0x0, (%rax)
jmp 0x3b74
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x3b9a
jmp 0x3b74
movq %rbx, %rdi
callq 0x3c42
jmp 0x3b74
movq %rbx, %rdi
callq 0x3dd8
jmp 0x3b74
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x3e0b
jmp 0x3b74
leaq 0x6(%rsp), %rsi
movq %rbx, %rdi
callq 0x436d
cmpw $0x0, 0x6(%rsp)
je 0x3b88
callq 0x7451
movw $0x0, 0x6(%rsp)
movq %rbx, %rdi
callq 0x3932
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_configure
void ipc_command_configure(vector_t *input, unsigned short *screen_update) {
    /*
     * Usage:
     *  custard - configure ([configurable] [value])...
     */

    char *variable;
    char *value_string;
    kv_value_t *value = NULL;

    while (input->remaining) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        if (!(value = get_value_from_key(configuration, variable)))
            continue;

        ipc_helper_typecast_and_assign(value, variable, value_string);
    }

    if (!windows)
        return;

    window_t *window;
    while ((window = vector_iterator(windows))) {
        set_window_geometry(window, window->geometry);
        decorate(window);
    }

    *screen_update = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rsi, %rbx
cmpl $0x0, 0x10(%rdi)
je 0x3bf2
movq %rdi, %r14
leaq 0x8d0a(%rip), %r13      # 0xc8c0
movq %r14, %rdi
callq 0x3851
movq %rax, %r15
movq %r14, %rdi
callq 0x3851
movq %rax, %r12
movq (%r13), %rdi
movq %r15, %rsi
callq 0x4e15
testq %rax, %rax
je 0x3beb
movq %rax, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x44c9
cmpl $0x0, 0x10(%r14)
jne 0x3bb6
leaq 0x8cef(%rip), %r15      # 0xc8e8
cmpq $0x0, (%r15)
je 0x3c38
movq (%r15), %rdi
callq 0x3851
testq %rax, %rax
je 0x3c33
movq %rax, %r14
movq 0x8(%r14), %rsi
movq %r14, %rdi
callq 0x7087
movq %r14, %rdi
callq 0x58c3
movq (%r15), %rdi
callq 0x3851
movq %rax, %r14
testq %rax, %rax
jne 0x3c0f
movw $0x1, (%rbx)
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_match
void ipc_command_match(vector_t *input, unsigned short *screen_update) {
    suppress_unused(screen_update);

    if (input->size < 3) return;

    char *subject = vector_iterator(input);

    if (!strcmp(subject, "monitor"))
        ipc_sub_command_match_monitor(input);
    else
        ipc_sub_command_match_window(input);
}

// Assembly:
pushq %rbx
cmpl $0x3, 0xc(%rdi)
jae 0x3de1
popq %rbx
retq
movq %rdi, %rbx
callq 0x3851
leaq 0x43d9(%rip), %rsi      # 0x81c9
movq %rax, %rdi
callq 0x3370
movq %rbx, %rdi
testl %eax, %eax
je 0x3e05
popq %rbx
jmp 0x4671
popq %rbx
jmp 0x4592
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_workspace
void ipc_command_workspace(vector_t *input, unsigned short *screen_update) {
    monitor_t *monitor = monitor_with_cursor_residence();

    unsigned int workspace = string_to_integer(vector_iterator(input));
    if (workspace) {
        show_workspace_on_monitor(monitor, workspace);
    }

    *screen_update = 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r15
callq 0x69f2
movq %rax, %r14
movq %r15, %rdi
callq 0x3851
movq %rax, %rdi
callq 0x479c
testl %eax, %eax
je 0x439e
movq %r14, %rdi
movl %eax, %esi
callq 0x7218
movw $0x1, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_command_focus
void ipc_command_focus(vector_t *input, unsigned short *screen_update) {
    suppress_unused(input);

    unsigned short passed = 0;

    monitor_t *monitor = monitor_with_cursor_residence();

    window_t *window;
    while ((window = vector_iterator(windows))) {
        if (window->workspace != monitor->workspace)
            continue;

        if (window->id == focused_window) {
            if (passed)
                return; // only one window

            if (!windows->remaining)
                reset_vector_iterator(windows);

            passed = 1;
            continue;
        }

        if (passed) {
            reset_vector_iterator(windows);
            /* Focus on this window */
            xcb_window_t previous_window = focused_window;
            focused_window = window->id;

            xcb_ungrab_button(xcb_connection,
                XCB_BUTTON_INDEX_ANY, window->id, XCB_MOD_MASK_ANY);
            raise_window(window->parent);
            decorate(window);
            focus_window(window->id);

            if (previous_window != XCB_WINDOW_NONE) {
                window = get_window_by_id(previous_window);
                xcb_grab_button(xcb_connection, 0, previous_window,
                    XCB_EVENT_MASK_BUTTON_PRESS,
                    XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
                    XCB_NONE, XCB_NONE,
                    XCB_BUTTON_INDEX_ANY ^ \
                        XCB_BUTTON_INDEX_4 ^ XCB_BUTTON_INDEX_5,
                    XCB_MOD_MASK_ANY);
                decorate(window);
            }

            *screen_update = 1;
            return;
        }
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, (%rsp)
movb $0x1, %bpl
callq 0x69f2
movq %rax, %r14
leaq 0x851e(%rip), %r13      # 0xc8e8
leaq 0x851f(%rip), %r12      # 0xc8f0
movq (%r13), %rdi
callq 0x3851
testq %rax, %rax
je 0x44ba
movq %rax, %r15
movl 0x24(%rax), %eax
cmpl 0x20(%r14), %eax
jne 0x43d1
movl (%r15), %eax
cmpl (%r12), %eax
setne %bl
je 0x4405
testb $0x1, %bpl
movl %ebx, %ebp
jne 0x43d1
jmp 0x4424
testb $0x1, %bpl
je 0x44ba
movq (%r13), %rdi
cmpl $0x0, 0x10(%rdi)
movl %ebx, %ebp
jne 0x43d1
callq 0x3885
movl %ebx, %ebp
jmp 0x43d1
movq (%r13), %rdi
callq 0x3885
movl (%r12), %ebp
movl (%r15), %eax
movl %eax, (%r12)
leaq 0x84b9(%rip), %r13      # 0xc8f8
movq (%r13), %rdi
movl (%r15), %edx
xorl %r12d, %r12d
xorl %esi, %esi
movl $0x8000, %ecx           # imm = 0x8000
callq 0x3500
movl 0x4(%r15), %edi
callq 0x77ea
movq %r15, %rdi
callq 0x58c3
movl (%r15), %edi
callq 0x7750
testl %ebp, %ebp
je 0x44b1
movl %ebp, %edi
callq 0x6d63
movq %rax, %r14
movq (%r13), %rdi
xorl %esi, %esi
movl %ebp, %edx
movl $0x4, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq $0x8000                 # imm = 0x8000
pushq $0x1
pushq %r12
pushq %r12
callq 0x3360
addq $0x20, %rsp
movq %r14, %rdi
callq 0x58c3
movq (%rsp), %rax
movw $0x1, (%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_helper_typecast_and_assign
void ipc_helper_typecast_and_assign(kv_value_t *kv_value, char *variable,
    char *input) {

    // Assign all color values

    if (!strcmp(variable, "border.color.focused") ||
        !strcmp(variable, "border.color.unfocused") ||
        !strcmp(variable, "border.color.background")) {
        kv_value->color = string_to_color(input);
        return;
    }

    // Assign all boolean values

    if (!strcmp(variable, "border.colors.flipped")) {
        kv_value->boolean = string_to_boolean(input);
        return;
    }

    // Assign all string values

    if (!strcmp(variable, "geometry") ||
        !strcmp(variable, "monitor")) {
        kv_value->string = (char*)calloc(1, sizeof(char));
        strcpy(kv_value->string, input);
        return;
    }

    // If all else fails, it's an integer

    kv_value->number = string_to_integer(input);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
leaq 0x3b7f(%rip), %rsi      # 0x805d
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4553
leaq 0x3b81(%rip), %rsi      # 0x8072
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4553
leaq 0x3b85(%rip), %rsi      # 0x8089
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4553
leaq 0x3b8a(%rip), %rsi      # 0x80a1
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4585
leaq 0x4471(%rip), %rsi      # 0x899b
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4563
leaq 0x3c8c(%rip), %rsi      # 0x81c9
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x4563
movq %r14, %rdi
callq 0x479c
jmp 0x455b
movq %r14, %rdi
callq 0x47a1
movl %eax, (%rbx)
popq %rbx
popq %r14
popq %r15
retq
movl $0x1, %edi
movl $0x1, %esi
callq 0x3340
movq %rax, (%rbx)
movq %rax, %rdi
movq %r14, %rsi
popq %rbx
popq %r14
popq %r15
jmp 0x30e0
movq %r14, %rdi
callq 0x4768
movw %ax, (%rbx)
jmp 0x455d
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_sub_command_match_monitor
void ipc_sub_command_match_monitor(vector_t *input) {
    char *monitor_name = vector_iterator(input);
    monitor_t *monitor = monitor_from_name(monitor_name);

    if (!monitor)
        return;

    if (!monitor->configuration)
        monitor->configuration = construct_vector();

    char *configurables[7] = {
        "grid.rows,"
        "grid.columns",
        "grid.margins",
        "grid.margin.top",
        "grid.margin.bottom",
        "grid.margin.left",
        "grid.margin.right"
    };
    unsigned int index = 0;
    kv_pair_t *setting;

    char *variable;
    char *value_string;

    while (input->remaining) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        log_debug("%s = %s", variable, value_string);

        for (index = 0; index < 7;) {
            if (!strcmp(configurables[index++], variable)) {
                setting = create_or_get_kv_pair(monitor->configuration,
                    variable);
                setting->value->number = string_to_integer(value_string);
                break;
            }
        }
    }

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
callq 0x3851
movq %rax, %rdi
callq 0x69ad
testq %rax, %rax
je 0x4662
movq %rax, %r14
cmpq $0x0, 0x18(%rax)
jne 0x45c9
callq 0x3818
movq %rax, 0x18(%r14)
cmpl $0x0, 0x10(%rbx)
je 0x4662
leaq 0x7766(%rip), %r12      # 0xbd40
movq %rbx, %rdi
callq 0x3851
movq %rax, %rbp
movq %rbx, %rdi
callq 0x3851
movq %rax, %r15
movq %rax, (%rsp)
movl $0x3, %edi
leaq 0x3afa(%rip), %rsi      # 0x80fa
leaq 0x3bac(%rip), %rdx      # 0x81b3
movl $0x1ec, %ecx            # imm = 0x1EC
leaq 0x3bbe(%rip), %r8       # 0x81d1
movq %rbp, %r9
xorl %eax, %eax
callq 0x5206
xorl %r13d, %r13d
cmpq $0x38, %r13
je 0x4658
movq (%r13,%r12), %rdi
movq %rbp, %rsi
callq 0x3370
addq $0x8, %r13
testl %eax, %eax
jne 0x4620
movq 0x18(%r14), %rdi
movq %rbp, %rsi
callq 0x4d5b
movq %rax, %rbp
movq %r15, %rdi
callq 0x479c
movq 0x8(%rbp), %rcx
movl %eax, (%rcx)
cmpl $0x0, 0x10(%rbx)
jne 0x45da
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/comfies[P]custard/src/ipc/ipc.c
// Function: ipc_sub_command_match_window
void ipc_sub_command_match_window(vector_t *input) {
    /*
     * Usage:
     *  custard - match window.name [expression] ([configurable] [value])...
     * custard - match window.class [expression] ([configurable] [value])...
     */

    input->remaining++;
    char *subject = vector_iterator(input);
    char *expression = vector_iterator(input);

    window_attribute_t attribute;

    if (!strcmp(subject, "window.name"))
        attribute = name;
    else if (!strcmp(subject, "window.class"))
        attribute = class;
    else return;

    rule_t *rule = create_or_get_rule(attribute, expression);
    if (!rule->rules)
        rule->rules = construct_vector();

    char *configurables[10] = {
        "borders",
        "border.size.outer",
        "border.size.inner",
        "border.color.focused",
        "border.color.unfocused",
        "border.color.background",
        "border.colors.flipped",
        "geometry",
        "monitor",
        "workspace"
    };
    unsigned int index = 0;
    kv_pair_t *setting;

    char *variable;
    char *value_string;

    while (input->remaining > 0) {
        variable = vector_iterator(input);
        value_string = vector_iterator(input);

        for (index = 0; index < 10;) {
            if (!strcmp(configurables[index++], variable)) {
                setting = create_or_get_kv_pair(rule->rules, variable);
                ipc_helper_typecast_and_assign(setting->value,
                    variable, value_string);
                break;
            }
        }
    }

    add_rule(rule);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
incl 0x10(%rdi)
callq 0x3851
movq %rax, %r15
movq %rbx, %rdi
callq 0x3851
movq %rax, %r14
leaq 0x3b3d(%rip), %rsi      # 0x81d9
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x46ca
leaq 0x3b36(%rip), %rsi      # 0x81e5
movq %r15, %rdi
callq 0x3370
testl %eax, %eax
je 0x46ce
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
xorl %edi, %edi
jmp 0x46d3
movl $0x1, %edi
movq %r14, %rsi
callq 0x6aac
movq %rax, %r14
cmpq $0x0, 0x10(%rax)
jne 0x46ee
callq 0x3818
movq %rax, 0x10(%r14)
cmpl $0x0, 0x10(%rbx)
je 0x4752
leaq 0x3b25(%rip), %r13      # 0x8220
movq %rbx, %rdi
callq 0x3851
movq %rax, %r15
movq %rbx, %rdi
callq 0x3851
movq %rax, %r12
xorl %ebp, %ebp
cmpq $0x28, %rbp
je 0x474c
movslq (%rbp,%r13), %rdi
addq %r13, %rdi
movq %r15, %rsi
callq 0x3370
addq $0x4, %rbp
testl %eax, %eax
jne 0x4713
movq 0x10(%r14), %rdi
movq %r15, %rsi
callq 0x4d5b
movq 0x8(%rax), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x44c9
cmpl $0x0, 0x10(%rbx)
jne 0x46fb
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6b4f