user: 请从给定的汇编指令推导出C源代码:

```asm
<main>:
  endbr64
  push   %r15
  lea    D33(%rip),%rdi
  push   %r14
  push   %r13
  push   %r12
  lea    D65(%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    D37(%rip),%rdi
  call   <puts@plt>
  mov    0x1c(%rsp),%edi
  test   %edi,%edi
  jle    L214
  xor    %ebx,%ebx
  lea    0x20(%rsp),%rbp
  lea    0x70(%rsp),%r14
  xor    %r15d,%r15d
  lea    0x110(%rsp),%r13
  nopw   0x0(%rax,%rax,1)
L6:
  add    $0x1,%r15d
  lea    D97(%rip),%rdi
  xor    %eax,%eax
  mov    %r15d,%esi
  call   <printf@plt>
  lea    D44(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x0(%rbp,%rbx,1),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  lea    D13(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    0x0(%r13,%rbx,1),%rsi
  mov    %r12,%rdi
  call   <scanf@plt>
  mov    0x1c(%rsp),%edi
  mov    %r15d,(%r14,%rbx,1)
  add    $0x4,%rbx
  cmp    %edi,%r15d
  jl     L6
  test   %edi,%edi
  jle    L214
  mov    0x110(%rsp),%ebx
  cmp    $0x1,%edi
  je     L214
  lea    -0x1(%rdi),%r12d
  xor    %r10d,%r10d
  nopl   0x0(%rax,%rax,1)
L155:
  movslq %r10d,%rsi
  mov    %r10,%r11
  add    $0x1,%r10
  mov    %ebx,%ecx
  mov    %r10,%rax
  nop
L165:
  mov    0x0(%r13,%rax,4),%edx
  cmp    %ecx,%edx
  jge    L206
  mov    %edx,%ecx
  movslq %eax,%rsi
L206:
  add    $0x1,%rax
  cmp    %eax,%edi
  jg     L165
  mov    0x0(%rbp,%r11,4),%eax
  mov    0x20(%rsp,%rsi,4),%edx
  mov    %ecx,0x0(%r13,%r11,4)
  mov    %ebx,0x110(%rsp,%rsi,4)
  mov    0x0(%r13,%r10,4),%ebx
  mov    %edx,0x0(%rbp,%r11,4)
  mov    0x70(%rsp,%rsi,4),%edx
  mov    %eax,0x20(%rsp,%rsi,4)
  mov    (%r14,%r11,4),%eax
  mov    %edx,(%r14,%r11,4)
  mov    %eax,0x70(%rsp,%rsi,4)
  cmp    %r12,%r10
  jne    L155
  movdqa 0x20(%rsp),%xmm3
  movdqa 0x30(%rsp),%xmm4
  xor    %eax,%eax
  movl   $0x0,0xc0(%rsp)
  movdqa 0x40(%rsp),%xmm5
  movdqa 0x50(%rsp),%xmm2
  mov    $0x1,%ecx
  lea    0xc4(%rsp),%r10
  paddd  %xmm3,%xmm4
  paddd  %xmm4,%xmm5
  paddd  %xmm5,%xmm2
  jmp    L162
  xchg   %ax,%ax
L199:
  cmp    $0x2,%edx
  je     L68
  cmp    $0x4,%edx
  jne    L158
  movdqa %xmm2,%xmm0
L231:
  movdqa %xmm0,%xmm1
  mov    %ecx,%r8d
  psrldq $0x8,%xmm1
  and    $0xfffffffc,%r8d
  paddd  %xmm1,%xmm0
  movdqa %xmm0,%xmm1
  psrldq $0x4,%xmm1
  paddd  %xmm1,%xmm0
  movd   %xmm0,%edx
  test   $0x3,%cl
  je     L109
L235:
  movslq %r8d,%rsi
  lea    0x1(%r8),%r9d
  add    0x20(%rsp,%rsi,4),%edx
  cmp    %ecx,%r9d
  jge    L109
  movslq %r9d,%r9
  add    $0x2,%r8d
  add    0x20(%rsp,%r9,4),%edx
  cmp    %ecx,%r8d
  jge    L109
  movslq %r8d,%r8
  add    0x20(%rsp,%r8,4),%edx
L109:
  add    $0x1,%ecx
  mov    %edx,(%r10)
  add    %edx,%eax
  add    $0x4,%r10
  cmp    %ecx,%edi
  je     L147
L162:
  lea    -0x1(%rcx),%edx
  cmp    $0x2,%edx
  jbe    L124
  mov    %ecx,%edx
  shr    $0x2,%edx
  cmp    $0x1,%edx
  jne    L199
  movdqa %xmm3,%xmm0
  jmp    L231
  nopl   0x0(%rax)
L68:
  movdqa %xmm4,%xmm0
  jmp    L231
L214:
  movl   $0x0,0xc0(%rsp)
  xor    %eax,%eax
  cs nopw 0x0(%rax,%rax,1)
L147:
  cltd
  idiv   %edi
  lea    D53(%rip),%rdi
  mov    %eax,%r12d
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%ecx
  test   %ecx,%ecx
  jle    L77
  xor    %ebx,%ebx
  lea    0x20(%rsp),%rbp
  lea    0x70(%rsp),%r14
  xor    %r13d,%r13d
  lea    0xc0(%rsp),%r15
  nopw   0x0(%rax,%rax,1)
L119:
  mov    (%r15,%rbx,4),%ecx
  mov    0x0(%rbp,%rbx,4),%edx
  lea    D46(%rip),%rdi
  xor    %eax,%eax
  mov    (%r14,%rbx,4),%esi
  add    $0x1,%rbx
  lea    (%rdx,%rcx,1),%r8d
  add    %r8d,%r13d
  call   <printf@plt>
  mov    0x1c(%rsp),%ecx
  cmp    %ebx,%ecx
  jg     L119
L8:
  mov    %r12d,%esi
  lea    D73(%rip),%rdi
  xor    %eax,%eax
  mov    %ecx,0xc(%rsp)
  call   <printf@plt>
  mov    %r13d,%eax
  mov    0xc(%rsp),%ecx
  lea    D62(%rip),%rdi
  cltd
  idiv   %ecx
  mov    %eax,%esi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x168(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L52
  add    $0x178,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L158:
  movdqa %xmm5,%xmm0
  jmp    L231
  nopl   0x0(%rax)
L124:
  xor    %edx,%edx
  xor    %r8d,%r8d
  jmp    L235
L77:
  xor    %r13d,%r13d
  jmp    L8
L52:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D33
datatype: string
name: unpack_data
arguments: data_tag: D65
datatype: string
name: unpack_data
arguments: data_tag: D37
datatype: string
name: unpack_data
arguments: data_tag: D97
datatype: string
name: unpack_data
arguments: data_tag: D44
datatype: string
name: unpack_data
arguments: data_tag: D13
datatype: string
name: unpack_data
arguments: data_tag: D53
datatype: string
name: unpack_data
arguments: data_tag: D46
datatype: string
name: unpack_data
arguments: data_tag: D73
datatype: string
name: unpack_data
arguments: data_tag: D62
datatype: string

tool: D33: Enter Total Number of Process:

tool: D65: %d

tool: D37: 
Enter Burst Time and Priority

tool: D97: 
P[%d]


tool: D44: Burst Time:

tool: D13: Priority:

tool: D53: 
Process	    Burst Time    	Waiting Time	Turnaround Time

tool: D46: 
P[%d]		  %d		    %d			%d

tool: D73: 

Average Waiting Time=%d

tool: D62: 
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;
}
```