oal_mutex_unlock.isra.0 (const oal_mutex_t ISRA.3)
{
  errno_t retval;
  short unsigned int _2;
  int _3;
  unsigned char _4;
  void (*<T4e5>) (void) _5;

  <bb 6> [local count: 1073741824]:
  # DEBUG mutex s=> mutex

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG retval => 22
  # DEBUG BEGIN_STMT
  _2 = ISRA.3_10(D);
  if (_2 <= 255)
    goto <bb 3>; [65.00%]
  else
    goto <bb 5>; [35.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  _3 = (int) _2;
  _4 = mutex_alloc[_3];
  if (_4 != 0)
    goto <bb 4>; [65.00%]
  else
    goto <bb 5>; [35.00%]

  <bb 4> [local count: 453655921]:
  # DEBUG BEGIN_STMT
  _5 = SchM_Exit_Eth_43_PFE_ETH_EXCLUSIVE_AREA_ID[_3];
  _5 ();
  # DEBUG BEGIN_STMT
  # DEBUG retval => 0

  <bb 5> [local count: 1073741824]:
  # retval_6 = PHI <22(2), 22(3), 0(4)>
  # DEBUG retval => retval_6
  # DEBUG BEGIN_STMT
  return retval_6;

}


oal_mutex_lock.isra.0 (const oal_mutex_t ISRA.1)
{
  errno_t retval;
  short unsigned int _2;
  int _3;
  unsigned char _4;
  void (*<T4e5>) (void) _5;

  <bb 6> [local count: 1073741824]:
  # DEBUG mutex s=> mutex

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG retval => 22
  # DEBUG BEGIN_STMT
  _2 = ISRA.1_10(D);
  if (_2 <= 255)
    goto <bb 3>; [65.00%]
  else
    goto <bb 5>; [35.00%]

  <bb 3> [local count: 697932186]:
  # DEBUG BEGIN_STMT
  _3 = (int) _2;
  _4 = mutex_alloc[_3];
  if (_4 != 0)
    goto <bb 4>; [65.00%]
  else
    goto <bb 5>; [35.00%]

  <bb 4> [local count: 453655921]:
  # DEBUG BEGIN_STMT
  _5 = SchM_Enter_Eth_43_PFE_ETH_EXCLUSIVE_AREA_ID[_3];
  _5 ();
  # DEBUG BEGIN_STMT
  # DEBUG retval => 0

  <bb 5> [local count: 1073741824]:
  # retval_6 = PHI <22(2), 22(3), 0(4)>
  # DEBUG retval => retval_6
  # DEBUG BEGIN_STMT
  return retval_6;

}


fci_core_client_get_msg (struct fci_msg_t * * msg)
{
  struct fci_core_t * core;
  struct fifo_t * _1;
  void * _2;
  short unsigned int _10;
  short unsigned int _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  core_4 = __context.core;
  # DEBUG core => core_4
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#6 => &core_4->client.fifo_lock
  _10 = MEM[(const oal_mutex_t *)core_4 + 8B];
  # DEBUG D#1 => D#6
  oal_mutex_lock.isra.0 (_10);
  # DEBUG BEGIN_STMT
  _1 = core_4->client.msg_fifo;
  _2 = fifo_get (_1);
  *msg_7(D) = _2;
  # DEBUG BEGIN_STMT
  # DEBUG D#7 => &core_4->client.fifo_lock
  _11 = MEM[(const oal_mutex_t *)core_4 + 8B];
  # DEBUG D#2 => D#7
  oal_mutex_unlock.isra.0 (_11);
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0
  # DEBUG BEGIN_STMT
  return 0;

}


fci_core_client_send_broadcast (struct fci_msg_t * msg, struct fci_msg_t * rep)
{
  errno_t err;
  struct fci_core_t * core;
  _Bool _1;
  long int _2;
  long int _3;
  struct fifo_t * _4;
  short unsigned int _15;
  short unsigned int _16;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  core_8 = __context.core;
  # DEBUG core => core_8
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = core_8 == 0B;
  _2 = (long int) _1;
  _3 = __builtin_expect (_2, 0);
  if (_3 != 0)
    goto <bb 4>; [10.00%]
  else
    goto <bb 3>; [90.00%]

  <bb 3> [local count: 966367642]:
  # DEBUG BEGIN_STMT
  msg_9(D)->type = 4100;
  # DEBUG BEGIN_STMT
  # DEBUG D#4 => &core_8->client.fifo_lock
  _15 = MEM[(const oal_mutex_t *)core_8 + 8B];
  # DEBUG D#1 => D#4
  oal_mutex_lock.isra.0 (_15);
  # DEBUG BEGIN_STMT
  _4 = core_8->client.msg_fifo;
  err_13 = fifo_put (_4, msg_9(D));
  # DEBUG err => err_13
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#5 => &core_8->client.fifo_lock
  _16 = MEM[(const oal_mutex_t *)core_8 + 8B];
  # DEBUG D#2 => D#5
  oal_mutex_unlock.isra.0 (_16);

  <bb 4> [local count: 1073741824]:
  # err_5 = PHI <22(2), err_13(3)>
  # DEBUG err => err_5
  # DEBUG BEGIN_STMT
  return err_5;

}


fci_core_client_send (struct fci_core_client_t * client, struct fci_msg_t * msg, struct fci_msg_t * rep)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG err => 0
  # DEBUG BEGIN_STMT
  return 0;

}


