// File: /workspace/github_c_makefile_star2_O1/rafa9811[P]theIndiependenceGame/interface.c
// Function: interface_printShop
int interface_printShop(Interact *interact, Interface *interface){
  Inventory *aux;
  int i=0,linenumber=1,j=0,price,len,max;
  char line[STAT_LINE],prename[STAT_LINE*10],*name,*ini;
  Object *o;
  if(!interact||!interface) return -1;
  win_cls(interface->stats);
  aux = interact_getShop(interact);
  max = inventory_getMax(aux);
  if(!aux) return -1;
  sprintf(line,"S H O P: ");
  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));
    price = object_getMoney(o);
    name=(char*)malloc(STAT_LINE*10);
    sprintf(name,"%d (%d Ç): %s",i,price,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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
orb %al, %cl
jne 0x5817
movq %rsi, %r14
movq %rdi, %rbx
movq 0x10(%rsi), %rdi
callq 0x3f6e
movq %rbx, %rdi
callq 0x461a
movq %rax, %rbx
movq %rax, %rdi
callq 0x2350
movq %rbx, 0x8(%rsp)
testq %rbx, %rbx
je 0x5817
movl %eax, %r13d
movabsq $0x3a50204f20482053, %rax # imm = 0x3A50204F20482053
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movw $0x20, 0x8(%rcx)
movq 0x10(%r14), %rdi
xorl %ebp, %ebp
xorl %esi, %esi
movl $0x2, %edx
callq 0x4081
testl %r13d, %r13d
jle 0x57f8
movq 0x8(%rsp), %rdi
xorl %esi, %esi
callq 0x235f
testq %rax, %rax
je 0x57fa
movq %rax, %r15
movl $0x1, %ebp
xorl %ebx, %ebx
movl %r13d, (%rsp)
movq %r15, %rdi
callq 0x3960
movl %ebx, %r13d
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movq %rax, %rsi
callq 0x1050
movq %r15, %rdi
callq 0x3a20
movl %eax, %r15d
movl $0x190, %edi            # imm = 0x190
callq 0x1130
movq %rax, %r12
movq %rax, %rdi
leaq 0x1400(%rip), %rsi      # 0x6b3d
movl %r13d, 0x4(%rsp)
movl %r13d, %edx
movl %r15d, %ecx
movq %rbx, %r8
xorl %eax, %eax
callq 0x11a0
movq %r12, %rdi
callq 0x1080
movq %rax, %r15
cmpl $0x29, %r15d
jl 0x57b5
xorl %ebx, %ebx
movl %ebp, %r13d
movq 0x20(%r12,%rbx), %rax
movq %rax, 0x30(%rsp)
movups (%r12,%rbx), %xmm0
movups 0x10(%r12,%rbx), %xmm1
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x10(%r14), %rdi
movl %r13d, %esi
movl $0x2, %edx
leaq 0x10(%rsp), %rcx
callq 0x4081
addq $0x28, %rbx
leal 0x1(%r13), %ebp
cmpl %r15d, %ebx
jge 0x57ca
cmpl $0x1e, %r13d
movl %ebp, %r13d
jl 0x5768
jmp 0x57ca
movq 0x10(%r14), %rdi
movl %ebp, %esi
movl $0x2, %edx
movq %r12, %rcx
callq 0x4081
incl %ebp
movl 0x4(%rsp), %ebx
incl %ebx
movl (%rsp), %r13d
cmpl %r13d, %ebx
jge 0x5808
cmpl $0x1f, %ebp
jge 0x5808
movq 0x8(%rsp), %rdi
movl %ebx, %esi
callq 0x235f
movq %rax, %r15
testq %rax, %rax
jne 0x5700
jmp 0x57fa
jmp 0x580a
testq %r12, %r12
movl $0x0, %ebp
jne 0x580f
xorl %ebp, %ebp
jmp 0x5817
xorl %ebp, %ebp
testq %r12, %r12
je 0x5817
movq %r12, %rdi
callq 0x1030
movl %ebp, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq