char **__snippet_encrypt_blocks(const unsigned long *rk, int nrounds,
                                char **plain_blocks) {
  int index = 0;
  int count = __snippet_block_count(plain_blocks);
  printf("%i\n", count);
  char *cipher_block, plain_block;
  char **cipher_blocks = (char **)malloc(sizeof(char *) * (count + 1));
  for (index = 0; index < count; index++) {
    printf("!!\n");
    plain_block = *(plain_blocks + index);
    printf("lkjsd\n");
    printf("%s\n", plain_block);
    cipher_block = (char *)malloc(sizeof(char) * 16);
    rijndaelEncrypt(rk, nrounds, (const char *)plain_block,
                    (const char *)cipher_block);
    printf("%s --> %s", plain_block, cipher_block);
  }
}


x86 assembly (clang, -O0):
<__snippet_encrypt_blocks>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x0,%al
call   1050 <__snippet_block_count@plt>
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%esi
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdi
shl    $0x3,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x40(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x28(%rbp),%eax
jge    1228 <__snippet_encrypt_blocks+0xe8>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %al,-0x31(%rbp)
lea    0xe42(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movsbl -0x31(%rbp),%esi
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x10,%edi
call   1060 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
movsbq -0x31(%rbp),%rdx
mov    -0x30(%rbp),%rcx
mov    $0x0,%al
call   1030 <rijndaelEncrypt@plt>
movsbl -0x31(%rbp),%esi
mov    -0x30(%rbp),%rdx
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1196 <__snippet_encrypt_blocks+0x56>
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__snippet_encrypt_blocks>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,0x10(%rsp)
mov    %rdx,%rdi
xor    %eax,%eax
call   1060 <__snippet_block_count@plt>
mov    %eax,%r15d
lea    0xe84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
test   %r15d,%r15d
jle    1219 <__snippet_encrypt_blocks+0xc9>
mov    %r15d,%eax
mov    %rax,0x8(%rsp)
xor    %r14d,%r14d
nopl   0x0(%rax)
lea    0xe6b(%rip),%rdi
call   1030 <puts@plt>
mov    %ebp,%r15d
mov    (%rbx,%r14,8),%rbp
lea    0xe5b(%rip),%rdi
call   1030 <puts@plt>
movsbl %bpl,%r12d
lea    0xe3a(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x10,%edi
call   1070 <malloc@plt>
mov    %rax,%r13
movsbq %bpl,%rdx
mov    %r15d,%ebp
mov    0x10(%rsp),%rdi
mov    %r15d,%esi
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <rijndaelEncrypt@plt>
lea    0xe07(%rip),%rdi
mov    %r12d,%esi
mov    %r13,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%r14
cmp    %r14,0x8(%rsp)
jne    11a0 <__snippet_encrypt_blocks+0x50>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%i\0A\00"
@.str.1 = [4 x i8] c"!!\0A\00"
@.str.2 = [7 x i8] c"lkjsd\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [10 x i8] c"%s --> %s\00"
define i8** @__snippet_encrypt_blocks(i64* %0, i32 %1, i8** %2) {
%4 = alloca i8**
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i8**
store i64* %0, i64** %5
store i32 %1, i32* %6
store i8** %2, i8*** %7
store i32 0, i32* %8
%13 = load i8**, i8*** %7
%14 = call i32 (i8**, ...) bitcast (i32 (...)* @__snippet_block_count to i32 (i8**, ...)*)(i8** %13)
store i32 %14, i32* %9
%15 = load i32, i32* %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
%17 = load i32, i32* %9
%18 = add nsw i32 %17, 1
%19 = sext i32 %18 to i64
%20 = mul i64 8, %19
%21 = call i8* @malloc(i64 %20)
%22 = bitcast i8* %21 to i8**
store i8** %22, i8*** %12
store i32 0, i32* %8
br label %23
23: ; preds = %51, %3
%24 = load i32, i32* %8
%25 = load i32, i32* %9
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %54
27: ; preds = %23
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%29 = load i8**, i8*** %7
%30 = load i32, i32* %8
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8*, i8** %29, i64 %31
%33 = load i8*, i8** %32
%34 = ptrtoint i8* %33 to i8
store i8 %34, i8* %11
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
%36 = load i8, i8* %11
%37 = sext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %37)
%39 = call i8* @malloc(i64 16)
store i8* %39, i8** %10
%40 = load i64*, i64** %5
%41 = load i32, i32* %6
%42 = load i8, i8* %11
%43 = sext i8 %42 to i64
%44 = inttoptr i64 %43 to i8*
%45 = load i8*, i8** %10
%46 = call i32 (i64*, i32, i8*, i8*, ...) bitcast (i32 (...)* @rijndaelEncrypt to i32 (i64*, i32, i8*, i8*, ...)*)(i64* %40, i32 %41, i8* %44, i8* %45)
%47 = load i8, i8* %11
%48 = sext i8 %47 to i32
%49 = load i8*, i8** %10
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %48, i8* %49)
br label %51
51: ; preds = %27
%52 = load i32, i32* %8
%53 = add nsw i32 %52, 1
store i32 %53, i32* %8
br label %23
54: ; preds = %23
%55 = load i8**, i8*** %4
ret i8** %55
}

LLVM IR (-O2):
@.str = [4 x i8] c"%i\0A\00"
@.str.3 = [4 x i8] c"%s\0A\00"
@.str.4 = [10 x i8] c"%s --> %s\00"
@str = [3 x i8] c"!!\00"
@str.5 = [6 x i8] c"lkjsd\00"
define i8** @__snippet_encrypt_blocks(i64* %0, i32 %1, i8** %2) {
%4 = tail call i32 (i8**, ...) bitcast (i32 (...)* @__snippet_block_count to i32 (i8**, ...)*)(i8** %2)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = icmp sgt i32 %4, 0
br i1 %6, label %7, label %28
7: ; preds = %3
%8 = zext i32 %4 to i64
br label %9
9: ; preds = %7, %9
%10 = phi i64 [ 0, %7 ], [ %26, %9 ]
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
%12 = getelementptr inbounds i8*, i8** %2, i64 %10
%13 = load i8*, i8** %12
%14 = ptrtoint i8* %13 to i64
%15 = trunc i64 %14 to i32
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.5, i64 0, i64 0))
%17 = shl i32 %15, 24
%18 = ashr exact i32 %17, 24
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %18)
%20 = tail call dereferenceable_or_null(16) i8* @malloc(i64 16)
%21 = shl i64 %14, 56
%22 = ashr exact i64 %21, 56
%23 = inttoptr i64 %22 to i8*
%24 = tail call i32 (i64*, i32, i8*, i8*, ...) bitcast (i32 (...)* @rijndaelEncrypt to i32 (i64*, i32, i8*, i8*, ...)*)(i64* %0, i32 %1, i8* %23, i8* %20)
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %18, i8* %20)
%26 = add nuw nsw i64 %10, 1
%27 = icmp eq i64 %26, %8
br i1 %27, label %28, label %9
28: ; preds = %9, %3
ret i8** undef
}