fci_core_send (struct fci_msg_t * msg, struct fci_msg_t * rep)
{
  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG D#3 => __context.core
  # DEBUG core => D#3
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG ret => 22
  # DEBUG BEGIN_STMT
  return 22;

}


fci_core_fini ()
{
  struct fci_msg_t msg;
  struct fci_core_t * core;
  oal_mutex_t * _1;
  struct fifo_t * _2;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  core_5 = __context.core;
  # DEBUG core => core_5
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  memset (&msg, 0, 276);
  # DEBUG BEGIN_STMT
  msg.type = 4099;
  # DEBUG BEGIN_STMT
  msg.msg_cmd.code = 62211;
  # DEBUG BEGIN_STMT
  if (core_5 != 0B)
    goto <bb 3>; [0.04%]
  else
    goto <bb 4>; [99.96%]

  <bb 3> [local count: 429497]:
  # DEBUG BEGIN_STMT
  fci_core_client_send_broadcast (&msg, 0B);
  # DEBUG ret => NULL
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = &core_5->client.fifo_lock;
  oal_mutex_destroy (_1);
  # DEBUG BEGIN_STMT
  _2 = core_5->client.msg_fifo;
  fifo_destroy (_2);
  # DEBUG BEGIN_STMT
  oal_mm_free (core_5);
  # DEBUG BEGIN_STMT
  # DEBUG core => 0B

  <bb 4> [local count: 1073741824]:
  msg ={v} {CLOBBER};
  return;

}


fci_core_init (const char_t * const id)
{
  errno_t ret;
  struct fci_core_t * core;
  struct fci_core_t * _1;
  oal_mutex_t * _2;
  struct fifo_t * _3;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = __context.core;
  if (_1 != 0B)
    goto <bb 6>; [71.84%]
  else
    goto <bb 3>; [28.16%]

  <bb 3> [local count: 302365698]:
  # DEBUG BEGIN_STMT
  core_8 = oal_mm_malloc (12);
  # DEBUG core => core_8
  # DEBUG BEGIN_STMT
  if (core_8 == 0B)
    goto <bb 6>; [99.96%]
  else
    goto <bb 4>; [0.04%]

  <bb 4> [local count: 120946]:
  # DEBUG BEGIN_STMT
  memset (core_8, 0, 12);
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  core_8->client.fifo_lock = 186;
  # DEBUG BEGIN_STMT
  _2 = &core_8->client.fifo_lock;
  oal_mutex_init (_2);
  # DEBUG BEGIN_STMT
  _3 = fifo_create (8, &fci_fifo.instance, &fci_fifo.data);
  core_8->client.msg_fifo = _3;
  # DEBUG BEGIN_STMT
  if (_3 == 0B)
    goto <bb 6>; [18.75%]
  else
    goto <bb 5>; [81.25%]

  <bb 5> [local count: 98269]:
  # DEBUG BEGIN_STMT
  core_8->client.initialized = 1;
  # DEBUG BEGIN_STMT
  __context.core = core_8;
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0

  <bb 6> [local count: 1073741824]:
  # ret_4 = PHI <22(2), 11(3), 11(4), 0(5)>
  # DEBUG ret => ret_4
  # DEBUG BEGIN_STMT
  return ret_4;

}


