#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_arr(int *, int);
int /*<<< orphan*/ printf(char *);
void print_info(int **info) {
  int num_partitions = 4;
  printf("info begin\n");
  for (int i = 0; i < num_partitions; i++) {
    print_arr(info[i], 4);
  }
  printf("info end\n");
}


x86 assembly (clang, -O0):
<print_info>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x4,-0xc(%rbp)
lea    0xec6(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1176 <print_info+0x56>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    $0x4,%esi
call   1030 <print_arr@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1146 <print_info+0x26>
lea    0xe8f(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_info>:
push   %rbx
mov    %rdi,%rbx
lea    0xed5(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rdi
mov    $0x4,%esi
call   1040 <print_arr@plt>
mov    0x8(%rbx),%rdi
mov    $0x4,%esi
call   1040 <print_arr@plt>
mov    0x10(%rbx),%rdi
mov    $0x4,%esi
call   1040 <print_arr@plt>
mov    0x18(%rbx),%rdi
mov    $0x4,%esi
call   1040 <print_arr@plt>
lea    0xe9d(%rip),%rdi
pop    %rbx
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"info begin\0A\00"
@.str.1 = [10 x i8] c"info end\0A\00"
define void @print_info(i32** %0) {
%2 = alloca i32**
%3 = alloca i32
%4 = alloca i32
store i32** %0, i32*** %2
store i32 4, i32* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %4
br label %6
6: ; preds = %17, %1
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32**, i32*** %2
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32*, i32** %11, i64 %13
%15 = load i32*, i32** %14
%16 = call i32 @print_arr(i32* %15, i32 4)
br label %17
17: ; preds = %10
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %4
br label %6
20: ; preds = %6
%21 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [11 x i8] c"info begin\00"
@str.2 = [9 x i8] c"info end\00"
define void @print_info(i32** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%3 = load i32*, i32** %0
%4 = tail call i32 @print_arr(i32* %3, i32 4)
%5 = getelementptr inbounds i32*, i32** %0, i64 1
%6 = load i32*, i32** %5
%7 = tail call i32 @print_arr(i32* %6, i32 4)
%8 = getelementptr inbounds i32*, i32** %0, i64 2
%9 = load i32*, i32** %8
%10 = tail call i32 @print_arr(i32* %9, i32 4)
%11 = getelementptr inbounds i32*, i32** %0, i64 3
%12 = load i32*, i32** %11
%13 = tail call i32 @print_arr(i32* %12, i32 4)
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str.2, i64 0, i64 0))
ret void
}