#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*/ ft_putnbr_hex(unsigned char const, int);
int /*<<< orphan*/ write(int, char *, int);
void print_numbers(const unsigned char *addr, size_t size, size_t i) {
  int a;
  a = 0;
  while (a < 16) {
    if (a + i < size)
      ft_putnbr_hex(addr[i + a], 2);
    else
      write(1, "  ", 2);
    if (a % 2)
      write(1, " ", 1);
    a++;
  }
}


x86 assembly (clang, -O0):
<print_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    11c4 <print_numbers+0xa4>
movslq -0x1c(%rbp),%rax
add    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    1179 <print_numbers+0x59>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq -0x1c(%rbp),%rdx
add    %rdx,%rcx
mov    $0x2,%esi
movzbl (%rax,%rcx,1),%edi
call   1030 <ft_putnbr_hex@plt>
jmp    118f <print_numbers+0x6f>
mov    $0x1,%edi
lea    0xe7b(%rip),%rsi
mov    $0x2,%edx
call   1040 <write@plt>
mov    -0x1c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     11b6 <print_numbers+0x96>
mov    $0x1,%edx
lea    0xe52(%rip),%rsi
mov    %edx,%edi
call   1040 <write@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    113b <print_numbers+0x1b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_numbers>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
add    %rdx,%r15
xor    %ebp,%ebp
lea    0xec1(%rip),%r12
lea    0xeb9(%rip),%r13
jmp    115a <print_numbers+0x3a>
nopl   0x0(%rax)
add    $0x1,%rbp
cmp    $0x10,%rbp
je     11ac <print_numbers+0x8c>
lea    (%rbx,%rbp,1),%rax
cmp    %r14,%rax
jae    1180 <print_numbers+0x60>
movzbl (%r15,%rbp,1),%edi
mov    $0x2,%esi
call   1030 <ft_putnbr_hex@plt>
test   $0x1,%bpl
je     1150 <print_numbers+0x30>
jmp    1198 <print_numbers+0x78>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
mov    %r13,%rsi
mov    $0x2,%edx
call   1040 <write@plt>
test   $0x1,%bpl
je     1150 <print_numbers+0x30>
mov    $0x1,%edi
mov    %r12,%rsi
mov    $0x1,%edx
call   1040 <write@plt>
jmp    1150 <print_numbers+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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