// File: /workspace/github_cpp_makefile_star2_O1/dmonaldo[P]simple-network-file-system/Shell.cpp
// Function: Shell::head_rpc(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int)
void Shell::head_rpc(string fname, int n) {
  // to implement
  string command = "head " + fname + to_string(n) + "\r\n";
  char message[2048];
  char received[2048];
  strcpy(message, command.c_str());

  // send to server
  send(cs_sock, message, sizeof(message), 0);
  recv(cs_sock, received, sizeof(received), 0);

  // print
  print_response("head", received);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x1080, %rsp           # imm = 0x1080
movl %edx, %r14d
movq %rsi, %rdx
movq %rdi, %rbx
leaq 0x335f(%rip), %rsi      # 0xa516
leaq 0x880(%rsp), %rdi
callq 0x8ae7
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x7221
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x7218
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x721e
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x7221
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x71e5
addl $-0x3, %r15d
jmp 0x7221
addl $-0x2, %r15d
jmp 0x7221
decl %r15d
shrl $0x1f, %r14d
leal (%r15,%r14), %esi
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
movq %rsp, %rdi
movl $0x2d, %edx
callq 0x3320
movl %r14d, %edi
addq (%rsp), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x5c19
leaq 0x890(%rsp), %r14
movq -0x10(%r14), %rcx
movq -0x8(%r14), %r8
movq 0x8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %esi
cmpq %r14, %rcx
je 0x727c
movq 0x890(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x7296
movl $0xf, %esi
cmpq %r12, (%rsp)
je 0x7291
movq 0x10(%rsp), %rsi
cmpq %rsi, %rax
jbe 0x72a9
movq (%rsp), %rsi
leaq 0x880(%rsp), %rdi
callq 0x30e0
jmp 0x72b5
movq %rsp, %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x32f0
leaq 0x90(%rsp), %rdx
movq %rdx, -0x10(%rdx)
movq (%rax), %rsi
leaq 0x10(%rax), %rcx
cmpq %rcx, %rsi
je 0x72e2
movq %rsi, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x72e8
movups (%rcx), %xmm0
movups %xmm0, (%rdx)
movq %rax, %rdx
addq $0x8, %rdx
movq 0x8(%rax), %rsi
movq %rsi, 0x88(%rsp)
movq %rcx, (%rax)
movq $0x0, (%rdx)
movb $0x0, (%rcx)
leaq 0x2dd9(%rip), %rsi      # 0xa0e8
leaq 0x80(%rsp), %rdi
callq 0x3490
leaq 0x30(%rsp), %r15
movq %r15, -0x10(%r15)
movq (%rax), %rdx
movq %rax, %rcx
addq $0x10, %rcx
cmpq %rcx, %rdx
je 0x7343
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x734a
movups (%rcx), %xmm0
movups %xmm0, (%r15)
movq 0x8(%rax), %rdx
movq %rdx, 0x28(%rsp)
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
movb $0x0, 0x10(%rax)
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7383
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7399
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x880(%rsp), %rdi
cmpq %r14, %rdi
je 0x73b6
movq 0x890(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x20(%rsp), %rsi
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x3270
movl (%rbx), %edi
movl $0x800, %edx            # imm = 0x800
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x3180
movl (%rbx), %edi
leaq 0x880(%rsp), %rsi
movl $0x800, %edx            # imm = 0x800
xorl %ecx, %ecx
callq 0x3110
leaq 0x70(%rsp), %r14
movq %r14, -0x10(%r14)
leaq 0x2e75(%rip), %rsi      # 0xa277
leaq 0x2e72(%rip), %rdx      # 0xa27b
leaq 0x60(%rsp), %rdi
callq 0x5d16
leaq 0x50(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x880(%rsp), %rbx
movq %rbx, %rdi
callq 0x3160
leaq (%rsp,%rax), %rdx
addq $0x880, %rdx            # imm = 0x880
leaq 0x40(%rsp), %rdi
movq %rbx, %rsi
callq 0x5d16
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x6418
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x746b
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x7482
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7499
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
addq $0x1080, %rsp           # imm = 0x1080
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x74c8
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x74c8
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x7545
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7545
jmp 0x7542
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x750c
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x750c
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7527
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7527
movq %rax, %rbx
leaq 0x890(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x755c
movq 0x890(%rsp), %rsi
jmp 0x7554
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x755c
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3440