user: 这段汇编代码用C语言表示是什么样的：

```asm
<open_pty_master>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  lea    D172(%rip),%r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movzbl D172(%rip),%eax
  test   %al,%al
  je     L158
  mov    D54(%rip),%rbx
  mov    %r13,%r14
  lea    D118(%rip),%rbp
  jmp    L26
  nopw   0x0(%rax,%rax,1)
L154:
  movzbl 0x1(%r14),%eax
  add    $0x1,%r14
  test   %al,%al
  je     L158
L26:
  mov    (%rbx),%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  mov    %al,D111(%rip)
  call   <open@plt>
  test   %eax,%eax
  js     L154
  movb   $0x73,D144(%rip)
  mov    %rbp,(%r12)
L65:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L158:
  movzbl D120(%rip),%eax
  test   %al,%al
  je     L34
  lea    D120(%rip),%r14
  lea    D44(%rip),%rbp
L161:
  mov    %al,D5(%rip)
  movzbl 0x0(%r13),%eax
  test   %al,%al
  je     L64
  mov    D54(%rip),%rbx
  lea    D172(%rip),%r15
  jmp    L145
  nopl   0x0(%rax)
L165:
  movzbl 0x1(%r15),%eax
  add    $0x1,%r15
  test   %al,%al
  je     L64
L145:
  mov    (%rbx),%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  mov    %al,D177(%rip)
  call   <open@plt>
  test   %eax,%eax
  js     L165
  movzbl (%r14),%edx
  lea    D155(%rip),%rcx
  mov    %dl,D105(%rip)
  movzbl (%r15),%edx
  mov    %dl,D174(%rip)
  mov    %rcx,(%r12)
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L64:
  movzbl 0x1(%r14),%eax
  add    $0x1,%r14
  test   %al,%al
  jne    L161
  movzbl D120(%rip),%eax
  test   %al,%al
  je     L34
  lea    D120(%rip),%r14
  lea    D234(%rip),%rbp
L47:
  mov    %al,D150(%rip)
  movzbl 0x0(%r13),%eax
  test   %al,%al
  je     L155
  mov    D54(%rip),%rbx
  lea    D172(%rip),%r15
  jmp    L6
  nopl   0x0(%rax)
L168:
  movzbl 0x1(%r15),%eax
  add    $0x1,%r15
  test   %al,%al
  je     L155
L6:
  mov    (%rbx),%esi
  xor    %edx,%edx
  mov    %rbp,%rdi
  mov    %al,D213(%rip)
  call   <open@plt>
  test   %eax,%eax
  js     L168
  movb   $0x74,D225(%rip)
  mov    %rbp,(%r12)
  jmp    L65
L155:
  movzbl 0x1(%r14),%eax
  add    $0x1,%r14
  test   %al,%al
  jne    L47
L34:
  mov    $0xffffffff,%eax
  jmp    L65
```

assistant: ```c
int open_pty_master(char **ptyslave) {
  int mfd;
  char *major, *minor;
  static char majorchars[] = "pqrstuvwxyzabcdePQRSTUVWXYZABCDE";
  static char minorchars[] = "0123456789abcdefghijklmnopqrstuv"
                             "wxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_+";
  {
    static char ptyname[] = "/dev/pty/mX";
    for (minor = minorchars; *minor; minor++) {
      ptyname[10] = *minor;
      if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
        ptyname[9] = 's';
        *ptyslave = ptyname;
        return mfd;
      }
    }
  }
  {
    static char ptyname[] = "/dev/ptym/ptyXY";
    static char ttyname[] = "/dev/pty/ttyXY";
    for (major = majorchars; *major; major++) {
      ptyname[13] = *major;
      for (minor = minorchars; *minor; minor++) {
        ptyname[14] = *minor;
        if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
          ttyname[12] = *major;
          ttyname[13] = *minor;
          *ptyslave = ttyname;
          return mfd;
        }
      }
    }
  }
  {
    static char ptyname[] = "/dev/ptyXY";
    for (major = majorchars; *major; major++) {
      ptyname[8] = *major;
      for (minor = minorchars; *minor; minor++) {
        ptyname[9] = *minor;
        if ((mfd = open(ptyname, O_RDWR, 0)) >= 0) {
          ptyname[5] = 't';
          *ptyslave = ptyname;
          return mfd;
        }
      }
    }
  }
  return -1;
}
```