#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, int const, int const, int const);
int /*<<< orphan*/ puts(char *);
void print_block(char *title, const uint8_t *block) {
  int i;
  puts(title);
  for (i = 0; i < 4; i++) {
    printf("%02X %02X %02X %02X\n", block[i * 4 + 0], block[i * 4 + 1],
           block[i * 4 + 2], block[i * 4 + 3]);
  }
}


x86 assembly (clang, -O0):
<print_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <puts@plt>
movl   $0x0,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    11b1 <print_block+0x91>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
add    $0x0,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x2,%ecx
add    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%edi
shl    $0x2,%edi
add    $0x3,%edi
movslq %edi,%rdi
mov    (%rax,%rdi,4),%r8d
lea    0xe62(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1140 <print_block+0x20>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_block>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
call   1030 <puts@plt>
mov    (%rbx),%esi
mov    0x4(%rbx),%edx
mov    0x8(%rbx),%ecx
mov    0xc(%rbx),%r8d
lea    0xec1(%rip),%r14
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x10(%rbx),%esi
mov    0x14(%rbx),%edx
mov    0x18(%rbx),%ecx
mov    0x1c(%rbx),%r8d
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x20(%rbx),%esi
mov    0x24(%rbx),%edx
mov    0x28(%rbx),%ecx
mov    0x2c(%rbx),%r8d
mov    %r14,%rdi
call   1040 <printf@plt>
mov    0x30(%rbx),%esi
mov    0x34(%rbx),%edx
mov    0x38(%rbx),%ecx
mov    0x3c(%rbx),%r8d
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

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

LLVM IR (-O2):
@.str = [21 x i8] c"%02X %02X %02X %02X\0A\00"
define void @print_block(i8* nocapture %0, i32* nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) %0)
%4 = load i32, i32* %1
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = getelementptr inbounds i32, i32* %1, i64 2
%8 = load i32, i32* %7
%9 = getelementptr inbounds i32, i32* %1, i64 3
%10 = load i32, i32* %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %10)
%12 = getelementptr inbounds i32, i32* %1, i64 4
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 5
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %1, i64 6
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 7
%19 = load i32, i32* %18
%20 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %13, i32 %15, i32 %17, i32 %19)
%21 = getelementptr inbounds i32, i32* %1, i64 8
%22 = load i32, i32* %21
%23 = getelementptr inbounds i32, i32* %1, i64 9
%24 = load i32, i32* %23
%25 = getelementptr inbounds i32, i32* %1, i64 10
%26 = load i32, i32* %25
%27 = getelementptr inbounds i32, i32* %1, i64 11
%28 = load i32, i32* %27
%29 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %22, i32 %24, i32 %26, i32 %28)
%30 = getelementptr inbounds i32, i32* %1, i64 12
%31 = load i32, i32* %30
%32 = getelementptr inbounds i32, i32* %1, i64 13
%33 = load i32, i32* %32
%34 = getelementptr inbounds i32, i32* %1, i64 14
%35 = load i32, i32* %34
%36 = getelementptr inbounds i32, i32* %1, i64 15
%37 = load i32, i32* %36
%38 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %33, i32 %35, i32 %37)
ret void
}