ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请显示与下面列出的汇编代码相匹配的C语言实现：

```asm
<contains>:
  endbr64
  test   %edx,%edx
  je     L1
  mov    %rsi,%rax
  lea    -0x1(%rdx),%edx
  lea    0x1(%rsi,%rdx,1),%rdx
L18:
  cmp    %dil,(%rax)
  je     L6
  add    $0x1,%rax
  cmp    %rdx,%rax
  jne    L18
  mov    $0x0,%eax
  ret
L1:
  mov    $0x0,%eax
  ret
L6:
  mov    $0x1,%eax
  ret
```

assistant: ```c
int contains(const char c, const char *matrix, int len) {
  for (unsigned int x = 0; x < len; x++)
    if ((char)matrix[x] == c)
      return 1;
  return 0;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<contains>:
  endbr64
  test   %edx,%edx
  je     L15
  lea    -0x1(%rdx),%eax
  lea    0x1(%rsi,%rax,1),%rax
  jmp    L10
  nopw   0x0(%rax,%rax,1)
L26:
  add    $0x1,%rsi
  cmp    %rax,%rsi
  je     L15
L10:
  cmp    %dil,(%rsi)
  jne    L26
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L15:
  xor    %eax,%eax
  ret
```

assistant: ```c
int contains(const char c, const char *matrix, int len) {
  for (unsigned int x = 0; x < len; x++)
    if ((char)matrix[x] == c)
      return 1;
  return 0;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<contains>:
  endbr64
  test   %edx,%edx
  je     L34
  lea    -0x1(%rdx),%eax
  lea    0x1(%rsi,%rax,1),%rax
  jmp    L1
  nopw   0x0(%rax,%rax,1)
L38:
  add    $0x1,%rsi
  cmp    %rax,%rsi
  je     L34
L1:
  cmp    %dil,(%rsi)
  jne    L38
  mov    $0x1,%eax
  ret
  nopl   0x0(%rax)
L34:
  xor    %eax,%eax
  ret
```

assistant: ```c
int contains(const char c, const char *matrix, int len) {
  for (unsigned int x = 0; x < len; x++)
    if ((char)matrix[x] == c)
      return 1;
  return 0;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<GetPid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x28(%rbp),%rax
  lea    D14(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0x10(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L4
  mov    $0xffffffff,%eax
  jmp    L16
L4:
  lea    -0x18(%rbp),%rdx
  mov    -0x10(%rbp),%rax
  lea    D6(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L31
  mov    -0x18(%rbp),%rax
  jmp    L16
L31:
  mov    $0xffffffff,%eax
L16:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L23
  call   <__stack_chk_fail@plt>
L23:
  leave
  ret
```

tool_calls: name: read_data
arguments: label: D14
type_infered: string
name: read_data
arguments: label: D6
type_infered: string

tool: D14: r

tool: D6: %ld

