#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*/ print_bits(unsigned long);
int /*<<< orphan*/ printf(char *);
void print_all(unsigned long M[][156], int righe) {
  for (int i = 0; i < righe; ++i) {
    for (int j = 0; j < 156; ++j) {
      print_bits(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)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a9 <print_all+0x89>
movl   $0x0,-0x14(%rbp)
cmpl   $0x9c,-0x14(%rbp)
jge    118f <print_all+0x6f>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x4e0,%rcx,%rcx
add    %rcx,%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1040 <print_bits@plt>
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1149 <print_all+0x29>
lea    0xe6c(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1136 <print_all+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_all>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    118a <print_all+0x6a>
mov    %rdi,%r12
mov    %esi,%r14d
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nop
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%r12,%rbx,8),%rdi
call   1040 <print_bits@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x9c,%rbx
jne    1150 <print_all+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    $0x4e0,%r12
cmp    %r14,%r15
jne    1140 <print_all+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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