// File: /workspace/github_c_makefile_star2_O2/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 0xdc2(%rip), %r14       # 0x317d
leaq 0x2f8e(%rip), %r15      # 0x5350
leaq 0x2f8b(%rip), %r12      # 0x5354
movl %ebp, %edi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x2180
testl %eax, %eax
jle 0x23ef
movq %r15, %rcx
cmpl $0x62, %eax
je 0x23ea
cmpl $0x6e, %eax
jne 0x23fa
movq %r12, %rcx
movb $0x1, (%rcx)
jmp 0x23c9
movq 0x2bda(%rip), %rax      # 0x4fd0
cmpl %ebp, (%rax)
jge 0x2402
movq (%rbx), %rdi
callq 0x237a
leaq 0xd7d(%rip), %rdi       # 0x3186
movl $0x800, %esi            # imm = 0x800
xorl %eax, %eax
callq 0x2170
movl %eax, 0x20(%rsp)
testl %eax, %eax
jns 0x2429
leaq 0xd5d(%rip), %rsi       # 0x3181
jmp 0x2a01
movzbl 0x2f20(%rip), %edx      # 0x5350
xorl $0x1, %edx
addl %edx, %edx
movl %eax, %edi
xorl %esi, %esi
callq 0x20a0
callq 0x22cc
leaq 0x20(%rsp), %r13
movl %eax, 0x8(%r13)
leaq 0xd3d(%rip), %rdi       # 0x3190
callq 0x2030
movq %rax, 0x2ef9(%rip)      # 0x5358
movw $0x1, %ax
movw %ax, 0xc(%r13)
movw %ax, 0x4(%r13)
leaq 0x18(%rsp), %rbx
leaq 0x90(%rsp), %r14
movq 0x2b57(%rip), %rbp      # 0x4fd8
movq %r13, %rdi
pushq $0x2
popq %rsi
pushq $-0x1
popq %rdx
callq 0x2150
testl %eax, %eax
js 0x253e
testb $0x1, 0x26(%rsp)
je 0x26aa
movl 0x20(%rsp), %edi
movl $0x10000, %edx          # imm = 0x10000
leaq 0x2eae(%rip), %rsi      # 0x5360
callq 0x20b0
movq %rax, %r15
testl %r15d, %r15d
jle 0x26aa
leaq 0x70(%rsp), %rdi
callq 0x20f0
movq 0x2e84(%rip), %rcx      # 0x5358
movq %rbp, %rax
testq %rcx, %rcx
je 0x24eb
cmpb $0x0, (%rcx)
movq 0x2ae2(%rip), %rax      # 0x4fc8
jne 0x24eb
movq %rbp, %rax
leaq 0x70(%rsp), %rdi
leaq 0x38(%rsp), %rsi
callq *%rax
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq 0x2e5b(%rip), %rax      # 0x5360
addq %rax, %r15
cmpq %r15, %rax
jae 0x255c
movzbl (%rax), %edx
xorl %ecx, %ecx
testl %edx, %edx
je 0x251b
cmpl $0xa, %edx
jne 0x2522
movb %cl, (%rax)
incq %rax
jmp 0x2508
cmpb $0x20, %dl
setl %sil
cmpb $0x9, %dl
setne %dil
movb $0x20, %cl
cmpb $0x7f, %dl
je 0x251b
andb %dil, %sil
je 0x251d
jmp 0x251b
callq 0x2040
movl (%rax), %eax
cmpl $0x4, %eax
je 0x2481
cmpl $0xb, %eax
je 0x2481
jmp 0x29fa
movq %rax, 0x90(%rsp)
movb $0x0, (%r15)
leaq 0x2df1(%rip), %rbp      # 0x5360
movq %rbp, %rdi
movq %r14, %rsi
pushq $0xa
popq %rdx
callq 0x2190
movq %rax, %r12
cmpq %rbp, 0x90(%rsp)
pushq $0x5
popq %rax
cmovel %eax, %r12d
movq %rbp, %rdi
pushq $0x3b
popq %rsi
callq 0x2080
leaq 0x1(%rax), %r15
testq %rax, %rax
cmoveq %rbp, %r15
movq 0x2a2c(%rip), %rbp      # 0x4fd8
cmpb $0x0, (%r15)
je 0x26aa
cmpb $0x1, 0x2d97(%rip)      # 0x5354
jne 0x25d8
movl %r12d, %esi
andl $0x3f8, %esi            # imm = 0x3F8
leaq 0xbc9(%rip), %rdi       # 0x3198
xorl %eax, %eax
callq 0x2090
jmp 0x25f1
movl %r12d, %edi
callq 0x2a0b
leaq 0xbba(%rip), %rdi       # 0x31a1
movq %rax, %rsi
xorl %eax, %eax
callq 0x2090
andl $0x7, %r12d
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 0xb89(%rip), %rdi       # 0x31aa
movl %r12d, %esi
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
popq %rcx
popq %rdx
movq 0x2d20(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x268a
cmpb $0x0, (%rax)
je 0x268a
movq 0x60(%rsp), %rax
movq %rax, %rcx
shrq $0x3f, %rcx
leal 0x2b(,%rcx,2), %esi
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl %ecx, %eax
xorl %edx, %edx
movl $0xe10, %edi            # imm = 0xE10
divl %edi
movl %eax, %r8d
movl %ecx, %eax
xorl %edx, %edx
pushq $0x3c
popq %rcx
divl %ecx
xorl %edx, %edx
divl %ecx
movl %edx, %ecx
leaq 0xb4c(%rip), %rdi       # 0x31cc
movl %r8d, %edx
xorl %eax, %eax
callq 0x2090
leaq 0xb46(%rip), %rdi       # 0x31d7
movq %r15, %rsi
xorl %eax, %eax
callq 0x2090
movq 0x291e(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
testb $0x1, 0x2e(%rsp)
je 0x2481
movl 0x28(%rsp), %edi
andq $0x0, 0x38(%rsp)
leaq 0x2c9a(%rip), %rax      # 0x5360
movq %rax, 0xc8(%rsp)
andl $0x0, 0x40(%rsp)
movq $0x10000, 0xd0(%rsp) # imm = 0x10000
leaq 0xc8(%rsp), %rax
movq %rax, 0x48(%rsp)
movq $0x1, 0x50(%rsp)
leaq 0x70(%rsp), %rax
movq %rax, 0x58(%rsp)
movq $0x20, 0x60(%rsp)
andl $0x0, 0x68(%rsp)
leaq 0x38(%rsp), %rsi
xorl %edx, %edx
callq 0x2140
movq %rax, %r15
testl %r15d, %r15d
jle 0x2481
movl 0x78(%rsp), %eax
movl 0x7c(%rsp), %ecx
movl 0x80(%rsp), %edx
movl %edx, 0x10(%rsp)
movl 0x84(%rsp), %edx
movl %edx, 0xc(%rsp)
movl 0x88(%rsp), %edx
movl %edx, 0x8(%rsp)
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
leaq 0x2c04(%rip), %rdx      # 0x5360
addq %rdx, %r15
cmpq %r15, %rdx
jae 0x279a
movzbl (%rdx), %edi
xorl %esi, %esi
testl %edi, %edi
je 0x2772
cmpl $0xa, %edi
jne 0x277a
movb %sil, (%rdx)
incq %rdx
jmp 0x275f
cmpb $0x20, %dil
setl %r8b
cmpb $0x9, %dil
setne %r9b
movb $0x20, %sil
cmpb $0x7f, %dil
je 0x2772
andb %r9b, %r8b
je 0x2775
jmp 0x2772
xorl $0x2, %ecx
xorl $0x1, %eax
orl %ecx, %eax
movl $0x0, %eax
movl 0xc(%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, 0xc(%rsp)
movl 0x8(%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, 0x8(%rsp)
movl 0x10(%rsp), %ecx
cmovnel %eax, %ecx
movl %ecx, 0x10(%rsp)
movb $0x0, (%r15)
movl $0x1d, 0x14(%rsp)
leaq 0x2b85(%rip), %r13      # 0x5360
cmpq %r15, %r13
jae 0x29e1
andl $0x0, 0x18(%rsp)
movq %r13, %rdi
leaq 0x9fa(%rip), %rsi       # 0x31ed
leaq 0x14(%rsp), %rdx
movq %rbx, %rcx
xorl %eax, %eax
callq 0x2120
movslq 0x18(%rsp), %r12
addq %r13, %r12
movq %rbx, %rdi
callq 0x20f0
movq %rbx, %rdi
movq %r14, %rsi
callq 0x21d0
movq %r12, %rdi
leaq 0x9cd(%rip), %rsi       # 0x31f4
movq %r14, %rdx
callq 0x21b0
movq %rax, %r13
testq %rax, %rax
je 0x2876
movq 0x18(%rsp), %rbp
movq %r14, %rdi
callq 0x2130
subq %rax, %rbp
addq $-0xf0c3f0, %rbp        # imm = 0xFF0F3C10
movq %rbp, %rax
movq 0x2780(%rip), %rbp      # 0x4fd8
cqto
movl $0x1e187e0, %ecx        # imm = 0x1E187E0
idivq %rcx
addl %eax, 0xa4(%rsp)
movq %r14, %rdi
callq 0x2130
movq %rax, 0x18(%rsp)
movq 0x2adb(%rip), %rcx      # 0x5358
movq %rbp, %rax
testq %rcx, %rcx
je 0x2894
cmpb $0x0, (%rcx)
movq 0x2739(%rip), %rax      # 0x4fc8
jne 0x2894
movq %rbp, %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *%rax
movl %r13d, %eax
subl %r12d, %eax
testq %r13, %r13
cltq
cmoveq %r13, %rax
leaq (%r12,%rax), %r13
cmpb $0x0, (%r12,%rax)
je 0x29ce
leaq 0x923(%rip), %rdi       # 0x31e4
movl 0x10(%rsp), %esi
movl 0xc(%rsp), %edx
movl 0x8(%rsp), %ecx
xorl %eax, %eax
callq 0x2090
movl 0x14(%rsp), %esi
cmpb $0x1, 0x2a75(%rip)      # 0x5354
jne 0x28f7
andl $0x3f8, %esi            # imm = 0x3F8
leaq 0x8af(%rip), %rdi       # 0x319d
xorl %eax, %eax
callq 0x2090
jmp 0x290f
movl %esi, %edi
callq 0x2a0b
leaq 0x8a1(%rip), %rdi       # 0x31a6
movq %rax, %rsi
xorl %eax, %eax
callq 0x2090
movl 0x14(%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 0x856(%rip), %rdi       # 0x31aa
xorl %eax, %eax
pushq %r10
pushq %r11
callq 0x2090
popq %rcx
popq %rdx
movq 0x29f0(%rip), %rax      # 0x5358
testq %rax, %rax
je 0x29bd
cmpb $0x0, (%rax)
je 0x29bd
movq 0xb8(%rsp), %rax
movq %rax, %rcx
shrq $0x3f, %rcx
leal 0x2b(,%rcx,2), %esi
movl %eax, %ecx
negl %ecx
cmovsl %eax, %ecx
movl %ecx, %eax
xorl %edx, %edx
movl $0xe10, %edi            # imm = 0xE10
divl %edi
movl %eax, %r8d
movl %ecx, %eax
xorl %edx, %edx
pushq $0x3c
popq %rcx
divl %ecx
xorl %edx, %edx
divl %ecx
movl %edx, %ecx
leaq 0x819(%rip), %rdi       # 0x31cc
movl %r8d, %edx
xorl %eax, %eax
callq 0x2090
leaq 0x813(%rip), %rdi       # 0x31d7
movq %r13, %rsi
xorl %eax, %eax
callq 0x2090
movq %r13, %rdi
callq 0x2070
addq %rax, %r13
incq %r13
jmp 0x27db
movq 0x25d8(%rip), %rax      # 0x4fc0
movq (%rax), %rdi
callq 0x2110
leaq 0x20(%rsp), %r13
jmp 0x2481
leaq 0x792(%rip), %rsi       # 0x3193
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x2100