#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*/ get_matrix_l(unsigned long **, int, int);
int /*<<< orphan*/ print_bits(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void print_all(unsigned long **M, int righe, int blocchi) {
  for (int i = 0; i < righe; ++i) {
    for (int j = 0; j < blocchi; ++j) {
      print_bits(get_matrix_l(M, i, j));
      printf(" ");
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<print_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11b2 <print_all+0x82>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1198 <print_all+0x68>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <get_matrix_l@plt>
mov    %eax,%edi
call   1050 <print_bits@plt>
lea    0xe7b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115c <print_all+0x2c>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <print_all+0x19>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_all>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %esi,%esi
jle    1197 <print_all+0x67>
mov    %edx,%r12d
mov    %esi,%r14d
mov    %rdi,%r15
xor    %ebp,%ebp
jmp    1162 <print_all+0x32>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x1,%ebp
cmp    %r14d,%ebp
je     1197 <print_all+0x67>
test   %r12d,%r12d
jle    1150 <print_all+0x20>
xor    %ebx,%ebx
nopl   0x0(%rax)
mov    %r15,%rdi
mov    %ebp,%esi
mov    %ebx,%edx
call   1030 <get_matrix_l@plt>
mov    %eax,%edi
call   1050 <print_bits@plt>
mov    $0x20,%edi
call   1040 <putchar@plt>
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    1170 <print_all+0x40>
jmp    1150 <print_all+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define void @print_all(i64** %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %9
5: ; preds = %3
%6 = icmp sgt i32 %2, 0
br label %7
7: ; preds = %5, %10
%8 = phi i32 [ 0, %5 ], [ %12, %10 ]
br i1 %6, label %14, label %10
9: ; preds = %10, %3
ret void
10: ; preds = %14, %7
%11 = tail call i32 @putchar(i32 10)
%12 = add nuw nsw i32 %8, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %9, label %7
14: ; preds = %7, %14
%15 = phi i32 [ %19, %14 ], [ 0, %7 ]
%16 = tail call i32 @get_matrix_l(i64** %0, i32 %8, i32 %15)
%17 = tail call i32 @print_bits(i32 %16)
%18 = tail call i32 @putchar(i32 32)
%19 = add nuw nsw i32 %15, 1
%20 = icmp eq i32 %19, %2
br i1 %20, label %10, label %14
}