ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<OpenSubset>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3,%r8d
  jle    L30
  cmp    $0x4,%r8d
  jne    L24
  mov    (%rcx),%edi
  mov    %rcx,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  call   <PrintIndent@plt>
  lea    D63(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%eax
  lea    0x1(%rax),%edi
  mov    %edi,(%rbx)
  call   <PrintIndent@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L3
  mov    %rbp,%rsi
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L32:
  mov    (%rbx),%edi
  call   <PrintIndent@plt>
  lea    D29(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%eax
  mov    %r12,%rdi
  mov    $0x46,%esi
  lea    D26(%rip),%rcx
  lea    0x2(%rax),%edx
  call   <print_spec_indented_and_max_length@plt>
  mov    (%rbx),%edi
  call   <PrintIndent@plt>
  add    $0x8,%rsp
  lea    D50(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1090 <puts@plt>
  nopw   0x0(%rax,%rax,1)
L30:
  test   %r8d,%r8d
  jg     L14
L24:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L14:
  add    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D30(%rip),%rdi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10b0 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L3:
  mov    %r13,%rsi
  lea    D2(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L32
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D63
type: string
name: extract_symbolic_data
arguments: data_label: D2
type: string
name: extract_symbolic_data
arguments: data_label: D29
type: string
name: extract_symbolic_data
arguments: data_label: D26
type: string
name: extract_symbolic_data
arguments: data_label: D50
type: string
name: extract_symbolic_data
arguments: data_label: D30
type: string

tool: D63: <subset>

tool: D2: <subset_name>%s</subset_name>


tool: D29: <subset_description>

tool: 

tool: D50: </subset_description>

tool: D30: 
   ****  %s  ****



assistant: ```c
void OpenSubset(const char *SubName, const char *xml_name, const char *SubDesc, int *IndentLevel, int CommentLevel) {
  switch (CommentLevel) {
  case (1):
  case (2):
  case (3):
    printf("\n   ****  %s  ****\n\n", SubName);
    return;
    break;
  case (4):
    PrintIndent(*IndentLevel);
    printf("<subset>\n");
    *IndentLevel += 1;
    PrintIndent(*IndentLevel);
    if (strlen(xml_name) > 0) {
      printf("<subset_name>%s</subset_name>\n", xml_name);
    } else {
      printf("<subset_name>%s</subset_name>\n", SubName);
    }
    PrintIndent(*IndentLevel);
    printf("<subset_description>\n");
    print_spec_indented_and_max_length(SubDesc, 70, *IndentLevel + 2, "");
    PrintIndent(*IndentLevel);
    printf("</subset_description>\n");
    break;
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<OpenSubset>:
  endbr64
  push   %r13
  mov    %rdi,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    $0x3,%r8d
  jle    L9
  cmp    $0x4,%r8d
  jne    L24
  mov    (%rcx),%edi
  mov    %rcx,%rbx
  mov    %rsi,%rbp
  mov    %rdx,%r12
  call   <PrintIndent@plt>
  lea    D44(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%eax
  lea    0x1(%rax),%edi
  mov    %edi,(%rbx)
  call   <PrintIndent@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  jle    L39
  mov    %rbp,%rsi
  lea    D32(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
L7:
  mov    (%rbx),%edi
  call   <PrintIndent@plt>
  lea    D34(%rip),%rdi
  call   <puts@plt>
  mov    (%rbx),%eax
  mov    %r12,%rdi
  mov    $0x46,%esi
  lea    D58(%rip),%rcx
  lea    0x2(%rax),%edx
  call   <print_spec_indented_and_max_length@plt>
  mov    (%rbx),%edi
  call   <PrintIndent@plt>
  add    $0x8,%rsp
  lea    D53(%rip),%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    1090 <puts@plt>
  nopw   0x0(%rax,%rax,1)
L9:
  test   %r8d,%r8d
  jg     L20
L24:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L20:
  add    $0x8,%rsp
  mov    %rdi,%rsi
  lea    D68(%rip),%rdi
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  jmp    10b0 <printf@plt>
  nopl   0x0(%rax,%rax,1)
L39:
  mov    %r13,%rsi
  lea    D32(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L7
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D44
datatype: string
name: extract_symbolic_data
arguments: data_label: D32
datatype: string
name: extract_symbolic_data
arguments: data_label: D34
datatype: string
name: extract_symbolic_data
arguments: data_label: D58
datatype: string
name: extract_symbolic_data
arguments: data_label: D53
datatype: string
name: extract_symbolic_data
arguments: data_label: D68
datatype: string

tool: D44: <subset>

tool: D32: <subset_name>%s</subset_name>


tool: D34: <subset_description>

tool: 

tool: D53: </subset_description>

tool: D68: 
   ****  %s  ****



assistant: ```c
void OpenSubset(const char *SubName, const char *xml_name, const char *SubDesc, int *IndentLevel, int CommentLevel) {
  switch (CommentLevel) {
  case (1):
  case (2):
  case (3):
    printf("\n   ****  %s  ****\n\n", SubName);
    return;
    break;
  case (4):
    PrintIndent(*IndentLevel);
    printf("<subset>\n");
    *IndentLevel += 1;
    PrintIndent(*IndentLevel);
    if (strlen(xml_name) > 0) {
      printf("<subset_name>%s</subset_name>\n", xml_name);
    } else {
      printf("<subset_name>%s</subset_name>\n", SubName);
    }
    PrintIndent(*IndentLevel);
    printf("<subset_description>\n");
    print_spec_indented_and_max_length(SubDesc, 70, *IndentLevel + 2, "");
    PrintIndent(*IndentLevel);
    printf("</subset_description>\n");
    break;
  }
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<julday_add>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  mov    (%rax),%eax
  mov    %eax,-0xc(%rbp)
  mov    -0xc(%rbp),%edx
  mov    -0x18(%rbp),%eax
  add    %edx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x14(%rbp),%eax
  add    %eax,%edx
  mov    -0x20(%rbp),%rax
  mov    %edx,(%rax)
  lea    -0xc(%rbp),%rdx
  mov    -0x20(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <adjust_seconds@plt>
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%rax
  mov    %edx,(%rax)
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L4
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

assistant: ```c
void julday_add(int days, int secs, int *julday, int *secofday) {
  int64_t sec_of_day = *secofday;
  sec_of_day += secs;
  *julday += days;
  adjust_seconds(julday, &sec_of_day);
  *secofday = (int)sec_of_day;
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<julday_add>:
  endbr64
  push   %rbx
  sub    $0x10,%rsp
  mov    %edi,%eax
  mov    %rdx,%rdi
  mov    %rcx,%rbx
  mov    %fs:0x28,%rdx
  mov    %rdx,0x8(%rsp)
  xor    %edx,%edx
  add    (%rcx),%esi
  mov    %esi,0x4(%rsp)
  add    %eax,(%rdi)
  lea    0x4(%rsp),%rsi
  call   <adjust_seconds@plt>
  mov    0x4(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x10,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void julday_add(int days, int secs, int *julday, int *secofday) {
  int64_t sec_of_day = *secofday;
  sec_of_day += secs;
  *julday += days;
  adjust_seconds(julday, &sec_of_day);
  *secofday = (int)sec_of_day;
}
```
user: Translate the below assembly code into C programming language:

```asm
<julday_add>:
  endbr64
  push   %rbx
  mov    %edi,%r8d
  mov    %rdx,%rdi
  mov    %rcx,%rbx
  sub    $0x10,%rsp
  add    (%rcx),%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  add    %r8d,(%rdx)
  mov    %esi,0x4(%rsp)
  lea    0x4(%rsp),%rsi
  call   <adjust_seconds@plt>
  mov    0x4(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x10,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void julday_add(int days, int secs, int *julday, int *secofday) {
  int64_t sec_of_day = *secofday;
  sec_of_day += secs;
  *julday += days;
  adjust_seconds(julday, &sec_of_day);
  *secofday = (int)sec_of_day;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<julday_add>:
  endbr64
  push   %rbx
  mov    %edi,%r8d
  mov    %rdx,%rdi
  mov    %rcx,%rbx
  sub    $0x10,%rsp
  add    (%rcx),%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  add    %r8d,(%rdx)
  mov    %esi,0x4(%rsp)
  lea    0x4(%rsp),%rsi
  call   <adjust_seconds@plt>
  mov    0x4(%rsp),%eax
  mov    %eax,(%rbx)
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0x10,%rsp
  pop    %rbx
  ret
L4:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void julday_add(int days, int secs, int *julday, int *secofday) {
  int64_t sec_of_day = *secofday;
  sec_of_day += secs;
  *julday += days;
  adjust_seconds(julday, &sec_of_day);
  *secofday = (int)sec_of_day;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<send_http_ok_msg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x2e0,%rsp
  mov    %edi,-0x2d4(%rbp)
  mov    %rsi,-0x2e0(%rbp)
  mov    %rdx,-0xa0(%rbp)
  mov    %rcx,-0x98(%rbp)
  mov    %r8,-0x90(%rbp)
  mov    %r9,-0x88(%rbp)
  test   %al,%al
  je     L9
  movaps %xmm0,-0x80(%rbp)
  movaps %xmm1,-0x70(%rbp)
  movaps %xmm2,-0x60(%rbp)
  movaps %xmm3,-0x50(%rbp)
  movaps %xmm4,-0x40(%rbp)
  movaps %xmm5,-0x30(%rbp)
  movaps %xmm6,-0x20(%rbp)
  movaps %xmm7,-0x10(%rbp)
L9:
  mov    %fs:0x28,%rax
  mov    %rax,-0xb8(%rbp)
  xor    %eax,%eax
  mov    -0x2e0(%rbp),%rdx
  mov    -0x2c4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <va_start@plt>
  mov    -0x2c4(%rbp),%ecx
  mov    -0x2e0(%rbp),%rdx
  lea    -0x2c0(%rbp),%rax
  mov    $0x200,%esi
  mov    %rax,%rdi
  call   <vsnprintf@plt>
  mov    -0x2c4(%rbp),%eax
  mov    %eax,%edi
  call   <va_end@plt>
  lea    -0x2c0(%rbp),%rdx
  mov    -0x2d4(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <send_http_ok@plt>
  nop
  mov    -0xb8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  leave
  ret
```

assistant: ```c
void send_http_ok_msg(int clientsock, const char *fmt, ...) {
  char msg[512];
  va_list args;
  va_start(args, fmt);
  vsnprintf(msg, 512, fmt, args);
  va_end(args);
  send_http_ok(clientsock, msg);
}
```
user: Translate the below assembly code into C programming language:

```asm
<send_http_ok_msg>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x218,%rsp
  mov    %edi,%ebp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    $0x0,%r12d
  mov    %r12d,%edi
  call   <va_start@plt>
  mov    %rsp,%r13
  mov    %r12d,%ecx
  mov    %rbx,%rdx
  mov    $0x200,%esi
  mov    %r13,%rdi
  call   <vsnprintf@plt>
  mov    %r12d,%edi
  call   <va_end@plt>
  mov    %r13,%rsi
  mov    %ebp,%edi
  call   <send_http_ok@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x218,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L3:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void send_http_ok_msg(int clientsock, const char *fmt, ...) {
  char msg[512];
  va_list args;
  va_start(args, fmt);
  vsnprintf(msg, 512, fmt, args);
  va_end(args);
  send_http_ok(clientsock, msg);
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<send_http_ok_msg>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  mov    %r13d,%edi
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r14
  call   <va_start@plt>
  mov    $0x200,%esi
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %r14,%rdi
  call   <vsnprintf@plt>
  mov    %r13d,%edi
  call   <va_end@plt>
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <send_http_ok@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L9
  add    $0x218,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L9:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void send_http_ok_msg(int clientsock, const char *fmt, ...) {
  char msg[512];
  va_list args;
  va_start(args, fmt);
  vsnprintf(msg, 512, fmt, args);
  va_end(args);
  send_http_ok(clientsock, msg);
}
```
user: 下面的汇编指令对应的C源代码是什么:

```asm
<send_http_ok_msg>:
  endbr64
  push   %r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %edi,%ebp
  mov    %r13d,%edi
  sub    $0x218,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x208(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r14
  call   <va_start@plt>
  mov    $0x200,%esi
  mov    %r13d,%ecx
  mov    %r12,%rdx
  mov    %r14,%rdi
  call   <vsnprintf@plt>
  mov    %r13d,%edi
  call   <va_end@plt>
  mov    %r14,%rsi
  mov    %ebp,%edi
  call   <send_http_ok@plt>
  mov    0x208(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x218,%rsp
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L8:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void send_http_ok_msg(int clientsock, const char *fmt, ...) {
  char msg[512];
  va_list args;
  va_start(args, fmt);
  vsnprintf(msg, 512, fmt, args);
  va_end(args);
  send_http_ok(clientsock, msg);
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<f2au_GameID_gen>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xe0,%rsp
  mov    %rdi,-0xd8(%rbp)
  mov    %rsi,-0xe0(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    -0xd0(%rbp),%rcx
  mov    -0xd8(%rbp),%rax
  mov    $0xbd,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <buffer_from_file@plt>
  test   %rax,%rax
  jns    L12
  mov    $0xffffffff,%eax
  jmp    L0
L12:
  movzbl -0x14(%rbp),%eax
  mov    %al,-0x1c(%rbp)
  mov    -0xe0(%rbp),%rcx
  lea    -0xd0(%rbp),%rax
  mov    $0xb5,%edx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <cart_crc32@plt>
  mov    $0x0,%eax
L0:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L18
  call   <__stack_chk_fail@plt>
L18:
  leave
  ret
```

assistant: ```c
int f2au_GameID_gen(const char *filename, int *game_id) {
  unsigned char buffer[189];
  if (buffer_from_file(filename, buffer, 189) < 0)
    return -1;
  buffer[180] = buffer[188];
  cart_crc32(buffer, game_id, 181);
  return 0;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<f2au_GameID_gen>:
  endbr64
  push   %rbx
  sub    $0xd0,%rsp
  mov    %rsi,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%rsi
  mov    $0xbd,%edx
  call   <buffer_from_file@plt>
  test   %rax,%rax
  js     L3
  movzbl 0xbc(%rsp),%eax
  mov    %al,0xb4(%rsp)
  mov    %rsp,%rdi
  mov    $0xb5,%edx
  mov    %rbx,%rsi
  call   <cart_crc32@plt>
  mov    $0x0,%eax
L10:
  mov    0xc8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L1
  add    $0xd0,%rsp
  pop    %rbx
  ret
L3:
  mov    $0xffffffff,%eax
  jmp    L10
L1:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int f2au_GameID_gen(const char *filename, int *game_id) {
  unsigned char buffer[189];
  if (buffer_from_file(filename, buffer, 189) < 0)
    return -1;
  buffer[180] = buffer[188];
  cart_crc32(buffer, game_id, 181);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<f2au_GameID_gen>:
  endbr64
  push   %r12
  mov    $0xbd,%edx
  push   %rbp
  mov    %rsi,%rbp
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rsi
  call   <buffer_from_file@plt>
  test   %rax,%rax
  js     L29
  movzbl 0xbc(%rsp),%eax
  mov    $0xb5,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %al,0xb4(%rsp)
  call   <cart_crc32@plt>
  xor    %eax,%eax
L1:
  mov    0xc8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L26
  add    $0xd8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L29:
  mov    $0xffffffff,%eax
  jmp    L1
L26:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int f2au_GameID_gen(const char *filename, int *game_id) {
  unsigned char buffer[189];
  if (buffer_from_file(filename, buffer, 189) < 0)
    return -1;
  buffer[180] = buffer[188];
  cart_crc32(buffer, game_id, 181);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<f2au_GameID_gen>:
  endbr64
  push   %r12
  mov    $0xbd,%edx
  push   %rbp
  mov    %rsi,%rbp
  sub    $0xd8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xc8(%rsp)
  xor    %eax,%eax
  mov    %rsp,%r12
  mov    %r12,%rsi
  call   <buffer_from_file@plt>
  test   %rax,%rax
  js     L3
  movzbl 0xbc(%rsp),%eax
  mov    $0xb5,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    %al,0xb4(%rsp)
  call   <cart_crc32@plt>
  xor    %eax,%eax
L4:
  mov    0xc8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L29
  add    $0xd8,%rsp
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L3:
  mov    $0xffffffff,%eax
  jmp    L4
L29:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int f2au_GameID_gen(const char *filename, int *game_id) {
  unsigned char buffer[189];
  if (buffer_from_file(filename, buffer, 189) < 0)
    return -1;
  buffer[180] = buffer[188];
  cart_crc32(buffer, game_id, 181);
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<main>:
  endbr64
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0xf,0x4(%rsp)
  movl   $0xd,(%rsp)
  mov    $0xf,%edx
  mov    $0xd,%esi
  mov    $0x7bd,%edi
  call   <day_of_year@plt>
  mov    %eax,%esi
  lea    D3(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0x20,0x4(%rsp)
  movl   $0x6,(%rsp)
  mov    $0x20,%edx
  mov    $0x6,%esi
  mov    $0x7bd,%edi
  call   <day_of_year@plt>
  mov    %eax,%esi
  lea    D27(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  movl   $0xf,0x4(%rsp)
  movl   $0x1,(%rsp)
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    $0x7bd,%edi
  call   <day_of_year@plt>
  mov    %eax,%esi
  lea    D15(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    0x4(%rsp),%rbp
  mov    %rsp,%rbx
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  mov    $0x172,%esi
  mov    $0x7bd,%edi
  call   <month_day@plt>
  mov    (%rsp),%edx
  mov    0x4(%rsp),%esi
  lea    D46(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    %rbp,%rcx
  mov    %rbx,%rdx
  mov    $0xf,%esi
  mov    $0x7bd,%edi
  call   <month_day@plt>
  mov    $0x7bd,%ecx
  mov    (%rsp),%edx
  mov    0x4(%rsp),%esi
  lea    D17(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  mov    $0x0,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D3
type_infered: string
name: read_data
arguments: data_tag: D27
type_infered: string
name: read_data
arguments: data_tag: D15
type_infered: string
name: read_data
arguments: data_tag: D46
type_infered: string
name: read_data
arguments: data_tag: D17
type_infered: string

tool: D3: 13th month exists? %d


tool: D27: 32nd day exists? %d


tool: D15: 15th of January 1981 valid? Day of year = %d


tool: D46: 370th yearday in 1981 exists? day = %d, month = %d


tool: D17: 15th yearday in 1981 is on %d/%d/%d


assistant: ```c
int main() {
  int month, day, yearday, year, ret;
  day = 15;
  month = 13;
  year = 1981;
  ret = day_of_year(year, month, day);
  printf("13th month exists? %d\n", ret);
  day = 32;
  month = 6;
  ret = day_of_year(year, month, day);
  printf("32nd day exists? %d\n", ret);
  day = 15;
  month = 1;
  ret = day_of_year(year, month, day);
  printf("15th of January 1981 valid? Day of year = %d\n", ret);
  yearday = 370;
  month_day(year, yearday, &month, &day);
  printf("370th yearday in 1981 exists? day = %d, month = %d\n", day, month);
  yearday = 15;
  month_day(year, yearday, &month, &day);
  printf("15th yearday in 1981 is on %d/%d/%d\n", day, month, year);
  return 0;
}
```
user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<main>:
  endbr64
  push   %r13
  mov    $0xf,%edx
  mov    $0xd,%esi
  mov    $0x7bd,%edi
  push   %r12
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movl   $0xf,0x4(%rsp)
  lea    0x4(%rsp),%r13
  mov    %rsp,%r12
  movl   $0xd,(%rsp)
  call   <day_of_year@plt>
  lea    D25(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0x20,%edx
  mov    $0x6,%esi
  mov    $0x7bd,%edi
  movl   $0x20,0x4(%rsp)
  movl   $0x6,(%rsp)
  call   <day_of_year@plt>
  lea    D12(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    $0xf,%edx
  mov    $0x1,%esi
  mov    $0x7bd,%edi
  movl   $0xf,0x4(%rsp)
  movl   $0x1,(%rsp)
  call   <day_of_year@plt>
  lea    D4(%rip),%rdi
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    $0x172,%esi
  mov    $0x7bd,%edi
  call   <month_day@plt>
  mov    (%rsp),%edx
  mov    0x4(%rsp),%esi
  xor    %eax,%eax
  lea    D21(%rip),%rdi
  call   <printf@plt>
  mov    %r13,%rcx
  mov    %r12,%rdx
  mov    $0xf,%esi
  mov    $0x7bd,%edi
  call   <month_day@plt>
  mov    (%rsp),%edx
  mov    0x4(%rsp),%esi
  xor    %eax,%eax
  mov    $0x7bd,%ecx
  lea    D43(%rip),%rdi
  call   <printf@plt>
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L8
  add    $0x18,%rsp
  xor    %eax,%eax
  pop    %r12
  pop    %r13
  ret
L8:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D25
data_type: string
name: disassemble_data
arguments: data_tag: D12
data_type: string
name: disassemble_data
arguments: data_tag: D4
data_type: string
name: disassemble_data
arguments: data_tag: D21
data_type: string
name: disassemble_data
arguments: data_tag: D43
data_type: string

tool: D25: 13th month exists? %d


tool: D12: 32nd day exists? %d


tool: D4: 15th of January 1981 valid? Day of year = %d


tool: D21: 370th yearday in 1981 exists? day = %d, month = %d


tool: D43: 15th yearday in 1981 is on %d/%d/%d


assistant: ```c
int main() {
  int month, day, yearday, year, ret;
  day = 15;
  month = 13;
  year = 1981;
  ret = day_of_year(year, month, day);
  printf("13th month exists? %d\n", ret);
  day = 32;
  month = 6;
  ret = day_of_year(year, month, day);
  printf("32nd day exists? %d\n", ret);
  day = 15;
  month = 1;
  ret = day_of_year(year, month, day);
  printf("15th of January 1981 valid? Day of year = %d\n", ret);
  yearday = 370;
  month_day(year, yearday, &month, &day);
  printf("370th yearday in 1981 exists? day = %d, month = %d\n", day, month);
  yearday = 15;
  month_day(year, yearday, &month, &day);
  printf("15th yearday in 1981 is on %d/%d/%d\n", day, month, year);
  return 0;
}
```