#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ close(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ makeheader(int /*<<< orphan*/ *, char *, char *, char *);
int /*<<< orphan*/ sprintf(char *, char *, int);
void make_general_hdl(int n) {
  FILE *fd;
  char buf[20];
  int i, j;
  sprintf(buf, "hdl/ks%d.v", n);
  fd = fopen(buf, "w");
  makeheader(fd, buf, "Karatsuba Multiplier", "general.c");
  fprintf(fd, "`ifndef __KS_%d_V__\n", n);
  fprintf(fd, "`define __KS_%d_V__\n\n", n);
  fprintf(fd, "module ks%d(a, b, d);\n\n", n);
  fprintf(fd, "input wire [0:%d] a;\n", n - 1);
  fprintf(fd, "input wire [0:%d] b;\n", n - 1);
  fprintf(fd, "output wire [0:%d] d;\n\n", 2 * n - 2);
  fprintf(fd, "wire ");
  for (i = 0; i < n - 1; ++i)
    fprintf(fd, "m%d, ", i);
  fprintf(fd, "m%d;\n", n - 1);
  for (i = 0; i < n - 1; ++i) {
    fprintf(fd, "wire ");
    for (j = i + 1; j < n - 1; ++j) {
      fprintf(fd, "m%d_%d, ", i, j);
    }
    fprintf(fd, "m%d_%d;\n", i, n - 1);
  }
  for (i = 0; i < n; ++i)
    fprintf(fd, "assign m%d = a[%d] & b[%d];\n", i, i, i);
  for (i = 0; i < n; ++i) {
    for (j = i + 1; j < n; ++j) {
      fprintf(fd, "assign m%d_%d = (a[%d] ^ a[%d]) & (b[%d] ^ b[%d]);\n", i, j,
              i, j, i, j);
    }
  }
  for (i = 0; i < n; ++i) {
    fprintf(fd, "assign d[%d] = ", i);
    for (j = 0; j < i; ++j) {
      if (j >= i - j)
        continue;
      fprintf(fd, "m%d_%d ^ ", j, i - j);
    }
    for (j = 0; j < i; ++j) {
      fprintf(fd, "m%d ^ ", j);
    }
    fprintf(fd, "m%d;\n", i);
  }
  for (i = n; i < 2 * n - 1; ++i) {
    fprintf(fd, "assign d[%d] = ", i);
    for (j = i - n + 1; j < i; ++j) {
      if (j >= i - j)
        break;
      fprintf(fd, "m%d_%d ^ ", j, i - j);
    }
    for (j = i - n + 1; j < n - 1; ++j) {
      fprintf(fd, "m%d ^ ", j);
    }
    fprintf(fd, "m%d;\n", n - 1);
  }
  fprintf(fd, "endmodule\n");
  fprintf(fd, "`endif\n");
  close(fd);
}


