#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int atTop(int *, int);
int /*<<< orphan*/ deleteCQ(int *, int *, int *, int *);
int /*<<< orphan*/ deleteQueue(int *, int *, int *, int *);
int /*<<< orphan*/ displayCQ(int *, int, int);
int /*<<< orphan*/ displayQueue(int *, int, int);
int /*<<< orphan*/ displayStack(int *, int);
int frontValue(int *, int *, int *);
int get(char *);
int /*<<< orphan*/ initializeCQ(int *, int *, int *);
int /*<<< orphan*/ initializeQueue(int *, int *, int *);
int /*<<< orphan*/ initializeStack(int *, int *);
int /*<<< orphan*/ insertCQ(int *, int *, int *, int);
int /*<<< orphan*/ insertQueue(int *, int *, int *, int);
int /*<<< orphan*/ isEmpty(int *, int);
int /*<<< orphan*/ isEmptyCQ(int *, int *);
int /*<<< orphan*/ isEmptyQ(int *, int, int);
int /*<<< orphan*/ isFull(int *, int);
int /*<<< orphan*/ isFullCQ(int *, int *);
int /*<<< orphan*/ isFullQ(int *, int, int);
int /*<<< orphan*/ menu(int);
int pop(int *, int, int *);
int /*<<< orphan*/ printf(char *, ...);
int push(int *, int, int);
int rearValue(int *, int *, int *);
int main() {
  int mode, op, continueResponse, top, value, stack[5], poppedv;
  int Q[5], front, rear, key;
  int CQ[5];
  do {
    printf("\n\t--------------------Choose an ADT--------------------");
    printf("\n\t1. Stack \t2. Queue \t3. Circular");
    printf("\n\t-----------------------------------------------------");
    do {
      mode = get("the choice");
    } while (mode < 1 || mode > 3);
    switch (mode) {
    case 1:
      initializeStack(stack, &top);
      do {
        menu(mode);
        do {
          op = get("the operation code");
        } while (op < 0 || op > 6);
        switch (op) {
        case 1:
          if (top < 5 - 1) {
            top = push(stack, top, get("the value"));
            printf("\n\tValue Inserted. %d", top);
          } else {
            printf("\n\tSTACK is full, can not add element.\n");
          }
          break;
        case 2:
          if (top != -1) {
            top = pop(stack, top, &poppedv);
            printf("\n\tThe popped value is = %d, TOP = %d", poppedv, top);
          } else {
            printf(
                "\n\tSorry the stack is empty! Please add some values first.");
          }
          break;
        case 3:
          if (isEmpty(stack, top))
            printf("\n\tThe Stack is empty.");
          else
            printf("\n\tThe Stack is not empty.");
          break;
        case 4:
          if (isFull(stack, top))
            printf("\n\tThe Stack is Full.");
          else
            printf("\n\tThe Stack is not Full.");
          break;
        case 5:
          if (top != -1) {
            printf("\n\tDisplaying the contents of STACK\n\t");
            displayStack(stack, top);
          } else {
            printf(
                "\n\tSorry the stack is empty! Please add some values first.");
          }
          break;
        case 6:
          if (top == -1)
            printf("\n\tThe Stack is empty.");
          else
            printf("\n\tThe element at top is: %d", atTop(stack, top));
          break;
        }
      } while (op != 0);
      break;
    case 2:
      initializeQueue(Q, &front, &rear);
      do {
        menu(2);
        do {
          op = get("the operation code");
        } while (op < 0 || op > 7);
        switch (op) {
        case 1:
          if (!isFullQ(Q, front, rear)) {
            insertQueue(Q, &front, &rear, get("the value"));
            printf("\n\tValue Inserted. Value = %d ", Q[rear]);
          } else {
            printf("\n\tQueue is full, can not add element.\n");
          }
          break;
        case 2:
          if (!isEmptyQ(Q, front, rear)) {
            deleteQueue(Q, &front, &rear, &key);
            printf("\n\tThe deleted value is = %d", key);
          } else {
            printf(
                "\n\tSorry the Queue is empty! Please add some values first.");
          }
          break;
        case 3:
          if (isEmptyQ(Q, front, rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe Queue is not empty.");
          break;
        case 4:
          if (isFullQ(Q, front, rear))
            printf("\n\tThe Queue is Full.");
          else
            printf("\n\tThe Queue is not Full.");
          break;
        case 5:
          if (!isEmptyQ(Q, front, rear)) {
            printf("\n\tDisplaying the contents of QUEUE\n\t");
            displayQueue(Q, front, rear);
          } else {
            printf(
                "\n\tSorry the Queue is empty! Please add some values first.");
          }
          break;
        case 6:
          if (isEmptyQ(Q, front, rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe element at front is: %d",
                   frontValue(Q, &front, &rear));
          break;
        case 7:
          if (isEmptyQ(Q, front, rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe element at rear is: %d",
                   rearValue(Q, &front, &rear));
          break;
        }
      } while (op != 0);
      break;
    case 3:
      initializeCQ(CQ, &front, &rear);
      do {
        menu(3);
        do {
          op = get("the operation code");
        } while (op < 0 || op > 7);
        switch (op) {
        case 1:
          if (!isFullCQ(&front, &rear)) {
            insertCQ(CQ, &front, &rear, get("the value"));
            printf("\n\tValue Inserted. Value = %d ", CQ[rear]);
          } else {
            printf("\n\tQueue is full, can't add the elements!");
          }
          break;
        case 2:
          if (!isEmptyCQ(&front, &rear)) {
            deleteCQ(CQ, &front, &rear, &key);
            printf("\n\tThe deleted value is = %d", key);
          } else {
            printf(
                "\n\tSorry the Queue is empty! Please add some values first.");
          }
          break;
        case 3:
          if (isEmptyCQ(&front, &rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe Queue is not empty.");
          break;
        case 4:
          if (isFullCQ(&front, &rear))
            printf("\n\tThe Queue is Full.");
          else
            printf("\n\tThe Queue is not Full.");
          break;
        case 5:
          if (!isEmptyCQ(&front, &rear)) {
            printf("\n\tDisplaying the contents of QUEUE\n\t");
            displayCQ(CQ, front, rear);
          } else {
            printf(
                "\n\tSorry the Queue is empty! Please add some values first.");
          }
          break;
        case 6:
          if (isEmptyCQ(&front, &rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe element at front is: %d",
                   frontValue(CQ, &front, &rear));
          break;
        case 7:
          if (isEmptyCQ(&front, &rear))
            printf("\n\tThe Queue is empty.");
          else
            printf("\n\tThe element at rear is: %d",
                   rearValue(CQ, &front, &rear));
          break;
        }
      } while (op != 0);
      break;
    }
    continueResponse = get("Press 0 to exit or any other key to continue");
  } while (continueResponse != 0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xe1f(%rip),%rdi
call   1120 <get@plt>
mov    %eax,-0x8(%rbp)
mov    $0x1,%al
cmpl   $0x1,-0x8(%rbp)
mov    %al,-0x71(%rbp)
jl     12e4 <main+0x64>
cmpl   $0x3,-0x8(%rbp)
setg   %al
mov    %al,-0x71(%rbp)
mov    -0x71(%rbp),%al
test   $0x1,%al
jne    12bc <main+0x3c>
mov    -0x8(%rbp),%eax
mov    %eax,-0x78(%rbp)
sub    $0x1,%eax
je     1325 <main+0xa5>
jmp    1303 <main+0x83>
mov    -0x78(%rbp),%eax
sub    $0x2,%eax
je     1553 <main+0x2d3>
jmp    1314 <main+0x94>
mov    -0x78(%rbp),%eax
sub    $0x3,%eax
je     1821 <main+0x5a1>
jmp    1ae1 <main+0x861>
lea    -0x30(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1140 <initializeStack@plt>
mov    -0x8(%rbp),%edi
call   1050 <menu@plt>
lea    0xdac(%rip),%rdi
call   1120 <get@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x79(%rbp)
jl     1362 <main+0xe2>
cmpl   $0x6,-0xc(%rbp)
setg   %al
mov    %al,-0x79(%rbp)
mov    -0x79(%rbp),%al
test   $0x1,%al
jne    133a <main+0xba>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x88(%rbp)
sub    $0x5,%eax
ja     153f <main+0x2bf>
mov    -0x88(%rbp),%rax
lea    0xca5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x4,-0x14(%rbp)
jge    13f3 <main+0x173>
lea    -0x30(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x8c(%rbp)
lea    0xd3f(%rip),%rdi
call   1120 <get@plt>
mov    -0x98(%rbp),%rdi
mov    -0x8c(%rbp),%esi
mov    %eax,%edx
call   1160 <push@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xd23(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1401 <main+0x181>
lea    0xd25(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
cmpl   $0xffffffff,-0x14(%rbp)
je     143c <main+0x1bc>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x34(%rbp),%rdx
call   10b0 <pop@plt>
mov    %eax,-0x14(%rbp)
mov    -0x34(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xd16(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    144a <main+0x1ca>
lea    0xd28(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1110 <isEmpty@plt>
cmp    $0x0,%eax
je     1477 <main+0x1f7>
lea    0xd3a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1485 <main+0x205>
lea    0xd3d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1150 <isFull@plt>
cmp    $0x0,%eax
je     14b2 <main+0x232>
lea    0xd2f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    14c0 <main+0x240>
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
cmpl   $0xffffffff,-0x14(%rbp)
je     14ee <main+0x26e>
lea    0xd2d(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1060 <displayStack@plt>
jmp    14fc <main+0x27c>
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
cmpl   $0xffffffff,-0x14(%rbp)
jne    151e <main+0x29e>
lea    0xc93(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153a <main+0x2ba>
lea    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   10c0 <atTop@plt>
mov    %eax,%esi
lea    0xcf5(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    153f <main+0x2bf>
jmp    1544 <main+0x2c4>
cmpl   $0x0,-0xc(%rbp)
jne    1332 <main+0xb2>
jmp    1ae1 <main+0x861>
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   10e0 <initializeQueue@plt>
mov    $0x2,%edi
call   1050 <menu@plt>
lea    0xb78(%rip),%rdi
call   1120 <get@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x99(%rbp)
jl     159c <main+0x31c>
cmpl   $0x7,-0xc(%rbp)
setg   %al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
test   $0x1,%al
jne    156e <main+0x2ee>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xa8(%rbp)
sub    $0x6,%eax
ja     180d <main+0x58d>
mov    -0xa8(%rbp),%rax
lea    0xa4c(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   10d0 <isFullQ@plt>
cmp    $0x0,%eax
jne    1639 <main+0x3b9>
lea    -0x50(%rbp),%rax
mov    %rax,-0xb0(%rbp)
lea    0xafd(%rip),%rdi
call   1120 <get@plt>
mov    -0xb0(%rbp),%rdi
mov    %eax,%ecx
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1130 <insertQueue@plt>
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,4),%esi
lea    0xc17(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1647 <main+0x3c7>
lea    0xc22(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1080 <isEmptyQ@plt>
cmp    $0x0,%eax
jne    168f <main+0x40f>
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x5c(%rbp),%rcx
call   10a0 <deleteQueue@plt>
mov    -0x5c(%rbp),%esi
lea    0xc06(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    169d <main+0x41d>
lea    0xc0f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1080 <isEmptyQ@plt>
cmp    $0x0,%eax
je     16cd <main+0x44d>
lea    0xc1e(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    16db <main+0x45b>
lea    0xc21(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   10d0 <isFullQ@plt>
cmp    $0x0,%eax
je     170b <main+0x48b>
lea    0xc10(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1719 <main+0x499>
lea    0xc12(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1080 <isEmptyQ@plt>
cmp    $0x0,%eax
jne    1758 <main+0x4d8>
lea    0xc00(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1180 <displayQueue@plt>
jmp    1766 <main+0x4e6>
lea    0xb46(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1080 <isEmptyQ@plt>
cmp    $0x0,%eax
je     1796 <main+0x516>
lea    0xb55(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    17b7 <main+0x537>
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   10f0 <frontValue@plt>
mov    %eax,%esi
lea    0xbb2(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
lea    -0x50(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   1080 <isEmptyQ@plt>
cmp    $0x0,%eax
je     17e7 <main+0x567>
lea    0xb04(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1808 <main+0x588>
lea    -0x50(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1030 <rearValue@plt>
mov    %eax,%esi
lea    0xb7f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    180d <main+0x58d>
jmp    1812 <main+0x592>
cmpl   $0x0,-0xc(%rbp)
jne    1564 <main+0x2e4>
jmp    1ae1 <main+0x861>
lea    -0x70(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1090 <initializeCQ@plt>
mov    $0x3,%edi
call   1050 <menu@plt>
lea    0x8aa(%rip),%rdi
call   1120 <get@plt>
mov    %eax,-0xc(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0xb1(%rbp)
jl     186a <main+0x5ea>
cmpl   $0x7,-0xc(%rbp)
setg   %al
mov    %al,-0xb1(%rbp)
mov    -0xb1(%rbp),%al
test   $0x1,%al
jne    183c <main+0x5bc>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xc0(%rbp)
sub    $0x6,%eax
ja     1acd <main+0x84d>
mov    -0xc0(%rbp),%rax
lea    0x762(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1190 <isFullCQ@plt>
cmp    $0x0,%eax
jne    1905 <main+0x685>
lea    -0x70(%rbp),%rax
mov    %rax,-0xc8(%rbp)
lea    0x831(%rip),%rdi
call   1120 <get@plt>
mov    -0xc8(%rbp),%rdi
mov    %eax,%ecx
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1170 <insertCQ@plt>
movslq -0x58(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%esi
lea    0x94b(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1913 <main+0x693>
lea    0xa91(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1100 <isEmptyCQ@plt>
cmp    $0x0,%eax
jne    1959 <main+0x6d9>
lea    -0x70(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
lea    -0x5c(%rbp),%rcx
call   1040 <deleteCQ@plt>
mov    -0x5c(%rbp),%esi
lea    0x93c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1967 <main+0x6e7>
lea    0x945(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1100 <isEmptyCQ@plt>
cmp    $0x0,%eax
je     1995 <main+0x715>
lea    0x956(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    19a3 <main+0x723>
lea    0x959(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1190 <isFullCQ@plt>
cmp    $0x0,%eax
je     19d1 <main+0x751>
lea    0x94a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    19df <main+0x75f>
lea    0x94c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1100 <isEmptyCQ@plt>
cmp    $0x0,%eax
jne    1a1c <main+0x79c>
lea    0x93c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x54(%rbp),%esi
mov    -0x58(%rbp),%edx
call   11a0 <displayCQ@plt>
jmp    1a2a <main+0x7aa>
lea    0x882(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1100 <isEmptyCQ@plt>
cmp    $0x0,%eax
je     1a58 <main+0x7d8>
lea    0x893(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1a79 <main+0x7f9>
lea    -0x70(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   10f0 <frontValue@plt>
mov    %eax,%esi
lea    0x8f0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
lea    -0x54(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1100 <isEmptyCQ@plt>
cmp    $0x0,%eax
je     1aa7 <main+0x827>
lea    0x844(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1ac8 <main+0x848>
lea    -0x70(%rbp),%rdi
lea    -0x54(%rbp),%rsi
lea    -0x58(%rbp),%rdx
call   1030 <rearValue@plt>
mov    %eax,%esi
lea    0x8bf(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    1acd <main+0x84d>
jmp    1ad2 <main+0x852>
cmpl   $0x0,-0xc(%rbp)
jne    1832 <main+0x5b2>
jmp    1ae1 <main+0x861>
lea    0x8de(%rip),%rdi
call   1120 <get@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    1292 <main+0x12>
xor    %eax,%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
lea    0x10(%rsp),%r13
lea    0xe4f(%rip),%r15
lea    0xd4f(%rip),%rbx
lea    0xfab(%rip),%r12
lea    0xfde(%rip),%r14
lea    0x60(%rsp),%rbp
jmp    12e4 <main+0x54>
cs nopw 0x0(%rax,%rax,1)
lea    0x10ad(%rip),%rdi
call   1130 <get@plt>
test   %eax,%eax
je     1889 <main+0x5f9>
lea    0xd71(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xd9b(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
lea    0xdaf(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
xchg   %ax,%ax
lea    0xdd7(%rip),%rdi
call   1130 <get@plt>
lea    -0x4(%rax),%ecx
cmp    $0xfffffffd,%ecx
jb     1310 <main+0x80>
cmp    $0x3,%eax
je     16c0 <main+0x430>
cmp    $0x2,%eax
je     14e0 <main+0x250>
cmp    $0x1,%eax
jne    12d0 <main+0x40>
lea    0x40(%rsp),%rdi
lea    0x14(%rsp),%rsi
call   1150 <initializeStack@plt>
jmp    135a <main+0xca>
lea    0xdfd(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x1,%edi
call   1060 <menu@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
call   1130 <get@plt>
cmp    $0x6,%eax
ja     1370 <main+0xe0>
ja     135a <main+0xca>
mov    %eax,%eax
lea    0xcb8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %r14,%rbp
mov    %rbx,%r14
mov    0x14(%rsp),%ebx
cmp    $0x3,%ebx
jg     14b4 <main+0x224>
lea    0xd61(%rip),%rdi
call   1130 <get@plt>
lea    0x40(%rsp),%rdi
mov    %ebx,%esi
mov    %eax,%edx
call   1170 <push@plt>
mov    %eax,0x14(%rsp)
lea    0xd4d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    14c0 <main+0x230>
mov    0x14(%rsp),%esi
cmp    $0xffffffff,%esi
je     134c <main+0xbc>
lea    0x40(%rsp),%rdi
lea    0x1c(%rsp),%rdx
call   10c0 <pop@plt>
mov    %eax,0x14(%rsp)
mov    0x1c(%rsp),%esi
lea    0xd29(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1080 <printf@plt>
jmp    135a <main+0xca>
mov    0x14(%rsp),%esi
lea    0x40(%rsp),%rdi
call   1120 <isEmpty@plt>
test   %eax,%eax
jne    14a8 <main+0x218>
lea    0xd73(%rip),%rdi
jmp    1353 <main+0xc3>
mov    0x14(%rsp),%esi
lea    0x40(%rsp),%rdi
call   1160 <isFull@plt>
test   %eax,%eax
je     14d0 <main+0x240>
lea    0xd6b(%rip),%rdi
jmp    1353 <main+0xc3>
cmpl   $0xffffffff,0x14(%rsp)
je     134c <main+0xbc>
lea    0xd82(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0x14(%rsp),%esi
lea    0x40(%rsp),%rdi
call   1070 <displayStack@plt>
jmp    135a <main+0xca>
mov    0x14(%rsp),%esi
cmp    $0xffffffff,%esi
je     14a8 <main+0x218>
lea    0x40(%rsp),%rdi
call   10d0 <atTop@plt>
lea    0xd73(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    135a <main+0xca>
lea    0xcdb(%rip),%rdi
jmp    1353 <main+0xc3>
lea    0xf1c(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rbx
mov    %rbp,%r14
lea    0x60(%rsp),%rbp
jmp    135a <main+0xca>
lea    0xcf8(%rip),%rdi
jmp    1353 <main+0xc3>
nopl   0x0(%rax)
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   10f0 <initializeQueue@plt>
jmp    1514 <main+0x284>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1090 <isEmptyQ@plt>
test   %eax,%eax
je     1648 <main+0x3b8>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x2,%edi
call   1060 <menu@plt>
xchg   %ax,%ax
mov    %r15,%rdi
call   1130 <get@plt>
cmp    $0x7,%eax
ja     1520 <main+0x290>
ja     1514 <main+0x284>
mov    %eax,%eax
lea    0xae8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   10e0 <isFullQ@plt>
test   %eax,%eax
je     1654 <main+0x3c4>
lea    0xe51(%rip),%rdi
call   1050 <puts@plt>
jmp    1514 <main+0x284>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1090 <isEmptyQ@plt>
test   %eax,%eax
jne    15dc <main+0x34c>
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
lea    0x18(%rsp),%rcx
call   10b0 <deleteQueue@plt>
mov    0x18(%rsp),%esi
lea    0xcac(%rip),%rdi
jmp    1682 <main+0x3f2>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   10e0 <isFullQ@plt>
test   %eax,%eax
je     168e <main+0x3fe>
lea    0xd0e(%rip),%rdi
jmp    150d <main+0x27d>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1090 <isEmptyQ@plt>
test   %eax,%eax
je     169a <main+0x40a>
mov    %r12,%rdi
jmp    150d <main+0x27d>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1090 <isEmptyQ@plt>
test   %eax,%eax
jne    150a <main+0x27a>
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   1100 <frontValue@plt>
lea    0xd0d(%rip),%rdi
jmp    1644 <main+0x3b4>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1090 <isEmptyQ@plt>
test   %eax,%eax
jne    150a <main+0x27a>
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   1030 <rearValue@plt>
lea    0xcfa(%rip),%rdi
mov    %eax,%esi
jmp    1682 <main+0x3f2>
lea    0xc64(%rip),%rdi
jmp    150d <main+0x27d>
lea    0xab1(%rip),%rdi
call   1130 <get@plt>
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
mov    %eax,%ecx
call   1140 <insertQueue@plt>
movslq 0x10(%rsp),%rax
mov    0x60(%rsp,%rax,4),%esi
lea    0xba7(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    1514 <main+0x284>
lea    0xc4d(%rip),%rdi
jmp    150d <main+0x27d>
lea    0xc5a(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
mov    %rbp,%rdi
call   1190 <displayQueue@plt>
jmp    1514 <main+0x284>
nopl   (%rax)
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   10a0 <initializeCQ@plt>
jmp    16f3 <main+0x463>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   1110 <isEmptyCQ@plt>
test   %eax,%eax
je     1810 <main+0x580>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    $0x3,%edi
call   1060 <menu@plt>
nopl   (%rax)
mov    %r15,%rdi
call   1130 <get@plt>
cmp    $0x7,%eax
ja     1700 <main+0x470>
ja     16f3 <main+0x463>
mov    %eax,%eax
movslq (%rbx,%rax,4),%rax
add    %rbx,%rax
jmp    *%rax
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   11a0 <isFullCQ@plt>
test   %eax,%eax
je     181c <main+0x58c>
lea    0xc25(%rip),%rdi
jmp    16ec <main+0x45c>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   1110 <isEmptyCQ@plt>
test   %eax,%eax
jne    17a6 <main+0x516>
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
lea    0x18(%rsp),%rcx
call   1040 <deleteCQ@plt>
mov    0x18(%rsp),%esi
lea    0xadc(%rip),%rdi
jmp    184c <main+0x5bc>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   11a0 <isFullCQ@plt>
test   %eax,%eax
je     1858 <main+0x5c8>
lea    0xb41(%rip),%rdi
jmp    16ec <main+0x45c>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   1110 <isEmptyCQ@plt>
test   %eax,%eax
je     1864 <main+0x5d4>
mov    %r12,%rdi
jmp    16ec <main+0x45c>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   1110 <isEmptyCQ@plt>
test   %eax,%eax
jne    16e9 <main+0x459>
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   1100 <frontValue@plt>
lea    0xb44(%rip),%rdi
jmp    180c <main+0x57c>
lea    0xc(%rsp),%rdi
mov    %r13,%rsi
call   1110 <isEmptyCQ@plt>
test   %eax,%eax
jne    16e9 <main+0x459>
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
call   1030 <rearValue@plt>
lea    0xb32(%rip),%rdi
mov    %eax,%esi
jmp    184c <main+0x5bc>
lea    0xa9c(%rip),%rdi
jmp    16ec <main+0x45c>
lea    0x8e9(%rip),%rdi
call   1130 <get@plt>
lea    0x20(%rsp),%rdi
lea    0xc(%rsp),%rsi
mov    %r13,%rdx
mov    %eax,%ecx
call   1180 <insertCQ@plt>
movslq 0x10(%rsp),%rax
mov    0x20(%rsp,%rax,4),%esi
lea    0x9dd(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
jmp    16f3 <main+0x463>
lea    0xa83(%rip),%rdi
jmp    16ec <main+0x45c>
lea    0xa90(%rip),%rdi
xor    %eax,%eax
call   1080 <printf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%edx
lea    0x20(%rsp),%rdi
call   11b0 <displayCQ@plt>
jmp    16f3 <main+0x463>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [56 x i8] c"\0A\09--------------------Choose an ADT--------------------\00"
@.str.1 = [34 x i8] c"\0A\091. Stack \092. Queue \093. Circular\00"
@.str.2 = [56 x i8] c"\0A\09-----------------------------------------------------\00"
@.str.3 = [11 x i8] c"the choice\00"
@.str.4 = [19 x i8] c"the operation code\00"
@.str.5 = [10 x i8] c"the value\00"
@.str.6 = [21 x i8] c"\0A\09Value Inserted. %d\00"
@.str.7 = [39 x i8] c"\0A\09STACK is full, can not add element.\0A\00"
@.str.8 = [37 x i8] c"\0A\09The popped value is = %d, TOP = %d\00"
@.str.9 = [58 x i8] c"\0A\09Sorry the stack is empty! Please add some values first.\00"
@.str.10 = [22 x i8] c"\0A\09The Stack is empty.\00"
@.str.11 = [26 x i8] c"\0A\09The Stack is not empty.\00"
@.str.12 = [21 x i8] c"\0A\09The Stack is Full.\00"
@.str.13 = [25 x i8] c"\0A\09The Stack is not Full.\00"
@.str.14 = [37 x i8] c"\0A\09Displaying the contents of STACK\0A\09\00"
@.str.15 = [28 x i8] c"\0A\09The element at top is: %d\00"
@.str.16 = [30 x i8] c"\0A\09Value Inserted. Value = %d \00"
@.str.17 = [39 x i8] c"\0A\09Queue is full, can not add element.\0A\00"
@.str.18 = [28 x i8] c"\0A\09The deleted value is = %d\00"
@.str.19 = [58 x i8] c"\0A\09Sorry the Queue is empty! Please add some values first.\00"
@.str.20 = [22 x i8] c"\0A\09The Queue is empty.\00"
@.str.21 = [26 x i8] c"\0A\09The Queue is not empty.\00"
@.str.22 = [21 x i8] c"\0A\09The Queue is Full.\00"
@.str.23 = [25 x i8] c"\0A\09The Queue is not Full.\00"
@.str.24 = [37 x i8] c"\0A\09Displaying the contents of QUEUE\0A\09\00"
@.str.25 = [30 x i8] c"\0A\09The element at front is: %d\00"
@.str.26 = [29 x i8] c"\0A\09The element at rear is: %d\00"
@.str.27 = [41 x i8] c"\0A\09Queue is full, can't add the elements!\00"
@.str.28 = [45 x i8] c"Press 0 to exit or any other key to continue\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [5 x i32]
%8 = alloca i32
%9 = alloca [5 x i32]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [5 x i32]
store i32 0, i32* %1
br label %14
14: ; preds = %336, %0
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %18
18: ; preds = %26, %14
%19 = call i32 @get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
store i32 %19, i32* %2
br label %20
20: ; preds = %18
%21 = load i32, i32* %2
%22 = icmp slt i32 %21, 1
br i1 %22, label %26, label %23
23: ; preds = %20
%24 = load i32, i32* %2
%25 = icmp sgt i32 %24, 3
br label %26
26: ; preds = %23, %20
%27 = phi i1 [ true, %20 ], [ %25, %23 ]
br i1 %27, label %18, label %28
28: ; preds = %26
%29 = load i32, i32* %2
switch i32 %29, label %334 [
i32 1, label %30
i32 2, label %121
i32 3, label %238
]
30: ; preds = %28
%31 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%32 = call i32 @initializeStack(i32* %31, i32* %5)
br label %33
33: ; preds = %117, %30
%34 = load i32, i32* %2
%35 = call i32 @menu(i32 %34)
br label %36
36: ; preds = %44, %33
%37 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 %37, i32* %3
br label %38
38: ; preds = %36
%39 = load i32, i32* %3
%40 = icmp slt i32 %39, 0
br i1 %40, label %44, label %41
41: ; preds = %38
%42 = load i32, i32* %3
%43 = icmp sgt i32 %42, 6
br label %44
44: ; preds = %41, %38
%45 = phi i1 [ true, %38 ], [ %43, %41 ]
br i1 %45, label %36, label %46
46: ; preds = %44
%47 = load i32, i32* %3
switch i32 %47, label %116 [
i32 1, label %48
i32 2, label %61
i32 3, label %74
i32 4, label %84
i32 5, label %94
i32 6, label %105
]
48: ; preds = %46
%49 = load i32, i32* %5
%50 = icmp slt i32 %49, 4
br i1 %50, label %51, label %58
51: ; preds = %48
%52 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%53 = load i32, i32* %5
%54 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%55 = call i32 @push(i32* %52, i32 %53, i32 %54)
store i32 %55, i32* %5
%56 = load i32, i32* %5
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %56)
br label %60
58: ; preds = %48
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.7, i64 0, i64 0))
br label %60
60: ; preds = %58, %51
br label %116
61: ; preds = %46
%62 = load i32, i32* %5
%63 = icmp ne i32 %62, -1
br i1 %63, label %64, label %71
64: ; preds = %61
%65 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%66 = load i32, i32* %5
%67 = call i32 @pop(i32* %65, i32 %66, i32* %8)
store i32 %67, i32* %5
%68 = load i32, i32* %8
%69 = load i32, i32* %5
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %68, i32 %69)
br label %73
71: ; preds = %61
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
br label %73
73: ; preds = %71, %64
br label %116
74: ; preds = %46
%75 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%76 = load i32, i32* %5
%77 = call i32 @isEmpty(i32* %75, i32 %76)
%78 = icmp ne i32 %77, 0
br i1 %78, label %79, label %81
79: ; preds = %74
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
br label %83
81: ; preds = %74
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %83
83: ; preds = %81, %79
br label %116
84: ; preds = %46
%85 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%86 = load i32, i32* %5
%87 = call i32 @isFull(i32* %85, i32 %86)
%88 = icmp ne i32 %87, 0
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %93
91: ; preds = %84
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
br label %93
93: ; preds = %91, %89
br label %116
94: ; preds = %46
%95 = load i32, i32* %5
%96 = icmp ne i32 %95, -1
br i1 %96, label %97, label %102
97: ; preds = %94
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0))
%99 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%100 = load i32, i32* %5
%101 = call i32 @displayStack(i32* %99, i32 %100)
br label %104
102: ; preds = %94
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
br label %104
104: ; preds = %102, %97
br label %116
105: ; preds = %46
%106 = load i32, i32* %5
%107 = icmp eq i32 %106, -1
br i1 %107, label %108, label %110
108: ; preds = %105
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
br label %115
110: ; preds = %105
%111 = getelementptr inbounds [5 x i32], [5 x i32]* %7, i64 0, i64 0
%112 = load i32, i32* %5
%113 = call i32 @atTop(i32* %111, i32 %112)
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %113)
br label %115
115: ; preds = %110, %108
br label %116
116: ; preds = %46, %115, %104, %93, %83, %73, %60
br label %117
117: ; preds = %116
%118 = load i32, i32* %3
%119 = icmp ne i32 %118, 0
br i1 %119, label %33, label %120
120: ; preds = %117
br label %334
121: ; preds = %28
%122 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%123 = call i32 @initializeQueue(i32* %122, i32* %10, i32* %11)
br label %124
124: ; preds = %234, %121
%125 = call i32 @menu(i32 2)
br label %126
126: ; preds = %134, %124
%127 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 %127, i32* %3
br label %128
128: ; preds = %126
%129 = load i32, i32* %3
%130 = icmp slt i32 %129, 0
br i1 %130, label %134, label %131
131: ; preds = %128
%132 = load i32, i32* %3
%133 = icmp sgt i32 %132, 7
br label %134
134: ; preds = %131, %128
%135 = phi i1 [ true, %128 ], [ %133, %131 ]
br i1 %135, label %126, label %136
136: ; preds = %134
%137 = load i32, i32* %3
switch i32 %137, label %233 [
i32 1, label %138
i32 2, label %156
i32 3, label %170
i32 4, label %181
i32 5, label %192
i32 6, label %207
i32 7, label %220
]
138: ; preds = %136
%139 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%140 = load i32, i32* %10
%141 = load i32, i32* %11
%142 = call i32 @isFullQ(i32* %139, i32 %140, i32 %141)
%143 = icmp ne i32 %142, 0
br i1 %143, label %153, label %144
144: ; preds = %138
%145 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%146 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%147 = call i32 @insertQueue(i32* %145, i32* %10, i32* %11, i32 %146)
%148 = load i32, i32* %11
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 %149
%151 = load i32, i32* %150
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %151)
br label %155
153: ; preds = %138
%154 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.17, i64 0, i64 0))
br label %155
155: ; preds = %153, %144
br label %233
156: ; preds = %136
%157 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%158 = load i32, i32* %10
%159 = load i32, i32* %11
%160 = call i32 @isEmptyQ(i32* %157, i32 %158, i32 %159)
%161 = icmp ne i32 %160, 0
br i1 %161, label %167, label %162
162: ; preds = %156
%163 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%164 = call i32 @deleteQueue(i32* %163, i32* %10, i32* %11, i32* %12)
%165 = load i32, i32* %12
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.18, i64 0, i64 0), i32 %165)
br label %169
167: ; preds = %156
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %169
169: ; preds = %167, %162
br label %233
170: ; preds = %136
%171 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%172 = load i32, i32* %10
%173 = load i32, i32* %11
%174 = call i32 @isEmptyQ(i32* %171, i32 %172, i32 %173)
%175 = icmp ne i32 %174, 0
br i1 %175, label %176, label %178
176: ; preds = %170
%177 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %180
178: ; preds = %170
%179 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0))
br label %180
180: ; preds = %178, %176
br label %233
181: ; preds = %136
%182 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%183 = load i32, i32* %10
%184 = load i32, i32* %11
%185 = call i32 @isFullQ(i32* %182, i32 %183, i32 %184)
%186 = icmp ne i32 %185, 0
br i1 %186, label %187, label %189
187: ; preds = %181
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
br label %191
189: ; preds = %181
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
br label %191
191: ; preds = %189, %187
br label %233
192: ; preds = %136
%193 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%194 = load i32, i32* %10
%195 = load i32, i32* %11
%196 = call i32 @isEmptyQ(i32* %193, i32 %194, i32 %195)
%197 = icmp ne i32 %196, 0
br i1 %197, label %204, label %198
198: ; preds = %192
%199 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%200 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%201 = load i32, i32* %10
%202 = load i32, i32* %11
%203 = call i32 @displayQueue(i32* %200, i32 %201, i32 %202)
br label %206
204: ; preds = %192
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %206
206: ; preds = %204, %198
br label %233
207: ; preds = %136
%208 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%209 = load i32, i32* %10
%210 = load i32, i32* %11
%211 = call i32 @isEmptyQ(i32* %208, i32 %209, i32 %210)
%212 = icmp ne i32 %211, 0
br i1 %212, label %213, label %215
213: ; preds = %207
%214 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %219
215: ; preds = %207
%216 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%217 = call i32 @frontValue(i32* %216, i32* %10, i32* %11)
%218 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0), i32 %217)
br label %219
219: ; preds = %215, %213
br label %233
220: ; preds = %136
%221 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%222 = load i32, i32* %10
%223 = load i32, i32* %11
%224 = call i32 @isEmptyQ(i32* %221, i32 %222, i32 %223)
%225 = icmp ne i32 %224, 0
br i1 %225, label %226, label %228
226: ; preds = %220
%227 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %232
228: ; preds = %220
%229 = getelementptr inbounds [5 x i32], [5 x i32]* %9, i64 0, i64 0
%230 = call i32 @rearValue(i32* %229, i32* %10, i32* %11)
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %230)
br label %232
232: ; preds = %228, %226
br label %233
233: ; preds = %136, %232, %219, %206, %191, %180, %169, %155
br label %234
234: ; preds = %233
%235 = load i32, i32* %3
%236 = icmp ne i32 %235, 0
br i1 %236, label %124, label %237
237: ; preds = %234
br label %334
238: ; preds = %28
%239 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%240 = call i32 @initializeCQ(i32* %239, i32* %10, i32* %11)
br label %241
241: ; preds = %330, %238
%242 = call i32 @menu(i32 3)
br label %243
243: ; preds = %251, %241
%244 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
store i32 %244, i32* %3
br label %245
245: ; preds = %243
%246 = load i32, i32* %3
%247 = icmp slt i32 %246, 0
br i1 %247, label %251, label %248
248: ; preds = %245
%249 = load i32, i32* %3
%250 = icmp sgt i32 %249, 7
br label %251
251: ; preds = %248, %245
%252 = phi i1 [ true, %245 ], [ %250, %248 ]
br i1 %252, label %243, label %253
253: ; preds = %251
%254 = load i32, i32* %3
switch i32 %254, label %329 [
i32 1, label %255
i32 2, label %270
i32 3, label %281
i32 4, label %289
i32 5, label %297
i32 6, label %309
i32 7, label %319
]
255: ; preds = %253
%256 = call i32 @isFullCQ(i32* %10, i32* %11)
%257 = icmp ne i32 %256, 0
br i1 %257, label %267, label %258
258: ; preds = %255
%259 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%260 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%261 = call i32 @insertCQ(i32* %259, i32* %10, i32* %11, i32 %260)
%262 = load i32, i32* %11
%263 = sext i32 %262 to i64
%264 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 %263
%265 = load i32, i32* %264
%266 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %265)
br label %269
267: ; preds = %255
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.27, i64 0, i64 0))
br label %269
269: ; preds = %267, %258
br label %329
270: ; preds = %253
%271 = call i32 @isEmptyCQ(i32* %10, i32* %11)
%272 = icmp ne i32 %271, 0
br i1 %272, label %278, label %273
273: ; preds = %270
%274 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%275 = call i32 @deleteCQ(i32* %274, i32* %10, i32* %11, i32* %12)
%276 = load i32, i32* %12
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.18, i64 0, i64 0), i32 %276)
br label %280
278: ; preds = %270
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %280
280: ; preds = %278, %273
br label %329
281: ; preds = %253
%282 = call i32 @isEmptyCQ(i32* %10, i32* %11)
%283 = icmp ne i32 %282, 0
br i1 %283, label %284, label %286
284: ; preds = %281
%285 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %288
286: ; preds = %281
%287 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0))
br label %288
288: ; preds = %286, %284
br label %329
289: ; preds = %253
%290 = call i32 @isFullCQ(i32* %10, i32* %11)
%291 = icmp ne i32 %290, 0
br i1 %291, label %292, label %294
292: ; preds = %289
%293 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
br label %296
294: ; preds = %289
%295 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
br label %296
296: ; preds = %294, %292
br label %329
297: ; preds = %253
%298 = call i32 @isEmptyCQ(i32* %10, i32* %11)
%299 = icmp ne i32 %298, 0
br i1 %299, label %306, label %300
300: ; preds = %297
%301 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%302 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%303 = load i32, i32* %10
%304 = load i32, i32* %11
%305 = call i32 @displayCQ(i32* %302, i32 %303, i32 %304)
br label %308
306: ; preds = %297
%307 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %308
308: ; preds = %306, %300
br label %329
309: ; preds = %253
%310 = call i32 @isEmptyCQ(i32* %10, i32* %11)
%311 = icmp ne i32 %310, 0
br i1 %311, label %312, label %314
312: ; preds = %309
%313 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %318
314: ; preds = %309
%315 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%316 = call i32 @frontValue(i32* %315, i32* %10, i32* %11)
%317 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0), i32 %316)
br label %318
318: ; preds = %314, %312
br label %329
319: ; preds = %253
%320 = call i32 @isEmptyCQ(i32* %10, i32* %11)
%321 = icmp ne i32 %320, 0
br i1 %321, label %322, label %324
322: ; preds = %319
%323 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %328
324: ; preds = %319
%325 = getelementptr inbounds [5 x i32], [5 x i32]* %13, i64 0, i64 0
%326 = call i32 @rearValue(i32* %325, i32* %10, i32* %11)
%327 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %326)
br label %328
328: ; preds = %324, %322
br label %329
329: ; preds = %253, %328, %318, %308, %296, %288, %280, %269
br label %330
330: ; preds = %329
%331 = load i32, i32* %3
%332 = icmp ne i32 %331, 0
br i1 %332, label %241, label %333
333: ; preds = %330
br label %334
334: ; preds = %28, %333, %237, %120
%335 = call i32 @get(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.28, i64 0, i64 0))
store i32 %335, i32* %4
br label %336
336: ; preds = %334
%337 = load i32, i32* %4
%338 = icmp ne i32 %337, 0
br i1 %338, label %14, label %339
339: ; preds = %336
ret i32 0
}

LLVM IR (-O2):
@.str = [56 x i8] c"\0A\09--------------------Choose an ADT--------------------\00"
@.str.1 = [34 x i8] c"\0A\091. Stack \092. Queue \093. Circular\00"
@.str.2 = [56 x i8] c"\0A\09-----------------------------------------------------\00"
@.str.3 = [11 x i8] c"the choice\00"
@.str.4 = [19 x i8] c"the operation code\00"
@.str.5 = [10 x i8] c"the value\00"
@.str.6 = [21 x i8] c"\0A\09Value Inserted. %d\00"
@.str.8 = [37 x i8] c"\0A\09The popped value is = %d, TOP = %d\00"
@.str.9 = [58 x i8] c"\0A\09Sorry the stack is empty! Please add some values first.\00"
@.str.10 = [22 x i8] c"\0A\09The Stack is empty.\00"
@.str.11 = [26 x i8] c"\0A\09The Stack is not empty.\00"
@.str.12 = [21 x i8] c"\0A\09The Stack is Full.\00"
@.str.13 = [25 x i8] c"\0A\09The Stack is not Full.\00"
@.str.14 = [37 x i8] c"\0A\09Displaying the contents of STACK\0A\09\00"
@.str.15 = [28 x i8] c"\0A\09The element at top is: %d\00"
@.str.16 = [30 x i8] c"\0A\09Value Inserted. Value = %d \00"
@.str.18 = [28 x i8] c"\0A\09The deleted value is = %d\00"
@.str.19 = [58 x i8] c"\0A\09Sorry the Queue is empty! Please add some values first.\00"
@.str.20 = [22 x i8] c"\0A\09The Queue is empty.\00"
@.str.21 = [26 x i8] c"\0A\09The Queue is not empty.\00"
@.str.22 = [21 x i8] c"\0A\09The Queue is Full.\00"
@.str.23 = [25 x i8] c"\0A\09The Queue is not Full.\00"
@.str.24 = [37 x i8] c"\0A\09Displaying the contents of QUEUE\0A\09\00"
@.str.25 = [30 x i8] c"\0A\09The element at front is: %d\00"
@.str.26 = [29 x i8] c"\0A\09The element at rear is: %d\00"
@.str.27 = [41 x i8] c"\0A\09Queue is full, can't add the elements!\00"
@.str.28 = [45 x i8] c"Press 0 to exit or any other key to continue\00"
@str = [38 x i8] c"\0A\09Queue is full, can not add element.\00"
@str.29 = [38 x i8] c"\0A\09STACK is full, can not add element.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca [5 x i32]
%9 = bitcast i32* %1 to i8*
%10 = bitcast [5 x i32]* %2 to i8*
%11 = bitcast i32* %3 to i8*
%12 = bitcast [5 x i32]* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = bitcast i32* %6 to i8*
%15 = bitcast i32* %7 to i8*
%16 = bitcast [5 x i32]* %8 to i8*
%17 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 0
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%19 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
br label %20
20: ; preds = %245, %0
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.1, i64 0, i64 0))
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %24
24: ; preds = %24, %20
%25 = call i32 @get(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%26 = add i32 %25, -4
%27 = icmp ult i32 %26, -3
br i1 %27, label %24, label %28
28: ; preds = %24
switch i32 %25, label %245 [
i32 1, label %29
i32 2, label %89
i32 3, label %174
]
29: ; preds = %28
%30 = call i32 @initializeStack(i32* %19, i32* %1)
br label %31
31: ; preds = %85, %29
%32 = call i32 @menu(i32 1)
br label %33
33: ; preds = %33, %31
%34 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%35 = icmp ugt i32 %34, 6
br i1 %35, label %33, label %36
36: ; preds = %33
switch i32 %34, label %85 [
i32 1, label %37
i32 2, label %46
i32 3, label %55
i32 4, label %63
i32 5, label %71
i32 6, label %80
i32 0, label %245
]
37: ; preds = %36
%38 = load i32, i32* %1
%39 = icmp slt i32 %38, 4
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%42 = call i32 @push(i32* %19, i32 %38, i32 %41)
store i32 %42, i32* %1
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 %42)
br label %85
44: ; preds = %37
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.29, i64 0, i64 0))
br label %85
46: ; preds = %36
%47 = load i32, i32* %1
%48 = icmp eq i32 %47, -1
br i1 %48, label %53, label %49
49: ; preds = %46
%50 = call i32 @pop(i32* %19, i32 %47, i32* %3)
store i32 %50, i32* %1
%51 = load i32, i32* %3
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.8, i64 0, i64 0), i32 %51, i32 %50)
br label %85
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
br label %85
55: ; preds = %36
%56 = load i32, i32* %1
%57 = call i32 @isEmpty(i32* %19, i32 %56)
%58 = icmp eq i32 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %55
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
br label %85
61: ; preds = %55
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %85
63: ; preds = %36
%64 = load i32, i32* %1
%65 = call i32 @isFull(i32* %19, i32 %64)
%66 = icmp eq i32 %65, 0
br i1 %66, label %69, label %67
67: ; preds = %63
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
br label %85
69: ; preds = %63
%70 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.13, i64 0, i64 0))
br label %85
71: ; preds = %36
%72 = load i32, i32* %1
%73 = icmp eq i32 %72, -1
br i1 %73, label %78, label %74
74: ; preds = %71
%75 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.14, i64 0, i64 0))
%76 = load i32, i32* %1
%77 = call i32 @displayStack(i32* %19, i32 %76)
br label %85
78: ; preds = %71
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.9, i64 0, i64 0))
br label %85
80: ; preds = %36
%81 = load i32, i32* %1
%82 = icmp eq i32 %81, -1
br i1 %82, label %83, label %86
83: ; preds = %80
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0))
br label %85
85: ; preds = %83, %86, %74, %78, %67, %69, %59, %61, %49, %53, %40, %44, %36
br label %31
86: ; preds = %80
%87 = call i32 @atTop(i32* %19, i32 %81)
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.15, i64 0, i64 0), i32 %87)
br label %85
89: ; preds = %28
%90 = call i32 @initializeQueue(i32* %18, i32* %5, i32* %6)
br label %91
91: ; preds = %170, %89
%92 = call i32 @menu(i32 2)
br label %93
93: ; preds = %93, %91
%94 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%95 = icmp ugt i32 %94, 7
br i1 %95, label %93, label %96
96: ; preds = %93
switch i32 %94, label %170 [
i32 1, label %97
i32 2, label %112
i32 3, label %123
i32 4, label %132
i32 5, label %141
i32 6, label %153
i32 7, label %163
i32 0, label %245
]
97: ; preds = %96
%98 = load i32, i32* %5
%99 = load i32, i32* %6
%100 = call i32 @isFullQ(i32* %18, i32 %98, i32 %99)
%101 = icmp eq i32 %100, 0
br i1 %101, label %102, label %110
102: ; preds = %97
%103 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%104 = call i32 @insertQueue(i32* %18, i32* %5, i32* %6, i32 %103)
%105 = load i32, i32* %6
%106 = sext i32 %105 to i64
%107 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 %106
%108 = load i32, i32* %107
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %108)
br label %170
110: ; preds = %97
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %170
112: ; preds = %96
%113 = load i32, i32* %5
%114 = load i32, i32* %6
%115 = call i32 @isEmptyQ(i32* %18, i32 %113, i32 %114)
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %121
117: ; preds = %112
%118 = call i32 @deleteQueue(i32* %18, i32* %5, i32* %6, i32* %7)
%119 = load i32, i32* %7
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.18, i64 0, i64 0), i32 %119)
br label %170
121: ; preds = %112
%122 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %170
123: ; preds = %96
%124 = load i32, i32* %5
%125 = load i32, i32* %6
%126 = call i32 @isEmptyQ(i32* %18, i32 %124, i32 %125)
%127 = icmp eq i32 %126, 0
br i1 %127, label %130, label %128
128: ; preds = %123
%129 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %170
130: ; preds = %123
%131 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0))
br label %170
132: ; preds = %96
%133 = load i32, i32* %5
%134 = load i32, i32* %6
%135 = call i32 @isFullQ(i32* %18, i32 %133, i32 %134)
%136 = icmp eq i32 %135, 0
br i1 %136, label %139, label %137
137: ; preds = %132
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
br label %170
139: ; preds = %132
%140 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
br label %170
141: ; preds = %96
%142 = load i32, i32* %5
%143 = load i32, i32* %6
%144 = call i32 @isEmptyQ(i32* %18, i32 %142, i32 %143)
%145 = icmp eq i32 %144, 0
br i1 %145, label %146, label %151
146: ; preds = %141
%147 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%148 = load i32, i32* %5
%149 = load i32, i32* %6
%150 = call i32 @displayQueue(i32* %18, i32 %148, i32 %149)
br label %170
151: ; preds = %141
%152 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %170
153: ; preds = %96
%154 = load i32, i32* %5
%155 = load i32, i32* %6
%156 = call i32 @isEmptyQ(i32* %18, i32 %154, i32 %155)
%157 = icmp eq i32 %156, 0
br i1 %157, label %160, label %158
158: ; preds = %153
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %170
160: ; preds = %153
%161 = call i32 @frontValue(i32* %18, i32* %5, i32* %6)
%162 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0), i32 %161)
br label %170
163: ; preds = %96
%164 = load i32, i32* %5
%165 = load i32, i32* %6
%166 = call i32 @isEmptyQ(i32* %18, i32 %164, i32 %165)
%167 = icmp eq i32 %166, 0
br i1 %167, label %171, label %168
168: ; preds = %163
%169 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %170
170: ; preds = %168, %171, %158, %160, %146, %151, %137, %139, %128, %130, %117, %121, %102, %110, %96
br label %91
171: ; preds = %163
%172 = call i32 @rearValue(i32* %18, i32* %5, i32* %6)
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %172)
br label %170
174: ; preds = %28
%175 = call i32 @initializeCQ(i32* %17, i32* %5, i32* %6)
br label %176
176: ; preds = %241, %174
%177 = call i32 @menu(i32 3)
br label %178
178: ; preds = %178, %176
%179 = call i32 @get(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.4, i64 0, i64 0))
%180 = icmp ugt i32 %179, 7
br i1 %180, label %178, label %181
181: ; preds = %178
switch i32 %179, label %241 [
i32 1, label %182
i32 2, label %195
i32 3, label %204
i32 4, label %211
i32 5, label %218
i32 6, label %228
i32 7, label %236
i32 0, label %245
]
182: ; preds = %181
%183 = call i32 @isFullCQ(i32* %5, i32* %6)
%184 = icmp eq i32 %183, 0
br i1 %184, label %185, label %193
185: ; preds = %182
%186 = call i32 @get(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%187 = call i32 @insertCQ(i32* %17, i32* %5, i32* %6, i32 %186)
%188 = load i32, i32* %6
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [5 x i32], [5 x i32]* %8, i64 0, i64 %189
%191 = load i32, i32* %190
%192 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.16, i64 0, i64 0), i32 %191)
br label %241
193: ; preds = %182
%194 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.27, i64 0, i64 0))
br label %241
195: ; preds = %181
%196 = call i32 @isEmptyCQ(i32* %5, i32* %6)
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %202
198: ; preds = %195
%199 = call i32 @deleteCQ(i32* %17, i32* %5, i32* %6, i32* %7)
%200 = load i32, i32* %7
%201 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.18, i64 0, i64 0), i32 %200)
br label %241
202: ; preds = %195
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %241
204: ; preds = %181
%205 = call i32 @isEmptyCQ(i32* %5, i32* %6)
%206 = icmp eq i32 %205, 0
br i1 %206, label %209, label %207
207: ; preds = %204
%208 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %241
209: ; preds = %204
%210 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0))
br label %241
211: ; preds = %181
%212 = call i32 @isFullCQ(i32* %5, i32* %6)
%213 = icmp eq i32 %212, 0
br i1 %213, label %216, label %214
214: ; preds = %211
%215 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.22, i64 0, i64 0))
br label %241
216: ; preds = %211
%217 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.23, i64 0, i64 0))
br label %241
218: ; preds = %181
%219 = call i32 @isEmptyCQ(i32* %5, i32* %6)
%220 = icmp eq i32 %219, 0
br i1 %220, label %221, label %226
221: ; preds = %218
%222 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str.24, i64 0, i64 0))
%223 = load i32, i32* %5
%224 = load i32, i32* %6
%225 = call i32 @displayCQ(i32* %17, i32 %223, i32 %224)
br label %241
226: ; preds = %218
%227 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @.str.19, i64 0, i64 0))
br label %241
228: ; preds = %181
%229 = call i32 @isEmptyCQ(i32* %5, i32* %6)
%230 = icmp eq i32 %229, 0
br i1 %230, label %233, label %231
231: ; preds = %228
%232 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %241
233: ; preds = %228
%234 = call i32 @frontValue(i32* %17, i32* %5, i32* %6)
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.25, i64 0, i64 0), i32 %234)
br label %241
236: ; preds = %181
%237 = call i32 @isEmptyCQ(i32* %5, i32* %6)
%238 = icmp eq i32 %237, 0
br i1 %238, label %242, label %239
239: ; preds = %236
%240 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.20, i64 0, i64 0))
br label %241
241: ; preds = %239, %242, %231, %233, %221, %226, %214, %216, %207, %209, %198, %202, %185, %193, %181
br label %176
242: ; preds = %236
%243 = call i32 @rearValue(i32* %17, i32* %5, i32* %6)
%244 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.26, i64 0, i64 0), i32 %243)
br label %241
245: ; preds = %181, %96, %36, %28
%246 = call i32 @get(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.28, i64 0, i64 0))
%247 = icmp eq i32 %246, 0
br i1 %247, label %248, label %20
248: ; preds = %245
ret i32 0
}