// File: /workspace/github_c_makefile_star2_O0/evanwire[P]GitClone/client.c
// Function: destroy
void destroy(char* projectName){
  //Prepare message to server
  int i;
  char to_be_written[strlen(projectName) + 3];
  memset(to_be_written, 0, sizeof(to_be_written));
  to_be_written[0] = 'd';
  to_be_written[1] = ' ';
  int message_idx = 2;
  for(i = 0; i < strlen(projectName); i++){
    if(projectName[i]){
      to_be_written[message_idx] = projectName[i];
      message_idx++;
    }
  }
  printf("\nWritten to server: -%s- Size: %d passed in: -%s-\n", to_be_written, sizeof(to_be_written), projectName);

  //Connect to server, store the response
  char* response = connect_to_WTFserver(to_be_written);

  //Report if server responded with an error
  /*
    TODO: Make a method for receiving and alerting user of errors
      -Basically, if the server response begins with a certain character or some indicator of an error, it will send the server response to that method which will print
        the error message out to the user, without including the indicator we decide to use.
  */
  if(strcmp(response, "x") == 0){
    printf("\nError: The project %s does not exist on the server.\n", projectName);
    exit(1);
  }else if(strcmp(response, "e") == 0){
    printf("\nError: The server ran into an error processing your request. Please try again.\n");
    exit(1);
  }else{
    printf("\n%s\n", response);
  }
  return;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10b0
movq %rax, %rdx
addq $0x3, %rdx
movq %rdx, -0x40(%rbp)
movq %rsp, %rcx
movq %rcx, -0x18(%rbp)
addq $0x12, %rax
andq $-0x10, %rax
movq %rsp, %rdi
subq %rax, %rdi
movq %rdi, -0x38(%rbp)
movq %rdi, %rsp
movq %rdx, -0x20(%rbp)
xorl %esi, %esi
callq 0x10d0
movq -0x38(%rbp), %rax
movb $0x64, (%rax)
movb $0x20, 0x1(%rax)
movl $0x2, -0x24(%rbp)
movl $0x0, -0xc(%rbp)
movslq -0xc(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x10b0
movq %rax, %rcx
movq -0x48(%rbp), %rax
cmpq %rcx, %rax
jae 0x5507
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x54fa
movq -0x38(%rbp), %rax
movq -0x8(%rbp), %rcx
movslq -0xc(%rbp), %rdx
movb (%rcx,%rdx), %dl
movslq -0x24(%rbp), %rcx
movb %dl, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x54fc
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x54b0
movq -0x38(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x8(%rbp), %rcx
leaq 0x1fc8(%rip), %rdi      # 0x74e2
movb $0x0, %al
callq 0x1040
movq -0x38(%rbp), %rdi
callq 0x5be0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
leaq 0x26a1(%rip), %rsi      # 0x7bda
callq 0x1190
cmpl $0x0, %eax
jne 0x555f
movq -0x8(%rbp), %rsi
leaq 0x2163(%rip), %rdi      # 0x76b1
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x30(%rbp), %rdi
leaq 0x1b0b(%rip), %rsi      # 0x7075
callq 0x1190
cmpl $0x0, %eax
jne 0x558c
leaq 0x2025(%rip), %rdi      # 0x75a0
movb $0x0, %al
callq 0x1040
movl $0x1, %edi
callq 0x1170
movq -0x30(%rbp), %rsi
leaq 0x2115(%rip), %rdi      # 0x76ac
movb $0x0, %al
callq 0x1040
jmp 0x55a0
movq -0x18(%rbp), %rax
movq %rax, %rsp
movq %rbp, %rsp
popq %rbp
retq
nopl (%rax)