// File: /workspace/github_c_makefile_star2_O0/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
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 0x81e6
cmpq $0x0, -0x18(%rbp)
jne 0x81f2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8450
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x5b90
movq -0x10(%rbp), %rdi
callq 0x6940
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x28b0
movl %eax, -0x38(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x822b
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x8450
leaq -0x60(%rbp), %rdi
leaq 0x1909(%rip), %rsi      # 0x9b3f
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 -0x38(%rbp), %ecx
movb %al, -0x209(%rbp)
jge 0x8279
cmpl $0x1f, -0x28(%rbp)
setl %al
movb %al, -0x209(%rbp)
movb -0x209(%rbp), %al
testb $0x1, %al
jne 0x8288
jmp 0x8425
movq -0x20(%rbp), %rdi
movl -0x24(%rbp), %esi
callq 0x28e0
movq %rax, -0x208(%rbp)
cmpq $0x0, -0x208(%rbp)
jne 0x82d5
movq -0x200(%rbp), %rax
movq %rax, -0x1f8(%rbp)
cmpq $0x0, -0x1f8(%rbp)
je 0x82c9
movq -0x1f8(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
jmp 0x8450
leaq -0x1f0(%rbp), %rax
movq %rax, -0x218(%rbp)
movq -0x208(%rbp), %rdi
callq 0x4c00
movq -0x218(%rbp), %rdi
movq %rax, %rsi
callq 0x1040
movq -0x208(%rbp), %rdi
callq 0x4ed0
movl %eax, -0x30(%rbp)
movl $0x190, %edi            # imm = 0x190
callq 0x1130
movq %rax, -0x1f8(%rbp)
movq -0x1f8(%rbp), %rdi
movl -0x24(%rbp), %edx
movl -0x30(%rbp), %ecx
leaq -0x1f0(%rbp), %r8
leaq 0x1810(%rip), %rsi      # 0x9b49
movb $0x0, %al
callq 0x11a0
movq -0x1f8(%rbp), %rdi
callq 0x1070
movl %eax, -0x34(%rbp)
movq -0x1f8(%rbp), %rax
movq %rax, -0x200(%rbp)
cmpl $0x28, -0x34(%rbp)
jle 0x83f0
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %ecx
xorl %eax, %eax
cmpl -0x34(%rbp), %ecx
movb %al, -0x219(%rbp)
jge 0x838b
cmpl $0x1f, -0x28(%rbp)
setl %al
movb %al, -0x219(%rbp)
movb -0x219(%rbp), %al
testb $0x1, %al
jne 0x8397
jmp 0x83ee
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 0x836e
jmp 0x8415
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 0x8417
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x825c
movq -0x200(%rbp), %rax
movq %rax, -0x1f8(%rbp)
cmpq $0x0, -0x1f8(%rbp)
je 0x8449
movq -0x1f8(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x220, %rsp            # imm = 0x220
popq %rbp
retq
nopl (%rax)