#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ gen_small_rk(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
void gen_small_unrolled(void) {
  unsigned u, v;
  printf("\tsph_u32 p0, p1, p2, p3, p4, p5, p6, p7;\n");
  printf("\tsph_u32 x0, x1, x2, x3;\n");
  printf("\tsph_u32 rk0, rk1, rk2, rk3, rk4, rk5, rk6, rk7;\n");
  printf("\tsph_u32 rk8, rk9, rkA, rkB, rkC, rkD, rkE, rkF;\n");
  printf("\n");
  for (u = 0; u < 8; u++)
    printf("\tp%X = sc->h[0x%X];\n", u, u);
  for (u = 0; u < 12; u++) {
    unsigned x;
    unsigned po;
    printf("\t/* round %u */\n", u);
    x = 12 * u;
    po = 4 * (u & 1);
    for (v = 0; v < 4; v++) {
      gen_small_rk(x + v);
      printf("\tx%u = p%X ^ rk%X;\n", v, (po + 4 + v) & 7, (x + v) & 15);
    }
    printf("\tAES_ROUND_NOKEY(x0, x1, x2, x3);\n");
    x += 4;
    for (v = 0; v < 4; v++) {
      gen_small_rk(x + v);
      printf("\tx%u ^= rk%X;\n", v, (x + v) & 15);
    }
    printf("\tAES_ROUND_NOKEY(x0, x1, x2, x3);\n");
    x += 4;
    for (v = 0; v < 4; v++) {
      gen_small_rk(x + v);
      printf("\tx%u ^= rk%X;\n", v, (x + v) & 15);
    }
    printf("\tAES_ROUND_NOKEY(x0, x1, x2, x3);\n");
    for (v = 0; v < 4; v++)
      printf("\tp%X ^= x%u;\n", (po + v) & 7, v);
  }
  for (u = 0; u < 8; u++)
    printf("\tsc->h[0x%X] ^= p%X;\n", u, u);
}


