#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 _64_print_hexaSection(unsigned int size, unsigned int next_addr,
                           unsigned char *octet) {
  unsigned int i;
  i = 0;
  while (i < 16) {
    if (i % (16 / 4) == 0)
      printf(" ");
    if ((i + next_addr) < size)
      printf("%02x", octet[i + next_addr]);
    else
      printf("  ");
    i += 1;
  }
  printf("  ");
}


x86 assembly (clang, -O0):
<_64_print_hexaSection>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x10,-0x14(%rbp)
jae    119e <_64_print_hexaSection+0x8e>
mov    -0x14(%rbp),%eax
and    $0x3,%eax
cmp    $0x0,%eax
jne    1150 <_64_print_hexaSection+0x40>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    1182 <_64_print_hexaSection+0x72>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1190 <_64_print_hexaSection+0x80>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1129 <_64_print_hexaSection+0x19>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_64_print_hexaSection>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %edi,%r13d
mov    %esi,%ebx
lea    0xec6(%rip),%r14
lea    0xec4(%rip),%r15
xor    %ebp,%ebp
jmp    1164 <_64_print_hexaSection+0x44>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    $0x10,%rbp
je     1190 <_64_print_hexaSection+0x70>
test   $0x3,%bpl
jne    1174 <_64_print_hexaSection+0x54>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    (%rbx,%rbp,1),%rax
cmp    %r13d,%eax
jae    1150 <_64_print_hexaSection+0x30>
mov    %eax,%eax
movzbl (%r12,%rax,1),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    115a <_64_print_hexaSection+0x3a>
lea    0xe6e(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printf@plt>

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

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