#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const);
void print_bytes(const uint8_t *data, size_t N) {
  for (size_t i = 0, c = 0; i < N; i++)
    if (data[i] < 32 || data[i] > 126)
      if (c++ % 2)
        printf("\x1b[34m%d\x1b[0m", data[i]);
      else
        printf("\x1b[36m%d\x1b[0m", data[i]);
    else
      printf("%c", data[i]);
}


x86 assembly (clang, -O0):
<print_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11e4 <print_bytes+0xd4>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpl   $0x20,(%rax,%rcx,4)
jl     1162 <print_bytes+0x52>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
cmpl   $0x7e,(%rax,%rcx,4)
jle    11b7 <print_bytes+0xa7>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
and    $0x1,%rax
cmp    $0x0,%rax
je     119b <print_bytes+0x8b>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
jmp    11b2 <print_bytes+0xa2>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe5f(%rip),%rdi
call   1030 <printf@plt>
jmp    11ce <print_bytes+0xbe>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe4f(%rip),%rdi
call   1030 <printf@plt>
jmp    11d3 <print_bytes+0xc3>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1130 <print_bytes+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_bytes>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %rsi,%rsi
je     1171 <print_bytes+0x61>
mov    %rsi,%r15
mov    %rdi,%r14
xor    %ebx,%ebx
lea    0xedd(%rip),%r12
lea    0xee2(%rip),%rbp
xor    %r13d,%r13d
jmp    1159 <print_bytes+0x49>
nopl   0x0(%rax,%rax,1)
cmp    $0xffffffa1,%eax
cmovae %rbp,%rdi
adc    $0x0,%rbx
call   1030 <printf@plt>
add    $0x1,%r13
cmp    %r13,%r15
je     1171 <print_bytes+0x61>
mov    (%r14,%r13,4),%esi
lea    -0x7f(%rsi),%eax
mov    %r12,%rdi
test   $0x1,%bl
je     1140 <print_bytes+0x30>
lea    0xe91(%rip),%rdi
jmp    1140 <print_bytes+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c"\1B[34m%d\1B[0m\00"
@.str.1 = [12 x i8] c"\1B[36m%d\1B[0m\00"
@.str.2 = [3 x i8] c"%c\00"
define void @print_bytes(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
br label %7
7: ; preds = %48, %2
%8 = load i64, i64* %5
%9 = load i64, i64* %4
%10 = icmp ult i64 %8, %9
br i1 %10, label %11, label %51
11: ; preds = %7
%12 = load i32*, i32** %3
%13 = load i64, i64* %5
%14 = getelementptr inbounds i32, i32* %12, i64 %13
%15 = load i32, i32* %14
%16 = icmp slt i32 %15, 32
br i1 %16, label %23, label %17
17: ; preds = %11
%18 = load i32*, i32** %3
%19 = load i64, i64* %5
%20 = getelementptr inbounds i32, i32* %18, i64 %19
%21 = load i32, i32* %20
%22 = icmp sgt i32 %21, 126
br i1 %22, label %23, label %41
23: ; preds = %17, %11
%24 = load i64, i64* %6
%25 = add i64 %24, 1
store i64 %25, i64* %6
%26 = urem i64 %24, 2
%27 = icmp ne i64 %26, 0
br i1 %27, label %28, label %34
28: ; preds = %23
%29 = load i32*, i32** %3
%30 = load i64, i64* %5
%31 = getelementptr inbounds i32, i32* %29, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %32)
br label %40
34: ; preds = %23
%35 = load i32*, i32** %3
%36 = load i64, i64* %5
%37 = getelementptr inbounds i32, i32* %35, i64 %36
%38 = load i32, i32* %37
%39 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %34, %28
br label %47
41: ; preds = %17
%42 = load i32*, i32** %3
%43 = load i64, i64* %5
%44 = getelementptr inbounds i32, i32* %42, i64 %43
%45 = load i32, i32* %44
%46 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %45)
br label %47
47: ; preds = %41, %40
br label %48
48: ; preds = %47
%49 = load i64, i64* %5
%50 = add i64 %49, 1
store i64 %50, i64* %5
br label %7
51: ; preds = %7
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"\1B[34m%d\1B[0m\00"
@.str.1 = [12 x i8] c"\1B[36m%d\1B[0m\00"
@.str.2 = [3 x i8] c"%c\00"
define void @print_bytes(i32* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %4, label %5
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i64 [ %17, %5 ], [ 0, %2 ]
%7 = phi i64 [ %19, %5 ], [ 0, %2 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = add i32 %9, -127
%11 = icmp ult i32 %10, -95
%12 = and i64 %6, 1
%13 = icmp eq i64 %12, 0
%14 = select i1 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0)
%15 = select i1 %11, i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0)
%16 = zext i1 %11 to i64
%17 = add i64 %6, %16
%18 = tail call i32 @printf(i8* %15, i32 %9)
%19 = add nuw i64 %7, 1
%20 = icmp eq i64 %19, %1
br i1 %20, label %4, label %5
}