assistant: ```c
pid_t GetPid(char *sFilename) {
  FILE *hFilename;
  long ldPid;
  hFilename = fopen(sFilename, "r");
  if (hFilename == NULL) {
    return -1;
  }
  if (fscanf(hFilename, "%ld", &ldPid) == 1) {
    return (pid_t)ldPid;
  }
  return -1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<GetPid>:
  endbr64
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  lea    D1(%rip),%rsi
  call   <fopen@plt>
  test   %rax,%rax
  je     L23
  mov    %rax,%rdi
  mov    %rsp,%rdx
  lea    D7(%rip),%rsi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  mov    $0xffffffff,%eax
  cmove  (%rsp),%eax
L9:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L28
  add    $0x18,%rsp
  ret
L23:
  mov    $0xffffffff,%eax
  jmp    L9
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D1
type_infered: string
name: read_data
arguments: tag: D7
type_infered: string

tool: D1: r

tool: D7: %ld

assistant: ```c
pid_t GetPid(char *sFilename) {
  FILE *hFilename;
  long ldPid;
  hFilename = fopen(sFilename, "r");
  if (hFilename == NULL) {
    return -1;
  }
  if (fscanf(hFilename, "%ld", &ldPid) == 1) {
    return (pid_t)ldPid;
  }
  return -1;
}
```
user: What is the c source code of the assembly code below:

```asm
<GetPid>:
  endbr64
  sub    $0x18,%rsp
  lea    D9(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L12
  mov    %rax,%rdi
  mov    %rsp,%rdx
  lea    D7(%rip),%rsi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L12
  mov    (%rsp),%eax
L3:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L31
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L12:
  mov    $0xffffffff,%eax
  jmp    L3
L31:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D9
data_type: string
name: disassemble_data
arguments: data_tag: D7
data_type: string

tool: D9: r

tool: D7: %ld

assistant: ```c
pid_t GetPid(char *sFilename) {
  FILE *hFilename;
  long ldPid;
  hFilename = fopen(sFilename, "r");
  if (hFilename == NULL) {
    return -1;
  }
  if (fscanf(hFilename, "%ld", &ldPid) == 1) {
    return (pid_t)ldPid;
  }
  return -1;
}
```
user: What is the c source code of the assembly code below:

```asm
<GetPid>:
  endbr64
  sub    $0x18,%rsp
  lea    D13(%rip),%rsi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  test   %rax,%rax
  je     L4
  mov    %rax,%rdi
  mov    %rsp,%rdx
  lea    D19(%rip),%rsi
  call   <fscanf@plt>
  cmp    $0x1,%eax
  jne    L4
  mov    (%rsp),%eax
L29:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L32
  add    $0x18,%rsp
  ret
  nopl   0x0(%rax,%rax,1)
L4:
  mov    $0xffffffff,%eax
  jmp    L29
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D13
type_guessed: string
name: retrieve_data
arguments: label: D19
type_guessed: string

tool: D13: r

tool: D19: %ld

assistant: ```c
pid_t GetPid(char *sFilename) {
  FILE *hFilename;
  long ldPid;
  hFilename = fopen(sFilename, "r");
  if (hFilename == NULL) {
    return -1;
  }
  if (fscanf(hFilename, "%ld", &ldPid) == 1) {
    return (pid_t)ldPid;
  }
  return -1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<PaConvert_Float32_Int16_ClipDither>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %esi,-0x2c(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    %ecx,-0x30(%rbp)
  mov    %r8d,-0x3c(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L37
L30:
  mov    $0x0,%eax
  call   <PaConvert_TriangularDither@plt>
  movss  D19(%rip),%xmm1
  mulss  %xmm1,%xmm0
  movss  %xmm0,-0x10(%rbp)
  mov    -0x28(%rbp),%rax
  movss  (%rax),%xmm1
  movss  D11(%rip),%xmm0
  mulss  %xmm1,%xmm0
  movss  -0x10(%rbp),%xmm1
  addss  %xmm1,%xmm0
  movss  %xmm0,-0xc(%rbp)
  movss  -0xc(%rbp),%xmm0
  cvttss2si %xmm0,%rax
  mov    %rax,-0x8(%rbp)
  cmpq   $0xffffffffffff8000,-0x8(%rbp)
  jl     L35
  mov    -0x8(%rbp),%rax
  mov    $0x7fff,%edx
  cmp    %rdx,%rax
  cmovl  %rdx,%rax
  jmp    L10
L35:
  mov    $0xffffffffffff8000,%rax
L10:
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rax
  mov    %eax,%edx
  mov    -0x38(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x2c(%rbp),%eax
  cltq
  shl    $0x2,%rax
  add    %rax,-0x28(%rbp)
  mov    -0x30(%rbp),%eax
  cltq
  add    %rax,%rax
  add    %rax,-0x38(%rbp)
  addl   $0x1,-0x14(%rbp)
L37:
  mov    -0x14(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L30
  nop
  nop
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D19
datatype: byte[4]
name: unpack_data
arguments: data_label: D11
datatype: byte[4]

tool: {"D19": [0x00,0x01,0x00,0x38]}

tool: {"D11": [0x00,0xfc,0xff,0x46]}

assistant: ```c
void PaConvert_Float32_Int16_ClipDither(float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples) {
  int i;
  for (i = 0; i < numSamples; i++) {
    float dither = PaConvert_TriangularDither() * (1.0f / ((1 << (15)) - 1));
    float dithered = (*sourceBuffer * (32766.0f)) + dither;
    long samp = (long)dithered;
    { samp = ((samp) < (-0x8000)) ? -0x8000 : (((samp) < (0x7FFF)) ? (0x7FFF) : (samp)); };
    *targetBuffer = (short)samp;
    sourceBuffer += sourceStride;
    targetBuffer += targetStride;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的:

```asm
<PaConvert_Float32_Int16_ClipDither>:
  endbr64
  test   %r8d,%r8d
  jle    L13
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbx
  mov    %rdx,%rbp
  mov    %r8d,%r14d
  movslq %esi,%rsi
  lea    0x0(,%rsi,4),%r13
  movslq %ecx,%rcx
  lea    (%rcx,%rcx,1),%rax
  mov    %rax,0x8(%rsp)
  mov    $0x0,%r12d
  mov    $0xffffffffffff8000,%r15
L11:
  mov    $0x0,%eax
  call   <PaConvert_TriangularDither@plt>
  movss  D13(%rip),%xmm1
  mulss  (%rbx),%xmm1
  mulss  D1(%rip),%xmm0
  addss  %xmm0,%xmm1
  cvttss2si %xmm1,%rdx
  mov    $0x7fff,%eax
  cmp    %rax,%rdx
  cmovge %rdx,%rax
  cmp    $0xffffffffffff7fff,%rdx
  cmovle %r15,%rax
  mov    %ax,0x0(%rbp)
  add    %r13,%rbx
  add    0x8(%rsp),%rbp
  add    $0x1,%r12d
  cmp    %r12d,%r14d
  jne    L11
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L13:
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
type_infered: byte[4]
name: extract_symbolic_data
arguments: data_label: D1
type_infered: byte[4]

tool: {"D13": [0x00,0xfc,0xff,0x46]}

tool: {"D1": [0x00,0x01,0x00,0x38]}

assistant: ```c
void PaConvert_Float32_Int16_ClipDither(float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples) {
  int i;
  for (i = 0; i < numSamples; i++) {
    float dither = PaConvert_TriangularDither() * (1.0f / ((1 << (15)) - 1));
    float dithered = (*sourceBuffer * (32766.0f)) + dither;
    long samp = (long)dithered;
    { samp = ((samp) < (-0x8000)) ? -0x8000 : (((samp) < (0x7FFF)) ? (0x7FFF) : (samp)); };
    *targetBuffer = (short)samp;
    sourceBuffer += sourceStride;
    targetBuffer += targetStride;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<PaConvert_Float32_Int16_ClipDither>:
  endbr64
  test   %r8d,%r8d
  jle    L3
  push   %r15
  movslq %esi,%rsi
  movslq %ecx,%rcx
  mov    %rdx,%r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  xor    %r13d,%r13d
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  lea    0x0(,%rsi,4),%rbp
  push   %rbx
  lea    (%rcx,%rcx,1),%rbx
  sub    $0x8,%rsp
  nopl   0x0(%rax)
L17:
  xor    %eax,%eax
  call   <PaConvert_TriangularDither@plt>
  movss  D2(%rip),%xmm1
  mulss  D7(%rip),%xmm0
  mov    $0x7fff,%eax
  mulss  (%r14),%xmm1
  mov    $0xffffffffffff8000,%rdi
  addss  %xmm0,%xmm1
  cvttss2si %xmm1,%rdx
  cmp    %rax,%rdx
  cmovge %rdx,%rax
  cmp    $0xffffffffffff7fff,%rdx
  cmovle %rdi,%rax
  add    $0x1,%r13d
  add    %rbp,%r14
  mov    %ax,(%r15)
  add    %rbx,%r15
  cmp    %r13d,%r12d
  jne    L17
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L3:
  ret
```

tool_calls: name: disassemble_data
arguments: data_tag: D2
data_type: byte[4]
name: disassemble_data
arguments: data_tag: D7
data_type: byte[4]

tool: {"D2": [0x00,0xfc,0xff,0x46]}

tool: {"D7": [0x00,0x01,0x00,0x38]}

assistant: ```c
void PaConvert_Float32_Int16_ClipDither(float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples) {
  int i;
  for (i = 0; i < numSamples; i++) {
    float dither = PaConvert_TriangularDither() * (1.0f / ((1 << (15)) - 1));
    float dithered = (*sourceBuffer * (32766.0f)) + dither;
    long samp = (long)dithered;
    { samp = ((samp) < (-0x8000)) ? -0x8000 : (((samp) < (0x7FFF)) ? (0x7FFF) : (samp)); };
    *targetBuffer = (short)samp;
    sourceBuffer += sourceStride;
    targetBuffer += targetStride;
  }
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<PaConvert_Float32_Int16_ClipDither>:
  endbr64
  test   %r8d,%r8d
  jle    L7
  push   %r15
  movslq %esi,%rsi
  movslq %ecx,%rcx
  xor    %r15d,%r15d
  push   %r14
  mov    %rdx,%r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %r8d,%r12d
  push   %rbp
  lea    0x0(,%rsi,4),%rbp
  push   %rbx
  lea    (%rcx,%rcx,1),%rbx
  sub    $0x8,%rsp
  jmp    L23
  nopl   0x0(%rax,%rax,1)
L13:
  mov    $0x7fff,%edx
  cmp    %rdx,%rax
  cmovl  %rdx,%rax
  add    $0x1,%r15d
  add    %rbp,%r13
  mov    %ax,(%r14)
  add    %rbx,%r14
  cmp    %r15d,%r12d
  je     L27
L23:
  xor    %eax,%eax
  call   <PaConvert_TriangularDither@plt>
  movss  D19(%rip),%xmm1
  mulss  D4(%rip),%xmm0
  mulss  0x0(%r13),%xmm1
  addss  %xmm0,%xmm1
  cvttss2si %xmm1,%rax
  cmp    $0xffffffffffff8000,%rax
  jge    L13
  mov    $0xffff8000,%eax
  add    $0x1,%r15d
  add    %rbp,%r13
  mov    %ax,(%r14)
  add    %rbx,%r14
  cmp    %r15d,%r12d
  jne    L23
L27:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L7:
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D19
type_infered: byte[4]
name: unpack_data
arguments: data_label: D4
type_infered: byte[4]

tool: {"D19": [0x00,0xfc,0xff,0x46]}

tool: {"D4": [0x00,0x01,0x00,0x38]}

assistant: ```c
void PaConvert_Float32_Int16_ClipDither(float *sourceBuffer, int sourceStride, short *targetBuffer, int targetStride, int numSamples) {
  int i;
  for (i = 0; i < numSamples; i++) {
    float dither = PaConvert_TriangularDither() * (1.0f / ((1 << (15)) - 1));
    float dithered = (*sourceBuffer * (32766.0f)) + dither;
    long samp = (long)dithered;
    { samp = ((samp) < (-0x8000)) ? -0x8000 : (((samp) < (0x7FFF)) ? (0x7FFF) : (samp)); };
    *targetBuffer = (short)samp;
    sourceBuffer += sourceStride;
    targetBuffer += targetStride;
  }
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<timer_ms>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    -0x20(%rbp),%rax
  mov    (%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    (%rax),%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  imul   $0xf4240,%eax,%ecx
  mov    -0x20(%rbp),%rax
  mov    0x4(%rax),%edx
  mov    -0x18(%rbp),%rax
  mov    0x4(%rax),%eax
  sub    %eax,%edx
  lea    (%rcx,%rdx,1),%eax
  cltq
  mov    %rax,-0x8(%rbp)
  mov    -0x8(%rbp),%rcx
  movabs $0x431bde82d7b634db,%rdx
  mov    %rcx,%rax
  imul   %rdx
  mov    %rdx,%rax
  sar    $0x12,%rax
  sar    $0x3f,%rcx
  mov    %rcx,%rdx
  sub    %rdx,%rax
  pop    %rbp
  ret
```

assistant: ```c
long timer_ms(struct timeval *start, struct timeval *end) {
  long delta = ((end->tv_sec - start->tv_sec) * 1000000) + (end->tv_usec - start->tv_usec);
  return delta / 1000000;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<timer_ms>:
  endbr64
  mov    (%rsi),%ecx
  sub    (%rdi),%ecx
  imul   $0xf4240,%ecx,%ecx
  add    0x4(%rsi),%ecx
  sub    0x4(%rdi),%ecx
  movslq %ecx,%rcx
  movabs $0x431bde82d7b634db,%rdx
  mov    %rcx,%rax
  imul   %rdx
  sar    $0x12,%rdx
  sar    $0x3f,%rcx
  mov    %rdx,%rax
  sub    %rcx,%rax
  ret
```

assistant: ```c
long timer_ms(struct timeval *start, struct timeval *end) {
  long delta = ((end->tv_sec - start->tv_sec) * 1000000) + (end->tv_usec - start->tv_usec);
  return delta / 1000000;
}
```
user: Translate the below assembly code into C programming language:

```asm
<timer_ms>:
  endbr64
  movabs $0x431bde82d7b634db,%rdx
  mov    (%rsi),%ecx
  sub    (%rdi),%ecx
  imul   $0xf4240,%ecx,%ecx
  add    0x4(%rsi),%ecx
  sub    0x4(%rdi),%ecx
  movslq %ecx,%rcx
  mov    %rcx,%rax
  sar    $0x3f,%rcx
  imul   %rdx
  sar    $0x12,%rdx
  mov    %rdx,%rax
  sub    %rcx,%rax
  ret
```

assistant: ```c
long timer_ms(struct timeval *start, struct timeval *end) {
  long delta = ((end->tv_sec - start->tv_sec) * 1000000) + (end->tv_usec - start->tv_usec);
  return delta / 1000000;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<timer_ms>:
  endbr64
  movabs $0x431bde82d7b634db,%rdx
  mov    (%rsi),%ecx
  sub    (%rdi),%ecx
  imul   $0xf4240,%ecx,%ecx
  add    0x4(%rsi),%ecx
  sub    0x4(%rdi),%ecx
  movslq %ecx,%rcx
  mov    %rcx,%rax
  sar    $0x3f,%rcx
  imul   %rdx
  sar    $0x12,%rdx
  mov    %rdx,%rax
  sub    %rcx,%rax
  ret
```

assistant: ```c
long timer_ms(struct timeval *start, struct timeval *end) {
  long delta = ((end->tv_sec - start->tv_sec) * 1000000) + (end->tv_usec - start->tv_usec);
  return delta / 1000000;
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<CG_ShaderStateChanged>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0xc0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    $0x20,%edi
  call   <CG_ConfigString@plt>
  mov    %rax,-0xb8(%rbp)
  cmpq   $0x0,-0xb8(%rbp)
  je     L27
  jmp    L14
L36:
  mov    -0xb8(%rbp),%rax
  mov    $0x3d,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0xb0(%rbp)
  cmpq   $0x0,-0xb0(%rbp)
  je     L92
  mov    -0xb0(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L92
  mov    -0xb0(%rbp),%rax
  sub    -0xb8(%rbp),%rax
  mov    %eax,%edx
  mov    -0xb8(%rbp),%rcx
  lea    -0x90(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0xb0(%rbp),%rax
  sub    -0xb8(%rbp),%rax
  movb   $0x0,-0x90(%rbp,%rax,1)
  addq   $0x1,-0xb0(%rbp)
  mov    -0xb0(%rbp),%rax
  mov    $0x3a,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0xa8(%rbp)
  cmpq   $0x0,-0xa8(%rbp)
  je     L92
  mov    -0xa8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L92
  mov    -0xa8(%rbp),%rax
  sub    -0xb0(%rbp),%rax
  mov    %eax,%edx
  mov    -0xb0(%rbp),%rcx
  lea    -0x50(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0xa8(%rbp),%rax
  sub    -0xb0(%rbp),%rax
  movb   $0x0,-0x50(%rbp,%rax,1)
  addq   $0x1,-0xa8(%rbp)
  mov    -0xa8(%rbp),%rax
  mov    $0x40,%esi
  mov    %rax,%rdi
  call   <strchr@plt>
  mov    %rax,-0xb8(%rbp)
  cmpq   $0x0,-0xb8(%rbp)
  je     L14
  mov    -0xb8(%rbp),%rax
  sub    -0xa8(%rbp),%rax
  mov    %eax,%edx
  mov    -0xa8(%rbp),%rcx
  lea    -0xa0(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncpy@plt>
  mov    -0xb8(%rbp),%rax
  sub    -0xa8(%rbp),%rax
  movb   $0x0,-0xa0(%rbp,%rax,1)
  addq   $0x1,-0xb8(%rbp)
  lea    -0xa0(%rbp),%rdx
  lea    -0x50(%rbp),%rcx
  lea    -0x90(%rbp),%rax
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <trap_R_RemapShader@plt>
L14:
  cmpq   $0x0,-0xb8(%rbp)
  je     L92
  mov    -0xb8(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L36
  jmp    L92
L27:
  nop
L92:
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L103
  call   <__stack_chk_fail@plt>
L103:
  leave
  ret
```

assistant: ```c
void CG_ShaderStateChanged(void) {
  char originalShader[64];
  char newShader[64];
  char timeOffset[16];
  const char *o;
  char *n, *t;
  o = CG_ConfigString(32);
  if (!o)
    return;
  while (o && *o) {
    n = strstr(o, "=");
    if (n && *n) {
      strncpy(originalShader, o, n - o);
      originalShader[n - o] = 0;
      n++;
      t = strstr(n, ":");
      if (t && *t) {
        strncpy(newShader, n, t - n);
        newShader[t - n] = 0;
      } else {
        break;
      }
      t++;
      o = strstr(t, "@");
      if (o) {
        strncpy(timeOffset, t, o - t);
        timeOffset[o - t] = 0;
        o++;
        trap_R_RemapShader(originalShader, newShader, timeOffset);
      }
    } else {
      break;
    }
  }
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<CG_ShaderStateChanged>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa0,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  mov    $0x20,%edi
  call   <CG_ConfigString@plt>
  test   %rax,%rax
  je     L55
  mov    %rax,%rbp
  lea    0x10(%rsp),%r12
L83:
  test   %rbp,%rbp
  je     L55
  cmpb   $0x0,0x0(%rbp)
  je     L55
  mov    $0x3d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L55
  cmpb   $0x0,(%rax)
  je     L55
  mov    %rax,%r13
  sub    %rbp,%r13
  mov    %r13d,%edx
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strncpy@plt>
  movb   $0x0,0x10(%rsp,%r13,1)
  add    $0x1,%rbx
  mov    $0x3a,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L55
  cmpb   $0x0,(%rax)
  je     L55
  mov    %rax,%r13
  sub    %rbx,%r13
  lea    0x50(%rsp),%rdi
  mov    %r13d,%edx
  mov    %rbx,%rsi
  call   <strncpy@plt>
  movb   $0x0,0x50(%rsp,%r13,1)
  lea    0x1(%rbp),%rbx
  mov    $0x40,%esi
  mov    %rbx,%rdi
  call   <strchr@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L83
  mov    %rax,%r14
  sub    %rbx,%r14
  mov    %rsp,%r13
  mov    %r14d,%edx
  mov    %rbx,%rsi
  mov    %r13,%rdi
  call   <strncpy@plt>
  movb   $0x0,(%rsp,%r14,1)
  add    $0x1,%rbp
  lea    0x50(%rsp),%rsi
  mov    %r13,%rdx
  mov    %r12,%rdi
  call   <trap_R_RemapShader@plt>
  jmp    L83
L55:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L90
  add    $0xa0,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
L90:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CG_ShaderStateChanged(void) {
  char originalShader[64];
  char newShader[64];
  char timeOffset[16];
  const char *o;
  char *n, *t;
  o = CG_ConfigString(32);
  if (!o)
    return;
  while (o && *o) {
    n = strstr(o, "=");
    if (n && *n) {
      strncpy(originalShader, o, n - o);
      originalShader[n - o] = 0;
      n++;
      t = strstr(n, ":");
      if (t && *t) {
        strncpy(newShader, n, t - n);
        newShader[t - n] = 0;
      } else {
        break;
      }
      t++;
      o = strstr(t, "@");
      if (o) {
        strncpy(timeOffset, t, o - t);
        timeOffset[o - t] = 0;
        o++;
        trap_R_RemapShader(originalShader, newShader, timeOffset);
      }
    } else {
      break;
    }
  }
}
```
user: Translate the below assembly code into C programming language:

```asm
<CG_ShaderStateChanged>:
  endbr64
  push   %r15
  mov    $0x20,%edi
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  call   <CG_ConfigString@plt>
  test   %rax,%rax
  je     L76
  cmpb   $0x0,(%rax)
  mov    %rax,%rbp
  je     L76
  lea    0x10(%rsp),%r12
  jmp    L15
  xchg   %ax,%ax
L95:
  mov    %rax,%r15
  mov    %rsp,%r13
  mov    %rbp,%rsi
  sub    %rbp,%r15
  mov    %r13,%rdi
  lea    0x1(%rbx),%rbp
  mov    %r15d,%edx
  call   <strncpy@plt>
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %r12,%rdi
  movb   $0x0,(%rsp,%r15,1)
  call   <trap_R_RemapShader@plt>
  cmpb   $0x0,0x1(%rbx)
  je     L76
L15:
  mov    $0x3d,%esi
  mov    %rbp,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L76
  cmpb   $0x0,(%rax)
  je     L76
  mov    %rax,%r13
  mov    %rbp,%rsi
  mov    %r12,%rdi
  sub    %rbp,%r13
  lea    0x1(%rbx),%rbp
  mov    %r13d,%edx
  call   <strncpy@plt>
  mov    $0x3a,%esi
  mov    %rbp,%rdi
  movb   $0x0,0x10(%rsp,%r13,1)
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L76
  cmpb   $0x0,(%rax)
  je     L76
  mov    %rax,%r13
  lea    0x50(%rsp),%r14
  mov    %rbp,%rsi
  sub    %rbp,%r13
  mov    %r14,%rdi
  lea    0x1(%rbx),%rbp
  mov    %r13d,%edx
  call   <strncpy@plt>
  mov    $0x40,%esi
  mov    %rbp,%rdi
  movb   $0x0,0x50(%rsp,%r13,1)
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  jne    L95
L76:
  mov    0x98(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L92
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L92:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
void CG_ShaderStateChanged(void) {
  char originalShader[64];
  char newShader[64];
  char timeOffset[16];
  const char *o;
  char *n, *t;
  o = CG_ConfigString(32);
  if (!o)
    return;
  while (o && *o) {
    n = strstr(o, "=");
    if (n && *n) {
      strncpy(originalShader, o, n - o);
      originalShader[n - o] = 0;
      n++;
      t = strstr(n, ":");
      if (t && *t) {
        strncpy(newShader, n, t - n);
        newShader[t - n] = 0;
      } else {
        break;
      }
      t++;
      o = strstr(t, "@");
      if (o) {
        strncpy(timeOffset, t, o - t);
        timeOffset[o - t] = 0;
        o++;
        trap_R_RemapShader(originalShader, newShader, timeOffset);
      }
    } else {
      break;
    }
  }
}
```