#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 dp_D_print(int *D, char *a, char *b, int n_c, int m_r) {
  int i, j, k;
  printf("   ");
  for (i = 0; i < n_c; i++) {
    if (i == 0) {
      printf("  -");
    } else {
      printf(" %2c", a[i - 1]);
    }
  }
  printf("\n");
  for (j = 0; j < m_r; j++) {
    if (j == 0) {
      printf("  -");
    } else {
      printf(" %2c", b[j - 1]);
    }
    for (i = 0; i < n_c; i++) {
      printf(" %2i", D[j * n_c + i]);
    }
    printf("\n");
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<dp_D_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    119b <dp_D_print+0x8b>
cmpl   $0x0,-0x24(%rbp)
jne    1169 <dp_D_print+0x59>
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1188 <dp_D_print+0x78>
mov    -0x10(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    118d <dp_D_print+0x7d>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1140 <dp_D_print+0x30>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1257 <dp_D_print+0x147>
cmpl   $0x0,-0x28(%rbp)
jne    11d9 <dp_D_print+0xc9>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f8 <dp_D_print+0xe8>
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    123b <dp_D_print+0x12b>
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%ecx
imul   -0x1c(%rbp),%ecx
add    -0x24(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11ff <dp_D_print+0xef>
lea    0xdcb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b0 <dp_D_print+0xa0>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dp_D_print>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0x8(%rsp)
mov    %ecx,%ebp
mov    %rdx,0x10(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%r15d
mov    %ebp,0x4(%rsp)
test   %ebp,%ebp
jle    1198 <dp_D_print+0x78>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x1,0x4(%rsp)
je     1198 <dp_D_print+0x78>
lea    -0x1(%r15),%r12
lea    0xe8f(%rip),%r13
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%r14,%rbp,1),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbp
cmp    %rbp,%r12
jne    1180 <dp_D_print+0x60>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    1249 <dp_D_print+0x129>
movslq 0x4(%rsp),%r13
mov    %eax,%eax
mov    %rax,0x8(%rsp)
shl    $0x2,%r13
lea    0xe48(%rip),%rbp
xor    %r12d,%r12d
jmp    11e8 <dp_D_print+0xc8>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r12
add    %r13,%rbx
cmp    0x8(%rsp),%r12
je     1249 <dp_D_print+0x129>
test   %r12,%r12
je     1210 <dp_D_print+0xf0>
mov    0x10(%rsp),%rax
movsbl -0x1(%r12,%rax,1),%esi
lea    0xe09(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jg     1225 <dp_D_print+0x105>
jmp    11d0 <dp_D_print+0xb0>
nop
lea    0xded(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmpl   $0x0,0x4(%rsp)
jle    11d0 <dp_D_print+0xb0>
xor    %r14d,%r14d
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r14,4),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r15
jne    1230 <dp_D_print+0x110>
jmp    11d0 <dp_D_print+0xb0>
mov    $0xa,%edi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c" -\00"
@.str.2 = [5 x i8] c" %2c\00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [5 x i8] c" %2i\00"
define void @dp_D_print(i32* %0, i8* %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32* %0, i32** %6
store i8* %1, i8** %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %15
15: ; preds = %34, %5
%16 = load i32, i32* %11
%17 = load i32, i32* %9
%18 = icmp slt i32 %16, %17
br i1 %18, label %19, label %37
19: ; preds = %15
%20 = load i32, i32* %11
%21 = icmp eq i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %19
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %33
24: ; preds = %19
%25 = load i8*, i8** %7
%26 = load i32, i32* %11
%27 = sub nsw i32 %26, 1
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %25, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %31)
br label %33
33: ; preds = %24, %22
br label %34
34: ; preds = %33
%35 = load i32, i32* %11
%36 = add nsw i32 %35, 1
store i32 %36, i32* %11
br label %15
37: ; preds = %15
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %12
br label %39
39: ; preds = %78, %37
%40 = load i32, i32* %12
%41 = load i32, i32* %10
%42 = icmp slt i32 %40, %41
br i1 %42, label %43, label %81
43: ; preds = %39
%44 = load i32, i32* %12
%45 = icmp eq i32 %44, 0
br i1 %45, label %46, label %48
46: ; preds = %43
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %57
48: ; preds = %43
%49 = load i8*, i8** %8
%50 = load i32, i32* %12
%51 = sub nsw i32 %50, 1
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8, i8* %49, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %55)
br label %57
57: ; preds = %48, %46
store i32 0, i32* %11
br label %58
58: ; preds = %73, %57
%59 = load i32, i32* %11
%60 = load i32, i32* %9
%61 = icmp slt i32 %59, %60
br i1 %61, label %62, label %76
62: ; preds = %58
%63 = load i32*, i32** %6
%64 = load i32, i32* %12
%65 = load i32, i32* %9
%66 = mul nsw i32 %64, %65
%67 = load i32, i32* %11
%68 = add nsw i32 %66, %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i32, i32* %63, i64 %69
%71 = load i32, i32* %70
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %71)
br label %73
73: ; preds = %62
%74 = load i32, i32* %11
%75 = add nsw i32 %74, 1
store i32 %75, i32* %11
br label %58
76: ; preds = %58
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %78
78: ; preds = %76
%79 = load i32, i32* %12
%80 = add nsw i32 %79, 1
store i32 %80, i32* %12
br label %39
81: ; preds = %39
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [4 x i8] c" -\00"
@.str.2 = [5 x i8] c" %2c\00"
@.str.4 = [5 x i8] c" %2i\00"
define void @dp_D_print(i32* nocapture %0, i8* nocapture %1, i8* nocapture %2, i32 %3, i32 %4) {
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %3, 0
br i1 %7, label %8, label %21
8: ; preds = %5
%9 = zext i32 %3 to i64
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32 %3, 1
br i1 %11, label %21, label %12
12: ; preds = %8, %12
%13 = phi i64 [ %19, %12 ], [ 1, %8 ]
%14 = add nsw i64 %13, -1
%15 = getelementptr inbounds i8, i8* %1, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %17)
%19 = add nuw nsw i64 %13, 1
%20 = icmp eq i64 %19, %9
br i1 %20, label %21, label %12
21: ; preds = %12, %8, %5
%22 = tail call i32 @putchar(i32 10)
%23 = icmp sgt i32 %4, 0
br i1 %23, label %24, label %54
24: ; preds = %21
%25 = sext i32 %3 to i64
%26 = zext i32 %4 to i64
%27 = zext i32 %3 to i64
br label %28
28: ; preds = %24, %50
%29 = phi i64 [ 0, %24 ], [ %52, %50 ]
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %28
%32 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %39
33: ; preds = %28
%34 = add nsw i64 %29, -1
%35 = getelementptr inbounds i8, i8* %2, i64 %34
%36 = load i8, i8* %35
%37 = sext i8 %36 to i32
%38 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %33, %31
br i1 %7, label %40, label %50
40: ; preds = %39
%41 = mul nsw i64 %29, %25
br label %42
42: ; preds = %40, %42
%43 = phi i64 [ 0, %40 ], [ %48, %42 ]
%44 = add nsw i64 %43, %41
%45 = getelementptr inbounds i32, i32* %0, i64 %44
%46 = load i32, i32* %45
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %46)
%48 = add nuw nsw i64 %43, 1
%49 = icmp eq i64 %48, %27
br i1 %49, label %50, label %42
50: ; preds = %42, %39
%51 = tail call i32 @putchar(i32 10)
%52 = add nuw nsw i64 %29, 1
%53 = icmp eq i64 %52, %26
br i1 %53, label %54, label %28
54: ; preds = %50, %21
%55 = tail call i32 @putchar(i32 10)
ret void
}