user: 请将以下的汇编代码转换成C语言代码:

```asm
<main>:
  endbr64
  push   %rbp
  mov    $0x1,%ecx
  mov    $0x29,%esi
  lea    D77(%rip),%rdx
  sub    $0x40,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rbp
  mov    %rbp,%rdi
  call   <cal_sha1@plt>
  test   %rax,%rax
  jne    L80
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D126(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L110
L80:
  lea    D53(%rip),%rdi
  call   <printf@plt>
L36:
  xor    %ecx,%ecx
  lea    D102(%rip),%rdx
  mov    $0x29,%esi
  mov    %rbp,%rdi
  call   <cal_sha1@plt>
  test   %rax,%rax
  jne    L106
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L126
L106:
  lea    D19(%rip),%rdi
  call   <printf@plt>
L121:
  xor    %ecx,%ecx
  lea    D11(%rip),%rdx
  mov    $0x29,%esi
  mov    %rbp,%rdi
  call   <cal_sha1@plt>
  test   %rax,%rax
  jne    L12
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D41(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L10
L12:
  lea    D81(%rip),%rdi
  call   <printf@plt>
L7:
  mov    $0x1,%ecx
  lea    D150(%rip),%rdx
  mov    $0x29,%esi
  mov    %rbp,%rdi
  call   <cal_sha1@plt>
  test   %rax,%rax
  jne    L33
  mov    %rbp,%rdi
  call   <strlen@plt>
  lea    D63(%rip),%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L101
L33:
  lea    D64(%rip),%rdi
  call   <printf@plt>
L65:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L96
  add    $0x40,%rsp
  xor    %eax,%eax
  pop    %rbp
  ret
L101:
  lea    D111(%rip),%rdi
  call   <printf@plt>
  jmp    L65
L110:
  lea    D108(%rip),%rdi
  call   <printf@plt>
  jmp    L36
L126:
  lea    D2(%rip),%rdi
  call   <printf@plt>
  jmp    L121
L10:
  lea    D137(%rip),%rdi
  call   <printf@plt>
  jmp    L7
L96:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D77
data_type: string
name: unpack_data
arguments: tag: D126
data_type: string
name: unpack_data
arguments: tag: D53
data_type: string
name: unpack_data
arguments: tag: D102
data_type: string
name: unpack_data
arguments: tag: D6
data_type: string
name: unpack_data
arguments: tag: D19
data_type: string
name: unpack_data
arguments: tag: D11
data_type: string
name: unpack_data
arguments: tag: D41
data_type: string
name: unpack_data
arguments: tag: D81
data_type: string
name: unpack_data
arguments: tag: D150
data_type: string
name: unpack_data
arguments: tag: D63
data_type: string
name: unpack_data
arguments: tag: D64
data_type: string
name: unpack_data
arguments: tag: D111
data_type: string
name: unpack_data
arguments: tag: D108
data_type: string
name: unpack_data
arguments: tag: D2
data_type: string
name: unpack_data
arguments: tag: D137
data_type: string

tool: D77: abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz123

tool: D126: 5e8ea80e5c1f2debab393d2678b0279ae2089bc4

tool: D53: test 1 failed!


tool: D102: abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234

tool: D6: 70ED417BFA26AFF9BE6F6D7841197F29FE16A994

tool: D19: test 2 failed!


tool: D11: abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz12345

tool: D41: 413CB77D8DF41D00739F51D93A2507EFE1900C80

tool: D81: test 3 failed!


tool: 

tool: D63: da39a3ee5e6b4b0d3255bfef95601890afd80709

tool: D64: test 4 failed!


tool: D111: test 4 successful!


tool: D108: test 1 successful!


tool: D2: test 2 successful!


tool: D137: test 3 successful!


assistant: ```c
int main(void) {
  char result[41];
  int32_t ret = -1;
  ret = cal_sha1(result, sizeof(result), "abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz123", 1);
  if (ret == 0 && 0 == strncmp(result, "5e8ea80e5c1f2debab393d2678b0279ae2089bc4", strlen(result))) {
    printf("test 1 successful!\n");
  } else {
    printf("test 1 failed!\n");
  }
  ret = cal_sha1(result, sizeof(result), "abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234", 0);
  if (ret == 0 && 0 == strncmp(result, "70ED417BFA26AFF9BE6F6D7841197F29FE16A994", strlen(result))) {
    printf("test 2 successful!\n");
  } else {
    printf("test 2 failed!\n");
  }
  ret = cal_sha1(result, sizeof(result), "abcdegfhijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz12345", 0);
  if (ret == 0 && 0 == strncmp(result, "413CB77D8DF41D00739F51D93A2507EFE1900C80", strlen(result))) {
    printf("test 3 successful!\n");
  } else {
    printf("test 3 failed!\n");
  }
  ret = cal_sha1(result, sizeof(result), "", 1);
  if (ret == 0 && 0 == strncmp(result, "da39a3ee5e6b4b0d3255bfef95601890afd80709", strlen(result))) {
    printf("test 4 successful!\n");
  } else {
    printf("test 4 failed!\n");
  }
  return 0;
}
```