// File: /workspace/github_cpp_makefile_star2_O3/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 0x3335(%rip), %rsi      # 0xa566
leaq 0x880(%rsp), %rdi
callq 0x8b2c
movl %r14d, %ebp
negl %ebp
cmovsl %r14d, %ebp
movl $0x1, %r15d
cmpl $0xa, %ebp
jb 0x729b
movl $0x4, %r15d
movl $0xd1b71759, %eax       # imm = 0xD1B71759
movl %ebp, %ecx
cmpl $0x63, %ecx
jbe 0x7292
cmpl $0x3e7, %ecx            # imm = 0x3E7
jbe 0x7298
cmpl $0x2710, %ecx           # imm = 0x2710
jb 0x729b
movl %ecx, %edx
imulq %rax, %rdx
shrq $0x2d, %rdx
addl $0x4, %r15d
cmpl $0x1869f, %ecx          # imm = 0x1869F
movl %edx, %ecx
ja 0x725f
addl $-0x3, %r15d
jmp 0x729b
addl $-0x2, %r15d
jmp 0x729b
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 0x5c7b
leaq 0x890(%rsp), %r14
movq -0x10(%r14), %rcx
movq -0x8(%r14), %r8
movq 0x8(%rsp), %rdx
leaq (%rdx,%r8), %rax
movl $0xf, %edi
cmpq %r14, %rcx
je 0x72f6
movq 0x890(%rsp), %rdi
movq (%rsp), %rsi
cmpq %rdi, %rax
jbe 0x7313
movl $0xf, %edi
cmpq %r12, %rsi
je 0x730e
movq 0x10(%rsp), %rdi
cmpq %rdi, %rax
jbe 0x7322
leaq 0x880(%rsp), %rdi
callq 0x30e0
jmp 0x732e
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 0x735b
movq %rsi, 0x80(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x90(%rsp)
jmp 0x7361
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 0x2dac(%rip), %rsi      # 0xa134
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 0x73bc
movq %rdx, 0x20(%rsp)
movq (%rcx), %rdx
movq %rdx, 0x30(%rsp)
jmp 0x73c3
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 0x73fc
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32c0
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x7412
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x880(%rsp), %rdi
cmpq %r14, %rdi
je 0x742f
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 0x2e48(%rip), %rsi      # 0xa2c3
leaq 0x2e45(%rip), %rdx      # 0xa2c7
leaq 0x60(%rsp), %rdi
callq 0x5d7e
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 0x5d7e
leaq 0x60(%rsp), %rsi
leaq 0x40(%rsp), %rdx
callq 0x648a
movq 0x40(%rsp), %rdi
cmpq %r12, %rdi
je 0x74e4
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x74fb
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32c0
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x7512
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 0x7541
movq 0x50(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7541
movq %rax, %rbx
movq 0x60(%rsp), %rdi
cmpq %r14, %rdi
je 0x75be
movq 0x70(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x75be
jmp 0x75bb
movq %rax, %rbx
leaq 0x90(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x7585
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x7585
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x75a0
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x32c0
jmp 0x75a0
movq %rax, %rbx
leaq 0x890(%rsp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x75d5
movq 0x890(%rsp), %rsi
jmp 0x75cd
movq %rax, %rbx
movq 0x20(%rsp), %rdi
cmpq %r15, %rdi
je 0x75d5
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x32c0
movq %rbx, %rdi
callq 0x3440
nop