x86 assembly (clang, -O0):
<gen_small_unrolled>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jae    11a1 <gen_small_unrolled+0x81>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xf1c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    1175 <gen_small_unrolled+0x55>
movl   $0x0,-0x4(%rbp)
cmpl   $0xc,-0x4(%rbp)
jae    1336 <gen_small_unrolled+0x216>
mov    -0x4(%rbp),%esi
lea    0xf01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
imul   $0xc,-0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1,%eax
shl    $0x2,%eax
mov    %eax,-0x10(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jae    1226 <gen_small_unrolled+0x106>
mov    -0xc(%rbp),%edi
add    -0x8(%rbp),%edi
call   1040 <gen_small_rk@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
add    $0x4,%edx
add    -0x8(%rbp),%edx
and    $0x7,%edx
mov    -0xc(%rbp),%ecx
add    -0x8(%rbp),%ecx
and    $0xf,%ecx
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11dd <gen_small_unrolled+0xbd>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jae    1281 <gen_small_unrolled+0x161>
mov    -0xc(%rbp),%edi
add    -0x8(%rbp),%edi
call   1040 <gen_small_rk@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    -0x8(%rbp),%edx
and    $0xf,%edx
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1244 <gen_small_unrolled+0x124>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x4,%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jae    12dc <gen_small_unrolled+0x1bc>
mov    -0xc(%rbp),%edi
add    -0x8(%rbp),%edi
call   1040 <gen_small_rk@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
add    -0x8(%rbp),%edx
and    $0xf,%edx
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    129f <gen_small_unrolled+0x17f>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x4,-0x8(%rbp)
jae    1323 <gen_small_unrolled+0x203>
mov    -0x10(%rbp),%esi
add    -0x8(%rbp),%esi
and    $0x7,%esi
mov    -0x8(%rbp),%edx
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12f1 <gen_small_unrolled+0x1d1>
jmp    1328 <gen_small_unrolled+0x208>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    11a8 <gen_small_unrolled+0x88>
movl   $0x0,-0x4(%rbp)
cmpl   $0x8,-0x4(%rbp)
jae    1369 <gen_small_unrolled+0x249>
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xdce(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    133d <gen_small_unrolled+0x21d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_small_unrolled>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xf1b(%rip),%rdi
call   1040 <puts@plt>
lea    0xf38(%rip),%rdi
call   1040 <puts@plt>
lea    0xf45(%rip),%rdi
call   1040 <puts@plt>
lea    0xf6a(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe74(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xb,%ebx
xor    %r13d,%r13d
xor    %eax,%eax
mov    %eax,0x4(%rsp)
lea    0xdda(%rip),%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0xb(%rbx),%r15d
mov    %r15d,%edi
call   1060 <gen_small_rk@plt>
mov    %r13d,%r12d
and    $0x4,%r12d
mov    %r12d,%edx
xor    $0x4,%edx
and    $0xc,%r15d
lea    0xdbc(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0xa(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
lea    0x5(%r13),%edx
and    $0x5,%edx
and    $0xd,%ebp
mov    %r14,%rdi
mov    $0x1,%esi
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x9(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
lea    0x6(%r13),%edx
and    $0x6,%edx
and    $0xe,%ebp
mov    %r14,%rdi
mov    $0x2,%esi
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x8(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
lea    -0x1(%r13),%edx
and    $0x7,%edx
and    $0xf,%ebp
mov    %r14,%rdi
mov    $0x3,%esi
mov    %ebp,%ecx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe22(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
lea    -0x7(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xc,%ebp
lea    0xd2f(%rip),%r15
mov    %r15,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x6(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xd,%ebp
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x5(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xe,%ebp
mov    %r15,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x4(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xf,%ebp
mov    %r15,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    -0x3(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xc,%ebp
mov    %r15,%rdi
xor    %esi,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x2(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xd,%ebp
mov    %r15,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    -0x1(%rbx),%ebp
mov    %ebp,%edi
call   1060 <gen_small_rk@plt>
and    $0xe,%ebp
mov    %r15,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebx,%edi
call   1060 <gen_small_rk@plt>
mov    %ebx,%edx
and    $0xf,%edx
mov    %r15,%rdi
mov    $0x3,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
lea    0xc4d(%rip),%rbp
mov    %rbp,%rdi
mov    %r12d,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x1(%r12),%esi
mov    %rbp,%rdi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x2(%r12),%esi
mov    %rbp,%rdi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
or     $0x3,%r12d
mov    %rbp,%rdi
mov    %r12d,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%eax
add    $0x1,%eax
add    $0xc,%ebx
add    $0x4,%r13d
cmp    $0x9b,%ebx
jne    1230 <gen_small_unrolled+0xf0>
lea    0xbed(%rip),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x5,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x6,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    $0x7,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"\09sph_u32 p0, p1, p2, p3, p4, p5, p6, p7;\0A\00"
@.str.1 = [26 x i8] c"\09sph_u32 x0, x1, x2, x3;\0A\00"
@.str.2 = [50 x i8] c"\09sph_u32 rk0, rk1, rk2, rk3, rk4, rk5, rk6, rk7;\0A\00"
@.str.3 = [50 x i8] c"\09sph_u32 rk8, rk9, rkA, rkB, rkC, rkD, rkE, rkF;\0A\00"
@.str.4 = [2 x i8] c"\0A\00"
@.str.5 = [21 x i8] c"\09p%X = sc->h[0x%X];\0A\00"
@.str.6 = [17 x i8] c"\09/* round %u */\0A\00"
@.str.7 = [20 x i8] c"\09x%u = p%X ^ rk%X;\0A\00"
@.str.8 = [35 x i8] c"\09AES_ROUND_NOKEY(x0, x1, x2, x3);\0A\00"
@.str.9 = [15 x i8] c"\09x%u ^= rk%X;\0A\00"
@.str.10 = [14 x i8] c"\09p%X ^= x%u;\0A\00"
@.str.11 = [22 x i8] c"\09sc->h[0x%X] ^= p%X;\0A\00"
define void @gen_small_unrolled() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %10
10: ; preds = %17, %0
%11 = load i32, i32* %1
%12 = icmp ult i32 %11, 8
br i1 %12, label %13, label %20
13: ; preds = %10
%14 = load i32, i32* %1
%15 = load i32, i32* %1
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 %14, i32 %15)
br label %17
17: ; preds = %13
%18 = load i32, i32* %1
%19 = add i32 %18, 1
store i32 %19, i32* %1
br label %10
20: ; preds = %10
store i32 0, i32* %1
br label %21
21: ; preds = %112, %20
%22 = load i32, i32* %1
%23 = icmp ult i32 %22, 12
br i1 %23, label %24, label %115
24: ; preds = %21
%25 = load i32, i32* %1
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
%28 = mul i32 12, %27
store i32 %28, i32* %3
%29 = load i32, i32* %1
%30 = and i32 %29, 1
%31 = mul i32 4, %30
store i32 %31, i32* %4
store i32 0, i32* %2
br label %32
32: ; preds = %51, %24
%33 = load i32, i32* %2
%34 = icmp ult i32 %33, 4
br i1 %34, label %35, label %54
35: ; preds = %32
%36 = load i32, i32* %3
%37 = load i32, i32* %2
%38 = add i32 %36, %37
%39 = call i32 @gen_small_rk(i32 %38)
%40 = load i32, i32* %2
%41 = load i32, i32* %4
%42 = add i32 %41, 4
%43 = load i32, i32* %2
%44 = add i32 %42, %43
%45 = and i32 %44, 7
%46 = load i32, i32* %3
%47 = load i32, i32* %2
%48 = add i32 %46, %47
%49 = and i32 %48, 15
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %40, i32 %45, i32 %49)
br label %51
51: ; preds = %35
%52 = load i32, i32* %2
%53 = add i32 %52, 1
store i32 %53, i32* %2
br label %32
54: ; preds = %32
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
%56 = load i32, i32* %3
%57 = add i32 %56, 4
store i32 %57, i32* %3
store i32 0, i32* %2
br label %58
58: ; preds = %72, %54
%59 = load i32, i32* %2
%60 = icmp ult i32 %59, 4
br i1 %60, label %61, label %75
61: ; preds = %58
%62 = load i32, i32* %3
%63 = load i32, i32* %2
%64 = add i32 %62, %63
%65 = call i32 @gen_small_rk(i32 %64)
%66 = load i32, i32* %2
%67 = load i32, i32* %3
%68 = load i32, i32* %2
%69 = add i32 %67, %68
%70 = and i32 %69, 15
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %66, i32 %70)
br label %72
72: ; preds = %61
%73 = load i32, i32* %2
%74 = add i32 %73, 1
store i32 %74, i32* %2
br label %58
75: ; preds = %58
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
%77 = load i32, i32* %3
%78 = add i32 %77, 4
store i32 %78, i32* %3
store i32 0, i32* %2
br label %79
79: ; preds = %93, %75
%80 = load i32, i32* %2
%81 = icmp ult i32 %80, 4
br i1 %81, label %82, label %96
82: ; preds = %79
%83 = load i32, i32* %3
%84 = load i32, i32* %2
%85 = add i32 %83, %84
%86 = call i32 @gen_small_rk(i32 %85)
%87 = load i32, i32* %2
%88 = load i32, i32* %3
%89 = load i32, i32* %2
%90 = add i32 %88, %89
%91 = and i32 %90, 15
%92 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 %87, i32 %91)
br label %93
93: ; preds = %82
%94 = load i32, i32* %2
%95 = add i32 %94, 1
store i32 %95, i32* %2
br label %79
96: ; preds = %79
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %98
98: ; preds = %108, %96
%99 = load i32, i32* %2
%100 = icmp ult i32 %99, 4
br i1 %100, label %101, label %111
101: ; preds = %98
%102 = load i32, i32* %4
%103 = load i32, i32* %2
%104 = add i32 %102, %103
%105 = and i32 %104, 7
%106 = load i32, i32* %2
%107 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %105, i32 %106)
br label %108
108: ; preds = %101
%109 = load i32, i32* %2
%110 = add i32 %109, 1
store i32 %110, i32* %2
br label %98
111: ; preds = %98
br label %112
112: ; preds = %111
%113 = load i32, i32* %1
%114 = add i32 %113, 1
store i32 %114, i32* %1
br label %21
115: ; preds = %21
store i32 0, i32* %1
br label %116
116: ; preds = %123, %115
%117 = load i32, i32* %1
%118 = icmp ult i32 %117, 8
br i1 %118, label %119, label %126
119: ; preds = %116
%120 = load i32, i32* %1
%121 = load i32, i32* %1
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 %120, i32 %121)
br label %123
123: ; preds = %119
%124 = load i32, i32* %1
%125 = add i32 %124, 1
store i32 %125, i32* %1
br label %116
126: ; preds = %116
ret void
}

LLVM IR (-O2):
@.str.5 = [21 x i8] c"\09p%X = sc->h[0x%X];\0A\00"
@.str.6 = [17 x i8] c"\09/* round %u */\0A\00"
@.str.7 = [20 x i8] c"\09x%u = p%X ^ rk%X;\0A\00"
@.str.9 = [15 x i8] c"\09x%u ^= rk%X;\0A\00"
@.str.10 = [14 x i8] c"\09p%X ^= x%u;\0A\00"
@.str.11 = [22 x i8] c"\09sc->h[0x%X] ^= p%X;\0A\00"
@str = [41 x i8] c"\09sph_u32 p0, p1, p2, p3, p4, p5, p6, p7;\00"
@str.12 = [25 x i8] c"\09sph_u32 x0, x1, x2, x3;\00"
@str.13 = [49 x i8] c"\09sph_u32 rk0, rk1, rk2, rk3, rk4, rk5, rk6, rk7;\00"
@str.14 = [49 x i8] c"\09sph_u32 rk8, rk9, rkA, rkB, rkC, rkD, rkE, rkF;\00"
@str.17 = [34 x i8] c"\09AES_ROUND_NOKEY(x0, x1, x2, x3);\00"
define void @gen_small_unrolled() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.12, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.13, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.14, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 0, i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 1)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 2, i32 2)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 3, i32 3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 4)
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 5, i32 5)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 6, i32 6)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i32 7, i32 7)
br label %14
14: ; preds = %0, %14
%15 = phi i32 [ %88, %14 ], [ 0, %0 ]
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 %15)
%17 = mul nuw nsw i32 %15, 12
%18 = shl nuw nsw i32 %15, 2
%19 = tail call i32 @gen_small_rk(i32 %17)
%20 = and i32 %18, 4
%21 = xor i32 %20, 4
%22 = and i32 %17, 12
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 0, i32 %21, i32 %22)
%24 = or i32 %17, 1
%25 = tail call i32 @gen_small_rk(i32 %24)
%26 = add nuw nsw i32 %18, 5
%27 = and i32 %26, 5
%28 = and i32 %24, 13
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 1, i32 %27, i32 %28)
%30 = or i32 %17, 2
%31 = tail call i32 @gen_small_rk(i32 %30)
%32 = add nuw nsw i32 %18, 6
%33 = and i32 %32, 6
%34 = and i32 %30, 14
%35 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 2, i32 %33, i32 %34)
%36 = or i32 %17, 3
%37 = tail call i32 @gen_small_rk(i32 %36)
%38 = add nuw nsw i32 %18, 7
%39 = and i32 %38, 7
%40 = and i32 %36, 15
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 3, i32 %39, i32 %40)
%42 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.17, i64 0, i64 0))
%43 = add nuw nsw i32 %17, 4
%44 = tail call i32 @gen_small_rk(i32 %43)
%45 = and i32 %43, 12
%46 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 0, i32 %45)
%47 = add nuw nsw i32 %17, 5
%48 = tail call i32 @gen_small_rk(i32 %47)
%49 = and i32 %47, 13
%50 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 1, i32 %49)
%51 = add nuw nsw i32 %17, 6
%52 = tail call i32 @gen_small_rk(i32 %51)
%53 = and i32 %51, 14
%54 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 2, i32 %53)
%55 = add nuw nsw i32 %17, 7
%56 = tail call i32 @gen_small_rk(i32 %55)
%57 = and i32 %55, 15
%58 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 3, i32 %57)
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.17, i64 0, i64 0))
%60 = add nuw nsw i32 %17, 8
%61 = tail call i32 @gen_small_rk(i32 %60)
%62 = and i32 %60, 12
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 0, i32 %62)
%64 = add nuw nsw i32 %17, 9
%65 = tail call i32 @gen_small_rk(i32 %64)
%66 = and i32 %64, 13
%67 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 1, i32 %66)
%68 = add nuw nsw i32 %17, 10
%69 = tail call i32 @gen_small_rk(i32 %68)
%70 = and i32 %68, 14
%71 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 2, i32 %70)
%72 = add nuw nsw i32 %17, 11
%73 = tail call i32 @gen_small_rk(i32 %72)
%74 = and i32 %72, 15
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.9, i64 0, i64 0), i32 3, i32 %74)
%76 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.17, i64 0, i64 0))
%77 = and i32 %18, 4
%78 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %77, i32 0)
%79 = and i32 %18, 4
%80 = or i32 %79, 1
%81 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %80, i32 1)
%82 = and i32 %18, 4
%83 = or i32 %82, 2
%84 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %83, i32 2)
%85 = and i32 %18, 4
%86 = or i32 %85, 3
%87 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), i32 %86, i32 3)
%88 = add nuw nsw i32 %15, 1
%89 = icmp eq i32 %88, 12
br i1 %89, label %90, label %14
90: ; preds = %14
%91 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 0, i32 0)
%92 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 1, i32 1)
%93 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 2, i32 2)
%94 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 3, i32 3)
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 4, i32 4)
%96 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 5, i32 5)
%97 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 6, i32 6)
%98 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.11, i64 0, i64 0), i32 7, i32 7)
ret void
}