// File: /workspace/github_c_makefile_star2_O0/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printInventory
int interface_printInventory(Interact *interact, Interface *interface){
  Inventory *aux;
  int i=0,linenumber=1,j=0,len,max;
  char line[STAT_LINE],prename[STAT_LINE*10],*name,*ini;
  Object *o;
  if(!interact||!interface) return -1;
  aux = interact_getInventory(interact);
  if(!aux) return -1;
  win_cls(interface->stats);
  max = inventory_getMax(aux);
  sprintf(line,"I N V E N T O R Y:");
  win_write_line_at(interface->stats,0,2,line);
  for(i=0;i<max && linenumber<STATY;i++){
    o = inventory_get(aux,i);
    if(!o){
        name = ini;
        if(name) free(name);
        return 0;
    }
    strcpy(prename,object_getName(o));
    name=(char*)malloc(STAT_LINE*10);
    sprintf(name,"%d: %s",i,prename);
    len = strlen(name);
    ini=name;
    if(len>STAT_LINE){
    j=0;
    while(j<len && linenumber<STATY){
      name = ini + j;
      memcpy(line,name,STAT_LINE);
      win_write_line_at(interface->stats,linenumber,2,line);
      j+=STAT_LINE;
      linenumber++;
    }
    }
    else{
      win_write_line_at(interface->stats,linenumber,2,name);
      linenumber++;
    }
  }
  name=ini;
  if(name)free(name);
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x220, %rsp            # imm = 0x220
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x1, -0x28(%rbp)
movl $0x0, -0x2c(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x7f46
cmpq $0x0, -0x18(%rbp)
jne 0x7f52
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x819e
movq -0x10(%rbp), %rdi
callq 0x6910
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x7f72
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x819e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5b90
movq -0x20(%rbp), %rdi
callq 0x28b0
movl %eax, -0x34(%rbp)
leaq -0x60(%rbp), %rdi
leaq 0x1b8f(%rip), %rsi      # 0x9b25
movb $0x0, %al
callq 0x11a0
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
leaq -0x60(%rbp), %rcx
xorl %esi, %esi
movl $0x2, %edx
callq 0x5dd0
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x34(%rbp), %ecx
movb %al, -0x209(%rbp)
jge 0x7fd9
cmpl $0x1f, -0x28(%rbp)
setl %al
movb %al, -0x209(%rbp)
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x7fe8
jmp 0x8173
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x28e0
movq %rax, -0x208(%rbp)
cmpq $0x0, -0x208(%rbp)
jne 0x8035
movq -0x200(%rbp), %rax
movq %rax, -0x1f8(%rbp)
cmpq $0x0, -0x1f8(%rbp)
je 0x8029
movq -0x1f8(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
jmp 0x819e
leaq -0x1f0(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x208(%rbp), %rdi
callq 0x4c00
movq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0x1040
movl $0x190, %edi            # imm = 0x190
callq 0x1130
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
movl -0x24(%rbp), %edx
leaq -0x1f0(%rbp), %rcx
leaq 0x1ab1(%rip), %rsi      # 0x9b38
movb $0x0, %al
callq 0x11a0
movq -0x1f8(%rbp), %rdi
callq 0x1070
movl %eax, -0x30(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x200(%rbp)
cmpl $0x28, -0x30(%rbp)
jle 0x813e
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x30(%rbp), %ecx
movb %al, -0x219(%rbp)
jge 0x80d9
cmpl $0x1f, -0x28(%rbp)
setl %al
movb %al, -0x219(%rbp)
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x80e5
jmp 0x813c
movq -0x200(%rbp), %rax
movslq -0x2c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x1f8(%rbp)
leaq -0x60(%rbp), %rdi
movq -0x1f8(%rbp), %rsi
movl $0x28, %edx
callq 0x1100
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x28(%rbp), %esi
leaq -0x60(%rbp), %rcx
movl $0x2, %edx
callq 0x5dd0
movl -0x2c(%rbp), %eax
addl $0x28, %eax
movl %eax, -0x2c(%rbp)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x80bc
jmp 0x8163
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
movl -0x28(%rbp), %esi
movq -0x1f8(%rbp), %rcx
movl $0x2, %edx
callq 0x5dd0
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x8165
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x7fbc
movq -0x200(%rbp), %rax
movq %rax, -0x1f8(%rbp)
cmpq $0x0, -0x1f8(%rbp)
je 0x8197
movq -0x1f8(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopw (%rax,%rax)