// File: /workspace/github_c_makefile_star2_O1/arachsys[P]init/syslog.c
// Function: main
int main(int argc, char **argv) {
  struct pollfd fds[2];
  int option;

  while ((option = getopt(argc, argv, ":bn")) > 0)
    switch (option) {
      case 'b':
        boot = 1;
        break;
      case 'n':
        numeric = 1;
        break;
      default:
        usage(argv[0]);
    }

  if (argc > optind)
    usage(argv[0]);

  if ((fds[0].fd = open("/dev/kmsg", O_RDONLY | O_NONBLOCK)) < 0)
    err(EXIT_FAILURE, "open /dev/kmsg");
  lseek(fds[0].fd, 0, boot ? SEEK_SET : SEEK_END);
  fds[1].fd = syslog_open();

  zone = getenv("TZ");

  fds[0].events = fds[1].events = POLLIN;
  while(1) {
    while (poll(fds, 2, -1) < 0)
      if (errno != EAGAIN && errno != EINTR)
        err(EXIT_FAILURE, "poll");
    if (fds[0].revents & POLLIN)
      kernel_read(fds[0].fd);
    if (fds[1].revents & POLLIN)
      syslog_recv(fds[1].fd);
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rsi, %rbx
movl %edi, %ebp
leaq 0xdae(%rip), %rdx       # 0x317d
callq 0x2180
testl %eax, %eax
jle 0x2411
leaq 0x2f71(%rip), %r15      # 0x5350
leaq 0xd97(%rip), %r14       # 0x317d
leaq 0x2f67(%rip), %r12      # 0x5354
movq %r15, %rcx
cmpl $0x62, %eax
je 0x23fd
cmpl $0x6e, %eax
jne 0x241c
movq %r12, %rcx
movb $0x1, (%rcx)
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2180
testl %eax, %eax
jg 0x23ed
movq 0x2bb8(%rip), %rax      # 0x4fd0
cmpl %ebp, (%rax)
jge 0x2441
movq (%rbx), %rdx
movq 0x2bd2(%rip), %rax      # 0x4ff8
movq (%rax), %rdi
leaq 0xcca(%rip), %rsi       # 0x30fa
xorl %eax, %eax
callq 0x20c0
movl $0x40, %edi
callq 0x21a0
leaq 0xd3e(%rip), %rdi       # 0x3186
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x2170
movl %eax, 0x20(%rsp)
testl %eax, %eax
jns 0x2468
leaq 0xd1e(%rip), %rsi       # 0x3181
jmp 0x2b09
movzbl 0x2ee1(%rip), %edx      # 0x5350
xorl $0x1, %edx
addl %edx, %edx
movl %eax, %edi
xorl %esi, %esi
callq 0x20a0
callq 0x22cc
leaq 0x20(%rsp), %rbx
movl %eax, 0x8(%rbx)
leaq 0xcff(%rip), %rdi       # 0x3190
callq 0x2030
movq %rax, 0x2ebb(%rip)      # 0x5358
movw $0x1, %ax
movw %ax, 0xc(%rbx)
movw %ax, 0x4(%rbx)
leaq 0x2eb0(%rip), %rbp      # 0x5360
leaq 0x18(%rsp), %r12
leaq 0x90(%rsp), %r15
movl $0x2, %esi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2150
testl %eax, %eax
jns 0x2502
callq 0x2040
movq %rax, %r14
movl (%r14), %eax
cmpl $0x4, %eax
je 0x24ec
cmpl $0xb, %eax
jne 0x2b02
movl $0x2, %esi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2150
testl %eax, %eax
js 0x24db
testb $0x1, 0x26(%rsp)
je 0x274b
movl 0x20(%rsp), %edi
movl $0x10000, %edx          # imm = 0x10000
movq %rbp, %rsi
callq 0x20b0
movq %rax, %r14
testl %r14d, %r14d
jle 0x274b
leaq 0x70(%rsp), %rdi
callq 0x20f0
movq 0x2e1d(%rip), %rcx      # 0x5358
movq 0x2a96(%rip), %rax      # 0x4fd8
testq %rcx, %rcx
je 0x255a
cmpb $0x0, (%rcx)
movq 0x2a77(%rip), %rax      # 0x4fc8
jne 0x255a
movq 0x2a7e(%rip), %rax      # 0x4fd8
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq *%rax
movq %rbp, %rax
andl $0x7fffffff, %r14d      # imm = 0x7FFFFFFF
je 0x25b2
leaq (%r14,%rbp), %rcx
movq %rbp, %rax
movzbl (%rax), %esi
xorl %edx, %edx
testl %esi, %esi
je 0x2587
cmpl $0xa, %esi
jne 0x2593
movb %dl, (%rax)
incq %rax
cmpq %rcx, %rax
jb 0x2579
jmp 0x25b2
cmpb $0x20, %sil
setl %dil
cmpb $0x9, %sil
setne %r8b
movb $0x20, %dl
cmpb $0x7f, %sil
je 0x2587
andb %r8b, %dil
je 0x2589
jmp 0x2587
movq %rax, 0x90(%rsp)
movb $0x0, (%r14,%rbp)
movq %rbp, %rdi
movq %r15, %rsi
movl $0xa, %edx
callq 0x2190
movq %rax, %r13
cmpq %rbp, 0x90(%rsp)
movl $0x5, %eax
cmovel %eax, %r13d
movq %rbp, %rdi
movl $0x3b, %esi
callq 0x2080
leaq 0x1(%rax), %r14
testq %rax, %rax
cmoveq %rbp, %r14
movq %r14, 0x90(%rsp)
cmpb $0x0, (%r14)
je 0x274b
cmpb $0x1, 0x2d40(%rip)      # 0x5354
jne 0x262f
movl %r13d, %esi
andl $0x3f8, %esi            # imm = 0x3F8
leaq 0xb72(%rip), %rdi       # 0x3198
xorl %eax, %eax
callq 0x2090
jmp 0x2683
movl 0x2ba3(%rip), %edx      # 0x51d8
leaq 0xba0(%rip), %rsi       # 0x31dc
testl %edx, %edx
js 0x2675
movl %r13d, %eax
andl $0x3f8, %eax            # imm = 0x3F8
leaq 0x2b81(%rip), %rcx      # 0x51d0
cmpl %eax, %edx
je 0x2669
leaq 0x2b76(%rip), %rcx      # 0x51d0
movl 0x18(%rcx), %edx
testl %edx, %edx
js 0x266e
addq $0x10, %rcx
cmpl %eax, %edx
jne 0x265a
movq (%rcx), %rsi
jmp 0x2675
leaq 0xb67(%rip), %rsi       # 0x31dc
leaq 0xb25(%rip), %rdi       # 0x31a1
xorl %eax, %eax
callq 0x2090
andl $0x7, %r13d
movl 0x4c(%rsp), %edx
movl $0x76c, %eax            # imm = 0x76C
addl %eax, %edx
movl 0x48(%rsp), %ecx
incl %ecx
movl 0x44(%rsp), %r8d
movl 0x40(%rsp), %r9d
movl 0x38(%rsp), %r10d
movl 0x3c(%rsp), %r11d
leaq 0xaf7(%rip), %rdi       # 0x31aa
movl %r13d, %esi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
addq $0x10, %rsp
movq 0x2c8c(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x272b
cmpb $0x0, (%rax)
je 0x272b
movq 0x60(%rsp), %rax
movq %rax, %rcx
shrq $0x3f, %rcx
leal 0x2b(,%rcx,2), %esi
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movq %rcx, %rdx
movl $0x91a2b3c5, %eax       # imm = 0x91A2B3C5
imulq %rax, %rdx
shrq $0x2b, %rdx
movl $0x88888889, %eax       # imm = 0x88888889
imulq %rax, %rcx
shrq $0x25, %rcx
imulq $0x8888889, %rcx, %rax  # imm = 0x8888889
shrq $0x21, %rax
imull $0x3c, %eax, %eax
subl %eax, %ecx
leaq 0xaa8(%rip), %rdi       # 0x31cc
xorl %eax, %eax
callq 0x2090
leaq 0xaa5(%rip), %rdi       # 0x31d7
movq %r14, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x287d(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
testb $0x1, 0x2e(%rsp)
je 0x24bd
movl 0x28(%rsp), %edi
movq %rbp, 0xc8(%rsp)
movq $0x10000, 0xd0(%rsp) # imm = 0x10000
movq $0x0, 0x38(%rsp)
xorl %eax, %eax
movl %eax, 0x40(%rsp)
leaq 0xc8(%rsp), %rcx
movq %rcx, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
leaq 0x70(%rsp), %rcx
movq %rcx, 0x58(%rsp)
movq $0x20, 0x60(%rsp)
movl %eax, 0x68(%rsp)
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x2140
testl %eax, %eax
jle 0x24bd
movl 0x78(%rsp), %ecx
movl 0x7c(%rsp), %edx
xorl $0x1, %ecx
xorl $0x2, %edx
movl $0x0, 0x14(%rsp)
orl %ecx, %edx
movl $0x0, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
jne 0x2809
movl 0x88(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl 0x84(%rsp), %ecx
movl %ecx, 0x10(%rsp)
movl 0x80(%rsp), %ecx
movl %ecx, 0xc(%rsp)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
je 0x2ad6
leaq (%rax,%rbp), %rbx
movq %rbp, %rcx
movzbl (%rcx), %esi
xorl %edx, %edx
testl %esi, %esi
je 0x2829
cmpl $0xa, %esi
jne 0x2835
movb %dl, (%rcx)
incq %rcx
cmpq %rbx, %rcx
jb 0x281b
jmp 0x2854
cmpb $0x20, %sil
setl %dil
cmpb $0x9, %sil
setne %r8b
movb $0x20, %dl
cmpb $0x7f, %sil
je 0x2829
andb %r8b, %dil
je 0x282b
jmp 0x2829
movb $0x0, (%rax,%rbp)
movl $0x1d, 0x8(%rsp)
testq %rax, %rax
je 0x2ae2
leaq 0x2af0(%rip), %rbp      # 0x5360
movl $0x0, 0x18(%rsp)
movq %rbp, %rdi
leaq 0x96b(%rip), %rsi       # 0x31ed
leaq 0x8(%rsp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2120
movslq 0x18(%rsp), %r13
addq %rbp, %r13
movq %r12, %rdi
callq 0x20f0
movq %r12, %rdi
movq %r15, %rsi
callq 0x21d0
movq %r13, %rdi
leaq 0x93e(%rip), %rsi       # 0x31f4
movq %r15, %rdx
callq 0x21b0
movq %rax, %rbp
testq %rax, %rax
je 0x290e
movq 0x18(%rsp), %r14
movq %r15, %rdi
callq 0x2130
subq %rax, %r14
addq $-0xf0c3f0, %r14        # imm = 0xFF0F3C10
movq %r14, %rax
movabsq $0x440cb5e3c5502dcf, %rcx # imm = 0x440CB5E3C5502DCF
imulq %rcx
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x17, %rdx
addl %eax, %edx
addl %edx, 0xa4(%rsp)
movq %r15, %rdi
callq 0x2130
movq %rax, 0x18(%rsp)
movq 0x2a43(%rip), %rcx      # 0x5358
movq 0x26bc(%rip), %rax      # 0x4fd8
testq %rcx, %rcx
je 0x2934
cmpb $0x0, (%rcx)
movq 0x269d(%rip), %rax      # 0x4fc8
jne 0x2934
movq 0x26a4(%rip), %rax      # 0x4fd8
movq %r12, %rdi
movq %r15, %rsi
callq *%rax
movl %ebp, %eax
subl %r13d, %eax
testq %rbp, %rbp
cltq
cmoveq %rbp, %rax
leaq (%rax,%r13), %rbp
cmpb $0x0, (%r13,%rax)
je 0x2abd
leaq 0x883(%rip), %rdi       # 0x31e4
movl 0xc(%rsp), %esi
movl 0x10(%rsp), %edx
movl 0x14(%rsp), %ecx
xorl %eax, %eax
callq 0x2090
cmpb $0x1, 0x29d9(%rip)      # 0x5354
jne 0x2998
movl 0x8(%rsp), %esi
movl $0x3f8, %eax            # imm = 0x3F8
andl %eax, %esi
leaq 0x80e(%rip), %rdi       # 0x319d
xorl %eax, %eax
callq 0x2090
jmp 0x29ef
movl 0x283a(%rip), %edx      # 0x51d8
leaq 0x837(%rip), %rsi       # 0x31dc
testl %edx, %edx
js 0x29e1
movl 0x8(%rsp), %eax
movl $0x3f8, %ecx            # imm = 0x3F8
andl %ecx, %eax
leaq 0x2815(%rip), %rcx      # 0x51d0
cmpl %eax, %edx
je 0x29d5
leaq 0x280a(%rip), %rcx      # 0x51d0
movl 0x18(%rcx), %edx
testl %edx, %edx
js 0x29da
addq $0x10, %rcx
cmpl %eax, %edx
jne 0x29c6
movq (%rcx), %rsi
jmp 0x29e1
leaq 0x7fb(%rip), %rsi       # 0x31dc
leaq 0x7be(%rip), %rdi       # 0x31a6
xorl %eax, %eax
callq 0x2090
movl 0x8(%rsp), %esi
andl $0x7, %esi
movl 0xa4(%rsp), %edx
movl $0x76c, %eax            # imm = 0x76C
addl %eax, %edx
movl 0xa0(%rsp), %ecx
incl %ecx
movl 0x9c(%rsp), %r8d
movl 0x98(%rsp), %r9d
movl 0x90(%rsp), %r10d
movl 0x94(%rsp), %r11d
leaq 0x776(%rip), %rdi       # 0x31aa
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
addq $0x10, %rsp
movq 0x290e(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x2aac
cmpb $0x0, (%rax)
je 0x2aac
movq 0xb8(%rsp), %rax
movq %rax, %rcx
shrq $0x3f, %rcx
leal 0x2b(,%rcx,2), %esi
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movq %rcx, %rdx
movl $0x91a2b3c5, %eax       # imm = 0x91A2B3C5
imulq %rax, %rdx
shrq $0x2b, %rdx
movl $0x88888889, %eax       # imm = 0x88888889
imulq %rax, %rcx
shrq $0x25, %rcx
imulq $0x8888889, %rcx, %rax  # imm = 0x8888889
shrq $0x21, %rax
imull $0x3c, %eax, %eax
subl %eax, %ecx
leaq 0x727(%rip), %rdi       # 0x31cc
xorl %eax, %eax
callq 0x2090
leaq 0x724(%rip), %rdi       # 0x31d7
movq %rbp, %rsi
xorl %eax, %eax
callq 0x2090
movq %rbp, %rdi
callq 0x2070
addq %rax, %rbp
incq %rbp
cmpq %rbx, %rbp
jb 0x2870
jmp 0x2ae2
movb $0x0, (%rax,%rbp)
movl $0x1d, 0x8(%rsp)
movq 0x24d7(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
leaq 0x20(%rsp), %rbx
leaq 0x2863(%rip), %rbp      # 0x5360
jmp 0x24bd
leaq 0x68a(%rip), %rsi       # 0x3193
movl $0x1, %edi
xorl %eax, %eax
callq 0x2100