#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 scalar_t__ uint32_t;

/* Variables and functions */
unsigned long atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int main(int argc, char *argv[]) {
  unsigned long i;
  unsigned long w, K, CHOP, REM, fn;
  unsigned long MASK, mask2;
  if (argc != 3) {
    fprintf(stderr, "Usage: %s <wordsize> k\n", argv[0]);
    exit(1);
  }
  w = atoi(argv[1]);
  K = atoi(argv[2]);
  printf(
      "/* This file is part of the gf2x library.\n"
      "\n"
      "   Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013\n"
      "   Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann\n"
      "\n"
      "   This program is free software; you can redistribute it and/or modify "
      "it\n"
      "   under the terms of either:\n"
      "    - If the archive contains a file named toom-gpl.c (not a trivial\n"
      "    placeholder), the GNU General Public License as published by the "
      "Free\n"
      "    Software Foundation; either version 3 of the License, or (at your\n"
      "    option) any later version.\n"
      "    - If the archive contains a file named toom-gpl.c which is a "
      "trivial\n"
      "    placeholder, the GNU Lesser General Public License as published by\n"
      "    the Free Software Foundation; either version 2.1 of the License, "
      "or\n"
      "    (at your option) any later version.\n"
      "\n"
      "   This program is distributed in the hope that it will be useful, but "
      "WITHOUT\n"
      "   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY "
      "or\n"
      "   FITNESS FOR A PARTICULAR PURPOSE.  See the license text for more "
      "details.\n"
      "\n"
      "   You should have received a copy of the GNU General Public License "
      "as\n"
      "   well as the GNU Lesser General Public License along with this "
      "program;\n"
      "   see the files COPYING and COPYING.LIB.  If not, write to the Free\n"
      "   Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n"
      "   02110-1301, USA.\n"
      "*/\n"
      "\n");
  printf("#ifndef GF2X_MUL1_H_\n");
  printf("#define GF2X_MUL1_H_\n");
  printf("\n");
  printf("/* This file was generated automatically with\n");
  printf("   %s %lu %lu. Don't edit it! */\n", argv[0], w, K);
  printf("\n");
  printf("#include \"gf2x.h\"\n"
         "/* All gf2x source files for lowlevel functions must include "
         "gf2x-small.h\n"
         " * This is mandatory for the tuning mechanism. */\n"
         "#include \"gf2x/gf2x-small.h\"\n"
         "\n");
  for (fn = 0; fn < 3; fn++) {
    if (fn == 0) {
      printf("GF2X_STORAGE_CLASS_mul1 void\n");
      printf(
          "gf2x_mul1 (unsigned long *c, unsigned long a, unsigned long b)\n");
    } else if (fn == 1) {
      printf("GF2X_STORAGE_CLASS_mul_1_n unsigned long\n");
      printf("gf2x_mul_1_n (unsigned long *cp, const unsigned long *bp, long "
             "sb, unsigned long a)\n");
    } else if (fn == 2) {
      printf("GF2X_STORAGE_CLASS_addmul_1_n unsigned long\n");
      printf("gf2x_addmul_1_n (unsigned long *dp, const unsigned long *cp, "
             "const unsigned long* bp, long sb,\n");
      printf("        unsigned long a)\n");
    }
    printf("{\n");
    if (fn > 0) {
      printf("   long i;\n");
      printf("   unsigned long carry = 0, b;\n");
    }
    printf("   unsigned long hi, lo, tmp, A[%lu];\n", 1UL << K);
    printf("\n");
    printf("   A[0] = 0;\t\t");
    printf("A[1] = a;\n");
    for (i = 2u; i < (1u << K); i++) {
      if (i % 2 == 0)
        printf("   A[%lu] = A[%lu] << 1;\t", i, i / 2);
      else
        printf("A[%lu] = A[%lu] ^ a;\n", i, i - 1);
    }
    printf("\n");
    if (fn > 0) {
      printf("   for (i = 0; i < sb; i++)\n");
      printf("     {\n");
      printf("       b = bp[i];\n");
    }
    REM = w - 2 * K;
    MASK = (1UL << K) - 1UL;
    for (CHOP = 0; CHOP + 2 * K < w; CHOP += 2 * K)
      ;
    CHOP = w - CHOP;
    if (CHOP <= K)
      printf("   lo = A[b >> %lu];\n", w - CHOP);
    else
      printf("   lo = (A[b >> %lu] << %lu) ^ A[(b >> %lu) & %lu];\n",
             w - (CHOP - K), K, w - CHOP, MASK);
    printf("   hi = lo >> %lu;\n", w - 2 * K);
    for (i = w - CHOP - 2 * K; i >= 2 * K; i -= 2 * K) {
      printf("   lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[(b >> "
             "%lu) & %lu];\n",
             2 * K, i + K, MASK, K, i, MASK);
      printf("   hi = (hi << %lu) | (lo >> %lu);\n", 2 * K, REM);
    }
    printf("   lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[b & %lu];\n",
           2 * K, K, MASK, K, MASK);
    MASK = 0;
    for (i = 0; i < w; i += 2 * K)
      MASK |= 1UL << i;
    MASK = ~MASK;
    mask2 = MASK;
    printf("\n");
    for (i = 1; i < 2 * K; i++) {
      printf("   tmp = -((a >> %lu) & 1);\n", w - i);
      if (w == 32) {
        mask2 = (unsigned long)(uint32_t)mask2;
      }
      printf("   tmp &= ((b & 0x%lx) >> %lu);\n", mask2, i);
      printf("   hi = hi ^ tmp;\n");
      mask2 = (mask2 << 1) & MASK;
    }
    printf("\n");
    if (fn == 0) {
      printf("   c[0] = lo;\n");
      printf("   c[1] = hi;\n");
    } else if (fn == 1) {
      printf("   cp[i] = carry ^ lo;\n");
      printf("   carry = hi;\n");
    } else if (fn == 2) {
      printf("   dp[i] = cp[i] ^ (carry ^ lo);\n");
      printf("   carry = hi;\n");
    }
    if (fn > 0) {
      printf("    }\n");
      printf("   return carry;\n");
    }
    printf("}\n\n");
  }
  printf("#endif\t/* GF2X_MUL1_H_ */\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1186 <main+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe89(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1060 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %rax,-0x28(%rbp)
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x137b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1383(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1487(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x137d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x28(%rbp),%rcx
lea    0x138f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x144e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1395(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x40(%rbp)
cmpq   $0x3,-0x40(%rbp)
jae    177a <main+0x63a>
cmpq   $0x0,-0x40(%rbp)
jne    1266 <main+0x126>
lea    0x1416(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1426(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d1 <main+0x191>
cmpq   $0x1,-0x40(%rbp)
jne    1292 <main+0x152>
lea    0x1448(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1464(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x18c>
cmpq   $0x2,-0x40(%rbp)
jne    12c7 <main+0x187>
lea    0x149b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x14ba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x150c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x18c>
jmp    12d1 <main+0x191>
lea    0x15cd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jbe    1306 <main+0x1c6>
lea    0x14f5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x14f3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
shl    %cl,%rsi
lea    0x14f9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1339(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1504(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1505(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
mov    %ecx,%ecx
cmp    %rcx,%rax
jae    13cf <main+0x28f>
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    139f <main+0x25f>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shr    $0x1,%rdx
lea    0x14c0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13b9 <main+0x279>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
lea    0x14bb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13be <main+0x27e>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1352 <main+0x212>
lea    0x128a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jbe    1412 <main+0x2d2>
lea    0x1494(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x14a3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x149d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
sub    $0x1,%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
add    %rcx,%rax
cmp    -0x20(%rbp),%rax
jae    1474 <main+0x334>
jmp    145f <main+0x31f>
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1441 <main+0x301>
mov    -0x20(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     14a9 <main+0x369>
mov    -0x20(%rbp),%rsi
sub    -0x30(%rbp),%rsi
lea    0x141e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14d6 <main+0x396>
mov    -0x20(%rbp),%rsi
mov    -0x30(%rbp),%rax
sub    -0x28(%rbp),%rax
sub    %rax,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x20(%rbp),%rcx
sub    -0x30(%rbp),%rcx
mov    -0x48(%rbp),%r8
lea    0x1402(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
sub    %rax,%rsi
lea    0x141a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
cmp    %rcx,%rax
jb     1583 <main+0x443>
mov    -0x28(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x18(%rbp),%rdx
add    -0x28(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x48(%rbp),%rax
lea    0x13d4(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x38(%rbp),%rdx
lea    0x1401(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
mov    -0x18(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x18(%rbp)
jmp    150a <main+0x3ca>
mov    -0x28(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    0x13e7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x48(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    15f0 <main+0x4b0>
mov    -0x18(%rbp),%rcx
mov    $0x1,%eax
shl    %cl,%rax
or     -0x48(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    15b9 <main+0x479>
mov    -0x48(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    0x1055(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x28(%rbp),%rcx
shl    $0x1,%rcx
cmp    %rcx,%rax
jae    169d <main+0x55d>
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
lea    0x138d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x20,-0x20(%rbp)
jne    1658 <main+0x518>
mov    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x1381(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1394(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x50(%rbp),%rax
shl    $0x1,%rax
and    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    161a <main+0x4da>
lea    0xfbc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jne    16d7 <main+0x597>
lea    0x135f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1360(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1734 <main+0x5f4>
cmpq   $0x1,-0x40(%rbp)
jne    1703 <main+0x5c3>
lea    0x1351(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x135b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    172f <main+0x5ef>
cmpq   $0x2,-0x40(%rbp)
jne    172a <main+0x5ea>
lea    0x134d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x132f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    172f <main+0x5ef>
jmp    1734 <main+0x5f4>
cmpq   $0x0,-0x40(%rbp)
jbe    175b <main+0x61b>
lea    0x133e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1337(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x133b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    122f <main+0xef>
lea    0x1320(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    160d <main+0x4ad>
mov    0x8(%rbp),%rdi
call   1070 <atoi@plt>
mov    %rax,%r12
mov    0x10(%rbp),%rdi
call   1070 <atoi@plt>
mov    %rax,%rbx
lea    0x1055(%rip),%rdi
call   1040 <puts@plt>
lea    0x1568(%rip),%rdi
call   1040 <puts@plt>
lea    0x1571(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1570(%rip),%rdi
call   1040 <puts@plt>
mov    0x0(%rbp),%rsi
lea    0xe41(%rip),%rdi
mov    %r12,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1570(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edx
mov    %ebx,%ecx
shl    %cl,%rdx
mov    $0x1,%eax
shl    %cl,%eax
lea    (%rbx,%rbx,1),%r14
mov    %r12,%rsi
sub    %r14,%rsi
mov    %rdx,0x60(%rsp)
lea    -0x1(%rdx),%rcx
mov    %rcx,0x20(%rsp)
cmp    $0x4,%eax
mov    $0x3,%r15d
cmovae %eax,%r15d
mov    %r14,%rax
neg    %rax
mov    %rax,0x50(%rsp)
mov    %rbx,%rax
neg    %rax
mov    %rax,0x18(%rsp)
lea    (%r12,%rbx,2),%rax
mov    %rax,0x48(%rsp)
lea    0x0(,%rbx,4),%rax
neg    %rax
mov    %rax,0x40(%rsp)
lea    -0x1(%r12),%rax
mov    %rax,0x38(%rsp)
xor    %ebp,%ebp
mov    %r12,0x28(%rsp)
mov    %r15,0x58(%rsp)
mov    %rbx,0x8(%rsp)
mov    %rsi,0x30(%rsp)
jmp    12c1 <main+0x161>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x1656(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%rbp
cmp    $0x3,%rbp
mov    0x58(%rsp),%r15
mov    0x28(%rsp),%r12
je     15f0 <main+0x490>
lea    0x177c(%rip),%rdi
lea    0x1792(%rip),%rbx
lea    0x16b3(%rip),%r13
mov    %rbp,0x10(%rsp)
test   %rbp,%rbp
je     1332 <main+0x1d2>
lea    0x16e0(%rip),%rdi
lea    0x1702(%rip),%rbx
cmpq   $0x1,0x10(%rsp)
je     1310 <main+0x1b0>
lea    0x152e(%rip),%rdi
call   1040 <puts@plt>
lea    0x154e(%rip),%rdi
lea    0x15a6(%rip),%rbx
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x1665(%rip),%rdi
lea    0x1672(%rip),%rbx
lea    0x1676(%rip),%r13
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
lea    0xcec(%rip),%rdi
mov    0x60(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcf6(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1556(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x2,0x8(%rsp)
lea    0xce6(%rip),%r13
jb     13d0 <main+0x270>
mov    $0x2,%ebx
jmp    13be <main+0x25e>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    -0x1(%rbx),%rdx
lea    0xcdf(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
je     13d0 <main+0x270>
test   $0x1,%bl
jne    13a0 <main+0x240>
mov    %rbx,%rdx
shr    %rdx
mov    %r13,%rdi
jmp    13ab <main+0x24b>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpq   $0x0,0x10(%rsp)
je     1406 <main+0x2a6>
lea    0x157f(%rip),%rdi
call   1040 <puts@plt>
lea    0x158f(%rip),%rdi
call   1040 <puts@plt>
lea    0x158a(%rip),%rdi
call   1040 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
mov    0x8(%rsp),%rdx
nop
mov    %rbx,%rbp
add    %r14,%rax
sub    %r14,%rbx
cmp    %r12,%rax
jb     1410 <main+0x2b0>
mov    0x48(%rsp),%rax
add    %rbx,%rax
mov    0x50(%rsp),%rcx
sub    %rbx,%rcx
cmp    %rax,%rdx
jae    1450 <main+0x2f0>
mov    0x18(%rsp),%rsi
sub    %rbx,%rsi
lea    0xc74(%rip),%rdi
mov    0x20(%rsp),%r8
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1461 <main+0x301>
lea    0xc49(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc83(%rip),%rdi
mov    0x30(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x40(%rsp),%r15
sub    %rbx,%r15
cmp    %r14,%r15
mov    0x20(%rsp),%r12
lea    0xc74(%rip),%rcx
mov    0x8(%rsp),%r13
jb     14e4 <main+0x384>
mov    0x18(%rsp),%rbx
sub    %rbp,%rbx
nopw   0x0(%rax,%rax,1)
mov    %r12,(%rsp)
mov    %rcx,%rbp
mov    %rcx,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %r15,%r9
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc83(%rip),%rdi
mov    %r14,%rsi
mov    0x30(%rsp),%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rcx
sub    %r14,%r15
sub    %r14,%rbx
cmp    %r14,%r15
jae    14a0 <main+0x340>
lea    0xc83(%rip),%rdi
mov    %r14,%rsi
mov    %r13,%rdx
mov    %r12,%rcx
mov    %r13,%r8
mov    %r12,%r9
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x28(%rsp),%rcx
xor    %r13d,%r13d
test   %rcx,%rcx
je     151c <main+0x3bc>
xor    %eax,%eax
bts    %rax,%r13
add    %r14,%rax
cmp    %rcx,%rax
jb     1510 <main+0x3b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
test   %r14,%r14
lea    0xc80(%rip),%r12
je     1590 <main+0x430>
not    %r13
mov    $0x1,%ebp
mov    0x38(%rsp),%r15
mov    %r13,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc69(%rip),%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x13de(%rip),%rdi
call   1040 <puts@plt>
add    %rbx,%rbx
and    %r13,%rbx
add    $0x1,%rbp
add    $0xffffffffffffffff,%r15
cmp    %rbp,%r14
jne    1550 <main+0x3f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1399(%rip),%rdi
lea    0x13a0(%rip),%rbx
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
je     1290 <main+0x130>
cmp    $0x1,%rbp
lea    0x1318(%rip),%rdi
lea    0x134c(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0x1353(%rip),%rdi
call   1040 <puts@plt>
lea    0x1319(%rip),%rdi
lea    0x1318(%rip),%rbx
jmp    1290 <main+0x130>
lea    0x121a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x29cc(%rip),%rax
mov    (%rax),%edi
mov    0x0(%rbp),%rdx
lea    0x9df(%rip),%rsi
call   1060 <fprintf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <wordsize> k\0A\00"
@.str.1 = [1312 x i8] c"/* This file is part of the gf2x library.\0A\0A Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013\0A Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann\0A\0A This program is free software; you can redistribute it and/or modify it\0A under the terms of either:\0A - If the archive contains a file named toom-gpl.c (not a trivial\0A placeholder), the GNU General Public License as published by the Free\0A Software Foundation; either version 3 of the License, or (at your\0A option) any later version.\0A - If the archive contains a file named toom-gpl.c which is a trivial\0A placeholder, the GNU Lesser General Public License as published by\0A the Free Software Foundation; either version 2.1 of the License, or\0A (at your option) any later version.\0A\0A This program is distributed in the hope that it will be useful, but WITHOUT\0A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\0A FITNESS FOR A PARTICULAR PURPOSE. See the license text for more details.\0A\0A You should have received a copy of the GNU General Public License as\0A well as the GNU Lesser General Public License along with this program;\0A see the files COPYING and COPYING.LIB. If not, write to the Free\0A Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\0A 02110-1301, USA.\0A*/\0A\0A\00"
@.str.2 = [22 x i8] c"#ifndef GF2X_MUL1_H_\0A\00"
@.str.3 = [22 x i8] c"#define GF2X_MUL1_H_\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [47 x i8] c"/* This file was generated automatically with\0A\00"
@.str.6 = [34 x i8] c" %s %lu %lu. Don't edit it! */\0A\00"
@.str.7 = [173 x i8] c"#include \22gf2x.h\22\0A/* All gf2x source files for lowlevel functions must include gf2x-small.h\0A * This is mandatory for the tuning mechanism. */\0A#include \22gf2x/gf2x-small.h\22\0A\0A\00"
@.str.8 = [30 x i8] c"GF2X_STORAGE_CLASS_mul1 void\0A\00"
@.str.9 = [64 x i8] c"gf2x_mul1 (unsigned long *c, unsigned long a, unsigned long b)\0A\00"
@.str.10 = [42 x i8] c"GF2X_STORAGE_CLASS_mul_1_n unsigned long\0A\00"
@.str.11 = [85 x i8] c"gf2x_mul_1_n (unsigned long *cp, const unsigned long *bp, long sb, unsigned long a)\0A\00"
@.str.12 = [45 x i8] c"GF2X_STORAGE_CLASS_addmul_1_n unsigned long\0A\00"
@.str.13 = [96 x i8] c"gf2x_addmul_1_n (unsigned long *dp, const unsigned long *cp, const unsigned long* bp, long sb,\0A\00"
@.str.14 = [26 x i8] c" unsigned long a)\0A\00"
@.str.15 = [3 x i8] c"{\0A\00"
@.str.16 = [12 x i8] c" long i;\0A\00"
@.str.17 = [32 x i8] c" unsigned long carry = 0, b;\0A\00"
@.str.18 = [39 x i8] c" unsigned long hi, lo, tmp, A[%lu];\0A\00"
@.str.19 = [15 x i8] c" A[0] = 0;\09\09\00"
@.str.20 = [11 x i8] c"A[1] = a;\0A\00"
@.str.21 = [26 x i8] c" A[%lu] = A[%lu] << 1;\09\00"
@.str.22 = [22 x i8] c"A[%lu] = A[%lu] ^ a;\0A\00"
@.str.23 = [29 x i8] c" for (i = 0; i < sb; i++)\0A\00"
@.str.24 = [8 x i8] c" {\0A\00"
@.str.25 = [19 x i8] c" b = bp[i];\0A\00"
@.str.26 = [22 x i8] c" lo = A[b >> %lu];\0A\00"
@.str.27 = [53 x i8] c" lo = (A[b >> %lu] << %lu) ^ A[(b >> %lu) & %lu];\0A\00"
@.str.28 = [20 x i8] c" hi = lo >> %lu;\0A\00"
@.str.29 = [75 x i8] c" lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[(b >> %lu) & %lu];\0A\00"
@.str.30 = [36 x i8] c" hi = (hi << %lu) | (lo >> %lu);\0A\00"
@.str.31 = [66 x i8] c" lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[b & %lu];\0A\00"
@.str.32 = [29 x i8] c" tmp = -((a >> %lu) & 1);\0A\00"
@.str.33 = [33 x i8] c" tmp &= ((b & 0x%lx) >> %lu);\0A\00"
@.str.34 = [19 x i8] c" hi = hi ^ tmp;\0A\00"
@.str.35 = [15 x i8] c" c[0] = lo;\0A\00"
@.str.36 = [15 x i8] c" c[1] = hi;\0A\00"
@.str.37 = [24 x i8] c" cp[i] = carry ^ lo;\0A\00"
@.str.38 = [16 x i8] c" carry = hi;\0A\00"
@.str.39 = [34 x i8] c" dp[i] = cp[i] ^ (carry ^ lo);\0A\00"
@.str.40 = [7 x i8] c" }\0A\00"
@.str.41 = [18 x i8] c" return carry;\0A\00"
@.str.42 = [4 x i8] c"}\0A\0A\00"
@.str.43 = [27 x i8] c"#endif\09/* GF2X_MUL1_H_ */\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = load i32, i32* %4
%15 = icmp ne i32 %14, 3
br i1 %15, label %16, label %23
16: ; preds = %2
%17 = load i32, i32* @stderr
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 0
%20 = load i8*, i8** %19
%21 = call i32 @fprintf(i32 %17, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = call i32 @exit(i32 1)
unreachable
23: ; preds = %2
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i64 @atoi(i8* %26)
store i64 %27, i64* %7
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i64 @atoi(i8* %30)
store i64 %31, i64* %8
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([1312 x i8], [1312 x i8]* @.str.1, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i64 0, i64 0))
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 0
%39 = load i8*, i8** %38
%40 = load i64, i64* %7
%41 = load i64, i64* %8
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8* %39, i64 %40, i64 %41)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str.7, i64 0, i64 0))
store i64 0, i64* %11
br label %45
45: ; preds = %280, %23
%46 = load i64, i64* %11
%47 = icmp ult i64 %46, 3
br i1 %47, label %48, label %283
48: ; preds = %45
%49 = load i64, i64* %11
%50 = icmp eq i64 %49, 0
br i1 %50, label %51, label %54
51: ; preds = %48
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.9, i64 0, i64 0))
br label %69
54: ; preds = %48
%55 = load i64, i64* %11
%56 = icmp eq i64 %55, 1
br i1 %56, label %57, label %60
57: ; preds = %54
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.10, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([85 x i8], [85 x i8]* @.str.11, i64 0, i64 0))
br label %68
60: ; preds = %54
%61 = load i64, i64* %11
%62 = icmp eq i64 %61, 2
br i1 %62, label %63, label %67
63: ; preds = %60
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.12, i64 0, i64 0))
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.13, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.14, i64 0, i64 0))
br label %67
67: ; preds = %63, %60
br label %68
68: ; preds = %67, %57
br label %69
69: ; preds = %68, %51
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0))
%71 = load i64, i64* %11
%72 = icmp ugt i64 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %69
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.16, i64 0, i64 0))
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.17, i64 0, i64 0))
br label %76
76: ; preds = %73, %69
%77 = load i64, i64* %8
%78 = shl i64 1, %77
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i64 %78)
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.20, i64 0, i64 0))
store i64 2, i64* %6
br label %83
83: ; preds = %105, %76
%84 = load i64, i64* %6
%85 = load i64, i64* %8
%86 = trunc i64 %85 to i32
%87 = shl i32 1, %86
%88 = zext i32 %87 to i64
%89 = icmp ult i64 %84, %88
br i1 %89, label %90, label %108
90: ; preds = %83
%91 = load i64, i64* %6
%92 = urem i64 %91, 2
%93 = icmp eq i64 %92, 0
br i1 %93, label %94, label %99
94: ; preds = %90
%95 = load i64, i64* %6
%96 = load i64, i64* %6
%97 = udiv i64 %96, 2
%98 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0), i64 %95, i64 %97)
br label %104
99: ; preds = %90
%100 = load i64, i64* %6
%101 = load i64, i64* %6
%102 = sub i64 %101, 1
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0), i64 %100, i64 %102)
br label %104
104: ; preds = %99, %94
br label %105
105: ; preds = %104
%106 = load i64, i64* %6
%107 = add i64 %106, 1
store i64 %107, i64* %6
br label %83
108: ; preds = %83
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%110 = load i64, i64* %11
%111 = icmp ugt i64 %110, 0
br i1 %111, label %112, label %116
112: ; preds = %108
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0))
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0))
br label %116
116: ; preds = %112, %108
%117 = load i64, i64* %7
%118 = load i64, i64* %8
%119 = mul i64 2, %118
%120 = sub i64 %117, %119
store i64 %120, i64* %10
%121 = load i64, i64* %8
%122 = shl i64 1, %121
%123 = sub i64 %122, 1
store i64 %123, i64* %12
store i64 0, i64* %9
br label %124
124: ; preds = %132, %116
%125 = load i64, i64* %9
%126 = load i64, i64* %8
%127 = mul i64 2, %126
%128 = add i64 %125, %127
%129 = load i64, i64* %7
%130 = icmp ult i64 %128, %129
br i1 %130, label %131, label %137
131: ; preds = %124
br label %132
132: ; preds = %131
%133 = load i64, i64* %8
%134 = mul i64 2, %133
%135 = load i64, i64* %9
%136 = add i64 %135, %134
store i64 %136, i64* %9
br label %124
137: ; preds = %124
%138 = load i64, i64* %7
%139 = load i64, i64* %9
%140 = sub i64 %138, %139
store i64 %140, i64* %9
%141 = load i64, i64* %9
%142 = load i64, i64* %8
%143 = icmp ule i64 %141, %142
br i1 %143, label %144, label %149
144: ; preds = %137
%145 = load i64, i64* %7
%146 = load i64, i64* %9
%147 = sub i64 %145, %146
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0), i64 %147)
br label %161
149: ; preds = %137
%150 = load i64, i64* %7
%151 = load i64, i64* %9
%152 = load i64, i64* %8
%153 = sub i64 %151, %152
%154 = sub i64 %150, %153
%155 = load i64, i64* %8
%156 = load i64, i64* %7
%157 = load i64, i64* %9
%158 = sub i64 %156, %157
%159 = load i64, i64* %12
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.27, i64 0, i64 0), i64 %154, i64 %155, i64 %158, i64 %159)
br label %161
161: ; preds = %149, %144
%162 = load i64, i64* %7
%163 = load i64, i64* %8
%164 = mul i64 2, %163
%165 = sub i64 %162, %164
%166 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0), i64 %165)
%167 = load i64, i64* %7
%168 = load i64, i64* %9
%169 = sub i64 %167, %168
%170 = load i64, i64* %8
%171 = mul i64 2, %170
%172 = sub i64 %169, %171
store i64 %172, i64* %6
br label %173
173: ; preds = %193, %161
%174 = load i64, i64* %6
%175 = load i64, i64* %8
%176 = mul i64 2, %175
%177 = icmp uge i64 %174, %176
br i1 %177, label %178, label %198
178: ; preds = %173
%179 = load i64, i64* %8
%180 = mul i64 2, %179
%181 = load i64, i64* %6
%182 = load i64, i64* %8
%183 = add i64 %181, %182
%184 = load i64, i64* %12
%185 = load i64, i64* %8
%186 = load i64, i64* %6
%187 = load i64, i64* %12
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([75 x i8], [75 x i8]* @.str.29, i64 0, i64 0), i64 %180, i64 %183, i64 %184, i64 %185, i64 %186, i64 %187)
%189 = load i64, i64* %8
%190 = mul i64 2, %189
%191 = load i64, i64* %10
%192 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0), i64 %190, i64 %191)
br label %193
193: ; preds = %178
%194 = load i64, i64* %8
%195 = mul i64 2, %194
%196 = load i64, i64* %6
%197 = sub i64 %196, %195
store i64 %197, i64* %6
br label %173
198: ; preds = %173
%199 = load i64, i64* %8
%200 = mul i64 2, %199
%201 = load i64, i64* %8
%202 = load i64, i64* %12
%203 = load i64, i64* %8
%204 = load i64, i64* %12
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([66 x i8], [66 x i8]* @.str.31, i64 0, i64 0), i64 %200, i64 %201, i64 %202, i64 %203, i64 %204)
store i64 0, i64* %12
store i64 0, i64* %6
br label %206
206: ; preds = %215, %198
%207 = load i64, i64* %6
%208 = load i64, i64* %7
%209 = icmp ult i64 %207, %208
br i1 %209, label %210, label %220
210: ; preds = %206
%211 = load i64, i64* %6
%212 = shl i64 1, %211
%213 = load i64, i64* %12
%214 = or i64 %213, %212
store i64 %214, i64* %12
br label %215
215: ; preds = %210
%216 = load i64, i64* %8
%217 = mul i64 2, %216
%218 = load i64, i64* %6
%219 = add i64 %218, %217
store i64 %219, i64* %6
br label %206
220: ; preds = %206
%221 = load i64, i64* %12
%222 = xor i64 %221, -1
store i64 %222, i64* %12
%223 = load i64, i64* %12
store i64 %223, i64* %13
%224 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i64 1, i64* %6
br label %225
225: ; preds = %248, %220
%226 = load i64, i64* %6
%227 = load i64, i64* %8
%228 = mul i64 2, %227
%229 = icmp ult i64 %226, %228
br i1 %229, label %230, label %251
230: ; preds = %225
%231 = load i64, i64* %7
%232 = load i64, i64* %6
%233 = sub i64 %231, %232
%234 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.32, i64 0, i64 0), i64 %233)
%235 = load i64, i64* %7
%236 = icmp eq i64 %235, 32
br i1 %236, label %237, label %239
237: ; preds = %230
%238 = load i64, i64* %13
store i64 %238, i64* %13
br label %239
239: ; preds = %237, %230
%240 = load i64, i64* %13
%241 = load i64, i64* %6
%242 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.33, i64 0, i64 0), i64 %240, i64 %241)
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.34, i64 0, i64 0))
%244 = load i64, i64* %13
%245 = shl i64 %244, 1
%246 = load i64, i64* %12
%247 = and i64 %245, %246
store i64 %247, i64* %13
br label %248
248: ; preds = %239
%249 = load i64, i64* %6
%250 = add i64 %249, 1
store i64 %250, i64* %6
br label %225
251: ; preds = %225
%252 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%253 = load i64, i64* %11
%254 = icmp eq i64 %253, 0
br i1 %254, label %255, label %258
255: ; preds = %251
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0))
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i64 0, i64 0))
br label %272
258: ; preds = %251
%259 = load i64, i64* %11
%260 = icmp eq i64 %259, 1
br i1 %260, label %261, label %264
261: ; preds = %258
%262 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.37, i64 0, i64 0))
%263 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.38, i64 0, i64 0))
br label %271
264: ; preds = %258
%265 = load i64, i64* %11
%266 = icmp eq i64 %265, 2
br i1 %266, label %267, label %270
267: ; preds = %264
%268 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.39, i64 0, i64 0))
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.38, i64 0, i64 0))
br label %270
270: ; preds = %267, %264
br label %271
271: ; preds = %270, %261
br label %272
272: ; preds = %271, %255
%273 = load i64, i64* %11
%274 = icmp ugt i64 %273, 0
br i1 %274, label %275, label %278
275: ; preds = %272
%276 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.40, i64 0, i64 0))
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.41, i64 0, i64 0))
br label %278
278: ; preds = %275, %272
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.42, i64 0, i64 0))
br label %280
280: ; preds = %278
%281 = load i64, i64* %11
%282 = add i64 %281, 1
store i64 %282, i64* %11
br label %45
283: ; preds = %45
%284 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.43, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [24 x i8] c"Usage: %s <wordsize> k\0A\00"
@.str.6 = [34 x i8] c" %s %lu %lu. Don't edit it! */\0A\00"
@.str.18 = [39 x i8] c" unsigned long hi, lo, tmp, A[%lu];\0A\00"
@.str.19 = [15 x i8] c" A[0] = 0;\09\09\00"
@.str.21 = [26 x i8] c" A[%lu] = A[%lu] << 1;\09\00"
@.str.22 = [22 x i8] c"A[%lu] = A[%lu] ^ a;\0A\00"
@.str.26 = [22 x i8] c" lo = A[b >> %lu];\0A\00"
@.str.27 = [53 x i8] c" lo = (A[b >> %lu] << %lu) ^ A[(b >> %lu) & %lu];\0A\00"
@.str.28 = [20 x i8] c" hi = lo >> %lu;\0A\00"
@.str.29 = [75 x i8] c" lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[(b >> %lu) & %lu];\0A\00"
@.str.30 = [36 x i8] c" hi = (hi << %lu) | (lo >> %lu);\0A\00"
@.str.31 = [66 x i8] c" lo = (lo << %lu) ^ (A[(b >> %lu) & %lu] << %lu) ^ A[b & %lu];\0A\00"
@.str.32 = [29 x i8] c" tmp = -((a >> %lu) & 1);\0A\00"
@.str.33 = [33 x i8] c" tmp &= ((b & 0x%lx) >> %lu);\0A\00"
@str = [1311 x i8] c"/* This file is part of the gf2x library.\0A\0A Copyright 2007, 2008, 2009, 2010, 2011, 2012, 2013\0A Richard Brent, Pierrick Gaudry, Emmanuel Thome', Paul Zimmermann\0A\0A This program is free software; you can redistribute it and/or modify it\0A under the terms of either:\0A - If the archive contains a file named toom-gpl.c (not a trivial\0A placeholder), the GNU General Public License as published by the Free\0A Software Foundation; either version 3 of the License, or (at your\0A option) any later version.\0A - If the archive contains a file named toom-gpl.c which is a trivial\0A placeholder, the GNU Lesser General Public License as published by\0A the Free Software Foundation; either version 2.1 of the License, or\0A (at your option) any later version.\0A\0A This program is distributed in the hope that it will be useful, but WITHOUT\0A ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\0A FITNESS FOR A PARTICULAR PURPOSE. See the license text for more details.\0A\0A You should have received a copy of the GNU General Public License as\0A well as the GNU Lesser General Public License along with this program;\0A see the files COPYING and COPYING.LIB. If not, write to the Free\0A Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\0A 02110-1301, USA.\0A*/\0A\00"
@str.44 = [21 x i8] c"#ifndef GF2X_MUL1_H_\00"
@str.45 = [21 x i8] c"#define GF2X_MUL1_H_\00"
@str.46 = [46 x i8] c"/* This file was generated automatically with\00"
@str.47 = [172 x i8] c"#include \22gf2x.h\22\0A/* All gf2x source files for lowlevel functions must include gf2x-small.h\0A * This is mandatory for the tuning mechanism. */\0A#include \22gf2x/gf2x-small.h\22\0A\00"
@str.48 = [26 x i8] c"#endif\09/* GF2X_MUL1_H_ */\00"
@str.49 = [44 x i8] c"GF2X_STORAGE_CLASS_addmul_1_n unsigned long\00"
@str.50 = [95 x i8] c"gf2x_addmul_1_n (unsigned long *dp, const unsigned long *cp, const unsigned long* bp, long sb,\00"
@str.51 = [25 x i8] c" unsigned long a)\00"
@str.52 = [2 x i8] c"{\00"
@str.53 = [10 x i8] c"A[1] = a;\00"
@str.54 = [33 x i8] c" dp[i] = cp[i] ^ (carry ^ lo);\00"
@str.56 = [3 x i8] c"}\0A\00"
@str.57 = [6 x i8] c" }\00"
@str.58 = [17 x i8] c" return carry;\00"
@str.59 = [23 x i8] c" cp[i] = carry ^ lo;\00"
@str.60 = [15 x i8] c" carry = hi;\00"
@str.61 = [14 x i8] c" c[0] = lo;\00"
@str.62 = [14 x i8] c" c[1] = hi;\00"
@str.63 = [18 x i8] c" hi = hi ^ tmp;\00"
@str.64 = [28 x i8] c" for (i = 0; i < sb; i++)\00"
@str.65 = [7 x i8] c" {\00"
@str.66 = [18 x i8] c" b = bp[i];\00"
@str.67 = [11 x i8] c" long i;\00"
@str.68 = [31 x i8] c" unsigned long carry = 0, b;\00"
@str.69 = [41 x i8] c"GF2X_STORAGE_CLASS_mul_1_n unsigned long\00"
@str.70 = [84 x i8] c"gf2x_mul_1_n (unsigned long *cp, const unsigned long *bp, long sb, unsigned long a)\00"
@str.71 = [29 x i8] c"GF2X_STORAGE_CLASS_mul1 void\00"
@str.72 = [63 x i8] c"gf2x_mul1 (unsigned long *c, unsigned long a, unsigned long b)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = load i32, i32* @stderr
%6 = load i8*, i8** %1
%7 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
%10 = getelementptr inbounds i8*, i8** %1, i64 1
%11 = load i8*, i8** %10
%12 = tail call i64 @atoi(i8* %11)
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i64 @atoi(i8* %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([1311 x i8], [1311 x i8]* @str, i64 0, i64 0))
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.44, i64 0, i64 0))
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.45, i64 0, i64 0))
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.46, i64 0, i64 0))
%21 = load i8*, i8** %1
%22 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.6, i64 0, i64 0), i8* %21, i64 %12, i64 %15)
%23 = tail call i32 @putchar(i32 10)
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([172 x i8], [172 x i8]* @str.47, i64 0, i64 0))
%25 = shl nuw i64 1, %15
%26 = trunc i64 %15 to i32
%27 = shl nuw i32 1, %26
%28 = icmp ugt i32 %26, 1
%29 = shl i64 %15, 1
%30 = sub i64 %12, %29
%31 = add i64 %25, -1
%32 = add i64 %15, %12
%33 = icmp eq i64 %12, 0
%34 = icmp eq i64 %29, 0
%35 = call i32 @llvm.umax.i32(i32 %27, i32 3)
%36 = zext i32 %35 to i64
br label %37
37: ; preds = %9, %135
%38 = phi i64 [ 0, %9 ], [ %141, %135 ]
%39 = icmp eq i64 %38, 0
br i1 %39, label %49, label %40
40: ; preds = %37
%41 = icmp eq i64 %38, 1
br i1 %41, label %44, label %42
42: ; preds = %40
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.49, i64 0, i64 0))
br label %44
44: ; preds = %40, %42
%45 = phi i8* [ getelementptr inbounds ([95 x i8], [95 x i8]* @str.50, i64 0, i64 0), %42 ], [ getelementptr inbounds ([41 x i8], [41 x i8]* @str.69, i64 0, i64 0), %40 ]
%46 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @str.51, i64 0, i64 0), %42 ], [ getelementptr inbounds ([84 x i8], [84 x i8]* @str.70, i64 0, i64 0), %40 ]
%47 = tail call i32 @puts(i8* dereferenceable(1) %45)
%48 = tail call i32 @puts(i8* dereferenceable(1) %46)
br label %49
49: ; preds = %37, %44
%50 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.52, i64 0, i64 0), %44 ], [ getelementptr inbounds ([29 x i8], [29 x i8]* @str.71, i64 0, i64 0), %37 ]
%51 = phi i8* [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.67, i64 0, i64 0), %44 ], [ getelementptr inbounds ([63 x i8], [63 x i8]* @str.72, i64 0, i64 0), %37 ]
%52 = phi i8* [ getelementptr inbounds ([31 x i8], [31 x i8]* @str.68, i64 0, i64 0), %44 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @str.52, i64 0, i64 0), %37 ]
%53 = tail call i32 @puts(i8* dereferenceable(1) %50)
%54 = tail call i32 @puts(i8* dereferenceable(1) %51)
%55 = tail call i32 @puts(i8* dereferenceable(1) %52)
%56 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.18, i64 0, i64 0), i64 %25)
%57 = tail call i32 @putchar(i32 10)
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0))
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.53, i64 0, i64 0))
br i1 %28, label %60, label %73
60: ; preds = %49, %70
%61 = phi i64 [ %71, %70 ], [ 2, %49 ]
%62 = and i64 %61, 1
%63 = icmp eq i64 %62, 0
br i1 %63, label %64, label %67
64: ; preds = %60
%65 = lshr i64 %61, 1
%66 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.21, i64 0, i64 0), i64 %61, i64 %65)
br label %70
67: ; preds = %60
%68 = add nsw i64 %61, -1
%69 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.22, i64 0, i64 0), i64 %61, i64 %68)
br label %70
70: ; preds = %64, %67
%71 = add nuw nsw i64 %61, 1
%72 = icmp eq i64 %71, %36
br i1 %72, label %73, label %60
73: ; preds = %70, %49
%74 = tail call i32 @putchar(i32 10)
br i1 %39, label %79, label %75
75: ; preds = %73
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.64, i64 0, i64 0))
%77 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.65, i64 0, i64 0))
%78 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.66, i64 0, i64 0))
br label %79
79: ; preds = %75, %73
br label %80
80: ; preds = %79, %80
%81 = phi i64 [ %82, %80 ], [ 0, %79 ]
%82 = add i64 %81, %29
%83 = icmp ult i64 %82, %12
br i1 %83, label %80, label %84
84: ; preds = %80
%85 = sub i64 %12, %81
%86 = icmp ult i64 %15, %85
br i1 %86, label %89, label %87
87: ; preds = %84
%88 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.26, i64 0, i64 0), i64 %81)
br label %92
89: ; preds = %84
%90 = sub i64 %32, %85
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.27, i64 0, i64 0), i64 %90, i64 %15, i64 %81, i64 %31)
br label %92
92: ; preds = %89, %87
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.28, i64 0, i64 0), i64 %30)
%94 = sub i64 %81, %29
%95 = icmp ult i64 %94, %29
br i1 %95, label %103, label %96
96: ; preds = %92, %96
%97 = phi i64 [ %101, %96 ], [ %94, %92 ]
%98 = add i64 %97, %15
%99 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @.str.29, i64 0, i64 0), i64 %29, i64 %98, i64 %31, i64 %15, i64 %97, i64 %31)
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.30, i64 0, i64 0), i64 %29, i64 %30)
%101 = sub i64 %97, %29
%102 = icmp ult i64 %101, %29
br i1 %102, label %103, label %96
103: ; preds = %96, %92
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([66 x i8], [66 x i8]* @.str.31, i64 0, i64 0), i64 %29, i64 %15, i64 %31, i64 %15, i64 %31)
br i1 %33, label %112, label %105
105: ; preds = %103, %105
%106 = phi i64 [ %109, %105 ], [ 0, %103 ]
%107 = phi i64 [ %110, %105 ], [ 0, %103 ]
%108 = shl nuw i64 1, %107
%109 = or i64 %106, %108
%110 = add i64 %107, %29
%111 = icmp ult i64 %110, %12
br i1 %111, label %105, label %112
112: ; preds = %105, %103
%113 = phi i64 [ 0, %103 ], [ %109, %105 ]
%114 = xor i64 %113, -1
%115 = tail call i32 @putchar(i32 10)
br i1 %34, label %127, label %116
116: ; preds = %112, %116
%117 = phi i64 [ %124, %116 ], [ %114, %112 ]
%118 = phi i64 [ %125, %116 ], [ 1, %112 ]
%119 = sub i64 %12, %118
%120 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.32, i64 0, i64 0), i64 %119)
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.33, i64 0, i64 0), i64 %117, i64 %118)
%122 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.63, i64 0, i64 0))
%123 = shl i64 %117, 1
%124 = and i64 %123, %114
%125 = add nuw i64 %118, 1
%126 = icmp eq i64 %125, %29
br i1 %126, label %127, label %116
127: ; preds = %116, %112
%128 = tail call i32 @putchar(i32 10)
br i1 %39, label %135, label %129
129: ; preds = %127
%130 = icmp eq i64 %38, 1
%131 = select i1 %130, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @str.59, i64 0, i64 0), i8* getelementptr inbounds ([33 x i8], [33 x i8]* @str.54, i64 0, i64 0)
%132 = select i1 %130, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.60, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @str.60, i64 0, i64 0)
%133 = tail call i32 @puts(i8* dereferenceable(1) %131)
%134 = tail call i32 @puts(i8* dereferenceable(1) %132)
br label %135
135: ; preds = %127, %129
%136 = phi i8* [ getelementptr inbounds ([6 x i8], [6 x i8]* @str.57, i64 0, i64 0), %129 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.61, i64 0, i64 0), %127 ]
%137 = phi i8* [ getelementptr inbounds ([17 x i8], [17 x i8]* @str.58, i64 0, i64 0), %129 ], [ getelementptr inbounds ([14 x i8], [14 x i8]* @str.62, i64 0, i64 0), %127 ]
%138 = tail call i32 @puts(i8* dereferenceable(1) %136)
%139 = tail call i32 @puts(i8* dereferenceable(1) %137)
%140 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.56, i64 0, i64 0))
%141 = add nuw nsw i64 %38, 1
%142 = icmp eq i64 %141, 3
br i1 %142, label %143, label %37
143: ; preds = %135
%144 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.48, i64 0, i64 0))
ret i32 0
}