user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<main>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %edi,-0x44(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  cmpl   $0x4,-0x44(%rbp)
  je     L146
  mov    -0x50(%rbp),%rax
  mov    (%rax),%rax
  mov    %rax,%rsi
  lea    D56(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L146:
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x40(%rbp)
  cmpl   $0xb,-0x40(%rbp)
  jne    L337
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x30,%al
  jne    L337
  movb   $0x34,-0x14(%rbp)
  movb   $0x34,-0x13(%rbp)
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rcx
  lea    -0x14(%rbp),%rax
  add    $0x2,%rax
  mov    $0xa,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  jmp    L236
L337:
  cmpl   $0xc,-0x40(%rbp)
  jne    L345
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rcx
  lea    -0x14(%rbp),%rax
  mov    $0xc,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  jmp    L236
L345:
  cmpl   $0xd,-0x40(%rbp)
  jne    L13
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  movzbl (%rax),%eax
  cmp    $0x2b,%al
  jne    L13
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  lea    0x1(%rax),%rcx
  lea    -0x14(%rbp),%rax
  mov    $0xc,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <memcpy@plt>
  jmp    L236
L13:
  mov    -0x50(%rbp),%rax
  add    $0x10,%rax
  mov    (%rax),%rax
  mov    -0x40(%rbp),%edx
  mov    %rax,%rsi
  lea    D121(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L236:
  movl   $0x0,-0x40(%rbp)
  jmp    L249
L63:
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  cmp    $0x2f,%al
  jle    L182
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  cmp    $0x39,%al
  jle    L2
L182:
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  cmp    $0x1f,%al
  jbe    L116
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  cmp    $0x7e,%al
  jbe    L326
L116:
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D93(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  jmp    L252
L326:
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  lea    D85(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
L252:
  mov    $0xffffffff,%edi
  call   <exit@plt>
L2:
  addl   $0x1,-0x40(%rbp)
L249:
  cmpl   $0xb,-0x40(%rbp)
  jle    L63
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x30(%rbp)
  cmpl   $0xa0,-0x30(%rbp)
  jle    L305
  mov    -0x40(%rbp),%eax
  mov    %eax,%esi
  lea    D29(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L305:
  cmpl   $0x0,-0x30(%rbp)
  jg     L46
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L46:
  mov    -0x30(%rbp),%edx
  mov    %edx,%eax
  shl    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,-0x40(%rbp)
  mov    -0x40(%rbp),%eax
  cltd
  shr    $0x1d,%edx
  add    %edx,%eax
  and    $0x7,%eax
  sub    %edx,%eax
  mov    %eax,-0x38(%rbp)
  cmpl   $0x0,-0x38(%rbp)
  je     L196
  mov    $0x8,%eax
  sub    -0x38(%rbp),%eax
  add    %eax,-0x40(%rbp)
L196:
  mov    -0x40(%rbp),%eax
  lea    0x7(%rax),%edx
  test   %eax,%eax
  cmovs  %edx,%eax
  sar    $0x3,%eax
  mov    %eax,-0x2c(%rbp)
  mov    -0x2c(%rbp),%eax
  mov    %eax,%edi
  call   <malloc@plt>
  mov    %rax,-0x28(%rbp)
  cmpq   $0x0,-0x28(%rbp)
  jne    L328
  mov    -0x2c(%rbp),%eax
  mov    %eax,%esi
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L328:
  mov    -0x2c(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  movl   $0x1,-0x3c(%rbp)
  movl   $0x0,-0x38(%rbp)
  movl   $0x0,-0x40(%rbp)
  jmp    L324
L133:
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x1f,%al
  jbe    L104
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x7e,%al
  jbe    L185
L104:
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D62(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L185:
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x24,%al
  jne    L247
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movb   $0x2,(%rax)
L247:
  movl   $0x0,-0x34(%rbp)
  jmp    L73
L98:
  mov    -0x50(%rbp),%rax
  add    $0x18,%rax
  mov    (%rax),%rdx
  mov    -0x40(%rbp),%eax
  cltq
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x34(%rbp),%eax
  mov    %eax,%ecx
  sar    %cl,%edx
  mov    %edx,%eax
  and    $0x1,%eax
  test   %eax,%eax
  je     L273
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %eax,%edx
  mov    -0x3c(%rbp),%eax
  mov    %edx,%ecx
  or     %eax,%ecx
  mov    -0x38(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  mov    %ecx,%edx
  mov    %dl,(%rax)
L273:
  shll   -0x3c(%rbp)
  cmpl   $0x100,-0x3c(%rbp)
  jne    L261
  movl   $0x1,-0x3c(%rbp)
  addl   $0x1,-0x38(%rbp)
L261:
  addl   $0x1,-0x34(%rbp)
L73:
  cmpl   $0x6,-0x34(%rbp)
  jle    L98
  addl   $0x1,-0x40(%rbp)
L324:
  mov    -0x40(%rbp),%eax
  cmp    -0x30(%rbp),%eax
  jl     L133
  mov    -0x50(%rbp),%rax
  add    $0x8,%rax
  mov    (%rax),%rax
  lea    D47(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x20(%rbp)
  cmpq   $0x0,-0x20(%rbp)
  jne    L222
  lea    D107(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L222:
  mov    -0x20(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xb,%edx
  mov    $0x1,%esi
  lea    D12(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  mov    -0x2c(%rbp),%eax
  lea    0xe(%rax),%edx
  mov    -0x20(%rbp),%rax
  lea    D104(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rcx
  mov    $0xa,%edx
  mov    $0x1,%esi
  lea    D106(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L245
L88:
  mov    -0x40(%rbp),%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  movsbl %al,%ecx
  mov    -0x40(%rbp),%eax
  add    $0x1,%eax
  cltq
  movzbl -0x14(%rbp,%rax,1),%eax
  movsbl %al,%edx
  mov    -0x20(%rbp),%rax
  lea    D72(%rip),%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x2,-0x40(%rbp)
L245:
  cmpl   $0xb,-0x40(%rbp)
  jle    L88
  mov    -0x20(%rbp),%rax
  mov    %rax,%rcx
  mov    $0x6,%edx
  mov    $0x1,%esi
  lea    D125(%rip),%rax
  mov    %rax,%rdi
  call   <fwrite@plt>
  mov    -0x30(%rbp),%edx
  mov    -0x20(%rbp),%rax
  lea    D149(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  movl   $0x0,-0x40(%rbp)
  jmp    L349
L37:
  mov    -0x40(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movzbl %al,%edx
  mov    -0x20(%rbp),%rax
  lea    D149(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <fprintf@plt>
  addl   $0x1,-0x40(%rbp)
L349:
  mov    -0x40(%rbp),%eax
  cmp    -0x2c(%rbp),%eax
  jl     L37
  mov    -0x20(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x1a,%edi
  call   <fputc@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fflush@plt>
  mov    -0x20(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0x28(%rbp),%rax
  mov    %rax,%rdi
  call   <free@plt>
  mov    $0x0,%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L303
  call   <__stack_chk_fail@plt>
L303:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D56
type_infered: string
name: read_data
arguments: label: D121
type_infered: string
name: read_data
arguments: label: D93
type_infered: string
name: read_data
arguments: label: D85
type_infered: string
name: read_data
arguments: label: D29
type_infered: string
name: read_data
arguments: label: D23
type_infered: string
name: read_data
arguments: label: D42
type_infered: string
name: read_data
arguments: label: D62
type_infered: string
name: read_data
arguments: label: D47
type_infered: string
name: read_data
arguments: label: D107
type_infered: string
name: read_data
arguments: label: D12
type_infered: string
name: read_data
arguments: label: D104
type_infered: string
name: read_data
arguments: label: D106
type_infered: string
name: read_data
arguments: label: D72
type_infered: string
name: read_data
arguments: label: D125
type_infered: string
name: read_data
arguments: label: D149
type_infered: string

tool: D56: usage: %s </dev/device> <phone-no> <sms text>


tool: D121: Invalid length for phone number '%s': %i


tool: D93: Invalid char in phone number: 0x'%.2X'


tool: D85: Invalid char in phone number: '%c'


tool: D29: Text is too long at %i chars. Max is 160.


tool: D23: No text supplied for the SMS.

tool: D42: Unable to malloc '%i' bytes for variable 'sms_string'


tool: D62: Invalid character in text input: 0x'%.2X'


tool: D47: wb

tool: D107: Unable to open output device

tool: D12: AT+CMGF=0


tool: D104: AT+CMGS=%i


tool: D106: 0011000C91

tool: D72: %c%c

tool: D125: 0000AA

tool: D149: %.2X

assistant: ```c
int main(int argc, char **argv) {
  FILE *output_device;
  char target_phone[12];
  unsigned char *sms_string;
  int i, l, m, n;
  int intext_length, sms_string_length;
  if (argc != 4) {
    printf("usage: %s </dev/device> <phone-no> <sms text>\n", argv[0]);
    exit(-1);
  }
  i = strlen((argv[2]));
  if (i == 11 && (argv[2])[0] == '0') {
    target_phone[0] = '4';
    target_phone[1] = '4';
    memcpy(target_phone + 2, (argv[2]) + 1, 10);
  } else if (i == 12) {
    memcpy(target_phone, (argv[2]), 12);
  } else if (i == 13 && (argv[2])[0] == '+') {
    memcpy(target_phone, (argv[2]) + 1, 12);
  } else {
    printf("Invalid length for phone number '%s': %i\n", (argv[2]), i);
    exit(-1);
  }
  for (i = 0; i < 12; i++) {
    if (target_phone[i] < '0' || target_phone[i] > '9') {
      if (((unsigned char)target_phone[i]) < 32 || ((unsigned char)target_phone[i]) > 126)
        printf("Invalid char in phone number: 0x'%.2X'\n", (unsigned char)target_phone[i]);
      else
        printf("Invalid char in phone number: '%c'\n", target_phone[i]);
      exit(-1);
    }
  }
  intext_length = strlen((argv[3]));
  if (intext_length > 160) {
    printf("Text is too long at %i chars. Max is 160.\n", i);
    exit(-1);
  }
  if (intext_length < 1) {
    printf("No text supplied for the SMS.\n");
    exit(-1);
  }
  i = intext_length * 7;
  m = i % 8;
  if (m != 0)
    i += (8 - m);
  sms_string_length = i / 8;
  sms_string = malloc(sms_string_length);
  if (sms_string == NULL) {
    printf("Unable to malloc '%i' bytes for variable 'sms_string'\n", sms_string_length);
    exit(-1);
  }
  memset(sms_string, 0, sms_string_length);
  l = 1;
  m = 0;
  for (i = 0; i < intext_length; i++) {
    if (((unsigned char)(argv[3])[i]) < 32 || ((unsigned char)(argv[3])[i]) > 126) {
      printf("Invalid character in text input: 0x'%.2X'\n", (unsigned char)(argv[3])[i]);
      exit(-1);
    }
    if ((argv[3])[i] == '$') {
      (argv[3])[i] = 0x02;
    }
    for (n = 0; n < 7; n++) {
      if (((unsigned char)(argv[3])[i]) & (1 << n)) {
        sms_string[m] |= l;
      }
      l = l << 1;
      if (l == 256) {
        l = 1;
        m++;
      }
    }
  }
  output_device = fopen((argv[1]), "wb");
  if (output_device == NULL) {
    perror("Unable to open output device");
    exit(-1);
  }
  fprintf(output_device, "AT+CMGF=0\r\n");
  fflush(output_device);
  fprintf(output_device, "AT+CMGS=%i\r\n", 14 + sms_string_length);
  fflush(output_device);
  fprintf(output_device, "0011000C91");
  for (i = 0; i < 12; i += 2) {
    fprintf(output_device, "%c%c", target_phone[i + 1], target_phone[i]);
  }
  fprintf(output_device, "0000AA");
  fprintf(output_device, "%.2X", intext_length);
  for (i = 0; i < sms_string_length; i++)
    fprintf(output_device, "%.2X", sms_string[i]);
  fprintf(output_device, "%c", 0x1a);
  fflush(output_device);
  fclose(output_device);
  free(sms_string);
  return 0;
}
```