#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*/ keyinit(unsigned char *, unsigned int *);
int /*<<< orphan*/ misty1_decrypt(unsigned int *, unsigned char *,
                                  unsigned char *);
int /*<<< orphan*/ misty1_encrypt(unsigned int *, unsigned char *,
                                  unsigned char *);
int /*<<< orphan*/ printf(char *, ...);
int main(void) {
  int i;
  static unsigned char plaintext1[8] = {0x01, 0x23, 0x45, 0x67,
                                        0x89, 0xab, 0xcd, 0xef};
  static unsigned char plaintext2[8] = {0xfe, 0xdc, 0xba, 0x98,
                                        0x76, 0x54, 0x32, 0x10};
  static unsigned char key[16] = {0x00, 0x11, 0x22, 0x33, 0x44, 0x55,
                                  0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb,
                                  0xcc, 0xdd, 0xee, 0xff};
  static unsigned char ciphertext1[8];
  static unsigned char ciphertext2[8];
  static unsigned char decryptedplaintext1[8];
  static unsigned char decryptedplaintext2[8];
  unsigned int expandedkey[32];
  keyinit(key, expandedkey);
  printf("old plaintext1 : ");
  for (i = 0; i < 8; i++)
    printf("%02x", plaintext1[i]);
  printf("\n");
  misty1_encrypt(expandedkey, plaintext1, ciphertext1);
  printf("ciphertext1    : ");
  for (i = 0; i < 8; i++)
    printf("%02x", ciphertext1[i]);
  printf("\n");
  misty1_decrypt(expandedkey, ciphertext1, decryptedplaintext1);
  printf("new plaintext1 : ");
  for (i = 0; i < 8; i++)
    printf("%02x", decryptedplaintext1[i]);
  printf("\n\n");
  printf("old plaintext2 : ");
  for (i = 0; i < 8; i++)
    printf("%02x", plaintext2[i]);
  printf("\n");
  misty1_encrypt(expandedkey, plaintext2, ciphertext2);
  printf("ciphertext2    : ");
  for (i = 0; i < 8; i++)
    printf("%02x", ciphertext2[i]);
  printf("\n");
  misty1_decrypt(expandedkey, ciphertext2, decryptedplaintext2);
  printf("new plaintext2 : ");
  for (i = 0; i < 8; i++)
    printf("%02x", decryptedplaintext2[i]);
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x90(%rbp),%rsi
lea    0x2f00(%rip),%rdi
call   1060 <keyinit@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    11af <main+0x6f>
movslq -0x8(%rbp),%rcx
lea    0x2ec1(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117a <main+0x3a>
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0x2e85(%rip),%rsi
lea    0x2e9f(%rip),%rdx
call   1030 <misty1_encrypt@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1221 <main+0xe1>
movslq -0x8(%rbp),%rcx
lea    0x2e70(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xe06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11ec <main+0xac>
lea    0xe14(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0x2e34(%rip),%rsi
lea    0x2e3d(%rip),%rdx
call   1050 <misty1_decrypt@plt>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1293 <main+0x153>
movslq -0x8(%rbp),%rcx
lea    0x2e0e(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    125e <main+0x11e>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd96(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    12eb <main+0x1ab>
movslq -0x8(%rbp),%rcx
lea    0x2d8d(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xd3c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12b6 <main+0x176>
lea    0xd4a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0x2d51(%rip),%rsi
lea    0x2d6b(%rip),%rdx
call   1030 <misty1_encrypt@plt>
lea    0xd36(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    135d <main+0x21d>
movslq -0x8(%rbp),%rcx
lea    0x2d3c(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xcca(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1328 <main+0x1e8>
lea    0xcd8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x90(%rbp),%rdi
lea    0x2d00(%rip),%rsi
lea    0x2d09(%rip),%rdx
call   1050 <misty1_decrypt@plt>
lea    0xcd6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    13cf <main+0x28f>
movslq -0x8(%rbp),%rcx
lea    0x2cda(%rip),%rax
movzbl (%rax,%rcx,1),%esi
lea    0xc58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    139a <main+0x25a>
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0x2efb(%rip),%rdi
mov    %rsp,%r14
mov    %r14,%rsi
call   1080 <keyinit@plt>
lea    0xe79(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x2ecb(%rip),%r12
movzbl 0x2ec4(%rip),%esi
lea    0xe6f(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2ead(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e9d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e8d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e7d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e6d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e5d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e4d(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x2e4c(%rip),%r15
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <misty1_encrypt@plt>
lea    0xdcd(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e29(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e19(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2e09(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2df9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2de9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2dd9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2dc9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2db9(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x2da7(%rip),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <misty1_decrypt@plt>
lea    0xd2d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d87(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d77(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d67(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d57(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d47(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d37(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d27(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2d17(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xcdf(%rip),%rdi
call   1050 <puts@plt>
lea    0xc9d(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x2cbc(%rip),%r12
movzbl 0x2cb5(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2ca5(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c95(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c85(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c75(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c65(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c55(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c45(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x2c44(%rip),%r15
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
call   1030 <misty1_encrypt@plt>
lea    0xbf3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c21(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c11(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2c01(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2bf1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2be1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2bd1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2bc1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2bb1(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
lea    0x2b9f(%rip),%rdx
mov    %r14,%rdi
mov    %r15,%rsi
call   1070 <misty1_decrypt@plt>
lea    0xb53(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b7f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b6f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b5f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b4f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b3f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b2f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b1f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
movzbl 0x2b0f(%rip),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1040 <putchar@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@main.plaintext1 = internal global [8 x i8] c"\01#Eg\89\AB\CD\EF"
@main.plaintext2 = internal global [8 x i8] c"\FE\DC\BA\98vT2\10"
@main.key = internal global [16 x i8] c"\00\11\223DUfw\88\99\AA\BB\CC\DD\EE\FF"
@main.ciphertext1 = internal global [8 x i8] zeroinitializer
@main.ciphertext2 = internal global [8 x i8] zeroinitializer
@main.decryptedplaintext1 = internal global [8 x i8] zeroinitializer
@main.decryptedplaintext2 = internal global [8 x i8] zeroinitializer
@.str = [18 x i8] c"old plaintext1 : \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [18 x i8] c"ciphertext1 : \00"
@.str.4 = [18 x i8] c"new plaintext1 : \00"
@.str.5 = [3 x i8] c"\0A\0A\00"
@.str.6 = [18 x i8] c"old plaintext2 : \00"
@.str.7 = [18 x i8] c"ciphertext2 : \00"
@.str.8 = [18 x i8] c"new plaintext2 : \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [32 x i32]
store i32 0, i32* %1
%4 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%5 = call i32 @keyinit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @main.key, i64 0, i64 0), i32* %4)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %2
br label %7
7: ; preds = %17, %0
%8 = load i32, i32* %2
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %20
10: ; preds = %7
%11 = load i32, i32* %2
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 %12
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %2
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %7
20: ; preds = %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%22 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%23 = call i32 @misty1_encrypt(i32* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
store i32 0, i32* %2
br label %25
25: ; preds = %35, %20
%26 = load i32, i32* %2
%27 = icmp slt i32 %26, 8
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load i32, i32* %2
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %33)
br label %35
35: ; preds = %28
%36 = load i32, i32* %2
%37 = add nsw i32 %36, 1
store i32 %37, i32* %2
br label %25
38: ; preds = %25
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%40 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%41 = call i32 @misty1_decrypt(i32* %40, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 0))
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %2
br label %43
43: ; preds = %53, %38
%44 = load i32, i32* %2
%45 = icmp slt i32 %44, 8
br i1 %45, label %46, label %56
46: ; preds = %43
%47 = load i32, i32* %2
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds [8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 %48
%50 = load i8, i8* %49
%51 = zext i8 %50 to i32
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %51)
br label %53
53: ; preds = %46
%54 = load i32, i32* %2
%55 = add nsw i32 %54, 1
store i32 %55, i32* %2
br label %43
56: ; preds = %43
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %2
br label %59
59: ; preds = %69, %56
%60 = load i32, i32* %2
%61 = icmp slt i32 %60, 8
br i1 %61, label %62, label %72
62: ; preds = %59
%63 = load i32, i32* %2
%64 = sext i32 %63 to i64
%65 = getelementptr inbounds [8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 %64
%66 = load i8, i8* %65
%67 = zext i8 %66 to i32
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %67)
br label %69
69: ; preds = %62
%70 = load i32, i32* %2
%71 = add nsw i32 %70, 1
store i32 %71, i32* %2
br label %59
72: ; preds = %59
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%74 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%75 = call i32 @misty1_encrypt(i32* %74, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 0))
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %2
br label %77
77: ; preds = %87, %72
%78 = load i32, i32* %2
%79 = icmp slt i32 %78, 8
br i1 %79, label %80, label %90
80: ; preds = %77
%81 = load i32, i32* %2
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds [8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 %82
%84 = load i8, i8* %83
%85 = zext i8 %84 to i32
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %85)
br label %87
87: ; preds = %80
%88 = load i32, i32* %2
%89 = add nsw i32 %88, 1
store i32 %89, i32* %2
br label %77
90: ; preds = %77
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%92 = getelementptr inbounds [32 x i32], [32 x i32]* %3, i64 0, i64 0
%93 = call i32 @misty1_decrypt(i32* %92, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 0))
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
store i32 0, i32* %2
br label %95
95: ; preds = %105, %90
%96 = load i32, i32* %2
%97 = icmp slt i32 %96, 8
br i1 %97, label %98, label %108
98: ; preds = %95
%99 = load i32, i32* %2
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds [8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 %100
%102 = load i8, i8* %101
%103 = zext i8 %102 to i32
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %103)
br label %105
105: ; preds = %98
%106 = load i32, i32* %2
%107 = add nsw i32 %106, 1
store i32 %107, i32* %2
br label %95
108: ; preds = %95
%109 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@main.plaintext1 = internal global [8 x i8] c"\01#Eg\89\AB\CD\EF"
@main.plaintext2 = internal global [8 x i8] c"\FE\DC\BA\98vT2\10"
@main.key = internal global [16 x i8] c"\00\11\223DUfw\88\99\AA\BB\CC\DD\EE\FF"
@main.ciphertext1 = internal global [8 x i8] zeroinitializer
@main.ciphertext2 = internal global [8 x i8] zeroinitializer
@main.decryptedplaintext1 = internal global [8 x i8] zeroinitializer
@main.decryptedplaintext2 = internal global [8 x i8] zeroinitializer
@.str = [18 x i8] c"old plaintext1 : \00"
@.str.1 = [5 x i8] c"%02x\00"
@.str.3 = [18 x i8] c"ciphertext1 : \00"
@.str.4 = [18 x i8] c"new plaintext1 : \00"
@.str.6 = [18 x i8] c"old plaintext2 : \00"
@.str.7 = [18 x i8] c"ciphertext2 : \00"
@.str.8 = [18 x i8] c"new plaintext2 : \00"
@str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca [32 x i32]
%2 = bitcast [32 x i32]* %1 to i8*
%3 = getelementptr inbounds [32 x i32], [32 x i32]* %1, i64 0, i64 0
%4 = call i32 @keyinit(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @main.key, i64 0, i64 0), i32* %3)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%6 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 0)
%7 = zext i8 %6 to i32
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %7)
%9 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 1)
%10 = zext i8 %9 to i32
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %10)
%12 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 2)
%13 = zext i8 %12 to i32
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 3)
%16 = zext i8 %15 to i32
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 4)
%19 = zext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 5)
%22 = zext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 6)
%25 = zext i8 %24 to i32
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %25)
%27 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 7)
%28 = zext i8 %27 to i32
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = call i32 @putchar(i32 10)
%31 = call i32 @misty1_encrypt(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0))
%33 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 0)
%34 = zext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 1)
%37 = zext i8 %36 to i32
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %37)
%39 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 2)
%40 = zext i8 %39 to i32
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 3)
%43 = zext i8 %42 to i32
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %43)
%45 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 4)
%46 = zext i8 %45 to i32
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %46)
%48 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 5)
%49 = zext i8 %48 to i32
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %49)
%51 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 6)
%52 = zext i8 %51 to i32
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %52)
%54 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 7)
%55 = zext i8 %54 to i32
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %55)
%57 = call i32 @putchar(i32 10)
%58 = call i32 @misty1_decrypt(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext1, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 0))
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%60 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 0)
%61 = zext i8 %60 to i32
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %61)
%63 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 1)
%64 = zext i8 %63 to i32
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %64)
%66 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 2)
%67 = zext i8 %66 to i32
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %67)
%69 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 3)
%70 = zext i8 %69 to i32
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %70)
%72 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 4)
%73 = zext i8 %72 to i32
%74 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %73)
%75 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 5)
%76 = zext i8 %75 to i32
%77 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %76)
%78 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 6)
%79 = zext i8 %78 to i32
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %79)
%81 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext1, i64 0, i64 7)
%82 = zext i8 %81 to i32
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %82)
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%85 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%86 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 0)
%87 = zext i8 %86 to i32
%88 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %87)
%89 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 1)
%90 = zext i8 %89 to i32
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %90)
%92 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 2)
%93 = zext i8 %92 to i32
%94 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %93)
%95 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 3)
%96 = zext i8 %95 to i32
%97 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %96)
%98 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 4)
%99 = zext i8 %98 to i32
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %99)
%101 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 5)
%102 = zext i8 %101 to i32
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %102)
%104 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 6)
%105 = zext i8 %104 to i32
%106 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %105)
%107 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 7)
%108 = zext i8 %107 to i32
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %108)
%110 = call i32 @putchar(i32 10)
%111 = call i32 @misty1_encrypt(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.plaintext2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 0))
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%113 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 0)
%114 = zext i8 %113 to i32
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %114)
%116 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 1)
%117 = zext i8 %116 to i32
%118 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %117)
%119 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 2)
%120 = zext i8 %119 to i32
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %120)
%122 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 3)
%123 = zext i8 %122 to i32
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %123)
%125 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 4)
%126 = zext i8 %125 to i32
%127 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %126)
%128 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 5)
%129 = zext i8 %128 to i32
%130 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %129)
%131 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 6)
%132 = zext i8 %131 to i32
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %132)
%134 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 7)
%135 = zext i8 %134 to i32
%136 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %135)
%137 = call i32 @putchar(i32 10)
%138 = call i32 @misty1_decrypt(i32* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.ciphertext2, i64 0, i64 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 0))
%139 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%140 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 0)
%141 = zext i8 %140 to i32
%142 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %141)
%143 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 1)
%144 = zext i8 %143 to i32
%145 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %144)
%146 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 2)
%147 = zext i8 %146 to i32
%148 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %147)
%149 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 3)
%150 = zext i8 %149 to i32
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %150)
%152 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 4)
%153 = zext i8 %152 to i32
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %153)
%155 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 5)
%156 = zext i8 %155 to i32
%157 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %156)
%158 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 6)
%159 = zext i8 %158 to i32
%160 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %159)
%161 = load i8, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @main.decryptedplaintext2, i64 0, i64 7)
%162 = zext i8 %161 to i32
%163 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %162)
%164 = call i32 @putchar(i32 10)
ret i32 0
}