x86 assembly (clang, -O0):
<make_general_hdl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe97(%rip),%rsi
call   1060 <sprintf@plt>
lea    -0x30(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    0xe7c(%rip),%rdx
lea    0xe8a(%rip),%rcx
call   1070 <makeheader@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xe82(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
shl    $0x1,%edx
sub    $0x2,%edx
lea    0xe7b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1274 <make_general_hdl+0x124>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xe5a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1240 <make_general_hdl+0xf0>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xe3a(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    131f <make_general_hdl+0x1cf>
mov    -0x10(%rbp),%rdi
lea    0xe04(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    12f6 <make_general_hdl+0x1a6>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
lea    0xde4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12bf <make_general_hdl+0x16f>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
lea    0xdc4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1293 <make_general_hdl+0x143>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    135c <make_general_hdl+0x20c>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%r8d
lea    0xd90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1326 <make_general_hdl+0x1d6>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13d4 <make_general_hdl+0x284>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    13c1 <make_general_hdl+0x271>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r10d
mov    -0x38(%rbp),%eax
lea    0xd50(%rip),%rsi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1378 <make_general_hdl+0x228>
jmp    13c6 <make_general_hdl+0x276>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1363 <make_general_hdl+0x213>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    14a7 <make_general_hdl+0x357>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xd33(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    144e <make_general_hdl+0x2fe>
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
cmp    %ecx,%eax
jl     1425 <make_general_hdl+0x2d5>
jmp    1440 <make_general_hdl+0x2f0>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
lea    0xcff(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1403 <make_general_hdl+0x2b3>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1484 <make_general_hdl+0x334>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xcd3(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1455 <make_general_hdl+0x305>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xc2d(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13db <make_general_hdl+0x28b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    -0x4(%rbp),%ecx
shl    $0x1,%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1593 <make_general_hdl+0x443>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%edx
lea    0xc59(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    152d <make_general_hdl+0x3dd>
mov    -0x38(%rbp),%eax
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
cmp    %ecx,%eax
jl     1504 <make_general_hdl+0x3b4>
jmp    152d <make_general_hdl+0x3dd>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%edx
mov    -0x34(%rbp),%ecx
sub    -0x38(%rbp),%ecx
lea    0xc20(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    14e2 <make_general_hdl+0x392>
mov    -0x34(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    156d <make_general_hdl+0x41d>
mov    -0x10(%rbp),%rdi
mov    -0x38(%rbp),%edx
lea    0xbea(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1539 <make_general_hdl+0x3e9>
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sub    $0x1,%edx
lea    0xb41(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    14ad <make_general_hdl+0x35d>
mov    -0x10(%rbp),%rdi
lea    0xbab(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
lea    0xba4(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <close@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_general_hdl>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %edi,%r15d
lea    0xe88(%rip),%rsi
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15d,%edx
call   1060 <sprintf@plt>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
call   1050 <fopen@plt>
mov    %rax,%r14
lea    0xe6c(%rip),%rdx
lea    0xe7a(%rip),%rcx
mov    %rax,%rdi
mov    %rbx,%rsi
call   1080 <makeheader@plt>
lea    0xe72(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe73(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe75(%rip),%rsi
mov    %r14,%rdi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    -0x1(%r15),%ebx
lea    0xe75(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe78(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    (%r15,%r15,1),%edx
add    $0xfffffffe,%edx
lea    0xe74(%rip),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    0xe7b(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
cmp    $0x2,%r15d
mov    %r15,0x8(%rsp)
mov    %ebx,0x4(%rsp)
jl     1336 <make_general_hdl+0x1d6>
lea    0xe55(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r12,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1270 <make_general_hdl+0x110>
lea    0xe32(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0x2,%r15d
jl     1349 <make_general_hdl+0x1e9>
mov    $0x2,%r15d
sub    0x8(%rsp),%r15d
lea    0xe10(%rip),%r13
xor    %ebp,%ebp
jmp    12e1 <make_general_hdl+0x181>
nopl   0x0(%rax)
mov    %r14,%rdi
lea    0xe04(%rip),%rsi
mov    %ebp,%edx
mov    0x4(%rsp),%ebx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r12d,%ebp
cmp    %ebx,%r12d
je     1349 <make_general_hdl+0x1e9>
mov    $0x5,%esi
mov    $0x1,%edx
lea    0xdc1(%rip),%rdi
mov    %r14,%rcx
call   1070 <fwrite@plt>
lea    0x1(%rbp),%r12d
cmp    %ebx,%r12d
jge    12c0 <make_general_hdl+0x160>
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r13,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    (%r15,%rbx,1),%eax
add    $0x1,%eax
mov    %ebx,%ecx
add    $0x1,%ecx
mov    %ecx,%ebx
cmp    $0x1,%eax
jne    1310 <make_general_hdl+0x1b0>
jmp    12c0 <make_general_hdl+0x160>
lea    0xd82(%rip),%rsi
mov    %r14,%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x8(%rsp),%r13
lea    0x0(%r13,%r13,1),%eax
mov    %eax,(%rsp)
test   %r13d,%r13d
jle    14bc <make_general_hdl+0x35c>
lea    0xd71(%rip),%rbx
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    %ebp,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%ebp
cmp    %ebp,%r13d
jne    1370 <make_general_hdl+0x210>
test   %r13d,%r13d
jle    14bc <make_general_hdl+0x35c>
lea    0xd58(%rip),%r15
xor    %r12d,%r12d
jmp    13b5 <make_general_hdl+0x255>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %r13d,%r12d
je     13f7 <make_general_hdl+0x297>
mov    %r12d,%ebp
lea    0x1(%rbp),%r12d
cmp    %r13d,%r12d
jge    13b0 <make_general_hdl+0x250>
mov    %r12d,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
xor    %eax,%eax
push   %rbx
push   %rbp
call   1040 <fprintf@plt>
add    $0x10,%rsp
add    $0x1,%ebx
cmp    %ebx,%r13d
jne    13d0 <make_general_hdl+0x270>
jmp    13b0 <make_general_hdl+0x250>
test   %r13d,%r13d
jle    14bc <make_general_hdl+0x35c>
lea    0xd3b(%rip),%r15
xor    %r12d,%r12d
jmp    1431 <make_general_hdl+0x2d1>
nopl   0x0(%rax)
mov    %r14,%rdi
lea    0xca5(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r12d
cmp    %r13d,%r12d
je     14bc <make_general_hdl+0x35c>
mov    %r14,%rdi
lea    0xced(%rip),%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %r12d,%r12d
je     1410 <make_general_hdl+0x2b0>
xor    %ebp,%ebp
mov    %r12d,%r13d
lea    0xce2(%rip),%rbx
jmp    1469 <make_general_hdl+0x309>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0xffffffff,%r13d
je     1490 <make_general_hdl+0x330>
cmp    %r13d,%ebp
jge    1460 <make_general_hdl+0x300>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    1460 <make_general_hdl+0x300>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r12d,%r12d
mov    0x8(%rsp),%r13
je     1410 <make_general_hdl+0x2b0>
xor    %ebx,%ebx
mov    %r14,%rdi
mov    %r15,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%ebx
cmp    %ebx,%r12d
jne    14a0 <make_general_hdl+0x340>
jmp    1410 <make_general_hdl+0x2b0>
mov    (%rsp),%eax
add    $0xffffffff,%eax
mov    %eax,(%rsp)
cmp    %r13d,%eax
jle    15aa <make_general_hdl+0x44a>
mov    $0x2,%ebp
sub    %r13d,%ebp
mov    %r13d,%r15d
jmp    1507 <make_general_hdl+0x3a7>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
lea    0xbd5(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r15d
cmp    (%rsp),%r15d
mov    0x8(%rsp),%r13
je     15aa <make_general_hdl+0x44a>
mov    %r14,%rdi
lea    0xc17(%rip),%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    %r15d,%r12d
sub    %r13d,%r12d
add    $0x1,%r12d
cmp    %r12d,%r15d
jle    1564 <make_general_hdl+0x404>
mov    0x4(%rsp),%ebx
mov    %r12d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
cmp    %ebx,%r13d
jge    1564 <make_general_hdl+0x404>
mov    %r14,%rdi
lea    0xbe9(%rip),%rsi
mov    %r13d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <fprintf@plt>
add    $0x1,%r13d
add    $0xffffffff,%ebx
jne    1540 <make_general_hdl+0x3e0>
mov    0x4(%rsp),%r13d
cmp    %r13d,%r12d
lea    0xbcf(%rip),%rbx
jge    14e0 <make_general_hdl+0x380>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12d,%edx
xor    %eax,%eax
call   1040 <fprintf@plt>
lea    (%r12,%rbp,1),%eax
add    $0x1,%eax
mov    %r12d,%ecx
add    $0x1,%ecx
mov    %ecx,%r12d
cmp    $0x1,%eax
jne    1580 <make_general_hdl+0x420>
jmp    14e0 <make_general_hdl+0x380>
lea    0xb98(%rip),%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
lea    0xb8a(%rip),%rdi
mov    $0x7,%esi
mov    $0x1,%edx
mov    %r14,%rcx
call   1070 <fwrite@plt>
mov    %r14,%rdi
call   1030 <close@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"hdl/ks%d.v\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"Karatsuba Multiplier\00"
@.str.3 = [10 x i8] c"general.c\00"
@.str.4 = [21 x i8] c"`ifndef __KS_%d_V__\0A\00"
@.str.5 = [22 x i8] c"`define __KS_%d_V__\0A\0A\00"
@.str.6 = [24 x i8] c"module ks%d(a, b, d);\0A\0A\00"
@.str.7 = [22 x i8] c"input wire [0:%d] a;\0A\00"
@.str.8 = [22 x i8] c"input wire [0:%d] b;\0A\00"
@.str.9 = [24 x i8] c"output wire [0:%d] d;\0A\0A\00"
@.str.10 = [6 x i8] c"wire \00"
@.str.11 = [6 x i8] c"m%d, \00"
@.str.12 = [6 x i8] c"m%d;\0A\00"
@.str.13 = [9 x i8] c"m%d_%d, \00"
@.str.14 = [9 x i8] c"m%d_%d;\0A\00"
@.str.15 = [29 x i8] c"assign m%d = a[%d] & b[%d];\0A\00"
@.str.16 = [52 x i8] c"assign m%d_%d = (a[%d] ^ a[%d]) & (b[%d] ^ b[%d]);\0A\00"
@.str.17 = [16 x i8] c"assign d[%d] = \00"
@.str.18 = [10 x i8] c"m%d_%d ^ \00"
@.str.19 = [7 x i8] c"m%d ^ \00"
@.str.20 = [11 x i8] c"endmodule\0A\00"
@.str.21 = [8 x i8] c"`endif\0A\00"
define void @make_general_hdl(i32 %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca [20 x i8]
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%11 = call i32* @fopen(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %11, i32** %3
%12 = load i32*, i32** %3
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%14 = call i32 @makeheader(i32* %12, i8* %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%15 = load i32*, i32** %3
%16 = load i32, i32* %2
%17 = call i32 (i32*, i8*, ...) @fprintf(i32* %15, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %16)
%18 = load i32*, i32** %3
%19 = load i32, i32* %2
%20 = call i32 (i32*, i8*, ...) @fprintf(i32* %18, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = load i32*, i32** %3
%22 = load i32, i32* %2
%23 = call i32 (i32*, i8*, ...) @fprintf(i32* %21, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %22)
%24 = load i32*, i32** %3
%25 = load i32, i32* %2
%26 = sub nsw i32 %25, 1
%27 = call i32 (i32*, i8*, ...) @fprintf(i32* %24, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = load i32*, i32** %3
%29 = load i32, i32* %2
%30 = sub nsw i32 %29, 1
%31 = call i32 (i32*, i8*, ...) @fprintf(i32* %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i32 %30)
%32 = load i32*, i32** %3
%33 = load i32, i32* %2
%34 = mul nsw i32 2, %33
%35 = sub nsw i32 %34, 2
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %32, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %35)
%37 = load i32*, i32** %3
%38 = call i32 (i32*, i8*, ...) @fprintf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
store i32 0, i32* %5
br label %39
39: ; preds = %48, %1
%40 = load i32, i32* %5
%41 = load i32, i32* %2
%42 = sub nsw i32 %41, 1
%43 = icmp slt i32 %40, %42
br i1 %43, label %44, label %51
44: ; preds = %39
%45 = load i32*, i32** %3
%46 = load i32, i32* %5
%47 = call i32 (i32*, i8*, ...) @fprintf(i32* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %44
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %39
51: ; preds = %39
%52 = load i32*, i32** %3
%53 = load i32, i32* %2
%54 = sub nsw i32 %53, 1
%55 = call i32 (i32*, i8*, ...) @fprintf(i32* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %54)
store i32 0, i32* %5
br label %56
56: ; preds = %85, %51
%57 = load i32, i32* %5
%58 = load i32, i32* %2
%59 = sub nsw i32 %58, 1
%60 = icmp slt i32 %57, %59
br i1 %60, label %61, label %88
61: ; preds = %56
%62 = load i32*, i32** %3
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %62, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0))
%64 = load i32, i32* %5
%65 = add nsw i32 %64, 1
store i32 %65, i32* %6
br label %66
66: ; preds = %76, %61
%67 = load i32, i32* %6
%68 = load i32, i32* %2
%69 = sub nsw i32 %68, 1
%70 = icmp slt i32 %67, %69
br i1 %70, label %71, label %79
71: ; preds = %66
%72 = load i32*, i32** %3
%73 = load i32, i32* %5
%74 = load i32, i32* %6
%75 = call i32 (i32*, i8*, ...) @fprintf(i32* %72, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32 %73, i32 %74)
br label %76
76: ; preds = %71
%77 = load i32, i32* %6
%78 = add nsw i32 %77, 1
store i32 %78, i32* %6
br label %66
79: ; preds = %66
%80 = load i32*, i32** %3
%81 = load i32, i32* %5
%82 = load i32, i32* %2
%83 = sub nsw i32 %82, 1
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %81, i32 %83)
br label %85
85: ; preds = %79
%86 = load i32, i32* %5
%87 = add nsw i32 %86, 1
store i32 %87, i32* %5
br label %56
88: ; preds = %56
store i32 0, i32* %5
br label %89
89: ; preds = %99, %88
%90 = load i32, i32* %5
%91 = load i32, i32* %2
%92 = icmp slt i32 %90, %91
br i1 %92, label %93, label %102
93: ; preds = %89
%94 = load i32*, i32** %3
%95 = load i32, i32* %5
%96 = load i32, i32* %5
%97 = load i32, i32* %5
%98 = call i32 (i32*, i8*, ...) @fprintf(i32* %94, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0), i32 %95, i32 %96, i32 %97)
br label %99
99: ; preds = %93
%100 = load i32, i32* %5
%101 = add nsw i32 %100, 1
store i32 %101, i32* %5
br label %89
102: ; preds = %89
store i32 0, i32* %5
br label %103
103: ; preds = %127, %102
%104 = load i32, i32* %5
%105 = load i32, i32* %2
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %130
107: ; preds = %103
%108 = load i32, i32* %5
%109 = add nsw i32 %108, 1
store i32 %109, i32* %6
br label %110
110: ; preds = %123, %107
%111 = load i32, i32* %6
%112 = load i32, i32* %2
%113 = icmp slt i32 %111, %112
br i1 %113, label %114, label %126
114: ; preds = %110
%115 = load i32*, i32** %3
%116 = load i32, i32* %5
%117 = load i32, i32* %6
%118 = load i32, i32* %5
%119 = load i32, i32* %6
%120 = load i32, i32* %5
%121 = load i32, i32* %6
%122 = call i32 (i32*, i8*, ...) @fprintf(i32* %115, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.16, i64 0, i64 0), i32 %116, i32 %117, i32 %118, i32 %119, i32 %120, i32 %121)
br label %123
123: ; preds = %114
%124 = load i32, i32* %6
%125 = add nsw i32 %124, 1
store i32 %125, i32* %6
br label %110
126: ; preds = %110
br label %127
127: ; preds = %126
%128 = load i32, i32* %5
%129 = add nsw i32 %128, 1
store i32 %129, i32* %5
br label %103
130: ; preds = %103
store i32 0, i32* %5
br label %131
131: ; preds = %176, %130
%132 = load i32, i32* %5
%133 = load i32, i32* %2
%134 = icmp slt i32 %132, %133
br i1 %134, label %135, label %179
135: ; preds = %131
%136 = load i32*, i32** %3
%137 = load i32, i32* %5
%138 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %137)
store i32 0, i32* %6
br label %139
139: ; preds = %157, %135
%140 = load i32, i32* %6
%141 = load i32, i32* %5
%142 = icmp slt i32 %140, %141
br i1 %142, label %143, label %160
143: ; preds = %139
%144 = load i32, i32* %6
%145 = load i32, i32* %5
%146 = load i32, i32* %6
%147 = sub nsw i32 %145, %146
%148 = icmp sge i32 %144, %147
br i1 %148, label %149, label %150
149: ; preds = %143
br label %157
150: ; preds = %143
%151 = load i32*, i32** %3
%152 = load i32, i32* %6
%153 = load i32, i32* %5
%154 = load i32, i32* %6
%155 = sub nsw i32 %153, %154
%156 = call i32 (i32*, i8*, ...) @fprintf(i32* %151, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %152, i32 %155)
br label %157
157: ; preds = %150, %149
%158 = load i32, i32* %6
%159 = add nsw i32 %158, 1
store i32 %159, i32* %6
br label %139
160: ; preds = %139
store i32 0, i32* %6
br label %161
161: ; preds = %169, %160
%162 = load i32, i32* %6
%163 = load i32, i32* %5
%164 = icmp slt i32 %162, %163
br i1 %164, label %165, label %172
165: ; preds = %161
%166 = load i32*, i32** %3
%167 = load i32, i32* %6
%168 = call i32 (i32*, i8*, ...) @fprintf(i32* %166, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 %167)
br label %169
169: ; preds = %165
%170 = load i32, i32* %6
%171 = add nsw i32 %170, 1
store i32 %171, i32* %6
br label %161
172: ; preds = %161
%173 = load i32*, i32** %3
%174 = load i32, i32* %5
%175 = call i32 (i32*, i8*, ...) @fprintf(i32* %173, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %174)
br label %176
176: ; preds = %172
%177 = load i32, i32* %5
%178 = add nsw i32 %177, 1
store i32 %178, i32* %5
br label %131
179: ; preds = %131
%180 = load i32, i32* %2
store i32 %180, i32* %5
br label %181
181: ; preds = %238, %179
%182 = load i32, i32* %5
%183 = load i32, i32* %2
%184 = mul nsw i32 2, %183
%185 = sub nsw i32 %184, 1
%186 = icmp slt i32 %182, %185
br i1 %186, label %187, label %241
187: ; preds = %181
%188 = load i32*, i32** %3
%189 = load i32, i32* %5
%190 = call i32 (i32*, i8*, ...) @fprintf(i32* %188, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %189)
%191 = load i32, i32* %5
%192 = load i32, i32* %2
%193 = sub nsw i32 %191, %192
%194 = add nsw i32 %193, 1
store i32 %194, i32* %6
br label %195
195: ; preds = %213, %187
%196 = load i32, i32* %6
%197 = load i32, i32* %5
%198 = icmp slt i32 %196, %197
br i1 %198, label %199, label %216
199: ; preds = %195
%200 = load i32, i32* %6
%201 = load i32, i32* %5
%202 = load i32, i32* %6
%203 = sub nsw i32 %201, %202
%204 = icmp sge i32 %200, %203
br i1 %204, label %205, label %206
205: ; preds = %199
br label %216
206: ; preds = %199
%207 = load i32*, i32** %3
%208 = load i32, i32* %6
%209 = load i32, i32* %5
%210 = load i32, i32* %6
%211 = sub nsw i32 %209, %210
%212 = call i32 (i32*, i8*, ...) @fprintf(i32* %207, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %208, i32 %211)
br label %213
213: ; preds = %206
%214 = load i32, i32* %6
%215 = add nsw i32 %214, 1
store i32 %215, i32* %6
br label %195
216: ; preds = %205, %195
%217 = load i32, i32* %5
%218 = load i32, i32* %2
%219 = sub nsw i32 %217, %218
%220 = add nsw i32 %219, 1
store i32 %220, i32* %6
br label %221
221: ; preds = %230, %216
%222 = load i32, i32* %6
%223 = load i32, i32* %2
%224 = sub nsw i32 %223, 1
%225 = icmp slt i32 %222, %224
br i1 %225, label %226, label %233
226: ; preds = %221
%227 = load i32*, i32** %3
%228 = load i32, i32* %6
%229 = call i32 (i32*, i8*, ...) @fprintf(i32* %227, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 %228)
br label %230
230: ; preds = %226
%231 = load i32, i32* %6
%232 = add nsw i32 %231, 1
store i32 %232, i32* %6
br label %221
233: ; preds = %221
%234 = load i32*, i32** %3
%235 = load i32, i32* %2
%236 = sub nsw i32 %235, 1
%237 = call i32 (i32*, i8*, ...) @fprintf(i32* %234, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %236)
br label %238
238: ; preds = %233
%239 = load i32, i32* %5
%240 = add nsw i32 %239, 1
store i32 %240, i32* %5
br label %181
241: ; preds = %181
%242 = load i32*, i32** %3
%243 = call i32 (i32*, i8*, ...) @fprintf(i32* %242, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
%244 = load i32*, i32** %3
%245 = call i32 (i32*, i8*, ...) @fprintf(i32* %244, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%246 = load i32*, i32** %3
%247 = call i32 @close(i32* %246)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"hdl/ks%d.v\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [21 x i8] c"Karatsuba Multiplier\00"
@.str.3 = [10 x i8] c"general.c\00"
@.str.4 = [21 x i8] c"`ifndef __KS_%d_V__\0A\00"
@.str.5 = [22 x i8] c"`define __KS_%d_V__\0A\0A\00"
@.str.6 = [24 x i8] c"module ks%d(a, b, d);\0A\0A\00"
@.str.7 = [22 x i8] c"input wire [0:%d] a;\0A\00"
@.str.8 = [22 x i8] c"input wire [0:%d] b;\0A\00"
@.str.9 = [24 x i8] c"output wire [0:%d] d;\0A\0A\00"
@.str.10 = [6 x i8] c"wire \00"
@.str.11 = [6 x i8] c"m%d, \00"
@.str.12 = [6 x i8] c"m%d;\0A\00"
@.str.13 = [9 x i8] c"m%d_%d, \00"
@.str.14 = [9 x i8] c"m%d_%d;\0A\00"
@.str.15 = [29 x i8] c"assign m%d = a[%d] & b[%d];\0A\00"
@.str.16 = [52 x i8] c"assign m%d_%d = (a[%d] ^ a[%d]) & (b[%d] ^ b[%d]);\0A\00"
@.str.17 = [16 x i8] c"assign d[%d] = \00"
@.str.18 = [10 x i8] c"m%d_%d ^ \00"
@.str.19 = [7 x i8] c"m%d ^ \00"
@.str.20 = [11 x i8] c"endmodule\0A\00"
@.str.21 = [8 x i8] c"`endif\0A\00"
define void @make_general_hdl(i32 %0) {
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32* @fopen(i8* %3, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = call i32 @makeheader(i32* %5, i8* %3, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.4, i64 0, i64 0), i32 %0)
%8 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %0)
%9 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i32 %0)
%10 = add nsw i32 %0, -1
%11 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i32 %10)
%12 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i32 %10)
%13 = shl nsw i32 %0, 1
%14 = add nsw i32 %13, -2
%15 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0), i32 %14)
%16 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i64 5, i64 1, i32* %5)
%17 = icmp sgt i32 %0, 1
br i1 %17, label %20, label %18
18: ; preds = %1
%19 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %10)
br label %27
20: ; preds = %1, %20
%21 = phi i32 [ %23, %20 ], [ 0, %1 ]
%22 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %21)
%23 = add nuw nsw i32 %21, 1
%24 = icmp eq i32 %23, %10
br i1 %24, label %25, label %20
25: ; preds = %20
%26 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %10)
br i1 %17, label %29, label %27
27: ; preds = %39, %18, %25
%28 = icmp sgt i32 %0, 0
br i1 %28, label %43, label %60
29: ; preds = %25, %39
%30 = phi i32 [ %32, %39 ], [ 0, %25 ]
%31 = call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.10, i64 0, i64 0), i64 5, i64 1, i32* %5)
%32 = add nuw nsw i32 %30, 1
%33 = icmp slt i32 %32, %10
br i1 %33, label %34, label %39
34: ; preds = %29, %34
%35 = phi i32 [ %37, %34 ], [ %32, %29 ]
%36 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.13, i64 0, i64 0), i32 %30, i32 %35)
%37 = add nuw i32 %35, 1
%38 = icmp eq i32 %37, %10
br i1 %38, label %39, label %34
39: ; preds = %34, %29
%40 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.14, i64 0, i64 0), i32 %30, i32 %10)
%41 = icmp eq i32 %32, %10
br i1 %41, label %27, label %29
42: ; preds = %43
br i1 %28, label %51, label %60
43: ; preds = %27, %43
%44 = phi i32 [ %46, %43 ], [ 0, %27 ]
%45 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.15, i64 0, i64 0), i32 %44, i32 %44, i32 %44)
%46 = add nuw nsw i32 %44, 1
%47 = icmp eq i32 %46, %0
br i1 %47, label %42, label %43
48: ; preds = %55, %51
%49 = icmp eq i32 %53, %0
br i1 %49, label %50, label %51
50: ; preds = %48
br i1 %28, label %63, label %60
51: ; preds = %42, %48
%52 = phi i32 [ %53, %48 ], [ 0, %42 ]
%53 = add nuw nsw i32 %52, 1
%54 = icmp slt i32 %53, %0
br i1 %54, label %55, label %48
55: ; preds = %51, %55
%56 = phi i32 [ %58, %55 ], [ %53, %51 ]
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.16, i64 0, i64 0), i32 %52, i32 %56, i32 %52, i32 %56, i32 %52, i32 %56)
%58 = add nuw i32 %56, 1
%59 = icmp eq i32 %58, %0
br i1 %59, label %48, label %55
60: ; preds = %82, %27, %42, %50
%61 = add i32 %13, -1
%62 = icmp sgt i32 %61, %0
br i1 %62, label %86, label %111
63: ; preds = %50, %82
%64 = phi i32 [ %84, %82 ], [ 0, %50 ]
%65 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %64)
%66 = icmp eq i32 %64, 0
br i1 %66, label %82, label %68
67: ; preds = %74
br i1 %66, label %82, label %77
68: ; preds = %63, %74
%69 = phi i32 [ %75, %74 ], [ 0, %63 ]
%70 = sub nsw i32 %64, %69
%71 = icmp slt i32 %69, %70
br i1 %71, label %72, label %74
72: ; preds = %68
%73 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %69, i32 %70)
br label %74
74: ; preds = %68, %72
%75 = add nuw nsw i32 %69, 1
%76 = icmp eq i32 %75, %64
br i1 %76, label %67, label %68
77: ; preds = %67, %77
%78 = phi i32 [ %80, %77 ], [ 0, %67 ]
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 %78)
%80 = add nuw nsw i32 %78, 1
%81 = icmp eq i32 %80, %64
br i1 %81, label %82, label %77
82: ; preds = %77, %63, %67
%83 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %64)
%84 = add nuw nsw i32 %64, 1
%85 = icmp eq i32 %84, %0
br i1 %85, label %60, label %63
86: ; preds = %60, %107
%87 = phi i32 [ %109, %107 ], [ %0, %60 ]
%88 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.17, i64 0, i64 0), i32 %87)
%89 = sub nsw i32 %87, %0
%90 = add nsw i32 %89, 1
%91 = icmp sgt i32 %87, %90
br i1 %91, label %92, label %100
92: ; preds = %86, %96
%93 = phi i32 [ %98, %96 ], [ %90, %86 ]
%94 = sub nsw i32 %87, %93
%95 = icmp slt i32 %93, %94
br i1 %95, label %96, label %100
96: ; preds = %92
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0), i32 %93, i32 %94)
%98 = add nsw i32 %93, 1
%99 = icmp eq i32 %98, %87
br i1 %99, label %100, label %92
100: ; preds = %96, %92, %86
%101 = icmp slt i32 %90, %10
br i1 %101, label %102, label %107
102: ; preds = %100, %102
%103 = phi i32 [ %105, %102 ], [ %90, %100 ]
%104 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.19, i64 0, i64 0), i32 %103)
%105 = add i32 %103, 1
%106 = icmp eq i32 %105, %10
br i1 %106, label %107, label %102
107: ; preds = %102, %100
%108 = call i32 (i32*, i8*, ...) @fprintf(i32* %5, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 %10)
%109 = add i32 %87, 1
%110 = icmp eq i32 %109, %61
br i1 %110, label %111, label %86
111: ; preds = %107, %60
%112 = call i64 @fwrite(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0), i64 10, i64 1, i32* %5)
%113 = call i64 @fwrite(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0), i64 7, i64 1, i32* %5)
%114 = call i32 @close(i32* %5)
ret void
}