void test_array_queue() {
  struct array_queue *queue;
  int value;
  assert(!init_queue(5, &queue));
  assert(!queue);
  assert(init_queue(4, &queue));
  assert_queue_equals(queue, 0, -1, 0, 4, (int[]){-100, -100, -100, -100});
  assert(add_to_queue(queue, 1));
  assert_queue_equals(queue, 0, 0, 1, 4, (int[]){1, -100, -100, -100});
  assert(add_to_queue(queue, 2));
  assert_queue_equals(queue, 0, 1, 2, 4, (int[]){1, 2, -100, -100});
  assert(add_to_queue(queue, 3));
  assert_queue_equals(queue, 0, 2, 3, 4, (int[]){1, 2, 3, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 1);
  assert_queue_equals(queue, 1, 2, 2, 4, (int[]){-100, 2, 3, -100});
  assert(add_to_queue(queue, 4));
  assert_queue_equals(queue, 1, 3, 3, 4, (int[]){-100, 2, 3, 4});
  assert(add_to_queue(queue, 5));
  assert_queue_equals(queue, 1, 0, 4, 4, (int[]){5, 2, 3, 4});
  assert(add_to_queue(queue, 6));
  assert_queue_equals(queue, 0, 4, 5, 8,
                      (int[]){2, 3, 4, 5, 6, -100, -100, -100});
  assert(add_to_queue(queue, 7));
  assert_queue_equals(queue, 0, 5, 6, 8, (int[]){2, 3, 4, 5, 6, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 2);
  assert_queue_equals(queue, 1, 5, 5, 8,
                      (int[]){-100, 3, 4, 5, 6, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 3);
  assert_queue_equals(queue, 2, 5, 4, 8,
                      (int[]){-100, -100, 4, 5, 6, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 4);
  assert_queue_equals(queue, 3, 5, 3, 8,
                      (int[]){-100, -100, -100, 5, 6, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 5);
  assert_queue_equals(queue, 4, 5, 2, 8,
                      (int[]){-100, -100, -100, -100, 6, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 6);
  assert_queue_equals(queue, 5, 5, 1, 8,
                      (int[]){-100, -100, -100, -100, -100, 7, -100, -100});
  assert(read_from_queue(queue, &value));
  assert(value == 7);
  assert_queue_equals(queue, 6, 5, 0, 8,
                      (int[]){-100, -100, -100, -100, -100, -100, -100, -100});
  assert(!read_from_queue(queue, &value));
  assert_queue_equals(queue, 6, 5, 0, 8,
                      (int[]){-100, -100, -100, -100, -100, -100, -100, -100});
  assert(add_to_queue(queue, 8));
  assert_queue_equals(queue, 6, 6, 1, 8,
                      (int[]){-100, -100, -100, -100, -100, -100, 8, -100});
  destroy_queue(&queue);
  printf("-----------------------\n");
  printf("Array Queue Tests Pass!\n");
  printf("-----------------------\n");
}


x86 assembly (clang, -O0):
<test_array_queue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1c0,%rsp
mov    $0x5,%edi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <init_queue@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpq   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    $0x4,%edi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1030 <init_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0xffffff9c,-0x1c(%rbp)
movl   $0xffffff9c,-0x18(%rbp)
movl   $0xffffff9c,-0x14(%rbp)
movl   $0xffffff9c,-0x10(%rbp)
lea    -0x1c(%rbp),%r9
xor    %ecx,%ecx
mov    $0xffffffff,%edx
mov    $0x4,%r8d
mov    %ecx,%esi
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0x1,-0x2c(%rbp)
movl   $0xffffff9c,-0x28(%rbp)
movl   $0xffffff9c,-0x24(%rbp)
movl   $0xffffff9c,-0x20(%rbp)
lea    -0x2c(%rbp),%r9
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
mov    %edx,%esi
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0x1,-0x3c(%rbp)
movl   $0x2,-0x38(%rbp)
movl   $0xffffff9c,-0x34(%rbp)
movl   $0xffffff9c,-0x30(%rbp)
lea    -0x3c(%rbp),%r9
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0x1,-0x4c(%rbp)
movl   $0x2,-0x48(%rbp)
movl   $0x3,-0x44(%rbp)
movl   $0xffffff9c,-0x40(%rbp)
lea    -0x4c(%rbp),%r9
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x1,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0xffffff9c,-0x5c(%rbp)
movl   $0x2,-0x58(%rbp)
movl   $0x3,-0x54(%rbp)
movl   $0xffffff9c,-0x50(%rbp)
lea    -0x5c(%rbp),%r9
mov    $0x1,%esi
mov    $0x2,%ecx
mov    $0x4,%r8d
mov    %ecx,%edx
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0xffffff9c,-0x6c(%rbp)
movl   $0x2,-0x68(%rbp)
movl   $0x3,-0x64(%rbp)
movl   $0x4,-0x60(%rbp)
lea    -0x6c(%rbp),%r9
mov    $0x1,%esi
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    %ecx,%edx
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
movl   $0x5,-0x7c(%rbp)
movl   $0x2,-0x78(%rbp)
movl   $0x3,-0x74(%rbp)
movl   $0x4,-0x70(%rbp)
lea    -0x7c(%rbp),%r9
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x4,%r8d
mov    %r8d,%ecx
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2c1b(%rip),%rax
mov    %rax,-0x9c(%rbp)
mov    0x2c15(%rip),%rax
mov    %rax,-0x94(%rbp)
mov    0x2c0f(%rip),%rax
mov    %rax,-0x8c(%rbp)
mov    0x2c09(%rip),%rax
mov    %rax,-0x84(%rbp)
lea    -0x9c(%rbp),%r9
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2bc6(%rip),%rax
mov    %rax,-0xbc(%rbp)
mov    0x2bc0(%rip),%rax
mov    %rax,-0xb4(%rbp)
mov    0x2bba(%rip),%rax
mov    %rax,-0xac(%rbp)
mov    0x2bb4(%rip),%rax
mov    %rax,-0xa4(%rbp)
lea    -0xbc(%rbp),%r9
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x2,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2b5f(%rip),%rax
mov    %rax,-0xdc(%rbp)
mov    0x2b59(%rip),%rax
mov    %rax,-0xd4(%rbp)
mov    0x2b53(%rip),%rax
mov    %rax,-0xcc(%rbp)
mov    0x2b4d(%rip),%rax
mov    %rax,-0xc4(%rbp)
lea    -0xdc(%rbp),%r9
mov    $0x1,%esi
mov    $0x5,%ecx
mov    $0x8,%r8d
mov    %ecx,%edx
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x3,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2af8(%rip),%rax
mov    %rax,-0xfc(%rbp)
mov    0x2af2(%rip),%rax
mov    %rax,-0xf4(%rbp)
mov    0x2aec(%rip),%rax
mov    %rax,-0xec(%rbp)
mov    0x2ae6(%rip),%rax
mov    %rax,-0xe4(%rbp)
lea    -0xfc(%rbp),%r9
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x4,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2a8e(%rip),%rax
mov    %rax,-0x11c(%rbp)
mov    0x2a88(%rip),%rax
mov    %rax,-0x114(%rbp)
mov    0x2a82(%rip),%rax
mov    %rax,-0x10c(%rbp)
mov    0x2a7c(%rip),%rax
mov    %rax,-0x104(%rbp)
lea    -0x11c(%rbp),%r9
mov    $0x3,%ecx
mov    $0x5,%edx
mov    $0x8,%r8d
mov    %ecx,%esi
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x5,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2a27(%rip),%rax
mov    %rax,-0x13c(%rbp)
mov    0x2a21(%rip),%rax
mov    %rax,-0x134(%rbp)
mov    0x2a1b(%rip),%rax
mov    %rax,-0x12c(%rbp)
mov    0x2a15(%rip),%rax
mov    %rax,-0x124(%rbp)
lea    -0x13c(%rbp),%r9
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x6,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x29bd(%rip),%rax
mov    %rax,-0x15c(%rbp)
mov    0x29b7(%rip),%rax
mov    %rax,-0x154(%rbp)
mov    0x29b1(%rip),%rax
mov    %rax,-0x14c(%rbp)
mov    0x29ab(%rip),%rax
mov    %rax,-0x144(%rbp)
lea    -0x15c(%rbp),%r9
mov    $0x5,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
mov    %edx,%esi
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
cmpl   $0x7,-0xc(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x2956(%rip),%rax
mov    %rax,-0x17c(%rbp)
mov    0x2950(%rip),%rax
mov    %rax,-0x174(%rbp)
mov    0x294a(%rip),%rax
mov    %rax,-0x16c(%rbp)
mov    0x2944(%rip),%rax
mov    %rax,-0x164(%rbp)
lea    -0x17c(%rbp),%r9
mov    $0x6,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <read_from_queue@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x28f7(%rip),%rax
mov    %rax,-0x19c(%rbp)
mov    0x28f1(%rip),%rax
mov    %rax,-0x194(%rbp)
mov    0x28eb(%rip),%rax
mov    %rax,-0x18c(%rbp)
mov    0x28e5(%rip),%rax
mov    %rax,-0x184(%rbp)
lea    -0x19c(%rbp),%r9
mov    $0x6,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
mov    -0x8(%rbp),%rdi
mov    $0x8,%esi
mov    $0x0,%al
call   1090 <add_to_queue@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1070 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    0x28a2(%rip),%rax
mov    %rax,-0x1bc(%rbp)
mov    0x289c(%rip),%rax
mov    %rax,-0x1b4(%rbp)
mov    0x2896(%rip),%rax
mov    %rax,-0x1ac(%rbp)
mov    0x2890(%rip),%rax
mov    %rax,-0x1a4(%rbp)
lea    -0x1bc(%rbp),%r9
mov    $0x6,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
mov    %edx,%esi
mov    $0x0,%al
call   1040 <assert_queue_equals@plt>
lea    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1080 <destroy_queue@plt>
lea    0x6c7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x6d2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0x6ab(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
add    $0x1c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_array_queue>:
push   %r14
push   %rbx
sub    $0x1c8,%rsp
mov    %rsp,%r14
mov    $0x5,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <init_queue@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpq   $0x0,(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    $0x4,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <init_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xe30(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
lea    0x70(%rsp),%r9
xor    %esi,%esi
mov    $0xffffffff,%edx
xor    %ecx,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xdfc(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0x60(%rsp),%r9
xor    %esi,%esi
xor    %edx,%edx
mov    $0x1,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xdc8(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0x50(%rsp),%r9
xor    %esi,%esi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xd91(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
lea    0x40(%rsp),%r9
xor    %esi,%esi
mov    $0x2,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
lea    0xc(%rsp),%rbx
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x1,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xd45(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
lea    0x30(%rsp),%r9
mov    $0x1,%esi
mov    $0x2,%edx
mov    $0x2,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x4,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xd0b(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
lea    0x20(%rsp),%r9
mov    $0x1,%esi
mov    $0x3,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movaps 0xcd1(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%r9
mov    $0x1,%esi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x4,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x6,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xc9a(%rip),%xmm0
movaps %xmm0,0x1a0(%rsp)
movups 0xc9b(%rip),%xmm0
movaps %xmm0,0x1b0(%rsp)
lea    0x1a0(%rsp),%r9
xor    %esi,%esi
mov    $0x4,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x7,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xc5e(%rip),%xmm0
movaps %xmm0,0x180(%rsp)
movups 0xc5f(%rip),%xmm0
movaps %xmm0,0x190(%rsp)
lea    0x180(%rsp),%r9
xor    %esi,%esi
mov    $0x5,%edx
mov    $0x6,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x2,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xc12(%rip),%xmm0
movaps %xmm0,0x160(%rsp)
movups 0xc13(%rip),%xmm0
movaps %xmm0,0x170(%rsp)
lea    0x160(%rsp),%r9
mov    $0x1,%esi
mov    $0x5,%edx
mov    $0x5,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x3,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xbc3(%rip),%xmm0
movaps %xmm0,0x140(%rsp)
movups 0xbc4(%rip),%xmm0
movaps %xmm0,0x150(%rsp)
lea    0x140(%rsp),%r9
mov    $0x2,%esi
mov    $0x5,%edx
mov    $0x4,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x4,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xb74(%rip),%xmm0
movaps %xmm0,0x120(%rsp)
movups 0xb75(%rip),%xmm0
movaps %xmm0,0x130(%rsp)
lea    0x120(%rsp),%r9
mov    $0x3,%esi
mov    $0x5,%edx
mov    $0x3,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x5,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xb25(%rip),%xmm0
movaps %xmm0,0x100(%rsp)
movups 0xb26(%rip),%xmm0
movaps %xmm0,0x110(%rsp)
lea    0x100(%rsp),%r9
mov    $0x4,%esi
mov    $0x5,%edx
mov    $0x2,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x6,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xad6(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movups 0xad7(%rip),%xmm0
movaps %xmm0,0xf0(%rsp)
lea    0xe0(%rsp),%r9
mov    $0x5,%esi
mov    $0x5,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
xor    %edi,%edi
cmpl   $0x7,0xc(%rsp)
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xa87(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movups 0xa88(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
lea    0xc0(%rsp),%r9
mov    $0x6,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <read_from_queue@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0xa27(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movups 0xa28(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
lea    0xa0(%rsp),%r9
mov    $0x6,%esi
mov    $0x5,%edx
xor    %ecx,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    (%rsp),%rdi
mov    $0x8,%esi
xor    %eax,%eax
call   1090 <add_to_queue@plt>
mov    %eax,%edi
xor    %eax,%eax
call   1070 <assert@plt>
mov    (%rsp),%rdi
movups 0x9eb(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movups 0x9ec(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0x80(%rsp),%r9
mov    $0x6,%esi
mov    $0x6,%edx
mov    $0x1,%ecx
mov    $0x8,%r8d
xor    %eax,%eax
call   1040 <assert_queue_equals@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <destroy_queue@plt>
lea    0x9d7(%rip),%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0x9b0(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,%rdi
call   1050 <puts@plt>
add    $0x1c8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.array_queue = type opaque
@constinit = private global [8 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 -100, i32 -100, i32 -100]
@constinit.1 = private global [8 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.2 = private global [8 x i32] [i32 -100, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.3 = private global [8 x i32] [i32 -100, i32 -100, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.4 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.5 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 6, i32 7, i32 -100, i32 -100]
@constinit.6 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 7, i32 -100, i32 -100]
@constinit.7 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100]
@constinit.8 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100]
@constinit.9 = private global [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 8, i32 -100]
@.str = [25 x i8] c"-----------------------\0A\00"
@.str.10 = [25 x i8] c"Array Queue Tests Pass!\0A\00"
define void @test_array_queue() {
%1 = alloca %struct.array_queue*
%2 = alloca i32
%3 = alloca [4 x i32]
%4 = alloca [4 x i32]
%5 = alloca [4 x i32]
%6 = alloca [4 x i32]
%7 = alloca [4 x i32]
%8 = alloca [4 x i32]
%9 = alloca [4 x i32]
%10 = alloca [8 x i32]
%11 = alloca [8 x i32]
%12 = alloca [8 x i32]
%13 = alloca [8 x i32]
%14 = alloca [8 x i32]
%15 = alloca [8 x i32]
%16 = alloca [8 x i32]
%17 = alloca [8 x i32]
%18 = alloca [8 x i32]
%19 = alloca [8 x i32]
%20 = call i32 (i32, %struct.array_queue**, ...) bitcast (i32 (...)* @init_queue to i32 (i32, %struct.array_queue**, ...)*)(i32 5, %struct.array_queue** %1)
%21 = icmp ne i32 %20, 0
%22 = xor i1 %21, true
%23 = zext i1 %22 to i32
%24 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %23)
%25 = load %struct.array_queue*, %struct.array_queue** %1
%26 = icmp ne %struct.array_queue* %25, null
%27 = xor i1 %26, true
%28 = zext i1 %27 to i32
%29 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %28)
%30 = call i32 (i32, %struct.array_queue**, ...) bitcast (i32 (...)* @init_queue to i32 (i32, %struct.array_queue**, ...)*)(i32 4, %struct.array_queue** %1)
%31 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %30)
%32 = load %struct.array_queue*, %struct.array_queue** %1
%33 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
store i32 -100, i32* %33
%34 = getelementptr inbounds i32, i32* %33, i64 1
store i32 -100, i32* %34
%35 = getelementptr inbounds i32, i32* %34, i64 1
store i32 -100, i32* %35
%36 = getelementptr inbounds i32, i32* %35, i64 1
store i32 -100, i32* %36
%37 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%38 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %32, i32 0, i32 -1, i32 0, i32 4, i32* %37)
%39 = load %struct.array_queue*, %struct.array_queue** %1
%40 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %39, i32 1)
%41 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %40)
%42 = load %struct.array_queue*, %struct.array_queue** %1
%43 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
store i32 1, i32* %43
%44 = getelementptr inbounds i32, i32* %43, i64 1
store i32 -100, i32* %44
%45 = getelementptr inbounds i32, i32* %44, i64 1
store i32 -100, i32* %45
%46 = getelementptr inbounds i32, i32* %45, i64 1
store i32 -100, i32* %46
%47 = getelementptr inbounds [4 x i32], [4 x i32]* %4, i64 0, i64 0
%48 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %42, i32 0, i32 0, i32 1, i32 4, i32* %47)
%49 = load %struct.array_queue*, %struct.array_queue** %1
%50 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %49, i32 2)
%51 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %50)
%52 = load %struct.array_queue*, %struct.array_queue** %1
%53 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
store i32 1, i32* %53
%54 = getelementptr inbounds i32, i32* %53, i64 1
store i32 2, i32* %54
%55 = getelementptr inbounds i32, i32* %54, i64 1
store i32 -100, i32* %55
%56 = getelementptr inbounds i32, i32* %55, i64 1
store i32 -100, i32* %56
%57 = getelementptr inbounds [4 x i32], [4 x i32]* %5, i64 0, i64 0
%58 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %52, i32 0, i32 1, i32 2, i32 4, i32* %57)
%59 = load %struct.array_queue*, %struct.array_queue** %1
%60 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %59, i32 3)
%61 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %60)
%62 = load %struct.array_queue*, %struct.array_queue** %1
%63 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
store i32 1, i32* %63
%64 = getelementptr inbounds i32, i32* %63, i64 1
store i32 2, i32* %64
%65 = getelementptr inbounds i32, i32* %64, i64 1
store i32 3, i32* %65
%66 = getelementptr inbounds i32, i32* %65, i64 1
store i32 -100, i32* %66
%67 = getelementptr inbounds [4 x i32], [4 x i32]* %6, i64 0, i64 0
%68 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %62, i32 0, i32 2, i32 3, i32 4, i32* %67)
%69 = load %struct.array_queue*, %struct.array_queue** %1
%70 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %69, i32* %2)
%71 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %70)
%72 = load i32, i32* %2
%73 = icmp eq i32 %72, 1
%74 = zext i1 %73 to i32
%75 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %74)
%76 = load %struct.array_queue*, %struct.array_queue** %1
%77 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
store i32 -100, i32* %77
%78 = getelementptr inbounds i32, i32* %77, i64 1
store i32 2, i32* %78
%79 = getelementptr inbounds i32, i32* %78, i64 1
store i32 3, i32* %79
%80 = getelementptr inbounds i32, i32* %79, i64 1
store i32 -100, i32* %80
%81 = getelementptr inbounds [4 x i32], [4 x i32]* %7, i64 0, i64 0
%82 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %76, i32 1, i32 2, i32 2, i32 4, i32* %81)
%83 = load %struct.array_queue*, %struct.array_queue** %1
%84 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %83, i32 4)
%85 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %84)
%86 = load %struct.array_queue*, %struct.array_queue** %1
%87 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
store i32 -100, i32* %87
%88 = getelementptr inbounds i32, i32* %87, i64 1
store i32 2, i32* %88
%89 = getelementptr inbounds i32, i32* %88, i64 1
store i32 3, i32* %89
%90 = getelementptr inbounds i32, i32* %89, i64 1
store i32 4, i32* %90
%91 = getelementptr inbounds [4 x i32], [4 x i32]* %8, i64 0, i64 0
%92 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %86, i32 1, i32 3, i32 3, i32 4, i32* %91)
%93 = load %struct.array_queue*, %struct.array_queue** %1
%94 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %93, i32 5)
%95 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %94)
%96 = load %struct.array_queue*, %struct.array_queue** %1
%97 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
store i32 5, i32* %97
%98 = getelementptr inbounds i32, i32* %97, i64 1
store i32 2, i32* %98
%99 = getelementptr inbounds i32, i32* %98, i64 1
store i32 3, i32* %99
%100 = getelementptr inbounds i32, i32* %99, i64 1
store i32 4, i32* %100
%101 = getelementptr inbounds [4 x i32], [4 x i32]* %9, i64 0, i64 0
%102 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %96, i32 1, i32 0, i32 4, i32 4, i32* %101)
%103 = load %struct.array_queue*, %struct.array_queue** %1
%104 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %103, i32 6)
%105 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %104)
%106 = load %struct.array_queue*, %struct.array_queue** %1
%107 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
%108 = bitcast [8 x i32]* %10 to i8*
%109 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
%110 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %106, i32 0, i32 4, i32 5, i32 8, i32* %109)
%111 = load %struct.array_queue*, %struct.array_queue** %1
%112 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %111, i32 7)
%113 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %112)
%114 = load %struct.array_queue*, %struct.array_queue** %1
%115 = getelementptr inbounds [8 x i32], [8 x i32]* %11, i64 0, i64 0
%116 = bitcast [8 x i32]* %11 to i8*
%117 = getelementptr inbounds [8 x i32], [8 x i32]* %11, i64 0, i64 0
%118 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %114, i32 0, i32 5, i32 6, i32 8, i32* %117)
%119 = load %struct.array_queue*, %struct.array_queue** %1
%120 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %119, i32* %2)
%121 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %120)
%122 = load i32, i32* %2
%123 = icmp eq i32 %122, 2
%124 = zext i1 %123 to i32
%125 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %124)
%126 = load %struct.array_queue*, %struct.array_queue** %1
%127 = getelementptr inbounds [8 x i32], [8 x i32]* %12, i64 0, i64 0
%128 = bitcast [8 x i32]* %12 to i8*
%129 = getelementptr inbounds [8 x i32], [8 x i32]* %12, i64 0, i64 0
%130 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %126, i32 1, i32 5, i32 5, i32 8, i32* %129)
%131 = load %struct.array_queue*, %struct.array_queue** %1
%132 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %131, i32* %2)
%133 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %132)
%134 = load i32, i32* %2
%135 = icmp eq i32 %134, 3
%136 = zext i1 %135 to i32
%137 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %136)
%138 = load %struct.array_queue*, %struct.array_queue** %1
%139 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 0
%140 = bitcast [8 x i32]* %13 to i8*
%141 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 0
%142 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %138, i32 2, i32 5, i32 4, i32 8, i32* %141)
%143 = load %struct.array_queue*, %struct.array_queue** %1
%144 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %143, i32* %2)
%145 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %144)
%146 = load i32, i32* %2
%147 = icmp eq i32 %146, 4
%148 = zext i1 %147 to i32
%149 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %148)
%150 = load %struct.array_queue*, %struct.array_queue** %1
%151 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
%152 = bitcast [8 x i32]* %14 to i8*
%153 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
%154 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %150, i32 3, i32 5, i32 3, i32 8, i32* %153)
%155 = load %struct.array_queue*, %struct.array_queue** %1
%156 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %155, i32* %2)
%157 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %156)
%158 = load i32, i32* %2
%159 = icmp eq i32 %158, 5
%160 = zext i1 %159 to i32
%161 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %160)
%162 = load %struct.array_queue*, %struct.array_queue** %1
%163 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%164 = bitcast [8 x i32]* %15 to i8*
%165 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%166 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %162, i32 4, i32 5, i32 2, i32 8, i32* %165)
%167 = load %struct.array_queue*, %struct.array_queue** %1
%168 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %167, i32* %2)
%169 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %168)
%170 = load i32, i32* %2
%171 = icmp eq i32 %170, 6
%172 = zext i1 %171 to i32
%173 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %172)
%174 = load %struct.array_queue*, %struct.array_queue** %1
%175 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%176 = bitcast [8 x i32]* %16 to i8*
%177 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%178 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %174, i32 5, i32 5, i32 1, i32 8, i32* %177)
%179 = load %struct.array_queue*, %struct.array_queue** %1
%180 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %179, i32* %2)
%181 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %180)
%182 = load i32, i32* %2
%183 = icmp eq i32 %182, 7
%184 = zext i1 %183 to i32
%185 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %184)
%186 = load %struct.array_queue*, %struct.array_queue** %1
%187 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%188 = bitcast [8 x i32]* %17 to i8*
%189 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%190 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %186, i32 6, i32 5, i32 0, i32 8, i32* %189)
%191 = load %struct.array_queue*, %struct.array_queue** %1
%192 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %191, i32* %2)
%193 = icmp ne i32 %192, 0
%194 = xor i1 %193, true
%195 = zext i1 %194 to i32
%196 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %195)
%197 = load %struct.array_queue*, %struct.array_queue** %1
%198 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%199 = bitcast [8 x i32]* %18 to i8*
%200 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%201 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %197, i32 6, i32 5, i32 0, i32 8, i32* %200)
%202 = load %struct.array_queue*, %struct.array_queue** %1
%203 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %202, i32 8)
%204 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %203)
%205 = load %struct.array_queue*, %struct.array_queue** %1
%206 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%207 = bitcast [8 x i32]* %19 to i8*
%208 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%209 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %205, i32 6, i32 6, i32 1, i32 8, i32* %208)
%210 = call i32 (%struct.array_queue**, ...) bitcast (i32 (...)* @destroy_queue to i32 (%struct.array_queue**, ...)*)(%struct.array_queue** %1)
%211 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
%213 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.array_queue = type opaque
@constinit = [8 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 -100, i32 -100, i32 -100]
@constinit.1 = [8 x i32] [i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.2 = [8 x i32] [i32 -100, i32 3, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.3 = [8 x i32] [i32 -100, i32 -100, i32 4, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.4 = [8 x i32] [i32 -100, i32 -100, i32 -100, i32 5, i32 6, i32 7, i32 -100, i32 -100]
@constinit.5 = [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 6, i32 7, i32 -100, i32 -100]
@constinit.6 = [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 7, i32 -100, i32 -100]
@constinit.8 = [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100]
@constinit.9 = [8 x i32] [i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 -100, i32 8, i32 -100]
@str.11 = [24 x i8] c"Array Queue Tests Pass!\00"
@str.12 = [24 x i8] c"-----------------------\00"
define void @test_array_queue() {
%1 = alloca %struct.array_queue*
%2 = alloca i32
%3 = alloca <4 x i32>
%4 = alloca <4 x i32>
%5 = alloca <4 x i32>
%6 = alloca <4 x i32>
%7 = alloca <4 x i32>
%8 = alloca <4 x i32>
%9 = alloca <4 x i32>
%10 = alloca [8 x i32]
%11 = alloca [8 x i32]
%12 = alloca [8 x i32]
%13 = alloca [8 x i32]
%14 = alloca [8 x i32]
%15 = alloca [8 x i32]
%16 = alloca [8 x i32]
%17 = alloca [8 x i32]
%18 = alloca [8 x i32]
%19 = alloca [8 x i32]
%20 = bitcast %struct.array_queue** %1 to i8*
%21 = bitcast i32* %2 to i8*
%22 = call i32 (i32, %struct.array_queue**, ...) bitcast (i32 (...)* @init_queue to i32 (i32, %struct.array_queue**, ...)*)(i32 5, %struct.array_queue** %1)
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %24)
%26 = load %struct.array_queue*, %struct.array_queue** %1
%27 = icmp eq %struct.array_queue* %26, null
%28 = zext i1 %27 to i32
%29 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %28)
%30 = call i32 (i32, %struct.array_queue**, ...) bitcast (i32 (...)* @init_queue to i32 (i32, %struct.array_queue**, ...)*)(i32 4, %struct.array_queue** %1)
%31 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %30)
%32 = load %struct.array_queue*, %struct.array_queue** %1
%33 = getelementptr inbounds <4 x i32>, <4 x i32>* %3, i64 0, i64 0
store <4 x i32> <i32 -100, i32 -100, i32 -100, i32 -100>, <4 x i32>* %3
%34 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %32, i32 0, i32 -1, i32 0, i32 4, i32* %33)
%35 = load %struct.array_queue*, %struct.array_queue** %1
%36 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %35, i32 1)
%37 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %36)
%38 = load %struct.array_queue*, %struct.array_queue** %1
%39 = getelementptr inbounds <4 x i32>, <4 x i32>* %4, i64 0, i64 0
store <4 x i32> <i32 1, i32 -100, i32 -100, i32 -100>, <4 x i32>* %4
%40 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %38, i32 0, i32 0, i32 1, i32 4, i32* %39)
%41 = load %struct.array_queue*, %struct.array_queue** %1
%42 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %41, i32 2)
%43 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %42)
%44 = load %struct.array_queue*, %struct.array_queue** %1
%45 = getelementptr inbounds <4 x i32>, <4 x i32>* %5, i64 0, i64 0
store <4 x i32> <i32 1, i32 2, i32 -100, i32 -100>, <4 x i32>* %5
%46 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %44, i32 0, i32 1, i32 2, i32 4, i32* %45)
%47 = load %struct.array_queue*, %struct.array_queue** %1
%48 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %47, i32 3)
%49 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %48)
%50 = load %struct.array_queue*, %struct.array_queue** %1
%51 = getelementptr inbounds <4 x i32>, <4 x i32>* %6, i64 0, i64 0
store <4 x i32> <i32 1, i32 2, i32 3, i32 -100>, <4 x i32>* %6
%52 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %50, i32 0, i32 2, i32 3, i32 4, i32* %51)
%53 = load %struct.array_queue*, %struct.array_queue** %1
%54 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %53, i32* %2)
%55 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %54)
%56 = load i32, i32* %2
%57 = icmp eq i32 %56, 1
%58 = zext i1 %57 to i32
%59 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %58)
%60 = load %struct.array_queue*, %struct.array_queue** %1
%61 = getelementptr inbounds <4 x i32>, <4 x i32>* %7, i64 0, i64 0
store <4 x i32> <i32 -100, i32 2, i32 3, i32 -100>, <4 x i32>* %7
%62 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %60, i32 1, i32 2, i32 2, i32 4, i32* %61)
%63 = load %struct.array_queue*, %struct.array_queue** %1
%64 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %63, i32 4)
%65 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %64)
%66 = load %struct.array_queue*, %struct.array_queue** %1
%67 = getelementptr inbounds <4 x i32>, <4 x i32>* %8, i64 0, i64 0
store <4 x i32> <i32 -100, i32 2, i32 3, i32 4>, <4 x i32>* %8
%68 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %66, i32 1, i32 3, i32 3, i32 4, i32* %67)
%69 = load %struct.array_queue*, %struct.array_queue** %1
%70 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %69, i32 5)
%71 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %70)
%72 = load %struct.array_queue*, %struct.array_queue** %1
%73 = getelementptr inbounds <4 x i32>, <4 x i32>* %9, i64 0, i64 0
store <4 x i32> <i32 5, i32 2, i32 3, i32 4>, <4 x i32>* %9
%74 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %72, i32 1, i32 0, i32 4, i32 4, i32* %73)
%75 = load %struct.array_queue*, %struct.array_queue** %1
%76 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %75, i32 6)
%77 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %76)
%78 = load %struct.array_queue*, %struct.array_queue** %1
%79 = bitcast [8 x i32]* %10 to i8*
%80 = getelementptr inbounds [8 x i32], [8 x i32]* %10, i64 0, i64 0
%81 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %78, i32 0, i32 4, i32 5, i32 8, i32* %80)
%82 = load %struct.array_queue*, %struct.array_queue** %1
%83 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %82, i32 7)
%84 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %83)
%85 = load %struct.array_queue*, %struct.array_queue** %1
%86 = bitcast [8 x i32]* %11 to i8*
%87 = getelementptr inbounds [8 x i32], [8 x i32]* %11, i64 0, i64 0
%88 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %85, i32 0, i32 5, i32 6, i32 8, i32* %87)
%89 = load %struct.array_queue*, %struct.array_queue** %1
%90 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %89, i32* %2)
%91 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %90)
%92 = load i32, i32* %2
%93 = icmp eq i32 %92, 2
%94 = zext i1 %93 to i32
%95 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %94)
%96 = load %struct.array_queue*, %struct.array_queue** %1
%97 = bitcast [8 x i32]* %12 to i8*
%98 = getelementptr inbounds [8 x i32], [8 x i32]* %12, i64 0, i64 0
%99 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %96, i32 1, i32 5, i32 5, i32 8, i32* %98)
%100 = load %struct.array_queue*, %struct.array_queue** %1
%101 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %100, i32* %2)
%102 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %101)
%103 = load i32, i32* %2
%104 = icmp eq i32 %103, 3
%105 = zext i1 %104 to i32
%106 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %105)
%107 = load %struct.array_queue*, %struct.array_queue** %1
%108 = bitcast [8 x i32]* %13 to i8*
%109 = getelementptr inbounds [8 x i32], [8 x i32]* %13, i64 0, i64 0
%110 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %107, i32 2, i32 5, i32 4, i32 8, i32* %109)
%111 = load %struct.array_queue*, %struct.array_queue** %1
%112 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %111, i32* %2)
%113 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %112)
%114 = load i32, i32* %2
%115 = icmp eq i32 %114, 4
%116 = zext i1 %115 to i32
%117 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %116)
%118 = load %struct.array_queue*, %struct.array_queue** %1
%119 = bitcast [8 x i32]* %14 to i8*
%120 = getelementptr inbounds [8 x i32], [8 x i32]* %14, i64 0, i64 0
%121 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %118, i32 3, i32 5, i32 3, i32 8, i32* %120)
%122 = load %struct.array_queue*, %struct.array_queue** %1
%123 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %122, i32* %2)
%124 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %123)
%125 = load i32, i32* %2
%126 = icmp eq i32 %125, 5
%127 = zext i1 %126 to i32
%128 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %127)
%129 = load %struct.array_queue*, %struct.array_queue** %1
%130 = bitcast [8 x i32]* %15 to i8*
%131 = getelementptr inbounds [8 x i32], [8 x i32]* %15, i64 0, i64 0
%132 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %129, i32 4, i32 5, i32 2, i32 8, i32* %131)
%133 = load %struct.array_queue*, %struct.array_queue** %1
%134 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %133, i32* %2)
%135 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %134)
%136 = load i32, i32* %2
%137 = icmp eq i32 %136, 6
%138 = zext i1 %137 to i32
%139 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %138)
%140 = load %struct.array_queue*, %struct.array_queue** %1
%141 = bitcast [8 x i32]* %16 to i8*
%142 = getelementptr inbounds [8 x i32], [8 x i32]* %16, i64 0, i64 0
%143 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %140, i32 5, i32 5, i32 1, i32 8, i32* %142)
%144 = load %struct.array_queue*, %struct.array_queue** %1
%145 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %144, i32* %2)
%146 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %145)
%147 = load i32, i32* %2
%148 = icmp eq i32 %147, 7
%149 = zext i1 %148 to i32
%150 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %149)
%151 = load %struct.array_queue*, %struct.array_queue** %1
%152 = bitcast [8 x i32]* %17 to i8*
%153 = getelementptr inbounds [8 x i32], [8 x i32]* %17, i64 0, i64 0
%154 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %151, i32 6, i32 5, i32 0, i32 8, i32* %153)
%155 = load %struct.array_queue*, %struct.array_queue** %1
%156 = call i32 (%struct.array_queue*, i32*, ...) bitcast (i32 (...)* @read_from_queue to i32 (%struct.array_queue*, i32*, ...)*)(%struct.array_queue* %155, i32* %2)
%157 = icmp eq i32 %156, 0
%158 = zext i1 %157 to i32
%159 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %158)
%160 = load %struct.array_queue*, %struct.array_queue** %1
%161 = bitcast [8 x i32]* %18 to i8*
%162 = getelementptr inbounds [8 x i32], [8 x i32]* %18, i64 0, i64 0
%163 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %160, i32 6, i32 5, i32 0, i32 8, i32* %162)
%164 = load %struct.array_queue*, %struct.array_queue** %1
%165 = call i32 (%struct.array_queue*, i32, ...) bitcast (i32 (...)* @add_to_queue to i32 (%struct.array_queue*, i32, ...)*)(%struct.array_queue* %164, i32 8)
%166 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 %165)
%167 = load %struct.array_queue*, %struct.array_queue** %1
%168 = bitcast [8 x i32]* %19 to i8*
%169 = getelementptr inbounds [8 x i32], [8 x i32]* %19, i64 0, i64 0
%170 = call i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...) bitcast (i32 (...)* @assert_queue_equals to i32 (%struct.array_queue*, i32, i32, i32, i32, i32*, ...)*)(%struct.array_queue* %167, i32 6, i32 6, i32 1, i32 8, i32* %169)
%171 = call i32 (%struct.array_queue**, ...) bitcast (i32 (...)* @destroy_queue to i32 (%struct.array_queue**, ...)*)(%struct.array_queue** %1)
%172 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
%173 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.11, i64 0, i64 0))
%174 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.12, i64 0, i64 0))
ret void
}