user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<encrypt>:
  endbr64
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x10,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    0x32(%rsi),%rdx
  lea    0x9f6(%rsi),%rcx
L278:
  lea    -0x32(%rdx),%rax
L256:
  movb   $0x0,(%rax)
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L256
  add    $0x32,%rdx
  cmp    %rcx,%rdx
  jne    L278
  lea    D18(%rip),%rdi
  call   <printf@plt>
  lea    0x4(%rsp),%rsi
  lea    D2(%rip),%rdi
  call   <scanf@plt>
  mov    $0x0,%eax
  call   <getchar@plt>
  mov    0x4(%rsp),%edi
  lea    0x9c4(%rbx),%r9
  mov    %rbp,%r10
  mov    %rbx,%r8
  jmp    L59
L85:
  movsbl %dl,%edx
  lea    -0x61(%rdi,%rdx,1),%r11d
  movslq %r11d,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x23,%rdx
  mov    %r11d,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x1a,%edx,%r12d
  mov    %r11d,%edx
  sub    %r12d,%edx
  lea    0x1a(%rdx),%r11d
  cmovs  %r11d,%edx
  add    $0x61,%edx
  mov    %dl,(%rcx,%rax,1)
L153:
  add    $0x1,%rax
  cmp    $0x32,%rax
  je     L297
L175:
  movzbl (%rsi,%rax,1),%edx
  lea    -0x61(%rdx),%r11d
  cmp    $0x19,%r11b
  jbe    L85
  lea    -0x41(%rdx),%r11d
  cmp    $0x19,%r11b
  jbe    L228
  mov    %dl,(%rcx,%rax,1)
  jmp    L153
L228:
  movsbl %dl,%edx
  lea    -0x41(%rdi,%rdx,1),%r11d
  movslq %r11d,%rdx
  imul   $0x4ec4ec4f,%rdx,%rdx
  sar    $0x23,%rdx
  mov    %r11d,%r12d
  sar    $0x1f,%r12d
  sub    %r12d,%edx
  imul   $0x1a,%edx,%r12d
  mov    %r11d,%edx
  sub    %r12d,%edx
  lea    0x1a(%rdx),%r11d
  cmovs  %r11d,%edx
  add    $0x41,%edx
  mov    %dl,(%rcx,%rax,1)
  jmp    L153
L297:
  add    $0x32,%r8
  add    $0x32,%r10
  cmp    %r9,%r8
  je     L144
L59:
  mov    %r10,%rsi
  mov    %r8,%rcx
  mov    $0x0,%eax
  jmp    L175
L144:
  mov    %rbp,%r8
  mov    %rbx,%rdi
L298:
  mov    %rdi,%rsi
  mov    %r8,%rcx
  mov    $0x0,%eax
L88:
  movzbl (%rsi,%rax,1),%edx
  mov    %dl,(%rcx,%rax,1)
  add    $0x1,%rax
  cmp    $0x32,%rax
  jne    L88
  add    $0x32,%rdi
  add    $0x32,%r8
  cmp    %r9,%rdi
  jne    L298
  lea    0x9c4(%rbp),%rdi
  add    $0x9f6,%rbp
  mov    %rbx,%r10
  mov    $0x0,%r8d
  jmp    L63
L196:
  mov    %r8d,%ecx
L245:
  mov    %cl,(%rsi)
  add    $0x1,%rax
  add    $0x32,%rdx
  cmp    %rdx,%rdi
  je     L237
L189:
  mov    %rax,%rsi
  movzbl (%rax),%ecx
  cmp    $0xa,%cl
  je     L196
  cmp    $0xd,%cl
  je     L196
  movzbl (%rdx),%ecx
  jmp    L245
L237:
  add    $0x1,%rdi
  add    $0x32,%r10
  cmp    %rbp,%rdi
  je     L280
L63:
  lea    -0x9c4(%rdi),%rdx
  mov    %r10,%rax
  jmp    L189
L69:
  cmpb   $0x0,(%rcx,%rax,1)
  jne    L116
  movb   $0x20,(%rcx,%rax,1)
L116:
  sub    $0x1,%rax
  cmp    $0xffffffffffffffff,%rax
  je     L146
L6:
  test   %edx,%edx
  jne    L69
  cmpb   $0x0,(%rcx,%rax,1)
  setne  %dl
  movzbl %dl,%edx
  jmp    L116
L146:
  add    $0x32,%rsi
  cmp    %r9,%rsi
  je     L203
L242:
  mov    %rsi,%rcx
  mov    $0x31,%eax
  mov    %edi,%edx
  jmp    L6
L203:
  lea    -0x32(%rbx),%rcx
  mov    $0x0,%esi
  jmp    L2
L280:
  mov    %rbx,%rsi
  mov    $0x0,%edi
  jmp    L242
L70:
  cmpb   $0x0,(%rax)
  jne    L223
  movb   $0x20,(%rax)
L223:
  sub    $0x32,%rax
  cmp    %rax,%rcx
  je     L220
L295:
  test   %edx,%edx
  jne    L70
  cmpb   $0x0,(%rax)
  setne  %dl
  movzbl %dl,%edx
  jmp    L223
L220:
  add    $0x1,%rcx
  cmp    %rbx,%rcx
  je     L126
L2:
  lea    0x9c4(%rcx),%rax
  mov    %esi,%edx
  jmp    L295
L126:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L315
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L315:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D18
datatype: string
name: disassemble_data
arguments: data_label: D2
datatype: string

tool: D18: Input an integer N to encrypt: 

tool: D2: %i

assistant: ```c
void encrypt(char str[50][50], char encrypted[50][50]) {
  int n, i, j, fromZero, temp = 0;
  int length = 50;
  for (i = 0; i < length; i++) {
    for (j = 0; j < length; j++) {
      encrypted[i][j] = '\0';
    }
  }
  printf("Input an integer N to encrypt: ");
  scanf("%i", &n);
  getchar();
  for (i = 0; i < length; i++) {
    for (j = 0; j < length; j++) {
      if (str[i][j] >= 'a' && str[i][j] <= 'z') {
        fromZero = str[i][j] - 'a';
        temp = (fromZero + n) % 26;
        while (temp < 0)
          temp += 26;
        encrypted[i][j] = temp + 'a';
      } else if (str[i][j] >= 'A' && str[i][j] <= 'Z') {
        fromZero = str[i][j] - 'A';
        temp = (fromZero + n) % 26;
        while (temp < 0)
          temp += 26;
        encrypted[i][j] = temp + 'A';
      } else {
        encrypted[i][j] = str[i][j];
      }
    }
  }
  for (i = 0; i < length; i++) {
    for (j = 0; j < length; j++) {
      str[i][j] = encrypted[i][j];
    }
  }
  for (i = 0; i < length; i++) {
    for (j = 0; j < length; j++) {
      if (encrypted[i][j] == '\n' || encrypted[i][j] == '\r') {
        encrypted[i][j] = '\0';
      } else {
        encrypted[i][j] = str[j][i];
      }
    }
  }
  int charFound;
  for (i = 0; i < length; i++) {
    charFound = 0;
    for (j = length - 1; j >= 0; j--) {
      if (!charFound && encrypted[i][j] != '\0')
        charFound = 1;
      if (charFound && encrypted[i][j] == '\0')
        encrypted[i][j] = ' ';
    }
  }
  for (j = 0; j < length; j++) {
    charFound = 0;
    for (i = length - 1; i >= 0; i--) {
      if (!charFound && encrypted[i][j] != '\0')
        charFound = 1;
      if (charFound && encrypted[i][j] == '\0')
        encrypted[i][j] = ' ';
    }
  }
}
```