#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 printmat(unsigned char **m) {
  int i, j;
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 4; j++) {
      printf("%02x ", m[i][j]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<printmat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    118a <printmat+0x7a>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jge    116e <printmat+0x5e>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <printmat+0x24>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <printmat+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printmat>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rax
movzbl (%rax),%esi
lea    0xecc(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rax
movzbl 0x1(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rax
movzbl 0x2(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    (%rbx),%rax
movzbl 0x3(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rbx),%rax
movzbl (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movzbl 0x1(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movzbl 0x2(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rax
movzbl 0x3(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x10(%rbx),%rax
movzbl (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rax
movzbl 0x1(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rax
movzbl 0x2(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x10(%rbx),%rax
movzbl 0x3(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x18(%rbx),%rax
movzbl (%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rax
movzbl 0x1(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rax
movzbl 0x2(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x18(%rbx),%rax
movzbl 0x3(%rax),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"%02x \00"
define void @printmat(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i8*, i8** %0
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i32
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load i8*, i8** %0
%17 = getelementptr inbounds i8, i8* %16, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = tail call i32 @putchar(i32 10)
%22 = getelementptr inbounds i8*, i8** %0, i64 1
%23 = load i8*, i8** %22
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %25)
%27 = load i8*, i8** %22
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %22
%33 = getelementptr inbounds i8, i8* %32, i64 2
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %35)
%37 = load i8*, i8** %22
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %40)
%42 = tail call i32 @putchar(i32 10)
%43 = getelementptr inbounds i8*, i8** %0, i64 2
%44 = load i8*, i8** %43
%45 = load i8, i8* %44
%46 = zext i8 %45 to i32
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %46)
%48 = load i8*, i8** %43
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %51)
%53 = load i8*, i8** %43
%54 = getelementptr inbounds i8, i8* %53, i64 2
%55 = load i8, i8* %54
%56 = zext i8 %55 to i32
%57 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %56)
%58 = load i8*, i8** %43
%59 = getelementptr inbounds i8, i8* %58, i64 3
%60 = load i8, i8* %59
%61 = zext i8 %60 to i32
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %61)
%63 = tail call i32 @putchar(i32 10)
%64 = getelementptr inbounds i8*, i8** %0, i64 3
%65 = load i8*, i8** %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %67)
%69 = load i8*, i8** %64
%70 = getelementptr inbounds i8, i8* %69, i64 1
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %72)
%74 = load i8*, i8** %64
%75 = getelementptr inbounds i8, i8* %74, i64 2
%76 = load i8, i8* %75
%77 = zext i8 %76 to i32
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %77)
%79 = load i8*, i8** %64
%80 = getelementptr inbounds i8, i8* %79, i64 3
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %82)
%84 = tail call i32 @putchar(i32 10)
ret void
}