#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*/ fprintf(int /*<<< orphan*/, char *, int, ...);
int /*<<< orphan*/ stderr;
void bcheck2(int n, int c1, int c2) {
  if (n == 1)
    fprintf(stderr, "\tmissing %c\n", c2);
  else if (n > 1)
    fprintf(stderr, "\t%d missing %c's\n", n, c2);
  else if (n == -1)
    fprintf(stderr, "\textra %c\n", c2);
  else if (n < -1)
    fprintf(stderr, "\t%d extra %c's\n", -n, c2);
}


x86 assembly (clang, -O0):
<bcheck2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    114a <bcheck2+0x3a>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xec2(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11d7 <bcheck2+0xc7>
cmpl   $0x1,-0x4(%rbp)
jle    1176 <bcheck2+0x66>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xea3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11d2 <bcheck2+0xc2>
cmpl   $0xffffffff,-0x4(%rbp)
jne    119f <bcheck2+0x8f>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%edx
lea    0xe8c(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11cd <bcheck2+0xbd>
cmpl   $0xffffffff,-0x4(%rbp)
jge    11c8 <bcheck2+0xb8>
mov    0x2e30(%rip),%rax
mov    (%rax),%edi
xor    %edx,%edx
sub    -0x4(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    11cd <bcheck2+0xbd>
jmp    11d2 <bcheck2+0xc2>
jmp    11d7 <bcheck2+0xc7>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bcheck2>:
mov    %edx,%ecx
cmp    $0x1,%edi
jne    1130 <bcheck2+0x20>
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    0xed9(%rip),%rsi
mov    %ecx,%edx
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    %edi,%edx
jle    114b <bcheck2+0x3b>
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
cmp    $0xffffffff,%edx
je     116b <bcheck2+0x5b>
jge    117d <bcheck2+0x6d>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
neg    %edx
lea    0xec6(%rip),%rsi
xor    %eax,%eax
jmp    1030 <fprintf@plt>
mov    0x2e6e(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
jmp    1127 <bcheck2+0x17>
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"\09missing %c\0A\00"
@.str.1 = [18 x i8] c"\09%d missing %c's\0A\00"
@.str.2 = [11 x i8] c"\09extra %c\0A\00"
@.str.3 = [16 x i8] c"\09%d extra %c's\0A\00"
define void @bcheck2(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = icmp eq i32 %7, 1
br i1 %8, label %9, label %13
9: ; preds = %3
%10 = load i32, i32* @stderr
%11 = load i32, i32* %6
%12 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %40
13: ; preds = %3
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 1
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* @stderr
%18 = load i32, i32* %4
%19 = load i32, i32* %6
%20 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %17, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %18, i32 %19)
br label %39
21: ; preds = %13
%22 = load i32, i32* %4
%23 = icmp eq i32 %22, -1
br i1 %23, label %24, label %28
24: ; preds = %21
%25 = load i32, i32* @stderr
%26 = load i32, i32* %6
%27 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %26)
br label %38
28: ; preds = %21
%29 = load i32, i32* %4
%30 = icmp slt i32 %29, -1
br i1 %30, label %31, label %37
31: ; preds = %28
%32 = load i32, i32* @stderr
%33 = load i32, i32* %4
%34 = sub nsw i32 0, %33
%35 = load i32, i32* %6
%36 = call i32 (i32, i8*, i32, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %34, i32 %35)
br label %37
37: ; preds = %31, %28
br label %38
38: ; preds = %37, %24
br label %39
39: ; preds = %38, %16
br label %40
40: ; preds = %39, %9
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"\09missing %c\0A\00"
@.str.1 = [18 x i8] c"\09%d missing %c's\0A\00"
@.str.2 = [11 x i8] c"\09extra %c\0A\00"
@.str.3 = [16 x i8] c"\09%d extra %c's\0A\00"
define void @bcheck2(i32 %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %0, 1
br i1 %4, label %5, label %8
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %24
8: ; preds = %3
%9 = icmp sgt i32 %0, 1
br i1 %9, label %10, label %13
10: ; preds = %8
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 %2)
br label %24
13: ; preds = %8
%14 = icmp eq i32 %0, -1
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = load i32, i32* @stderr
%17 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %2)
br label %24
18: ; preds = %13
%19 = icmp slt i32 %0, -1
br i1 %19, label %20, label %24
20: ; preds = %18
%21 = load i32, i32* @stderr
%22 = sub nsw i32 0, %0
%23 = tail call i32 (i32, i8*, i32, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %2)
br label %24
24: ; preds = %10, %18, %20, %15, %5
ret void
}