#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*/ sprintf(char *, char *, int, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void EyeboxOne_use_bar(int fd, int bar, int level) {
  char buffer[16];
  if (bar > 2 || bar < 1)
    return;
  if (level > 10 || level < 0)
    return;
  sprintf(buffer, "\E[%d;%dB", bar, level);
  write(fd, buffer, strlen(buffer));
}


x86 assembly (clang, -O0):
<EyeboxOne_use_bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x2,-0x8(%rbp)
jg     1155 <EyeboxOne_use_bar+0x25>
cmpl   $0x1,-0x8(%rbp)
jge    115a <EyeboxOne_use_bar+0x2a>
jmp    11ae <EyeboxOne_use_bar+0x7e>
cmpl   $0xa,-0xc(%rbp)
jg     116e <EyeboxOne_use_bar+0x3e>
cmpl   $0x0,-0xc(%rbp)
jge    1173 <EyeboxOne_use_bar+0x43>
jmp    11ae <EyeboxOne_use_bar+0x7e>
lea    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe7c(%rip),%rsi
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x2c(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x2c(%rbp),%edi
mov    -0x28(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EyeboxOne_use_bar>:
mov    %edx,%ecx
mov    %esi,%edx
lea    -0x3(%rdx),%eax
cmp    $0xfffffffe,%eax
jb     1177 <EyeboxOne_use_bar+0x47>
cmp    $0xa,%ecx
ja     1177 <EyeboxOne_use_bar+0x47>
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
lea    0xeaf(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1050 <sprintf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [9 x i8] c"\1B[%d;%dB\00"
define void @EyeboxOne_use_bar(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [16 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = icmp sgt i32 %8, 2
br i1 %9, label %13, label %10
10: ; preds = %3
%11 = load i32, i32* %5
%12 = icmp slt i32 %11, 1
br i1 %12, label %13, label %14
13: ; preds = %10, %3
br label %31
14: ; preds = %10
%15 = load i32, i32* %6
%16 = icmp sgt i32 %15, 10
br i1 %16, label %20, label %17
17: ; preds = %14
%18 = load i32, i32* %6
%19 = icmp slt i32 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %17, %14
br label %31
21: ; preds = %17
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = call i32 @sprintf(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %23, i32 %24)
%26 = load i32, i32* %4
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%28 = getelementptr inbounds [16 x i8], [16 x i8]* %7, i64 0, i64 0
%29 = call i32 @strlen(i8* %28)
%30 = call i32 @write(i32 %26, i8* %27, i32 %29)
br label %31
31: ; preds = %21, %20, %13
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"\1B[%d;%dB\00"
define void @EyeboxOne_use_bar(i32 %0, i32 %1, i32 %2) {
%4 = alloca [16 x i8]
%5 = getelementptr inbounds [16 x i8], [16 x i8]* %4, i64 0, i64 0
%6 = add i32 %1, -3
%7 = icmp ult i32 %6, -2
%8 = icmp ugt i32 %2, 10
%9 = or i1 %7, %8
br i1 %9, label %14, label %10
10: ; preds = %3
%11 = call i32 @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%12 = call i32 @strlen(i8* %5)
%13 = call i32 @write(i32 %0, i8* %5, i32 %12)
br label %14
14: ; preds = %3, %10
ret void
}