#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 math_pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
void print_repair_list(int **dplist, int m, int k) {
  int num_per_node;
  int r = (math_pow((m), (k - 1)));
  int num_data;
  int num_parity;
  int i;
  num_per_node = r / m;
  num_data = (k - 1) * num_per_node;
  num_parity = m * num_per_node;
  printf(" data list\t");
  for (i = 0; i < num_data; ++i) {
    printf("%3d ", dplist[0][i]);
  }
  printf("\n");
  printf("parity list\t");
  for (i = 0; i < num_parity; ++i) {
    printf("%3d ", dplist[1][i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_repair_list>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
sub    $0x1,%esi
call   1040 <math_pow@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x20(%rbp)
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11af <print_repair_list+0x8f>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1179 <print_repair_list+0x59>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1209 <print_repair_list+0xe9>
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe18(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11d2 <print_repair_list+0xb2>
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_repair_list>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%ebp
mov    %esi,%r15d
mov    %rdi,%r12
add    $0xffffffff,%ebp
mov    %esi,%edi
mov    %ebp,%esi
call   1050 <math_pow@plt>
cltd
idiv   %r15d
mov    %eax,%r14d
imul   %eax,%ebp
imul   %r15d,%r14d
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %ebp,%ebp
jle    119a <print_repair_list+0x6a>
mov    %ebp,%ebp
lea    0xe97(%rip),%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r12),%rax
mov    (%rax,%rbx,4),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1180 <print_repair_list+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe66(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
test   %r14d,%r14d
jle    11eb <print_repair_list+0xbb>
mov    %r14d,%ebp
lea    0xe4b(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%r12),%rax
mov    (%rax,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    11d0 <print_repair_list+0xa0>
mov    $0xa,%edi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [12 x i8] c" data list\09\00"
@.str.1 = [5 x i8] c"%3d \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [13 x i8] c"parity list\09\00"
define void @print_repair_list(i32** %0, i32 %1, i32 %2) {
%4 = alloca i32**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32** %0, i32*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
%15 = call i32 @math_pow(i32 %12, i32 %14)
store i32 %15, i32* %8
%16 = load i32, i32* %8
%17 = load i32, i32* %5
%18 = sdiv i32 %16, %17
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = sub nsw i32 %19, 1
%21 = load i32, i32* %7
%22 = mul nsw i32 %20, %21
store i32 %22, i32* %9
%23 = load i32, i32* %5
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
store i32 %25, i32* %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %27
27: ; preds = %40, %3
%28 = load i32, i32* %11
%29 = load i32, i32* %9
%30 = icmp slt i32 %28, %29
br i1 %30, label %31, label %43
31: ; preds = %27
%32 = load i32**, i32*** %4
%33 = getelementptr inbounds i32*, i32** %32, i64 0
%34 = load i32*, i32** %33
%35 = load i32, i32* %11
%36 = sext i32 %35 to i64
%37 = getelementptr inbounds i32, i32* %34, i64 %36
%38 = load i32, i32* %37
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %31
%41 = load i32, i32* %11
%42 = add nsw i32 %41, 1
store i32 %42, i32* %11
br label %27
43: ; preds = %27
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %11
br label %46
46: ; preds = %59, %43
%47 = load i32, i32* %11
%48 = load i32, i32* %10
%49 = icmp slt i32 %47, %48
br i1 %49, label %50, label %62
50: ; preds = %46
%51 = load i32**, i32*** %4
%52 = getelementptr inbounds i32*, i32** %51, i64 1
%53 = load i32*, i32** %52
%54 = load i32, i32* %11
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds i32, i32* %53, i64 %55
%57 = load i32, i32* %56
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %50
%60 = load i32, i32* %11
%61 = add nsw i32 %60, 1
store i32 %61, i32* %11
br label %46
62: ; preds = %46
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c" data list\09\00"
@.str.1 = [5 x i8] c"%3d \00"
@.str.3 = [13 x i8] c"parity list\09\00"
define void @print_repair_list(i32** nocapture %0, i32 %1, i32 %2) {
%4 = add nsw i32 %2, -1
%5 = tail call i32 @math_pow(i32 %1, i32 %4)
%6 = sdiv i32 %5, %1
%7 = mul i32 %6, %4
%8 = mul i32 %6, %1
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%10 = icmp sgt i32 %7, 0
br i1 %10, label %11, label %21
11: ; preds = %3
%12 = zext i32 %7 to i64
br label %13
13: ; preds = %11, %13
%14 = phi i64 [ 0, %11 ], [ %19, %13 ]
%15 = load i32*, i32** %0
%16 = getelementptr inbounds i32, i32* %15, i64 %14
%17 = load i32, i32* %16
%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 = add nuw nsw i64 %14, 1
%20 = icmp eq i64 %19, %12
br i1 %20, label %21, label %13
21: ; preds = %13, %3
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%24 = icmp sgt i32 %8, 0
br i1 %24, label %25, label %36
25: ; preds = %21
%26 = getelementptr inbounds i32*, i32** %0, i64 1
%27 = zext i32 %8 to i64
br label %28
28: ; preds = %25, %28
%29 = phi i64 [ 0, %25 ], [ %34, %28 ]
%30 = load i32*, i32** %26
%31 = getelementptr inbounds i32, i32* %30, i64 %29
%32 = load i32, i32* %31
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = add nuw nsw i64 %29, 1
%35 = icmp eq i64 %34, %27
br i1 %35, label %36, label %28
36: ; preds = %28, %21
%37 = tail call i32 @putchar(i32 10)
ret void
}