#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 *, ...);
void print_buf8(unsigned char *msg, uint8_t *buf) {
  printf("[> %s:\n", msg);
  printf("initialize_vector8(");
  for (size_t i = 0; i < 16; i++) {
    printf("0x%02xU", buf[i]);
    if (i < 15) {
      printf(",");
    }
  }
  printf(");\n");
}


x86 assembly (clang, -O0):
<print_buf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x18(%rbp)
cmpq   $0x10,-0x18(%rbp)
jae    119b <print_buf8+0x8b>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0xf,-0x18(%rbp)
jae    1185 <print_buf8+0x75>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118a <print_buf8+0x7a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1148 <print_buf8+0x38>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_buf8>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%rsi
lea    0xebf(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    (%rbx),%esi
lea    0xebd(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0xc(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x14(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x1c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x20(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x24(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x28(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x2c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x30(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x34(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x38(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x2c,%edi
call   1030 <putchar@plt>
mov    0x3c(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd5b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"[> %s:\0A\00"
@.str.1 = [20 x i8] c"initialize_vector8(\00"
@.str.2 = [8 x i8] c"0x%02xU\00"
@.str.3 = [2 x i8] c",\00"
@.str.4 = [4 x i8] c");\0A\00"
define void @print_buf8(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i64
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
store i64 0, i64* %5
br label %9
9: ; preds = %23, %2
%10 = load i64, i64* %5
%11 = icmp ult i64 %10, 16
br i1 %11, label %12, label %26
12: ; preds = %9
%13 = load i32*, i32** %4
%14 = load i64, i64* %5
%15 = getelementptr inbounds i32, i32* %13, i64 %14
%16 = load i32, i32* %15
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %16)
%18 = load i64, i64* %5
%19 = icmp ult i64 %18, 15
br i1 %19, label %20, label %22
20: ; preds = %12
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %22
22: ; preds = %20, %12
br label %23
23: ; preds = %22
%24 = load i64, i64* %5
%25 = add i64 %24, 1
store i64 %25, i64* %5
br label %9
26: ; preds = %9
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"[> %s:\0A\00"
@.str.1 = [20 x i8] c"initialize_vector8(\00"
@.str.2 = [8 x i8] c"0x%02xU\00"
@str = [3 x i8] c");\00"
define void @print_buf8(i8* %0, i32* nocapture %1) {
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %5)
%7 = tail call i32 @putchar(i32 44)
%8 = getelementptr inbounds i32, i32* %1, i64 1
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %9)
%11 = tail call i32 @putchar(i32 44)
%12 = getelementptr inbounds i32, i32* %1, i64 2
%13 = load i32, i32* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = tail call i32 @putchar(i32 44)
%16 = getelementptr inbounds i32, i32* %1, i64 3
%17 = load i32, i32* %16
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = tail call i32 @putchar(i32 44)
%20 = getelementptr inbounds i32, i32* %1, i64 4
%21 = load i32, i32* %20
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %21)
%23 = tail call i32 @putchar(i32 44)
%24 = getelementptr inbounds i32, i32* %1, i64 5
%25 = load i32, i32* %24
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %25)
%27 = tail call i32 @putchar(i32 44)
%28 = getelementptr inbounds i32, i32* %1, i64 6
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %29)
%31 = tail call i32 @putchar(i32 44)
%32 = getelementptr inbounds i32, i32* %1, i64 7
%33 = load i32, i32* %32
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %33)
%35 = tail call i32 @putchar(i32 44)
%36 = getelementptr inbounds i32, i32* %1, i64 8
%37 = load i32, i32* %36
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = tail call i32 @putchar(i32 44)
%40 = getelementptr inbounds i32, i32* %1, i64 9
%41 = load i32, i32* %40
%42 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = tail call i32 @putchar(i32 44)
%44 = getelementptr inbounds i32, i32* %1, i64 10
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %45)
%47 = tail call i32 @putchar(i32 44)
%48 = getelementptr inbounds i32, i32* %1, i64 11
%49 = load i32, i32* %48
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %49)
%51 = tail call i32 @putchar(i32 44)
%52 = getelementptr inbounds i32, i32* %1, i64 12
%53 = load i32, i32* %52
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %53)
%55 = tail call i32 @putchar(i32 44)
%56 = getelementptr inbounds i32, i32* %1, i64 13
%57 = load i32, i32* %56
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %57)
%59 = tail call i32 @putchar(i32 44)
%60 = getelementptr inbounds i32, i32* %1, i64 14
%61 = load i32, i32* %60
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %61)
%63 = tail call i32 @putchar(i32 44)
%64 = getelementptr inbounds i32, i32* %1, i64 15
%65 = load i32, i32* %64
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %65)
%67 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}