#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 /*<<< orphan*/ dequeue();
int /*<<< orphan*/ enqueue(int);
int /*<<< orphan*/ front();
int /*<<< orphan*/ printtot();
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a;
  int i, n, m;
  scanf("%d", &n);
  while (n != 5) {
    if (n == 1) {
      scanf("%d", &a);
      enqueue(a);
    }
    if (n == 2)
      dequeue();
    if (n == 3)
      front();
    if (n == 4)
      printtot();
    scanf("%d", &n);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe9a(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
cmpl   $0x5,-0x10(%rbp)
je     11e3 <main+0x93>
cmpl   $0x1,-0x10(%rbp)
jne    119b <main+0x4b>
lea    0xe76(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1070 <enqueue@plt>
cmpl   $0x2,-0x10(%rbp)
jne    11ac <main+0x5c>
mov    $0x0,%al
call   1030 <dequeue@plt>
cmpl   $0x3,-0x10(%rbp)
jne    11bd <main+0x6d>
mov    $0x0,%al
call   1050 <front@plt>
cmpl   $0x4,-0x10(%rbp)
jne    11ce <main+0x7e>
mov    $0x0,%al
call   1040 <printtot@plt>
lea    0xe2b(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1060 <scanf@plt>
jmp    116f <main+0x1f>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xea0(%rip),%rbx
lea    0x8(%rsp),%r14
lea    0xc(%rsp),%r15
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x1,%eax
je     11a0 <main+0x50>
cmp    $0x5,%eax
je     11e6 <main+0x96>
cmp    $0x2,%eax
je     11bd <main+0x6d>
cmp    $0x3,%eax
je     11cd <main+0x7d>
cmp    $0x4,%eax
jne    1170 <main+0x20>
jmp    11dd <main+0x8d>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    %r15,%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
call   1070 <enqueue@plt>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jne    118e <main+0x3e>
xor    %eax,%eax
call   1030 <dequeue@plt>
mov    0x8(%rsp),%eax
cmp    $0x3,%eax
jne    1193 <main+0x43>
xor    %eax,%eax
call   1050 <front@plt>
mov    0x8(%rsp),%eax
cmp    $0x4,%eax
jne    1170 <main+0x20>
xor    %eax,%eax
call   1040 <printtot@plt>
jmp    1170 <main+0x20>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %7
7: ; preds = %32, %0
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 5
br i1 %9, label %10, label %34
10: ; preds = %7
%11 = load i32, i32* %4
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%15 = load i32, i32* %2
%16 = call i32 @enqueue(i32 %15)
br label %17
17: ; preds = %13, %10
%18 = load i32, i32* %4
%19 = icmp eq i32 %18, 2
br i1 %19, label %20, label %22
20: ; preds = %17
%21 = call i32 (...) @dequeue()
br label %22
22: ; preds = %20, %17
%23 = load i32, i32* %4
%24 = icmp eq i32 %23, 3
br i1 %24, label %25, label %27
25: ; preds = %22
%26 = call i32 (...) @front()
br label %27
27: ; preds = %25, %22
%28 = load i32, i32* %4
%29 = icmp eq i32 %28, 4
br i1 %29, label %30, label %32
30: ; preds = %27
%31 = call i32 (...) @printtot()
br label %32
32: ; preds = %30, %27
%33 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
br label %7
34: ; preds = %7
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
br label %5
5: ; preds = %30, %0
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
switch i32 %7, label %13 [
i32 5, label %31
i32 1, label %8
]
8: ; preds = %5
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%10 = load i32, i32* %1
%11 = call i32 @enqueue(i32 %10)
%12 = load i32, i32* %2
br label %13
13: ; preds = %5, %8
%14 = phi i32 [ %7, %5 ], [ %12, %8 ]
%15 = icmp eq i32 %14, 2
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = call i32 (...) @dequeue()
%18 = load i32, i32* %2
br label %19
19: ; preds = %16, %13
%20 = phi i32 [ %18, %16 ], [ %14, %13 ]
%21 = icmp eq i32 %20, 3
br i1 %21, label %22, label %25
22: ; preds = %19
%23 = call i32 (...) @front()
%24 = load i32, i32* %2
br label %25
25: ; preds = %22, %19
%26 = phi i32 [ %24, %22 ], [ %20, %19 ]
%27 = icmp eq i32 %26, 4
br i1 %27, label %28, label %30
28: ; preds = %25
%29 = call i32 (...) @printtot()
br label %30
30: ; preds = %28, %25
br label %5
31: ; preds = %5
ret i32 0
}