#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*/ printf(char *, ...);
void liquid_autotest_print_array(unsigned char *_x, unsigned int _n) {
  unsigned int i;
  printf("   {");
  for (i = 0; i < _n; i++) {
    printf("%.2x, ", (unsigned int)(_x[i]));
    if (((i + 1) % 16 == 0) && (i != (_n - 1)))
      printf("\n    ");
  }
  printf("}\n");
}


x86 assembly (clang, -O0):
<liquid_autotest_print_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    119d <liquid_autotest_print_array+0x8d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
and    $0xf,%eax
cmp    $0x0,%eax
jne    118a <liquid_autotest_print_array+0x7a>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     118a <liquid_autotest_print_array+0x7a>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118f <liquid_autotest_print_array+0x7f>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <liquid_autotest_print_array+0x24>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<liquid_autotest_print_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%r12
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
je     11a8 <liquid_autotest_print_array+0x88>
lea    -0x1(%r14),%r13d
mov    %r14d,%ebx
neg    %r13
neg    %rbx
mov    $0x1,%ebp
lea    0xea8(%rip),%r14
jmp    1172 <liquid_autotest_print_array+0x52>
nop
lea    (%rbx,%rbp,1),%rax
add    $0x1,%rax
add    $0x1,%rbp
cmp    $0x1,%rax
je     11a8 <liquid_autotest_print_array+0x88>
mov    %r13,%r15
add    %rbp,%r15
movzbl -0x1(%r12,%rbp,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    $0x1,%r15
je     1160 <liquid_autotest_print_array+0x40>
mov    %ebp,%eax
and    $0xf,%eax
test   %rax,%rax
jne    1160 <liquid_autotest_print_array+0x40>
lea    0xe6d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1160 <liquid_autotest_print_array+0x40>
lea    0xe63(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [5 x i8] c" {\00"
@.str.1 = [7 x i8] c"%.2x, \00"
@.str.2 = [6 x i8] c"\0A \00"
@.str.3 = [3 x i8] c"}\0A\00"
define void @liquid_autotest_print_array(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %5
br label %7
7: ; preds = %31, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp ult i32 %8, %9
br i1 %10, label %11, label %34
11: ; preds = %7
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = zext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %5
%20 = add i32 %19, 1
%21 = urem i32 %20, 16
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %30
23: ; preds = %11
%24 = load i32, i32* %5
%25 = load i32, i32* %4
%26 = sub i32 %25, 1
%27 = icmp ne i32 %24, %26
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %30
30: ; preds = %28, %23, %11
br label %31
31: ; preds = %30
%32 = load i32, i32* %5
%33 = add i32 %32, 1
store i32 %33, i32* %5
br label %7
34: ; preds = %7
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c" {\00"
@.str.1 = [7 x i8] c"%.2x, \00"
@.str.2 = [6 x i8] c"\0A \00"
@str = [2 x i8] c"}\00"
define void @liquid_autotest_print_array(i8* nocapture %0, i32 %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %1, 0
br i1 %4, label %24, label %5
5: ; preds = %2
%6 = add i32 %1, -1
%7 = zext i32 %6 to i64
%8 = zext i32 %1 to i64
br label %9
9: ; preds = %5, %22
%10 = phi i64 [ 0, %5 ], [ %15, %22 ]
%11 = getelementptr inbounds i8, i8* %0, i64 %10
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %10, 1
%16 = and i64 %15, 15
%17 = icmp ne i64 %16, 0
%18 = icmp eq i64 %10, %7
%19 = or i1 %18, %17
br i1 %19, label %22, label %20
20: ; preds = %9
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %22
22: ; preds = %9, %20
%23 = icmp eq i64 %15, %8
br i1 %23, label %24, label %9
24: ; preds = %22, %2
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}