user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    0x2c(%rsp),%rax
  mov    %rax,0x18(%rsp)
  nopl   0x0(%rax)
L22:
  mov    0x18(%rsp),%rsi
  lea    D8(%rip),%rdi
  xor    %eax,%eax
  call   <scanf@plt>
  mov    0x2c(%rsp),%eax
  test   %eax,%eax
  je     L109
  movl   $0x1,0xc(%rsp)
  jle    L5
  lea    0x33(%rsp),%rax
  xor    %r8d,%r8d
  mov    $0x6,%ebp
  mov    $0x5,%r12d
  mov    %rax,0x10(%rsp)
  mov    $0x4,%r13d
  mov    $0x1,%ebx
  mov    $0x3,%r14d
  mov    $0x2,%r15d
  jmp    L77
  xchg   %ax,%ax
L132:
  cmp    $0x53,%al
  je     L72
  jg     L49
  cmp    $0x45,%al
  je     L21
  cmp    $0x52,%al
  mov    %r15d,%eax
  jne    L119
  mov    %r14d,%r15d
  mov    %r12d,%r14d
  mov    %r13d,%r12d
  mov    %eax,%r13d
L8:
  add    %ebx,0xc(%rsp)
  add    $0x1,%r8d
  cmp    %r8d,0x2c(%rsp)
  jle    L5
L77:
  mov    0x10(%rsp),%rsi
  xor    %eax,%eax
  mov    %r8d,0x8(%rsp)
  lea    D16(%rip),%rdi
  call   <scanf@plt>
  movzbl 0x33(%rsp),%eax
  mov    0x8(%rsp),%r8d
  cmp    $0x4e,%al
  jne    L132
  mov    %ebx,%eax
  add    $0x1,%r8d
  mov    %r15d,%ebx
  mov    %ebp,%r15d
  add    %ebx,0xc(%rsp)
  mov    %r12d,%ebp
  mov    %eax,%r12d
  cmp    %r8d,0x2c(%rsp)
  jg     L77
L5:
  mov    0xc(%rsp),%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  jmp    L22
  nopl   0x0(%rax)
L49:
  cmp    $0x57,%al
  jne    L71
  mov    %ebx,%eax
  mov    %r14d,%ebx
  mov    %ebp,%r14d
  mov    %r13d,%ebp
  mov    %eax,%r13d
  jmp    L8
  nopl   0x0(%rax)
L21:
  mov    %ebx,%eax
  mov    %r13d,%ebx
  mov    %ebp,%r13d
  mov    %r14d,%ebp
  mov    %eax,%r14d
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L71:
  mov    %r15d,%eax
L119:
  mov    %r13d,%r15d
  mov    %r12d,%r13d
  mov    %r14d,%r12d
  mov    %eax,%r14d
  jmp    L8
  nopl   0x0(%rax)
L72:
  mov    %ebx,%eax
  mov    %r12d,%ebx
  mov    %ebp,%r12d
  mov    %r15d,%ebp
  mov    %eax,%r15d
  jmp    L8
  nopl   0x0(%rax,%rax,1)
L109:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L15
  add    $0x48,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L15:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_tag: D8
type: string
name: disassemble_data
arguments: data_tag: D16
type: string

tool: D8: %d


tool: D16: %s


assistant: ```c
int main(void) {
  int o, s, e, w, n, u, c, temp, i, sum;
  char inst[5];
  while (1) {
    scanf("%d\n", &c);
    if (c == 0)
      break;
    o = 1, s = 2, e = 3, w = 4, n = 5, u = 6, sum = 1;
    for (i = 0; i < c; i++) {
      scanf("%s\n", inst);
      if (inst[0] == 'N') {
        temp = o;
        o = s;
        s = u;
        u = n;
        n = temp;
      } else if (inst[0] == 'E') {
        temp = o;
        o = w;
        w = u;
        u = e;
        e = temp;
      } else if (inst[0] == 'W') {
        temp = o;
        o = e;
        e = u;
        u = w;
        w = temp;
      } else if (inst[0] == 'S') {
        temp = o;
        o = n;
        n = u;
        u = s;
        s = temp;
      } else if (inst[0] == 'R') {
        temp = n;
        n = w;
        w = s;
        s = e;
        e = temp;
      } else {
        temp = n;
        n = e;
        e = s;
        s = w;
        w = temp;
      }
      sum += o;
    }
    printf("%d\n", sum);
  }
  return 0;
}
```