// File: /workspace/github_c_makefile_star2_O2/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
pushq $-0x1
popq %rbp
orb %al, %cl
jne 0x53d3
movq %rsi, %rbx
movq %rdi, %r14
movq 0x10(%rsi), %rdi
callq 0x3c71
movq %r14, %rdi
callq 0x42ed
movq %rax, %r12
movq %rax, %rdi
callq 0x21fe
movl %eax, 0x8(%rsp)
testq %r12, %r12
je 0x53d3
movabsq $0x3a50204f20482053, %rax # imm = 0x3A50204F20482053
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
movw $0x20, 0x8(%rcx)
movq 0x10(%rbx), %rdi
pushq $0x2
popq %rdx
xorl %esi, %esi
callq 0x3d9a
pushq $0x1
popq %r13
xorl %r15d, %r15d
movq %r12, (%rsp)
cmpl 0x8(%rsp), %r15d
jge 0x53c9
cmpl $0x1e, %r13d
jg 0x53c9
movq %r12, %rdi
movl %r15d, %esi
callq 0x220b
testq %rax, %rax
je 0x53c9
movq %rax, %rbp
movq %rax, %rdi
callq 0x374d
movl %r15d, %r12d
leaq 0x40(%rsp), %r15
movq %r15, %rdi
movq %rax, %rsi
callq 0x1050
movq %rbp, %rdi
callq 0x37ff
movl %eax, %ebp
movl $0x190, %edi            # imm = 0x190
callq 0x1130
movq %rax, %r14
movq %rax, %rdi
leaq 0x1812(%rip), %rsi      # 0x6b3d
movl %r12d, 0xc(%rsp)
movl %r12d, %edx
movl %ebp, %ecx
movq %r15, %r8
xorl %eax, %eax
callq 0x11b0
movq %r14, %rdi
callq 0x1080
movq %rax, %rbp
cmpl $0x29, %ebp
jl 0x53a3
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
xorl %r15d, %r15d
pushq $0x2
popq %r12
cmpq %rbp, %r15
jae 0x53b8
cmpl $0x1e, %r13d
jg 0x53b8
movq 0x20(%r14,%r15), %rax
movq %rax, 0x30(%rsp)
movups (%r14,%r15), %xmm0
movups 0x10(%r14,%r15), %xmm1
movaps %xmm1, 0x20(%rsp)
movaps %xmm0, 0x10(%rsp)
movq 0x10(%rbx), %rdi
movl %r13d, %esi
movl %r12d, %edx
leaq 0x10(%rsp), %rcx
callq 0x3d9a
addq $0x28, %r15
incl %r13d
jmp 0x535c
movq 0x10(%rbx), %rdi
movl %r13d, %esi
pushq $0x2
popq %rdx
movq %r14, %rcx
callq 0x3d9a
incl %r13d
movq (%rsp), %r12
movl 0xc(%rsp), %r15d
incl %r15d
jmp 0x52c3
movq %r14, %rdi
callq 0x1030
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq