void error(int type, char symbol, int location, int line, int line_pos) {
  if (type == 0) {
    printf("%s%c%s%d%s%d%s%d", "\nMissing end symbol (", symbol, ") @ Line ",
           line, ", position ", line_pos, " #", location);
  } else if (type == 1) {
    printf("%s%c%s%d%s%d%s%d", "\nMissing start symbol for matching (", symbol,
           ") @ Line ", line, ", position ", line_pos, " #", location);
  } else if (type == 2) {
    printf("%s%c%s%d%s%d%s%d", "\nMismatched ending symbol (", symbol,
           ") @ Line ", line, ", position ", line_pos, " #", location);
  } else if (type == 3) {
    printf("%s%c%s%d%s%d%s%d", "\nMismatched ", symbol, " quote @ Line ", line,
           ", position ", line_pos, " #", location);
  } else if (type == 4) {
    printf("%s%c%s%d%s%d%s%d", "\nMissing quote at symbol ", symbol, " @ Line ",
           line, ", position ", line_pos, " #", location);
  }
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1180 <error+0x70>
movsbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0xc(%rbp),%eax
lea    0xeb5(%rip),%rdi
lea    0xebf(%rip),%rsi
lea    0xece(%rip),%rcx
lea    0xed1(%rip),%r9
lea    0xed6(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12e3 <error+0x1d3>
cmpl   $0x1,-0x4(%rbp)
jne    11d5 <error+0xc5>
movsbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0xc(%rbp),%eax
lea    0xe60(%rip),%rdi
lea    0xe99(%rip),%rsi
lea    0xe79(%rip),%rcx
lea    0xe7c(%rip),%r9
lea    0xe81(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12de <error+0x1ce>
cmpl   $0x2,-0x4(%rbp)
jne    122a <error+0x11a>
movsbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0xc(%rbp),%eax
lea    0xe0b(%rip),%rdi
lea    0xe69(%rip),%rsi
lea    0xe24(%rip),%rcx
lea    0xe27(%rip),%r9
lea    0xe2c(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d9 <error+0x1c9>
cmpl   $0x3,-0x4(%rbp)
jne    127f <error+0x16f>
movsbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0xc(%rbp),%eax
lea    0xdb6(%rip),%rdi
lea    0xe30(%rip),%rsi
lea    0xe36(%rip),%rcx
lea    0xdd2(%rip),%r9
lea    0xdd7(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d4 <error+0x1c4>
cmpl   $0x4,-0x4(%rbp)
jne    12cf <error+0x1bf>
movsbl -0x5(%rbp),%edx
mov    -0x10(%rbp),%r8d
mov    -0x14(%rbp),%r11d
mov    -0xc(%rbp),%eax
lea    0xd61(%rip),%rdi
lea    0xdf7(%rip),%rsi
lea    0xd7b(%rip),%rcx
lea    0xd7d(%rip),%r9
lea    0xd82(%rip),%r10
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d4 <error+0x1c4>
jmp    12d9 <error+0x1c9>
jmp    12de <error+0x1ce>
jmp    12e3 <error+0x1d3>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %rbx
cmp    $0x4,%edi
ja     1150 <error+0x40>
mov    %r8d,%r10d
mov    %ecx,%r8d
mov    %edx,%r11d
mov    %edi,%eax
lea    0xed8(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movsbl %sil,%edx
sub    $0x8,%rsp
lea    0xf11(%rip),%rbx
lea    0xecd(%rip),%rdi
lea    0xed7(%rip),%rsi
jmp    118e <error+0x7e>
pop    %rbx
ret
movsbl %sil,%edx
sub    $0x8,%rsp
lea    0xef0(%rip),%rbx
lea    0xeac(%rip),%rdi
lea    0xee5(%rip),%rsi
jmp    118e <error+0x7e>
movsbl %sil,%edx
sub    $0x8,%rsp
lea    0xed1(%rip),%rbx
lea    0xe8d(%rip),%rdi
lea    0xeeb(%rip),%rsi
lea    0xea6(%rip),%rcx
jmp    11e1 <error+0xd1>
movsbl %sil,%edx
sub    $0x8,%rsp
lea    0xeab(%rip),%rbx
lea    0xe67(%rip),%rdi
lea    0xee1(%rip),%rsi
lea    0xee7(%rip),%rcx
jmp    11e1 <error+0xd1>
movsbl %sil,%edx
sub    $0x8,%rsp
lea    0xe85(%rip),%rbx
lea    0xe41(%rip),%rdi
lea    0xed7(%rip),%rsi
lea    0xe5b(%rip),%rcx
lea    0xe5d(%rip),%r9
xor    %eax,%eax
push   %r11
push   %rbx
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"%s%c%s%d%s%d%s%d\00"
@.str.1 = [22 x i8] c"\0AMissing end symbol (\00"
@.str.2 = [10 x i8] c") @ Line \00"
@.str.3 = [12 x i8] c", position \00"
@.str.4 = [3 x i8] c" #\00"
@.str.5 = [37 x i8] c"\0AMissing start symbol for matching (\00"
@.str.6 = [28 x i8] c"\0AMismatched ending symbol (\00"
@.str.7 = [13 x i8] c"\0AMismatched \00"
@.str.8 = [15 x i8] c" quote @ Line \00"
@.str.9 = [26 x i8] c"\0AMissing quote at symbol \00"
@.str.10 = [9 x i8] c" @ Line \00"
define void @error(i32 %0, i8 signext %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i8 %1, i8* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %6
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %20
13: ; preds = %5
%14 = load i8, i8* %7
%15 = sext i8 %14 to i32
%16 = load i32, i32* %9
%17 = load i32, i32* %10
%18 = load i32, i32* %8
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %15, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %18)
br label %64
20: ; preds = %5
%21 = load i32, i32* %6
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %30
23: ; preds = %20
%24 = load i8, i8* %7
%25 = sext i8 %24 to i32
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load i32, i32* %8
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %25, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %28)
br label %63
30: ; preds = %20
%31 = load i32, i32* %6
%32 = icmp eq i32 %31, 2
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load i8, i8* %7
%35 = sext i8 %34 to i32
%36 = load i32, i32* %9
%37 = load i32, i32* %10
%38 = load i32, i32* %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %35, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %36, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %37, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %38)
br label %62
40: ; preds = %30
%41 = load i32, i32* %6
%42 = icmp eq i32 %41, 3
br i1 %42, label %43, label %50
43: ; preds = %40
%44 = load i8, i8* %7
%45 = sext i8 %44 to i32
%46 = load i32, i32* %9
%47 = load i32, i32* %10
%48 = load i32, i32* %8
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %45, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %46, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %47, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %48)
br label %61
50: ; preds = %40
%51 = load i32, i32* %6
%52 = icmp eq i32 %51, 4
br i1 %52, label %53, label %60
53: ; preds = %50
%54 = load i8, i8* %7
%55 = sext i8 %54 to i32
%56 = load i32, i32* %9
%57 = load i32, i32* %10
%58 = load i32, i32* %8
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %55, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %56, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %57, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %58)
br label %60
60: ; preds = %53, %50
br label %61
61: ; preds = %60, %43
br label %62
62: ; preds = %61, %33
br label %63
63: ; preds = %62, %23
br label %64
64: ; preds = %63, %13
ret void
}

LLVM IR (-O2):
@.str = [17 x i8] c"%s%c%s%d%s%d%s%d\00"
@.str.1 = [22 x i8] c"\0AMissing end symbol (\00"
@.str.2 = [10 x i8] c") @ Line \00"
@.str.3 = [12 x i8] c", position \00"
@.str.4 = [3 x i8] c" #\00"
@.str.5 = [37 x i8] c"\0AMissing start symbol for matching (\00"
@.str.6 = [28 x i8] c"\0AMismatched ending symbol (\00"
@.str.7 = [13 x i8] c"\0AMismatched \00"
@.str.8 = [15 x i8] c" quote @ Line \00"
@.str.9 = [26 x i8] c"\0AMissing quote at symbol \00"
@.str.10 = [9 x i8] c" @ Line \00"
define void @error(i32 %0, i8 signext %1, i32 %2, i32 %3, i32 %4) {
switch i32 %0, label %21 [
i32 0, label %6
i32 1, label %9
i32 2, label %12
i32 3, label %15
i32 4, label %18
]
6: ; preds = %5
%7 = sext i8 %1 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %21
9: ; preds = %5
%10 = sext i8 %1 to i32
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.5, i64 0, i64 0), i32 %10, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %21
12: ; preds = %5
%13 = sext i8 %1 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0), i32 %13, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %21
15: ; preds = %5
%16 = sext i8 %1 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %21
18: ; preds = %5
%19 = sext i8 %1 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.9, i64 0, i64 0), i32 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i32 %3, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %4, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32 %2)
br label %21
21: ; preds = %5, %9, %15, %18, %12, %6
ret void
}