#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 the GNU General Public License as published by "
      "the\n"
      "   Free Software Foundation; either version 3 of the License, or (at "
      "your\n"
      "   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 GNU General Public "
      "License for\n"
      "   more details.\n"
      "\n"
      "   You should have received a copy of the GNU General Public License "
      "along\n"
      "   with this program; see the file COPYING.  If not, write to the Free\n"
      "   Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\n"
      "   02111-1307, 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 %u %u. 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[%u];\n", 1 << 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[%u] = A[%u] << 1;\t", i, i / 2);
      else
        printf("A[%u] = A[%u] ^ 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 >> %u];\n", w - CHOP);
    else
      printf("   lo = (A[b >> %u] << %u) ^ A[(b >> %u) & %lu];\n",
             w - (CHOP - K), K, w - CHOP, MASK);
    printf("   hi = lo >> %u;\n", w - 2 * K);
    for (i = w - CHOP - 2 * K; i >= 2 * K; i -= 2 * K) {
      printf("   lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ A[(b >> %u) & "
             "%lu];\n",
             2 * K, i + K, MASK, K, i, MASK);
      printf("   hi = (hi << %u) | (lo >> %u);\n", 2 * K, REM);
    }
    printf("   lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ 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 >> %u) & 1);\n", w - i);
      if (w == 32) {
        mask2 = (unsigned long)(uint32_t)mask2;
      }
      printf("   tmp &= ((b & 0x%lx) >> %u);\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    0x11e6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11ee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x12f0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11e8(%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    0x11fa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x12b7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11fe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movq   $0x0,-0x40(%rbp)
cmpq   $0x3,-0x40(%rbp)
jae    177b <main+0x63b>
cmpq   $0x0,-0x40(%rbp)
jne    1266 <main+0x126>
lea    0x127f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x128f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12d1 <main+0x191>
cmpq   $0x1,-0x40(%rbp)
jne    1292 <main+0x152>
lea    0x12b1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x12cd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x18c>
cmpq   $0x2,-0x40(%rbp)
jne    12c7 <main+0x187>
lea    0x1304(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1323(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1375(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12cc <main+0x18c>
jmp    12d1 <main+0x191>
lea    0x1431(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jbe    1306 <main+0x1c6>
lea    0x135e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x135c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    %eax,%ecx
mov    $0x1,%esi
shl    %cl,%esi
lea    0x1361(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11a1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x136b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x136c(%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    13d0 <main+0x290>
mov    -0x18(%rbp),%rax
and    $0x1,%rax
cmp    $0x0,%rax
jne    13a0 <main+0x260>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
shr    $0x1,%rdx
lea    0x1327(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13ba <main+0x27a>
mov    -0x18(%rbp),%rsi
mov    -0x18(%rbp),%rdx
sub    $0x1,%rdx
lea    0x1320(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13bf <main+0x27f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1353 <main+0x213>
lea    0x10f2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jbe    1413 <main+0x2d3>
lea    0x12f7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1306(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1300(%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    1475 <main+0x335>
jmp    1460 <main+0x320>
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1442 <main+0x302>
mov    -0x20(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x28(%rbp),%rax
ja     14aa <main+0x36a>
mov    -0x20(%rbp),%rsi
sub    -0x30(%rbp),%rsi
lea    0x1281(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    14d7 <main+0x397>
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    0x1264(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rax
shl    $0x1,%rax
sub    %rax,%rsi
lea    0x1279(%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     1584 <main+0x444>
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    0x1232(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x38(%rbp),%rdx
lea    0x125b(%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    150b <main+0x3cb>
mov    -0x28(%rbp),%rsi
shl    $0x1,%rsi
mov    -0x28(%rbp),%rdx
mov    -0x48(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x48(%rbp),%r9
lea    0x123f(%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    15f1 <main+0x4b1>
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    15ba <main+0x47a>
mov    -0x48(%rbp),%rax
xor    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
lea    0xebd(%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    169e <main+0x55e>
mov    -0x20(%rbp),%rsi
sub    -0x18(%rbp),%rsi
lea    0x11e2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x20,-0x20(%rbp)
jne    1659 <main+0x519>
mov    -0x50(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0x11d5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11e7(%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    161b <main+0x4db>
lea    0xe24(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpq   $0x0,-0x40(%rbp)
jne    16d8 <main+0x598>
lea    0x11b2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11b3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1735 <main+0x5f5>
cmpq   $0x1,-0x40(%rbp)
jne    1704 <main+0x5c4>
lea    0x11a4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x11ae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1730 <main+0x5f0>
cmpq   $0x2,-0x40(%rbp)
jne    172b <main+0x5eb>
lea    0x11a0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x1182(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1730 <main+0x5f0>
jmp    1735 <main+0x5f5>
cmpq   $0x0,-0x40(%rbp)
jbe    175c <main+0x61c>
lea    0x1191(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x118a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0x118e(%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    0x1173(%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    0x103e(%rip),%rdi
call   1040 <puts@plt>
lea    0x13bc(%rip),%rdi
call   1040 <puts@plt>
lea    0x13c5(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x13c4(%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    0x13c4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%eax
mov    %ebx,%ecx
shl    %cl,%eax
lea    (%rbx,%rbx,1),%r14
mov    %r12,%rsi
mov    $0xffffffffffffffff,%rdx
shl    %cl,%rdx
sub    %r14,%rsi
not    %rdx
mov    %rdx,0x28(%rsp)
cmp    $0x4,%eax
mov    $0x3,%r15d
mov    %eax,0x1c(%rsp)
cmovae %eax,%r15d
mov    %r14,%rax
neg    %rax
mov    %rax,0x58(%rsp)
mov    %rbx,%rax
neg    %rax
mov    %rax,0x20(%rsp)
lea    (%r12,%rbx,2),%rax
mov    %rax,0x50(%rsp)
lea    0x0(,%rbx,4),%rax
neg    %rax
mov    %rax,0x48(%rsp)
lea    -0x1(%r12),%rax
mov    %rax,0x40(%rsp)
xor    %ebp,%ebp
mov    %r12,0x30(%rsp)
mov    %r15,0x60(%rsp)
mov    %rbx,0x8(%rsp)
mov    %rsi,0x38(%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    0x14aa(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%rbp
cmp    $0x3,%rbp
mov    0x60(%rsp),%r15
mov    0x30(%rsp),%r12
je     15f0 <main+0x490>
lea    0x15d0(%rip),%rdi
lea    0x15e6(%rip),%rbx
lea    0x1507(%rip),%r13
mov    %rbp,0x10(%rsp)
test   %rbp,%rbp
je     1332 <main+0x1d2>
lea    0x1534(%rip),%rdi
lea    0x1556(%rip),%rbx
cmpq   $0x1,0x10(%rsp)
je     1310 <main+0x1b0>
lea    0x1382(%rip),%rdi
call   1040 <puts@plt>
lea    0x13a2(%rip),%rdi
lea    0x13fa(%rip),%rbx
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x14b9(%rip),%rdi
lea    0x14c6(%rip),%rbx
lea    0x14ca(%rip),%r13
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1040 <puts@plt>
lea    0xcea(%rip),%rdi
mov    0x1c(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xcf4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x13ab(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0x2,0x8(%rsp)
lea    0xce4(%rip),%r13
jb     13d0 <main+0x270>
mov    $0x2,%ebx
jmp    13be <main+0x25e>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    -0x1(%rbx),%rdx
lea    0xcda(%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    0x13d3(%rip),%rdi
call   1040 <puts@plt>
lea    0x13e3(%rip),%rdi
call   1040 <puts@plt>
lea    0x13de(%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    0x50(%rsp),%rax
add    %rbx,%rax
mov    0x58(%rsp),%rcx
sub    %rbx,%rcx
cmp    %rax,%rdx
jae    1450 <main+0x2f0>
mov    0x20(%rsp),%rsi
sub    %rbx,%rsi
lea    0xc6c(%rip),%rdi
mov    0x28(%rsp),%r8
xor    %eax,%eax
call   1050 <printf@plt>
jmp    1461 <main+0x301>
lea    0xc42(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc78(%rip),%rdi
mov    0x38(%rsp),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x48(%rsp),%r15
sub    %rbx,%r15
cmp    %r14,%r15
mov    0x28(%rsp),%r12
lea    0xc68(%rip),%rcx
mov    0x8(%rsp),%r13
jb     14e4 <main+0x384>
mov    0x20(%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    0xc73(%rip),%rdi
mov    %r14,%rsi
mov    0x38(%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    0xc71(%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    0x30(%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    0xc6b(%rip),%r12
je     1590 <main+0x430>
not    %r13
mov    $0x1,%ebx
mov    0x40(%rsp),%r15
mov    %r13,%rbp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc53(%rip),%rdi
mov    %rbp,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1232(%rip),%rdi
call   1040 <puts@plt>
add    %rbp,%rbp
and    %r13,%rbp
add    $0x1,%rbx
add    $0xffffffffffffffff,%r15
cmp    %rbx,%r14
jne    1550 <main+0x3f0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x11ed(%rip),%rdi
lea    0x11f4(%rip),%rbx
mov    0x10(%rsp),%rbp
test   %rbp,%rbp
je     1290 <main+0x130>
cmp    $0x1,%rbp
lea    0x116c(%rip),%rdi
lea    0x11a0(%rip),%rax
cmove  %rax,%rdi
call   1040 <puts@plt>
lea    0x11a7(%rip),%rdi
call   1040 <puts@plt>
lea    0x116d(%rip),%rdi
lea    0x116c(%rip),%rbx
jmp    1290 <main+0x130>
lea    0x106e(%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 = [907 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 the GNU General Public License as published by the\0A Free Software Foundation; either version 3 of the License, or (at your\0A 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 GNU General Public License for\0A more details.\0A\0A You should have received a copy of the GNU General Public License along\0A with this program; see the file COPYING. If not, write to the Free\0A Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\0A 02111-1307, 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 = [32 x i8] c" %s %u %u. 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 = [38 x i8] c" unsigned long hi, lo, tmp, A[%u];\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 = [24 x i8] c" A[%u] = A[%u] << 1;\09\00"
@.str.22 = [20 x i8] c"A[%u] = A[%u] ^ 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 = [21 x i8] c" lo = A[b >> %u];\0A\00"
@.str.27 = [50 x i8] c" lo = (A[b >> %u] << %u) ^ A[(b >> %u) & %lu];\0A\00"
@.str.28 = [19 x i8] c" hi = lo >> %u;\0A\00"
@.str.29 = [71 x i8] c" lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ A[(b >> %u) & %lu];\0A\00"
@.str.30 = [34 x i8] c" hi = (hi << %u) | (lo >> %u);\0A\00"
@.str.31 = [63 x i8] c" lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ A[b & %lu];\0A\00"
@.str.32 = [28 x i8] c" tmp = -((a >> %u) & 1);\0A\00"
@.str.33 = [32 x i8] c" tmp &= ((b & 0x%lx) >> %u);\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 ([907 x i8], [907 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 ([32 x i8], [32 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 = %281, %23
%46 = load i64, i64* %11
%47 = icmp ult i64 %46, 3
br i1 %47, label %48, label %284
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 = trunc i64 %77 to i32
%79 = shl i32 1, %78
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0), i32 %79)
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0))
%83 = 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 %84
84: ; preds = %106, %76
%85 = load i64, i64* %6
%86 = load i64, i64* %8
%87 = trunc i64 %86 to i32
%88 = shl i32 1, %87
%89 = zext i32 %88 to i64
%90 = icmp ult i64 %85, %89
br i1 %90, label %91, label %109
91: ; preds = %84
%92 = load i64, i64* %6
%93 = urem i64 %92, 2
%94 = icmp eq i64 %93, 0
br i1 %94, label %95, label %100
95: ; preds = %91
%96 = load i64, i64* %6
%97 = load i64, i64* %6
%98 = udiv i64 %97, 2
%99 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.21, i64 0, i64 0), i64 %96, i64 %98)
br label %105
100: ; preds = %91
%101 = load i64, i64* %6
%102 = load i64, i64* %6
%103 = sub i64 %102, 1
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.22, i64 0, i64 0), i64 %101, i64 %103)
br label %105
105: ; preds = %100, %95
br label %106
106: ; preds = %105
%107 = load i64, i64* %6
%108 = add i64 %107, 1
store i64 %108, i64* %6
br label %84
109: ; preds = %84
%110 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%111 = load i64, i64* %11
%112 = icmp ugt i64 %111, 0
br i1 %112, label %113, label %117
113: ; preds = %109
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.23, i64 0, i64 0))
%115 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.25, i64 0, i64 0))
br label %117
117: ; preds = %113, %109
%118 = load i64, i64* %7
%119 = load i64, i64* %8
%120 = mul i64 2, %119
%121 = sub i64 %118, %120
store i64 %121, i64* %10
%122 = load i64, i64* %8
%123 = shl i64 1, %122
%124 = sub i64 %123, 1
store i64 %124, i64* %12
store i64 0, i64* %9
br label %125
125: ; preds = %133, %117
%126 = load i64, i64* %9
%127 = load i64, i64* %8
%128 = mul i64 2, %127
%129 = add i64 %126, %128
%130 = load i64, i64* %7
%131 = icmp ult i64 %129, %130
br i1 %131, label %132, label %138
132: ; preds = %125
br label %133
133: ; preds = %132
%134 = load i64, i64* %8
%135 = mul i64 2, %134
%136 = load i64, i64* %9
%137 = add i64 %136, %135
store i64 %137, i64* %9
br label %125
138: ; preds = %125
%139 = load i64, i64* %7
%140 = load i64, i64* %9
%141 = sub i64 %139, %140
store i64 %141, i64* %9
%142 = load i64, i64* %9
%143 = load i64, i64* %8
%144 = icmp ule i64 %142, %143
br i1 %144, label %145, label %150
145: ; preds = %138
%146 = load i64, i64* %7
%147 = load i64, i64* %9
%148 = sub i64 %146, %147
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.26, i64 0, i64 0), i64 %148)
br label %162
150: ; preds = %138
%151 = load i64, i64* %7
%152 = load i64, i64* %9
%153 = load i64, i64* %8
%154 = sub i64 %152, %153
%155 = sub i64 %151, %154
%156 = load i64, i64* %8
%157 = load i64, i64* %7
%158 = load i64, i64* %9
%159 = sub i64 %157, %158
%160 = load i64, i64* %12
%161 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.27, i64 0, i64 0), i64 %155, i64 %156, i64 %159, i64 %160)
br label %162
162: ; preds = %150, %145
%163 = load i64, i64* %7
%164 = load i64, i64* %8
%165 = mul i64 2, %164
%166 = sub i64 %163, %165
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.28, i64 0, i64 0), i64 %166)
%168 = load i64, i64* %7
%169 = load i64, i64* %9
%170 = sub i64 %168, %169
%171 = load i64, i64* %8
%172 = mul i64 2, %171
%173 = sub i64 %170, %172
store i64 %173, i64* %6
br label %174
174: ; preds = %194, %162
%175 = load i64, i64* %6
%176 = load i64, i64* %8
%177 = mul i64 2, %176
%178 = icmp uge i64 %175, %177
br i1 %178, label %179, label %199
179: ; preds = %174
%180 = load i64, i64* %8
%181 = mul i64 2, %180
%182 = load i64, i64* %6
%183 = load i64, i64* %8
%184 = add i64 %182, %183
%185 = load i64, i64* %12
%186 = load i64, i64* %8
%187 = load i64, i64* %6
%188 = load i64, i64* %12
%189 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.29, i64 0, i64 0), i64 %181, i64 %184, i64 %185, i64 %186, i64 %187, i64 %188)
%190 = load i64, i64* %8
%191 = mul i64 2, %190
%192 = load i64, i64* %10
%193 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0), i64 %191, i64 %192)
br label %194
194: ; preds = %179
%195 = load i64, i64* %8
%196 = mul i64 2, %195
%197 = load i64, i64* %6
%198 = sub i64 %197, %196
store i64 %198, i64* %6
br label %174
199: ; preds = %174
%200 = load i64, i64* %8
%201 = mul i64 2, %200
%202 = load i64, i64* %8
%203 = load i64, i64* %12
%204 = load i64, i64* %8
%205 = load i64, i64* %12
%206 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.31, i64 0, i64 0), i64 %201, i64 %202, i64 %203, i64 %204, i64 %205)
store i64 0, i64* %12
store i64 0, i64* %6
br label %207
207: ; preds = %216, %199
%208 = load i64, i64* %6
%209 = load i64, i64* %7
%210 = icmp ult i64 %208, %209
br i1 %210, label %211, label %221
211: ; preds = %207
%212 = load i64, i64* %6
%213 = shl i64 1, %212
%214 = load i64, i64* %12
%215 = or i64 %214, %213
store i64 %215, i64* %12
br label %216
216: ; preds = %211
%217 = load i64, i64* %8
%218 = mul i64 2, %217
%219 = load i64, i64* %6
%220 = add i64 %219, %218
store i64 %220, i64* %6
br label %207
221: ; preds = %207
%222 = load i64, i64* %12
%223 = xor i64 %222, -1
store i64 %223, i64* %12
%224 = load i64, i64* %12
store i64 %224, i64* %13
%225 = 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 %226
226: ; preds = %249, %221
%227 = load i64, i64* %6
%228 = load i64, i64* %8
%229 = mul i64 2, %228
%230 = icmp ult i64 %227, %229
br i1 %230, label %231, label %252
231: ; preds = %226
%232 = load i64, i64* %7
%233 = load i64, i64* %6
%234 = sub i64 %232, %233
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.32, i64 0, i64 0), i64 %234)
%236 = load i64, i64* %7
%237 = icmp eq i64 %236, 32
br i1 %237, label %238, label %240
238: ; preds = %231
%239 = load i64, i64* %13
store i64 %239, i64* %13
br label %240
240: ; preds = %238, %231
%241 = load i64, i64* %13
%242 = load i64, i64* %6
%243 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.33, i64 0, i64 0), i64 %241, i64 %242)
%244 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.34, i64 0, i64 0))
%245 = load i64, i64* %13
%246 = shl i64 %245, 1
%247 = load i64, i64* %12
%248 = and i64 %246, %247
store i64 %248, i64* %13
br label %249
249: ; preds = %240
%250 = load i64, i64* %6
%251 = add i64 %250, 1
store i64 %251, i64* %6
br label %226
252: ; preds = %226
%253 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%254 = load i64, i64* %11
%255 = icmp eq i64 %254, 0
br i1 %255, label %256, label %259
256: ; preds = %252
%257 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.35, i64 0, i64 0))
%258 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.36, i64 0, i64 0))
br label %273
259: ; preds = %252
%260 = load i64, i64* %11
%261 = icmp eq i64 %260, 1
br i1 %261, label %262, label %265
262: ; preds = %259
%263 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.37, i64 0, i64 0))
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.38, i64 0, i64 0))
br label %272
265: ; preds = %259
%266 = load i64, i64* %11
%267 = icmp eq i64 %266, 2
br i1 %267, label %268, label %271
268: ; preds = %265
%269 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.39, i64 0, i64 0))
%270 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.38, i64 0, i64 0))
br label %271
271: ; preds = %268, %265
br label %272
272: ; preds = %271, %262
br label %273
273: ; preds = %272, %256
%274 = load i64, i64* %11
%275 = icmp ugt i64 %274, 0
br i1 %275, label %276, label %279
276: ; preds = %273
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.40, i64 0, i64 0))
%278 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.41, i64 0, i64 0))
br label %279
279: ; preds = %276, %273
%280 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.42, i64 0, i64 0))
br label %281
281: ; preds = %279
%282 = load i64, i64* %11
%283 = add i64 %282, 1
store i64 %283, i64* %11
br label %45
284: ; preds = %45
%285 = 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 = [32 x i8] c" %s %u %u. Don't edit it! */\0A\00"
@.str.18 = [38 x i8] c" unsigned long hi, lo, tmp, A[%u];\0A\00"
@.str.19 = [15 x i8] c" A[0] = 0;\09\09\00"
@.str.21 = [24 x i8] c" A[%u] = A[%u] << 1;\09\00"
@.str.22 = [20 x i8] c"A[%u] = A[%u] ^ a;\0A\00"
@.str.26 = [21 x i8] c" lo = A[b >> %u];\0A\00"
@.str.27 = [50 x i8] c" lo = (A[b >> %u] << %u) ^ A[(b >> %u) & %lu];\0A\00"
@.str.28 = [19 x i8] c" hi = lo >> %u;\0A\00"
@.str.29 = [71 x i8] c" lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ A[(b >> %u) & %lu];\0A\00"
@.str.30 = [34 x i8] c" hi = (hi << %u) | (lo >> %u);\0A\00"
@.str.31 = [63 x i8] c" lo = (lo << %u) ^ (A[(b >> %u) & %lu] << %u) ^ A[b & %lu];\0A\00"
@.str.32 = [28 x i8] c" tmp = -((a >> %u) & 1);\0A\00"
@.str.33 = [32 x i8] c" tmp &= ((b & 0x%lx) >> %u);\0A\00"
@str = [906 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 the GNU General Public License as published by the\0A Free Software Foundation; either version 3 of the License, or (at your\0A 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 GNU General Public License for\0A more details.\0A\0A You should have received a copy of the GNU General Public License along\0A with this program; see the file COPYING. If not, write to the Free\0A Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA\0A 02111-1307, 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 ([906 x i8], [906 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 ([32 x i8], [32 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 = trunc i64 %15 to i32
%26 = shl nuw i32 1, %25
%27 = icmp ugt i32 %25, 1
%28 = shl i64 %15, 1
%29 = sub i64 %12, %28
%30 = shl nsw i64 -1, %15
%31 = xor i64 %30, -1
%32 = add i64 %15, %12
%33 = icmp eq i64 %12, 0
%34 = icmp eq i64 %28, 0
%35 = call i32 @llvm.umax.i32(i32 %26, 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 ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0), i32 %26)
%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 %27, 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 ([24 x i8], [24 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 ([20 x i8], [20 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, %28
%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 ([21 x i8], [21 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 ([50 x i8], [50 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 ([19 x i8], [19 x i8]* @.str.28, i64 0, i64 0), i64 %29)
%94 = sub i64 %81, %28
%95 = icmp ult i64 %94, %28
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 ([71 x i8], [71 x i8]* @.str.29, i64 0, i64 0), i64 %28, i64 %98, i64 %31, i64 %15, i64 %97, i64 %31)
%100 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.30, i64 0, i64 0), i64 %28, i64 %29)
%101 = sub i64 %97, %28
%102 = icmp ult i64 %101, %28
br i1 %102, label %103, label %96
103: ; preds = %96, %92
%104 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.31, i64 0, i64 0), i64 %28, 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, %28
%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 ([28 x i8], [28 x i8]* @.str.32, i64 0, i64 0), i64 %119)
%121 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 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, %28
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
}