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


x86 assembly (clang, -O0):
<print_char44>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jae    11b6 <print_char44+0xa6>
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jae    117d <print_char44+0x6d>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
movzbl (%rax,%rcx,1),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1142 <print_char44+0x32>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x3,-0xc(%rbp)
jne    11a3 <print_char44+0x93>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11a8 <print_char44+0x98>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <print_char44+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_char44>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xece(%rip),%r15
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl (%rbx),%esi
lea    0xebd(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xc(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe87(%rip),%r12
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x1(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x5(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x9(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xd(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x2(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x6(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xa(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xe(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x3(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x7(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xb(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0xf(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r12,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

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