#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*/ a(int, int /*<<< orphan*/);
int b(int, int /*<<< orphan*/);
int c(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ get_eq(int);
int /*<<< orphan*/ init_arrays(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n, v, w;
  char op;
  scanf("%d", &n);
  init_arrays(n);
  for (int i = 1; i <= n; i++) {
    scanf(" %c %d", &op, &v);
    switch (op) {
    case 'a':
      a(i, get_eq(v));
      break;
    case 'b':
      printf("%d\n", b(i, get_eq(v)));
      break;
    default:
      scanf("%d", &w);
      printf("%d\n", c(i, get_eq(v), get_eq(w)));
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7e(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1050 <init_arrays@plt>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1289 <main+0x119>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
lea    -0x11(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1080 <scanf@plt>
movsbl -0x11(%rbp),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x61,%eax
je     11e8 <main+0x78>
jmp    11d7 <main+0x67>
mov    -0x1c(%rbp),%eax
sub    $0x62,%eax
je     1205 <main+0x95>
jmp    1230 <main+0xc0>
mov    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <get_eq@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1070 <a@plt>
jmp    1276 <main+0x106>
mov    -0x18(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <get_eq@plt>
mov    -0x24(%rbp),%edi
mov    %eax,%esi
call   1030 <b@plt>
mov    %eax,%esi
lea    0xde1(%rip),%rdi
call   1040 <printf@plt>
jmp    1276 <main+0x106>
lea    0xdcd(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%edi
call   1090 <get_eq@plt>
mov    %eax,-0x28(%rbp)
mov    -0x10(%rbp),%edi
call   1090 <get_eq@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%esi
mov    %eax,%edx
call   1060 <c@plt>
mov    %eax,%esi
lea    0xd96(%rip),%rdi
call   1040 <printf@plt>
jmp    127b <main+0x10b>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a0 <main+0x30>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xe7f(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0x10(%rsp),%edi
call   1050 <init_arrays@plt>
cmpl   $0x0,0x10(%rsp)
jle    1275 <main+0x105>
lea    0xe54(%rip),%r14
lea    0xb(%rsp),%r15
lea    0xc(%rsp),%rbx
lea    0xe4a(%rip),%r12
xor    %r13d,%r13d
jmp    1214 <main+0xa4>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe2d(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    0xc(%rsp),%edi
call   1090 <get_eq@plt>
mov    %eax,%ebp
mov    0x14(%rsp),%edi
call   1090 <get_eq@plt>
mov    %r13d,%edi
mov    %ebp,%esi
mov    %eax,%edx
call   1060 <c@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cmp    0x10(%rsp),%r13d
jge    1275 <main+0x105>
add    $0x1,%r13d
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1080 <scanf@plt>
movsbl 0xb(%rsp),%eax
cmp    $0x62,%eax
je     1260 <main+0xf0>
cmp    $0x61,%eax
jne    11d0 <main+0x60>
mov    0xc(%rsp),%edi
call   1090 <get_eq@plt>
mov    %r13d,%edi
mov    %eax,%esi
call   1070 <a@plt>
cmp    0x10(%rsp),%r13d
jl     1214 <main+0xa4>
jmp    1275 <main+0x105>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0xc(%rsp),%edi
call   1090 <get_eq@plt>
mov    %r13d,%edi
mov    %eax,%esi
call   1030 <b@plt>
jmp    1203 <main+0x93>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" %c %d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
%6 = alloca i32
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%8 = load i32, i32* %2
%9 = call i32 @init_arrays(i32 %8)
store i32 1, i32* %6
br label %10
10: ; preds = %39, %0
%11 = load i32, i32* %6
%12 = load i32, i32* %2
%13 = icmp sle i32 %11, %12
br i1 %13, label %14, label %42
14: ; preds = %10
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32* %3)
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
switch i32 %17, label %29 [
i32 97, label %18
i32 98, label %23
]
18: ; preds = %14
%19 = load i32, i32* %6
%20 = load i32, i32* %3
%21 = call i32 @get_eq(i32 %20)
%22 = call i32 @a(i32 %19, i32 %21)
br label %38
23: ; preds = %14
%24 = load i32, i32* %6
%25 = load i32, i32* %3
%26 = call i32 @get_eq(i32 %25)
%27 = call i32 @b(i32 %24, i32 %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %27)
br label %38
29: ; preds = %14
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%31 = load i32, i32* %6
%32 = load i32, i32* %3
%33 = call i32 @get_eq(i32 %32)
%34 = load i32, i32* %4
%35 = call i32 @get_eq(i32 %34)
%36 = call i32 @c(i32 %31, i32 %33, i32 %35)
%37 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %29, %23, %18
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %10
42: ; preds = %10
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [7 x i8] c" %c %d\00"
@.str.2 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%9 = load i32, i32* %1
%10 = call i32 @init_arrays(i32 %9)
%11 = load i32, i32* %1
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %36, %0
ret i32 0
14: ; preds = %0, %36
%15 = phi i32 [ %37, %36 ], [ 1, %0 ]
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %4, i32* %2)
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
switch i32 %18, label %28 [
i32 97, label %19
i32 98, label %23
]
19: ; preds = %14
%20 = load i32, i32* %2
%21 = call i32 @get_eq(i32 %20)
%22 = call i32 @a(i32 %15, i32 %21)
br label %36
23: ; preds = %14
%24 = load i32, i32* %2
%25 = call i32 @get_eq(i32 %24)
%26 = call i32 @b(i32 %15, i32 %25)
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %36
28: ; preds = %14
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%30 = load i32, i32* %2
%31 = call i32 @get_eq(i32 %30)
%32 = load i32, i32* %3
%33 = call i32 @get_eq(i32 %32)
%34 = call i32 @c(i32 %15, i32 %31, i32 %33)
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %34)
br label %36
36: ; preds = %19, %23, %28
%37 = add nuw nsw i32 %15, 1
%38 = load i32, i32* %1
%39 = icmp slt i32 %15, %38
br i1 %39, label %14, label %13
}