fifo_get (struct fifo_t * const fifo)
{
  void * ret;
  long unsigned int _1;
  long unsigned int _2;
  _Bool _3;
  long int _4;
  long int _5;
  void * * _6;
  long unsigned int _7;
  long unsigned int _8;
  long unsigned int _9;
  void * * _10;
  long unsigned int _11;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG ret => 0B
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = fifo_15(D)->write;
  _2 = fifo_15(D)->read;
  # DEBUG fill_level => _1 - _2
  # DEBUG BEGIN_STMT
  _3 = _1 != _2;
  _4 = (long int) _3;
  _5 = __builtin_expect (_4, 1);
  if (_5 != 0)
    goto <bb 3>; [90.00%]
  else
    goto <bb 4>; [10.00%]

  <bb 3> [local count: 966367642]:
  # DEBUG BEGIN_STMT
  _6 = fifo_15(D)->data;
  _7 = fifo_15(D)->depth_mask;
  _8 = _2 & _7;
  _9 = _8 * 4;
  _10 = _6 + _9;
  ret_16 = *_10;
  # DEBUG ret => ret_16
  # DEBUG BEGIN_STMT
  _11 = _2 + 1;
  fifo_15(D)->read = _11;

  <bb 4> [local count: 1073741824]:
  # ret_12 = PHI <0B(2), ret_16(3)>
  # DEBUG ret => ret_12
  # DEBUG BEGIN_STMT
  return ret_12;

}


fifo_put (struct fifo_t * const fifo, void * const ptr)
{
  errno_t err;
  uint32_t fill_level;
  long unsigned int _1;
  long unsigned int _2;
  long unsigned int _3;
  _Bool _4;
  long int _5;
  long int _6;
  void * * _7;
  long unsigned int _8;
  long unsigned int _9;
  long unsigned int _10;
  void * * _11;
  long unsigned int _12;
  long unsigned int _13;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  # DEBUG BEGIN_STMT
  _1 = fifo_17(D)->write;
  _2 = fifo_17(D)->read;
  fill_level_18 = _1 - _2;
  # DEBUG fill_level => fill_level_18
  # DEBUG BEGIN_STMT
  _3 = fifo_17(D)->depth;
  _4 = _3 > fill_level_18;
  _5 = (long int) _4;
  _6 = __builtin_expect (_5, 1);
  if (_6 != 0)
    goto <bb 3>; [90.00%]
  else
    goto <bb 4>; [10.00%]

  <bb 3> [local count: 966367642]:
  # DEBUG BEGIN_STMT
  _7 = fifo_17(D)->data;
  _8 = fifo_17(D)->depth_mask;
  _9 = _1 & _8;
  _10 = _9 * 4;
  _11 = _7 + _10;
  *_11 = ptr_19(D);
  # DEBUG BEGIN_STMT
  __asm__ __volatile__(" dmb" :  :  : "memory");
  # DEBUG BEGIN_STMT
  _12 = fifo_17(D)->write;
  _13 = _12 + 1;
  fifo_17(D)->write = _13;
  # DEBUG BEGIN_STMT
  # DEBUG err => 0

  <bb 4> [local count: 1073741824]:
  # err_14 = PHI <0(3), 75(2)>
  # DEBUG err => err_14
  # DEBUG BEGIN_STMT
  return err_14;

}


oal_mutex_destroy (oal_mutex_t * mutex)
{
  errno_t _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_destroy_internal (mutex_2(D));
  return _4;

}


oal_mutex_init (oal_mutex_t * mutex)
{
  errno_t _4;

  <bb 2> [local count: 1073741824]:
  # DEBUG BEGIN_STMT
  _4 = oal_mutex_init_internal (mutex_2(D));
  return _4;

}


