// File: /workspace/github_c_makefile_star2_O3/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 0x2b03
movzbl 0x2ee1(%rip), %edx      # 0x5350
xorl $0x1, %edx
addl %edx, %edx
movl %eax, %edi
xorl %esi, %esi
callq 0x20a0
callq 0x22cc
leaq 0x20(%rsp), %r14
movl %eax, 0x8(%r14)
leaq 0xcfe(%rip), %rdi       # 0x3190
callq 0x2030
movq %rax, 0x2eba(%rip)      # 0x5358
movw $0x1, %ax
movw %ax, 0xc(%r14)
movw %ax, 0x4(%r14)
leaq 0x8(%rsp), %r12
leaq 0x90(%rsp), %r15
movq 0x2b18(%rip), %rbp      # 0x4fd8
movl $0x2, %esi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2150
testl %eax, %eax
jns 0x2504
callq 0x2040
movq %rax, %rbx
movl (%rbx), %eax
cmpl $0x4, %eax
je 0x24ee
cmpl $0xb, %eax
jne 0x2afc
movl $0x2, %esi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x2150
testl %eax, %eax
js 0x24de
testb $0x1, 0x26(%rsp)
je 0x274b
movl 0x20(%rsp), %edi
movl $0x10000, %edx          # imm = 0x10000
leaq 0x2e41(%rip), %rsi      # 0x5360
callq 0x20b0
movq %rax, %rbx
testl %ebx, %ebx
jle 0x2746
leaq 0x70(%rsp), %rdi
callq 0x20f0
movq 0x2e18(%rip), %rcx      # 0x5358
movq %rbp, %rax
testq %rcx, %rcx
je 0x2557
cmpb $0x0, (%rcx)
movq 0x2a76(%rip), %rax      # 0x4fc8
jne 0x2557
movq %rbp, %rax
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq *%rax
andl $0x7fffffff, %ebx       # imm = 0x7FFFFFFF
leaq 0x2df0(%rip), %rdi      # 0x5360
leaq (%rdi,%rbx), %rax
movq %rdi, %rcx
testq %rbx, %rbx
je 0x25b8
movq %rdi, %rcx
movzbl (%rcx), %esi
xorl %edx, %edx
testl %esi, %esi
je 0x258d
cmpl $0xa, %esi
jne 0x2599
movb %dl, (%rcx)
incq %rcx
cmpq %rax, %rcx
jb 0x257f
jmp 0x25b8
cmpb $0x20, %sil
setl %r9b
cmpb $0x9, %sil
setne %r8b
movb $0x20, %dl
cmpb $0x7f, %sil
je 0x258d
andb %r8b, %r9b
je 0x258f
jmp 0x258d
movq %rcx, 0x90(%rsp)
movb $0x0, (%rax)
movq %r15, %rsi
movl $0xa, %edx
movq %rdi, %r13
callq 0x2190
movq %rax, %r14
cmpq %r13, 0x90(%rsp)
movl $0x5, %eax
cmovel %eax, %r14d
movq %r13, %rdi
movl $0x3b, %esi
callq 0x2080
leaq 0x1(%rax), %rbx
testq %rax, %rax
cmoveq %r13, %rbx
cmpb $0x0, (%rbx)
je 0x2746
cmpb $0x1, 0x2d45(%rip)      # 0x5354
jne 0x262a
movl %r14d, %esi
andl $0x3f8, %esi            # imm = 0x3F8
leaq 0xb77(%rip), %rdi       # 0x3198
xorl %eax, %eax
callq 0x2090
jmp 0x267e
movl 0x2ba8(%rip), %edx      # 0x51d8
leaq 0xba5(%rip), %rsi       # 0x31dc
testl %edx, %edx
js 0x2670
movl %r14d, %eax
andl $0x3f8, %eax            # imm = 0x3F8
leaq 0x2b86(%rip), %rcx      # 0x51d0
cmpl %eax, %edx
je 0x2664
leaq 0x2b7b(%rip), %rcx      # 0x51d0
movl 0x18(%rcx), %edx
testl %edx, %edx
js 0x2669
addq $0x10, %rcx
cmpl %eax, %edx
jne 0x2655
movq (%rcx), %rsi
jmp 0x2670
leaq 0xb6c(%rip), %rsi       # 0x31dc
leaq 0xb2a(%rip), %rdi       # 0x31a1
xorl %eax, %eax
callq 0x2090
andl $0x7, %r14d
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 0xafc(%rip), %rdi       # 0x31aa
movl %r14d, %esi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
addq $0x10, %rsp
movq 0x2c91(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x2726
cmpb $0x0, (%rax)
je 0x2726
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 0xaad(%rip), %rdi       # 0x31cc
xorl %eax, %eax
callq 0x2090
leaq 0xaaa(%rip), %rdi       # 0x31d7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x2882(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
leaq 0x20(%rsp), %r14
testb $0x1, 0x2e(%rsp)
je 0x24c0
movl 0x28(%rsp), %edi
leaq 0x2bff(%rip), %rax      # 0x5360
movq %rax, 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 0x24c0
movl 0x78(%rsp), %ecx
movl 0x7c(%rsp), %edx
xorl $0x1, %ecx
xorl $0x2, %edx
movl $0x0, 0x1c(%rsp)
orl %ecx, %edx
movl $0x0, 0x18(%rsp)
movl $0x0, 0x14(%rsp)
jne 0x2810
movl 0x88(%rsp), %ecx
movl %ecx, 0x1c(%rsp)
movl 0x84(%rsp), %ecx
movl %ecx, 0x18(%rsp)
movl 0x80(%rsp), %ecx
movl %ecx, 0x14(%rsp)
andl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
leaq 0x2b44(%rip), %rbx      # 0x5360
leaq (%rbx,%rax), %r14
testq %rax, %rax
je 0x2ad7
movq %rbx, %rax
movzbl (%rax), %edx
xorl %ecx, %ecx
testl %edx, %edx
je 0x283a
cmpl $0xa, %edx
jne 0x2846
movb %cl, (%rax)
incq %rax
cmpq %r14, %rax
jb 0x282c
jmp 0x2862
cmpb $0x20, %dl
setl %sil
cmpb $0x9, %dl
setne %dil
movb $0x20, %cl
cmpb $0x7f, %dl
je 0x283a
andb %dil, %sil
je 0x283c
jmp 0x283a
movb $0x0, (%r14)
movl $0x1d, 0x4(%rsp)
movl $0x0, 0x8(%rsp)
movq %rbx, %rdi
leaq 0x96d(%rip), %rsi       # 0x31ed
leaq 0x4(%rsp), %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x2120
movslq 0x8(%rsp), %r13
addq %rbx, %r13
movq %r12, %rdi
callq 0x20f0
movq %r12, %rdi
movq %r15, %rsi
callq 0x21d0
movq %r13, %rdi
leaq 0x940(%rip), %rsi       # 0x31f4
movq %r15, %rdx
callq 0x21b0
movq %rax, %rbx
testq %rax, %rax
je 0x2917
movq %rbp, %r12
movq 0x8(%rsp), %rbp
movq %r15, %rdi
callq 0x2130
subq %rax, %rbp
addq $-0xf0c3f0, %rbp        # imm = 0xFF0F3C10
movq %rbp, %rax
movq %r12, %rbp
leaq 0x8(%rsp), %r12
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, 0x8(%rsp)
movq 0x2a3a(%rip), %rcx      # 0x5358
movq %rbp, %rax
testq %rcx, %rcx
je 0x2935
cmpb $0x0, (%rcx)
movq 0x2698(%rip), %rax      # 0x4fc8
jne 0x2935
movq %rbp, %rax
movq %r12, %rdi
movq %r15, %rsi
callq *%rax
movl %ebx, %eax
subl %r13d, %eax
testq %rbx, %rbx
cltq
cmoveq %rbx, %rax
leaq (%rax,%r13), %rbx
cmpb $0x0, (%r13,%rax)
je 0x2abe
leaq 0x882(%rip), %rdi       # 0x31e4
movl 0x14(%rsp), %esi
movl 0x18(%rsp), %edx
movl 0x1c(%rsp), %ecx
xorl %eax, %eax
callq 0x2090
cmpb $0x1, 0x29d8(%rip)      # 0x5354
jne 0x2999
movl 0x4(%rsp), %esi
movl $0x3f8, %eax            # imm = 0x3F8
andl %eax, %esi
leaq 0x80d(%rip), %rdi       # 0x319d
xorl %eax, %eax
callq 0x2090
jmp 0x29f0
movl 0x2839(%rip), %edx      # 0x51d8
leaq 0x836(%rip), %rsi       # 0x31dc
testl %edx, %edx
js 0x29e2
movl 0x4(%rsp), %eax
movl $0x3f8, %ecx            # imm = 0x3F8
andl %ecx, %eax
leaq 0x2814(%rip), %rcx      # 0x51d0
cmpl %eax, %edx
je 0x29d6
leaq 0x2809(%rip), %rcx      # 0x51d0
movl 0x18(%rcx), %edx
testl %edx, %edx
js 0x29db
addq $0x10, %rcx
cmpl %eax, %edx
jne 0x29c7
movq (%rcx), %rsi
jmp 0x29e2
leaq 0x7fa(%rip), %rsi       # 0x31dc
leaq 0x7bd(%rip), %rdi       # 0x31a6
xorl %eax, %eax
callq 0x2090
movl 0x4(%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 0x775(%rip), %rdi       # 0x31aa
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
addq $0x10, %rsp
movq 0x290d(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x2aad
cmpb $0x0, (%rax)
je 0x2aad
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 0x726(%rip), %rdi       # 0x31cc
xorl %eax, %eax
callq 0x2090
leaq 0x723(%rip), %rdi       # 0x31d7
movq %rbx, %rsi
xorl %eax, %eax
callq 0x2090
movq %rbx, %rdi
callq 0x2070
addq %rax, %rbx
incq %rbx
cmpq %r14, %rbx
jb 0x286e
jmp 0x2ae3
movb $0x0, (%r14)
movl $0x1d, 0x4(%rsp)
movq 0x24d6(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
leaq 0x20(%rsp), %r14
jmp 0x24c0
leaq 0x690(%rip), %rsi       # 0x3193
movl $0x1, %edi
xorl %eax, %eax
callq 0x2100