oal_irq_in_atomic ()
{
  bool_t D.7609;

  <bb 2> :
  # DEBUG BEGIN_STMT
  D.7609 = 0;
  return D.7609;

}


oal_irq_get_id (const struct oal_irq_t * irq)
{
  int32_t retval;
  int32_t D.7607;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  retval = irq->id;
  # DEBUG BEGIN_STMT
  D.7607 = retval;
  return D.7607;

}


oal_irq_destroy (struct oal_irq_t * irq)
{
  uint32_t ctr;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  irq->created = 0;
  # DEBUG BEGIN_STMT
  ctr = 0;
  goto <bb 4>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  irq->handler[ctr] = 0B;
  # DEBUG BEGIN_STMT
  irq->data[ctr] = 0B;
  # DEBUG BEGIN_STMT
  ctr = ctr + 1;

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (ctr <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  irq->flags = 0;
  return;

}


oal_irq_del_handler (struct oal_irq_t * irq, oal_irq_isr_handle_t handle)
{
  errno_t ret_val;
  errno_t D.7605;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_val = 0;
  # DEBUG BEGIN_STMT
  irq->handler[handle] = 0B;
  # DEBUG BEGIN_STMT
  irq->data[handle] = 0B;
  # DEBUG BEGIN_STMT
  D.7605 = ret_val;
  return D.7605;

}


oal_irq_add_handler (struct oal_irq_t * irq, bool_t (*oal_irq_handler_t) (void *) handler, void * data, oal_irq_isr_handle_t * handle)
{
  uint32_t ctr;
  errno_t ret_val;
  errno_t D.7603;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_val = 11;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ctr = 0;
  goto <bb 8>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = irq->handler[ctr];
  if (_1 == 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  if (handle != 0B)
    goto <bb 5>; [INV]
  else
    goto <bb 6>; [INV]

  <bb 5> :
  # DEBUG BEGIN_STMT
  *handle = ctr;

  <bb 6> :
  # DEBUG BEGIN_STMT
  irq->handler[ctr] = handler;
  # DEBUG BEGIN_STMT
  irq->data[ctr] = data;
  # DEBUG BEGIN_STMT
  ret_val = 0;
  # DEBUG BEGIN_STMT
  goto <bb 9>; [INV]

  <bb 7> :
  # DEBUG BEGIN_STMT
  ctr = ctr + 1;

  <bb 8> :
  # DEBUG BEGIN_STMT
  if (ctr <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 9>; [INV]

  <bb 9> :
  # DEBUG BEGIN_STMT
  D.7603 = ret_val;
  return D.7603;

}


oal_irq_create (int32_t id, oal_irq_flags_t flags, const char_t * name)
{
  uint32_t idx;
  struct oal_irq_t * ret_val;
  struct oal_irq_t * D.7595;

  <bb 2> :
  # DEBUG BEGIN_STMT
  ret_val = 0B;
  # DEBUG BEGIN_STMT
  _1 = find_irq_idx_from_id (id);
  idx = (uint32_t) _1;
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  if (idx <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 3> :
  _2 = irq_pool[idx].created;
  if (_2 == 0)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  irq_pool[idx].created = 1;
  # DEBUG BEGIN_STMT
  irq_pool[idx].id = id;
  # DEBUG BEGIN_STMT
  irq_pool[idx].flags = flags;
  # DEBUG BEGIN_STMT
  ret_val = &irq_pool[idx];

  <bb 5> :
  # DEBUG BEGIN_STMT
  D.7595 = ret_val;
  return D.7595;

}


oal_irq_common_handler (oal_irq_idx_t idx)
{
  uint32_t ctr;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  ctr = 0;
  goto <bb 6>; [INV]

  <bb 3> :
  # DEBUG BEGIN_STMT
  _1 = (int) idx;
  _2 = irq_pool[_1].handler[ctr];
  if (_2 != 0B)
    goto <bb 4>; [INV]
  else
    goto <bb 5>; [INV]

  <bb 4> :
  # DEBUG BEGIN_STMT
  _3 = (int) idx;
  _4 = irq_pool[_3].handler[ctr];
  _5 = (int) idx;
  _6 = irq_pool[_5].data[ctr];
  _4 (_6);

  <bb 5> :
  # DEBUG BEGIN_STMT
  ctr = ctr + 1;

  <bb 6> :
  # DEBUG BEGIN_STMT
  if (ctr <= 5)
    goto <bb 3>; [INV]
  else
    goto <bb 7>; [INV]

  <bb 7> :
  return;

}


find_irq_idx_from_id (int32_t id)
{
  oal_irq_idx_t ret_val;
  oal_irq_idx_t D.7597;

  <bb 2> :
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  switch (id) <default: <L6> [INV], case 190: <L0> [INV], case 191: <L1> [INV], case 192: <L2> [INV], case 193: <L3> [INV], case 194: <L4> [INV], case 195: <L5> [INV]>

  <bb 3> :
<L0>:
  # DEBUG BEGIN_STMT
  ret_val = 0;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 4> :
<L1>:
  # DEBUG BEGIN_STMT
  ret_val = 1;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 5> :
<L2>:
  # DEBUG BEGIN_STMT
  ret_val = 2;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 6> :
<L3>:
  # DEBUG BEGIN_STMT
  ret_val = 3;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 7> :
<L4>:
  # DEBUG BEGIN_STMT
  ret_val = 5;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 8> :
<L5>:
  # DEBUG BEGIN_STMT
  ret_val = 4;
  # DEBUG BEGIN_STMT
  goto <bb 10>; [INV]

  <bb 9> :
<L6>:
  # DEBUG BEGIN_STMT
  ret_val = 6;
  # DEBUG BEGIN_STMT

  <bb 10> :
  # DEBUG BEGIN_STMT
  D.7597 = ret_val;
  return D.7597;

}


