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

```asm
<main>:
  endbr64
  push   %r15
  lea    D29(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  lea    D45(%rip),%r12
  push   %rbp
  push   %rbx
  sub    $0x178,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x168(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x1c(%rsp),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D63(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%edi
  test   %edi,%edi
  jle    L66
  xor    %ebx,%ebx
  lea    0x20(%rsp),%rbp
  lea    0x70(%rsp),%r13
  xor    %r15d,%r15d
  lea    0x110(%rsp),%r14
  nopw   0x0(%rax,%rax,1)
L4:
  add    $0x1,%r15d
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  mov    %r15d,%esi
  call   <printf@plt>
  lea    D66(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x0(%rbp,%rbx,1),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D47(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    (%r14,%rbx,1),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%edi
  mov    %r15d,0x0(%r13,%rbx,1)
  add    $0x4,%rbx
  cmp    %edi,%r15d
  jl     L4
  test   %edi,%edi
  jle    L66
  xor    %r10d,%r10d
  lea    -0x1(%rdi),%r12d
  mov    (%r14,%r10,4),%r11d
  movslq %r10d,%rsi
  cmp    %r12,%r10
  je     L115
  nopw   0x0(%rax,%rax,1)
L140:
  lea    0x1(%r10),%rbx
  mov    %r11d,%ecx
  mov    %rbx,%rax
  nopw   0x0(%rax,%rax,1)
L1:
  mov    (%r14,%rax,4),%edx
  cmp    %ecx,%edx
  jge    L151
  mov    %edx,%ecx
  movslq %eax,%rsi
L151:
  add    $0x1,%rax
  cmp    %eax,%edi
  jg     L1
  mov    0x20(%rsp,%rsi,4),%edx
  mov    0x0(%rbp,%r10,4),%eax
  mov    %ecx,(%r14,%r10,4)
  mov    %r11d,0x110(%rsp,%rsi,4)
  mov    %edx,0x0(%rbp,%r10,4)
  mov    0x70(%rsp,%rsi,4),%edx
  mov    %eax,0x20(%rsp,%rsi,4)
  mov    0x0(%r13,%r10,4),%eax
  mov    %edx,0x0(%r13,%r10,4)
  mov    %rbx,%r10
  mov    %eax,0x70(%rsp,%rsi,4)
  mov    (%r14,%r10,4),%r11d
  movslq %r10d,%rsi
  cmp    %r12,%r10
  jne    L140
L115:
  cmp    $0x1,%edi
  jle    L66
  lea    -0x2(%rdi),%eax
  lea    0xc4(%rsp),%r9
  lea    0x28(%rsp,%rax,4),%rsi
  lea    0x24(%rsp),%r8
  xor    %eax,%eax
  nopl   0x0(%rax)
L117:
  mov    %rbp,%rdx
  xor    %ecx,%ecx
  nopl   (%rax)
L149:
  add    (%rdx),%ecx
  add    $0x4,%rdx
  cmp    %r8,%rdx
  jne    L149
  add    $0x4,%r8
  mov    %ecx,(%r9)
  add    %ecx,%eax
  add    $0x4,%r9
  cmp    %rsi,%r8
  jne    L117
L103:
  cltd
  idiv   %edi
  lea    D67(%rip),%rdi
  mov    %eax,0xc(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%r15d
  test   %r15d,%r15d
  jle    L65
  xor    %ebx,%ebx
  xor    %ecx,%ecx
  lea    0x20(%rsp),%rbp
  xor    %r12d,%r12d
  lea    0x70(%rsp),%r13
  lea    D54(%rip),%r14
  jmp    L40
  nopw   0x0(%rax,%rax,1)
L32:
  mov    0xc0(%rsp,%rbx,4),%ecx
L40:
  mov    0x0(%rbp,%rbx,4),%edx
  mov    0x0(%r13,%rbx,4),%esi
  mov    %r14,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  lea    (%rcx,%rdx,1),%r8d
  add    %r8d,%r12d
  call   <printf@plt>
  mov    0x1c(%rsp),%r15d
  cmp    %ebx,%r15d
  jg     L32
L30:
  mov    0xc(%rsp),%esi
  lea    D76(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r12d,%eax
  lea    D7(%rip),%rdi
  cltd
  idiv   %r15d
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L59
  add    $0x178,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L66:
  xor    %eax,%eax
  jmp    L103
L65:
  xor    %r12d,%r12d
  jmp    L30
L59:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D29
datatype: string
name: extract_symbolic_data
arguments: data_label: D45
datatype: string
name: extract_symbolic_data
arguments: data_label: D63
datatype: string
name: extract_symbolic_data
arguments: data_label: D73
datatype: string
name: extract_symbolic_data
arguments: data_label: D66
datatype: string
name: extract_symbolic_data
arguments: data_label: D47
datatype: string
name: extract_symbolic_data
arguments: data_label: D67
datatype: string
name: extract_symbolic_data
arguments: data_label: D54
datatype: string
name: extract_symbolic_data
arguments: data_label: D76
datatype: string
name: extract_symbolic_data
arguments: data_label: D7
datatype: string

tool: D29: Enter Total Number of Process:

tool: D45: %d

tool: D63: 
Enter Burst Time and Priority

tool: D73: 
P[%d]


tool: D66: Burst Time:

tool: D47: Priority:

tool: D67: 
Process	    Burst Time    	Waiting Time	Turnaround Time

tool: D54: 
P[%d]		  %d		    %d			%d

tool: D76: 

Average Waiting Time=%d

tool: D7: 
Average Turnaround Time=%d


assistant: ```c
int main() {
  int bt[20], p[20], wt[20], tat[20], pr[20], i, j, n, total = 0, pos, temp, avg_wt, avg_tat;
  printf("Enter Total Number of Process:");
  scanf("%d", &n);
  printf("\nEnter Burst Time and Priority\n");
  for (i = 0; i < n; i++) {
    printf("\nP[%d]\n", i + 1);
    printf("Burst Time:");
    scanf("%d", &bt[i]);
    printf("Priority:");
    scanf("%d", &pr[i]);
    p[i] = i + 1;
  }
  for (i = 0; i < n; i++) {
    pos = i;
    for (j = i + 1; j < n; j++) {
      if (pr[j] < pr[pos])
        pos = j;
    }
    temp = pr[i];
    pr[i] = pr[pos];
    pr[pos] = temp;
    temp = bt[i];
    bt[i] = bt[pos];
    bt[pos] = temp;
    temp = p[i];
    p[i] = p[pos];
    p[pos] = temp;
  }
  wt[0] = 0;
  for (i = 1; i < n; i++) {
    wt[i] = 0;
    for (j = 0; j < i; j++)
      wt[i] += bt[j];
    total += wt[i];
  }
  avg_wt = total / n;
  total = 0;
  printf("\nProcess\t    Burst Time    \tWaiting Time\tTurnaround Time");
  for (i = 0; i < n; i++) {
    tat[i] = bt[i] + wt[i];
    total += tat[i];
    printf("\nP[%d]\t\t  %d\t\t    %d\t\t\t%d", p[i], bt[i], wt[i], tat[i]);
  }
  avg_tat = total / n;
  printf("\n\nAverage Waiting Time=%d", avg_wt);
  printf("\nAverage Turnaround Time=%d\n", avg_tat);
  return 0;
}
```