#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 *, ...);
int strlen(char *);
void debug_print_W3(int *W, int m_r, int w_len, char *a, char *b) {
  int r, w, n_c, c;
  n_c = strlen(a) + 1;
  printf("     ");
  for (c = 0; c < (w_len / 2); c++) {
    printf("   ");
    printf("   ");
  }
  for (c = 0; c < n_c; c++) {
    if (c == 0) {
      printf("   ");
      printf("  -");
    } else {
      printf("  %2d %c", c, a[c - 1]);
    }
  }
  printf("\n");
  for (r = 0; r < m_r; r++) {
    if (r == 0) {
      printf("   ");
      printf(" -");
    } else {
      printf(" %2d %c", r, b[r - 1]);
    }
    for (c = 0; c < r; c++) {
      printf("   ");
      printf("   ");
    }
    for (w = 0; w < w_len; w++) {
      printf("   ");
      printf(" %2d", W[r * w_len + w]);
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<debug_print_W3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x10(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x34(%rbp),%eax
cmp    %ecx,%eax
jge    11a6 <debug_print_W3+0x86>
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    115e <debug_print_W3+0x3e>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1219 <debug_print_W3+0xf9>
cmpl   $0x0,-0x30(%rbp)
jne    11e4 <debug_print_W3+0xc4>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1206 <debug_print_W3+0xe6>
mov    -0x30(%rbp),%esi
mov    -0x18(%rbp),%rax
mov    -0x30(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xe0b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    120b <debug_print_W3+0xeb>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    11ad <debug_print_W3+0x8d>
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1331 <debug_print_W3+0x211>
cmpl   $0x0,-0x24(%rbp)
jne    1265 <debug_print_W3+0x145>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1287 <debug_print_W3+0x167>
mov    -0x24(%rbp),%esi
mov    -0x20(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%edx
lea    0xd8b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    12c4 <debug_print_W3+0x1a4>
lea    0xd61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    128e <debug_print_W3+0x16e>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1315 <debug_print_W3+0x1f5>
lea    0xd24(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0x24(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x28(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xd15(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    12cb <debug_print_W3+0x1ab>
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    122e <debug_print_W3+0x10e>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_print_W3>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r8,0x10(%rsp)
mov    %rcx,%rbx
mov    %edx,%ebp
mov    %esi,%r12d
mov    %rdi,%r13
mov    %rcx,%rdi
call   1040 <strlen@plt>
mov    %eax,%r14d
lea    0xea0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,0xc(%rsp)
cmp    $0x2,%ebp
jl     11a9 <debug_print_W3+0x79>
mov    0xc(%rsp),%eax
mov    %eax,%ebp
shr    $0x1f,%ebp
add    %eax,%ebp
sar    %ebp
lea    0xe7e(%rip),%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffff,%ebp
jne    1190 <debug_print_W3+0x60>
test   %r14d,%r14d
js     11fc <debug_print_W3+0xcc>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe43(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r14d,%r14d
je     11fc <debug_print_W3+0xcc>
add    $0x1,%r14d
mov    $0x1,%r15d
lea    0xe2a(%rip),%rbp
movsbl -0x1(%rbx,%r15,1),%edx
mov    %rbp,%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r15
cmp    %r15,%r14
jne    11e0 <debug_print_W3+0xb0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r12d,%r12d
jle    1307 <debug_print_W3+0x1d7>
mov    0xc(%rsp),%eax
movslq %eax,%rcx
mov    %r12d,%edx
mov    %rdx,0x18(%rsp)
mov    %eax,%r12d
shl    $0x2,%rcx
mov    %rcx,0x20(%rsp)
lea    0xdd1(%rip),%rbp
xor    %r15d,%r15d
jmp    125e <debug_print_W3+0x12e>
cs nopw 0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    0x20(%rsp),%r13
cmp    0x18(%rsp),%r15
je     1307 <debug_print_W3+0x1d7>
test   %r15,%r15
je     12b0 <debug_print_W3+0x180>
mov    0x10(%rsp),%rax
movsbl -0x1(%r15,%rax,1),%edx
lea    0xd96(%rip),%rdi
mov    %r15d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0xffffffffffffffff,%rbx
jne    1290 <debug_print_W3+0x160>
jmp    12c8 <debug_print_W3+0x198>
nopl   0x0(%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd46(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%rsp)
lea    0xd3f(%rip),%rbx
jle    1240 <debug_print_W3+0x110>
xor    %r14d,%r14d
nopl   (%rax)
mov    %rbp,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x0(%r13,%r14,4),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
cmp    %r14,%r12
jne    12e0 <debug_print_W3+0x1b0>
jmp    1240 <debug_print_W3+0x110>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c" \00"
@.str.1 = [4 x i8] c" \00"
@.str.2 = [4 x i8] c" -\00"
@.str.3 = [9 x i8] c" %2d %c\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [3 x i8] c" -\00"
@.str.6 = [8 x i8] c" %2d %c\00"
@.str.7 = [5 x i8] c" %2d\00"
define void @debug_print_W3(i32* %0, i32 %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%15 = load i8*, i8** %9
%16 = call i32 @strlen(i8* %15)
%17 = add nsw i32 %16, 1
store i32 %17, i32* %13
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %14
br label %19
19: ; preds = %27, %5
%20 = load i32, i32* %14
%21 = load i32, i32* %8
%22 = sdiv i32 %21, 2
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %27
27: ; preds = %24
%28 = load i32, i32* %14
%29 = add nsw i32 %28, 1
store i32 %29, i32* %14
br label %19
30: ; preds = %19
store i32 0, i32* %14
br label %31
31: ; preds = %52, %30
%32 = load i32, i32* %14
%33 = load i32, i32* %13
%34 = icmp slt i32 %32, %33
br i1 %34, label %35, label %55
35: ; preds = %31
%36 = load i32, i32* %14
%37 = icmp eq i32 %36, 0
br i1 %37, label %38, label %41
38: ; preds = %35
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0))
br label %51
41: ; preds = %35
%42 = load i32, i32* %14
%43 = load i8*, i8** %9
%44 = load i32, i32* %14
%45 = sub nsw i32 %44, 1
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds i8, i8* %43, i64 %46
%48 = load i8, i8* %47
%49 = sext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %42, i32 %49)
br label %51
51: ; preds = %41, %38
br label %52
52: ; preds = %51
%53 = load i32, i32* %14
%54 = add nsw i32 %53, 1
store i32 %54, i32* %14
br label %31
55: ; preds = %31
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %11
br label %57
57: ; preds = %110, %55
%58 = load i32, i32* %11
%59 = load i32, i32* %7
%60 = icmp slt i32 %58, %59
br i1 %60, label %61, label %113
61: ; preds = %57
%62 = load i32, i32* %11
%63 = icmp eq i32 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
br label %77
67: ; preds = %61
%68 = load i32, i32* %11
%69 = load i8*, i8** %10
%70 = load i32, i32* %11
%71 = sub nsw i32 %70, 1
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds i8, i8* %69, i64 %72
%74 = load i8, i8* %73
%75 = sext i8 %74 to i32
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), i32 %68, i32 %75)
br label %77
77: ; preds = %67, %64
store i32 0, i32* %14
br label %78
78: ; preds = %85, %77
%79 = load i32, i32* %14
%80 = load i32, i32* %11
%81 = icmp slt i32 %79, %80
br i1 %81, label %82, label %88
82: ; preds = %78
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
br label %85
85: ; preds = %82
%86 = load i32, i32* %14
%87 = add nsw i32 %86, 1
store i32 %87, i32* %14
br label %78
88: ; preds = %78
store i32 0, i32* %12
br label %89
89: ; preds = %105, %88
%90 = load i32, i32* %12
%91 = load i32, i32* %8
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %108
93: ; preds = %89
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%95 = load i32*, i32** %6
%96 = load i32, i32* %11
%97 = load i32, i32* %8
%98 = mul nsw i32 %96, %97
%99 = load i32, i32* %12
%100 = add nsw i32 %98, %99
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds i32, i32* %95, i64 %101
%103 = load i32, i32* %102
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %103)
br label %105
105: ; preds = %93
%106 = load i32, i32* %12
%107 = add nsw i32 %106, 1
store i32 %107, i32* %12
br label %89
108: ; preds = %89
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
br label %110
110: ; preds = %108
%111 = load i32, i32* %11
%112 = add nsw i32 %111, 1
store i32 %112, i32* %11
br label %57
113: ; preds = %57
ret void
}

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