You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: pidof.rs
    path of file: ./repos/rustybox/procps
    
    the code of the file until where you have to start completion: use crate::libbb::llist::llist_t;
use libc;
use libc::free;
use libc::pid_t;
use libc::printf;
extern "C" {
  #[no_mangle]
  static mut optind: libc::c_int;

  #[no_mangle]
  fn getppid() -> pid_t;
}

/*
 * pidof implementation for busybox
 *
 * Copyright (C) 1999-2004 by Erik Andersen <andersen@codepoet.org>
 *
 * Licensed under GPLv2, see file LICENSE in this source tree.
 */
//config:config PIDOF
//config:	bool "pidof (6.3 kb)"
//config:	default y
//config:	help
//config:	Pidof finds the process id's (pids) of the named programs. It prints
//config:	those id's on the standard output.
//config:
//config:config FEATURE_PIDOF_SINGLE
//config:	bool "Enable single shot (-s)"
//config:	default y
//config:	depends on PIDOF
//config:	help
//config:	Support '-s' for returning only the first pid found.
//config:
//config:config FEATURE_PIDOF_OMIT
//config:	bool "Enable omitting pids (-o PID)"
//config:	default y
//config:	depends on PIDOF
//config:	help
//config:	Support '-o PID' for omitting the given pid(s) in output.
//config:	The special pid %PPID can be used to name the parent process
//config:	of the pidof, in other words the calling shell or shell script.
//applet:IF_PIDOF(APPLET(pidof, BB_DIR_BIN, SUID_DROP))
/* can't be noexec: can find _itself_ under wrong name, since after fork only,
 * /proc/PID/cmdline and comm are wrong! Can fix comm (prctl(PR_SET_NAME)),
 * but cmdline?
 */
//kbuild:lib-$(CONFIG_PIDOF) += pidof.o
//usage:#if (ENABLE_FEATURE_PIDOF_SINGLE || ENABLE_FEATURE_PIDOF_OMIT)
//usage:#define pidof_trivial_usage
//usage:       "[OPTIONS] [NAME]..."
//usage:#define USAGE_PIDOF "\n"
//usage:#else
//usage:#define pidof_trivial_usage
//usage:       "[NAME]..."
//usage:#define USAGE_PIDOF /* none */
//usage:#endif
//usage:#define pidof_full_usage "\n\n"
//usage:       "List PIDs of all processes with n
    
pub unsafe fn pidof_main(mut _argc: libc::c_int, mut argv: *mut *mut libc::c_char) -> libc::c_int {
  let mut first: libc::c_uint = 1i32 as libc::c_uint;
  let mut opt: libc::c_uint = 0;
  let mut omits: *mut llist_t = std::ptr::null_mut();
  /* do unconditional option parsing */
  opt = crate::libbb::getopt32::getopt32(
    argv,
    b"so:*\x00" as *const u8 as *const libc::c_char,
    &mut omits as *mut *mut llist_t,
  );
  /* fill omit list.  */
  let mut omits_p: *mut llist_t = omits;
  loop {
    omits_p = crate::libbb::llist::llist_find_str(
      omits_p,
      b"%PPID\x00" as *const u8 as *const libc::c_char,
    );
    if omits_p.is_null() {
      break;
    }
    /* are we asked to exclude the parent's process ID?  */
    (*omits_p).data = crate::libbb::xfuncs::utoa(getppid() as libc::c_uint)
  }
  /* Looks like everything is set to go.  */
  argv = argv.offset(optind as isize);
  while !(*argv).is_null() {
    let mut pidList: *mut pid_t = std::ptr::null_mut();
    let mut pl: *mut pid_t = std::ptr::null_mut();
    /* reverse the pidlist like GNU pidof does.  */
    pidList = crate::libbb::find_pid_by_name::pidlist_reverse(
      crate::libbb::find_pid_by_name::find_pid_by_name(*argv),
    );
    let mut current_block_11: u64;
    pl = pidList;
    while *pl != 0 {
      if opt & OPT_OMIT as libc::c_int as libc::c_uint != 0 {
        let mut omits_p_0: *mut llist_t = omits;
        loop {
          if omits_p_0.is_null() {
            current_block_11 = 5601891728916014340;
            break;
          }
          if xatoul((*omits_p_0).data) == *pl as libc::c_ulong {
            current_block_11 = 10599921512955367680;
            break;
          }
          omits_p_0 = (*omits_p_0).link
        }
      } else {
        current_block_11 = 5601891728916014340;
      }
      match current_block_11 {
        5601891728916014340 => {
          printf(
            (b" %u\x00" as *const u8 as *const libc::c_char).offset(first as isize),
            *pl as libc::c_uint,
          );
          first = 0 as libc::c_uint;
          if 1i32 != 0 && opt & OPT_SINGLE as libc::c_int as libc::c_uint != 0 {
            break;
          }
        }
        _ => {}
      }
      pl = pl.offset(1)
    }
    free(pidList as *mut libc::c_void);
    argv = argv.offset(1)
  }
  if first == 0 {
    crate::libbb::xfuncs_printf::bb_putchar('\n' as i32);
  }
  return first as libc::c_int;
  /* 1 (failure) - no processes found */
}