#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 */
scalar_t__ aes_key_unwrap(unsigned char const *, unsigned int, unsigned char *,
                          unsigned int, int /*<<< orphan*/ *, unsigned char *,
                          unsigned int *, int /*<<< orphan*/ *);
scalar_t__ aes_key_wrap(unsigned char const *, unsigned int,
                        unsigned char const *, unsigned int,
                        int /*<<< orphan*/ *, unsigned char *, unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
int aeskw_test(const unsigned char *key, unsigned int key_length,
               const unsigned char *plaintext, unsigned int plaintext_length,
               const unsigned char *expected_ciphertext,
               unsigned int expected_ciphertext_length) {
  unsigned char ciphertext[1024];
  unsigned char plaintext_check[1024];
  unsigned int ciphertext_length;
  unsigned int plaintext_check_length;
  int i;
  const unsigned char *p1, *p2;
  printf("Encrypting using aes_key_wrap()\n");
  if (aes_key_wrap(key, key_length, plaintext, plaintext_length, NULL,
                   ciphertext, &ciphertext_length)) {
    printf("Error encrypting using aes_key_wrap()\n");
    return (-1);
  }
  printf("Checking known ciphertext\n");
  if (ciphertext_length != expected_ciphertext_length) {
    printf("Error: ciphertext length (%i) does not match "
           "expected (%i)\n",
           ciphertext_length, expected_ciphertext_length);
    return (-1);
  } else {
    printf("Encrypted lengths match\n");
  }
  for (i = 0, p1 = ciphertext, p2 = expected_ciphertext; i < ciphertext_length;
       i++) {
    if (*(p1++) != *(p2++)) {
      printf("Error: ciphertext does not match expected\n");
      return (-1);
    }
  }
  printf("Decrypting using aes_key_unwrap()\n");
  if (aes_key_unwrap(key, key_length, ciphertext, ciphertext_length, NULL,
                     plaintext_check, &plaintext_check_length, NULL)) {
    printf("Error decrypting using aes_key_unwrap()\n");
    return (-1);
  }
  printf("Checking aes_key_unwrap()\n");
  if (plaintext_check_length != plaintext_length) {
    printf("Error: Plaintext length (%i) does not match "
           "expected (%i)\n",
           plaintext_check_length, plaintext_length);
    return (-1);
  } else {
    printf("Decrypted lengths match\n");
  }
  for (i = 0, p1 = plaintext, p2 = plaintext_check; i < plaintext_check_length;
       i++) {
    if (*(p1++) != *(p2++)) {
      printf("Error: plaintext does not match expected\n");
      return (-1);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<aeskw_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x870,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %ecx,-0x24(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
lea    0xea8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    -0x440(%rbp),%r9
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x844(%rbp),%rax
mov    %rax,(%rsp)
call   1040 <aes_key_wrap@plt>
cmp    $0x0,%rax
je     11ad <aeskw_test+0x7d>
lea    0xe87(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x844(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     11ed <aeskw_test+0xbd>
mov    -0x844(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
lea    0xeab(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x84c(%rbp)
lea    -0x440(%rbp),%rax
mov    %rax,-0x858(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    -0x84c(%rbp),%eax
cmp    -0x844(%rbp),%eax
jae    129b <aeskw_test+0x16b>
mov    -0x858(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x858(%rbp)
movzbl (%rax),%eax
mov    -0x860(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x860(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     1282 <aeskw_test+0x152>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
jmp    1287 <aeskw_test+0x157>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    121e <aeskw_test+0xee>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x440(%rbp),%rdx
mov    -0x844(%rbp),%ecx
lea    -0x840(%rbp),%r9
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x848(%rbp),%rax
mov    %rax,(%rsp)
movq   $0x0,0x8(%rsp)
call   1050 <aes_key_unwrap@plt>
cmp    $0x0,%rax
je     1306 <aeskw_test+0x1d6>
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x848(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     1346 <aeskw_test+0x216>
mov    -0x848(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x84c(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x858(%rbp)
lea    -0x840(%rbp),%rax
mov    %rax,-0x860(%rbp)
mov    -0x84c(%rbp),%eax
cmp    -0x848(%rbp),%eax
jae    13f4 <aeskw_test+0x2c4>
mov    -0x858(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x858(%rbp)
movzbl (%rax),%eax
mov    -0x860(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x860(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
je     13db <aeskw_test+0x2ab>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13fb <aeskw_test+0x2cb>
jmp    13e0 <aeskw_test+0x2b0>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    1377 <aeskw_test+0x247>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeskw_test>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x818,%rsp
mov    %r9d,%ebp
mov    %r8,%rbx
mov    %ecx,%r15d
mov    %rdx,%r14
mov    %esi,%r12d
mov    %rdi,%r13
lea    0xf0d(%rip),%rdi
call   1030 <puts@plt>
sub    $0x8,%rsp
lea    0x10(%rsp),%rax
lea    0x18(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
xor    %r8d,%r8d
push   %rax
call   1050 <aes_key_wrap@plt>
add    $0x10,%rsp
test   %rax,%rax
je     11ac <aeskw_test+0x6c>
lea    0xff6(%rip),%rdi
call   1030 <puts@plt>
jmp    124b <aeskw_test+0x10b>
lea    0xee4(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%esi
cmp    %ebp,%esi
jne    123b <aeskw_test+0xfb>
lea    0xeea(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11f3 <aeskw_test+0xb3>
add    $0xffffffff,%eax
add    $0x1,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl 0x10(%rsp,%rcx,1),%edx
cmp    (%rbx,%rcx,1),%dl
jne    1262 <aeskw_test+0x122>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11e0 <aeskw_test+0xa0>
lea    0xecf(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%ecx
lea    0xc(%rsp),%rax
lea    0x10(%rsp),%rdx
lea    0x410(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
xor    %r8d,%r8d
push   $0x0
push   %rax
call   1060 <aes_key_unwrap@plt>
add    $0x10,%rsp
test   %rax,%rax
je     126e <aeskw_test+0x12e>
lea    0xf10(%rip),%rdi
jmp    11a2 <aeskw_test+0x62>
lea    0xdbe(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xf05(%rip),%rdi
jmp    11a2 <aeskw_test+0x62>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
cmp    %r15d,%esi
jne    12bb <aeskw_test+0x17b>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     12ca <aeskw_test+0x18a>
add    $0xffffffff,%ecx
add    $0x1,%rcx
xor    %edx,%edx
movzbl (%r14,%rdx,1),%eax
cmp    0x410(%rsp,%rdx,1),%al
jne    12ce <aeskw_test+0x18e>
add    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
jne    12a0 <aeskw_test+0x160>
jmp    1250 <aeskw_test+0x110>
lea    0xd7a(%rip),%rdi
mov    %r15d,%edx
jmp    1244 <aeskw_test+0x104>
xor    %eax,%eax
jmp    1250 <aeskw_test+0x110>
lea    0xe48(%rip),%rdi
jmp    11a2 <aeskw_test+0x62>

LLVM IR (-O0):
@.str = [33 x i8] c"Encrypting using aes_key_wrap()\0A\00"
@.str.1 = [39 x i8] c"Error encrypting using aes_key_wrap()\0A\00"
@.str.2 = [27 x i8] c"Checking known ciphertext\0A\00"
@.str.3 = [60 x i8] c"Error: ciphertext length (%i) does not match expected (%i)\0A\00"
@.str.4 = [25 x i8] c"Encrypted lengths match\0A\00"
@.str.5 = [43 x i8] c"Error: ciphertext does not match expected\0A\00"
@.str.6 = [35 x i8] c"Decrypting using aes_key_unwrap()\0A\00"
@.str.7 = [41 x i8] c"Error decrypting using aes_key_unwrap()\0A\00"
@.str.8 = [27 x i8] c"Checking aes_key_unwrap()\0A\00"
@.str.9 = [59 x i8] c"Error: Plaintext length (%i) does not match expected (%i)\0A\00"
@.str.10 = [25 x i8] c"Decrypted lengths match\0A\00"
@.str.11 = [42 x i8] c"Error: plaintext does not match expected\0A\00"
define i32 @aeskw_test(i8* %0, i32 %1, i8* %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i32
%14 = alloca [1024 x i8]
%15 = alloca [1024 x i8]
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i8* %4, i8** %12
store i32 %5, i32* %13
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%22 = load i8*, i8** %8
%23 = load i32, i32* %9
%24 = load i8*, i8** %10
%25 = load i32, i32* %11
%26 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%27 = call i64 @aes_key_wrap(i8* %22, i32 %23, i8* %24, i32 %25, i32* null, i8* %26, i32* %16)
%28 = icmp ne i64 %27, 0
br i1 %28, label %29, label %31
29: ; preds = %6
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %7
br label %111
31: ; preds = %6
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%33 = load i32, i32* %16
%34 = load i32, i32* %13
%35 = icmp ne i32 %33, %34
br i1 %35, label %36, label %40
36: ; preds = %31
%37 = load i32, i32* %16
%38 = load i32, i32* %13
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 %37, i32 %38)
store i32 -1, i32* %7
br label %111
40: ; preds = %31
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0))
br label %42
42: ; preds = %40
store i32 0, i32* %18
%43 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
store i8* %43, i8** %19
%44 = load i8*, i8** %12
store i8* %44, i8** %20
br label %45
45: ; preds = %62, %42
%46 = load i32, i32* %18
%47 = load i32, i32* %16
%48 = icmp ult i32 %46, %47
br i1 %48, label %49, label %65
49: ; preds = %45
%50 = load i8*, i8** %19
%51 = getelementptr inbounds i8, i8* %50, i32 1
store i8* %51, i8** %19
%52 = load i8, i8* %50
%53 = zext i8 %52 to i32
%54 = load i8*, i8** %20
%55 = getelementptr inbounds i8, i8* %54, i32 1
store i8* %55, i8** %20
%56 = load i8, i8* %54
%57 = zext i8 %56 to i32
%58 = icmp ne i32 %53, %57
br i1 %58, label %59, label %61
59: ; preds = %49
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0))
store i32 -1, i32* %7
br label %111
61: ; preds = %49
br label %62
62: ; preds = %61
%63 = load i32, i32* %18
%64 = add nsw i32 %63, 1
store i32 %64, i32* %18
br label %45
65: ; preds = %45
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.6, i64 0, i64 0))
%67 = load i8*, i8** %8
%68 = load i32, i32* %9
%69 = getelementptr inbounds [1024 x i8], [1024 x i8]* %14, i64 0, i64 0
%70 = load i32, i32* %16
%71 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
%72 = call i64 @aes_key_unwrap(i8* %67, i32 %68, i8* %69, i32 %70, i32* null, i8* %71, i32* %17, i32* null)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %65
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
store i32 -1, i32* %7
br label %111
76: ; preds = %65
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0))
%78 = load i32, i32* %17
%79 = load i32, i32* %11
%80 = icmp ne i32 %78, %79
br i1 %80, label %81, label %85
81: ; preds = %76
%82 = load i32, i32* %17
%83 = load i32, i32* %11
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 %82, i32 %83)
store i32 -1, i32* %7
br label %111
85: ; preds = %76
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.10, i64 0, i64 0))
br label %87
87: ; preds = %85
store i32 0, i32* %18
%88 = load i8*, i8** %10
store i8* %88, i8** %19
%89 = getelementptr inbounds [1024 x i8], [1024 x i8]* %15, i64 0, i64 0
store i8* %89, i8** %20
br label %90
90: ; preds = %107, %87
%91 = load i32, i32* %18
%92 = load i32, i32* %17
%93 = icmp ult i32 %91, %92
br i1 %93, label %94, label %110
94: ; preds = %90
%95 = load i8*, i8** %19
%96 = getelementptr inbounds i8, i8* %95, i32 1
store i8* %96, i8** %19
%97 = load i8, i8* %95
%98 = zext i8 %97 to i32
%99 = load i8*, i8** %20
%100 = getelementptr inbounds i8, i8* %99, i32 1
store i8* %100, i8** %20
%101 = load i8, i8* %99
%102 = zext i8 %101 to i32
%103 = icmp ne i32 %98, %102
br i1 %103, label %104, label %106
104: ; preds = %94
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.11, i64 0, i64 0))
store i32 -1, i32* %7
br label %111
106: ; preds = %94
br label %107
107: ; preds = %106
%108 = load i32, i32* %18
%109 = add nsw i32 %108, 1
store i32 %109, i32* %18
br label %90
110: ; preds = %90
store i32 0, i32* %7
br label %111
111: ; preds = %110, %104, %81, %74, %59, %36, %29
%112 = load i32, i32* %7
ret i32 %112
}

LLVM IR (-O2):
@.str.3 = [60 x i8] c"Error: ciphertext length (%i) does not match expected (%i)\0A\00"
@.str.9 = [59 x i8] c"Error: Plaintext length (%i) does not match expected (%i)\0A\00"
@str = [32 x i8] c"Encrypting using aes_key_wrap()\00"
@str.12 = [26 x i8] c"Checking known ciphertext\00"
@str.13 = [24 x i8] c"Encrypted lengths match\00"
@str.14 = [34 x i8] c"Decrypting using aes_key_unwrap()\00"
@str.15 = [26 x i8] c"Checking aes_key_unwrap()\00"
@str.16 = [24 x i8] c"Decrypted lengths match\00"
@str.17 = [41 x i8] c"Error: plaintext does not match expected\00"
@str.18 = [40 x i8] c"Error decrypting using aes_key_unwrap()\00"
@str.19 = [42 x i8] c"Error: ciphertext does not match expected\00"
@str.20 = [38 x i8] c"Error encrypting using aes_key_wrap()\00"
define i32 @aeskw_test(i8* %0, i32 %1, i8* %2, i32 %3, i8* nocapture %4, i32 %5) {
%7 = alloca [1024 x i8]
%8 = alloca [1024 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = getelementptr inbounds [1024 x i8], [1024 x i8]* %7, i64 0, i64 0
%12 = getelementptr inbounds [1024 x i8], [1024 x i8]* %8, i64 0, i64 0
%13 = bitcast i32* %9 to i8*
%14 = bitcast i32* %10 to i8*
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%16 = call i64 @aes_key_wrap(i8* %0, i32 %1, i8* %2, i32 %3, i32* null, i8* %11, i32* %9)
%17 = icmp eq i64 %16, 0
br i1 %17, label %20, label %18
18: ; preds = %6
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.20, i64 0, i64 0))
br label %79
20: ; preds = %6
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.12, i64 0, i64 0))
%22 = load i32, i32* %9
%23 = icmp eq i32 %22, %5
br i1 %23, label %26, label %24
24: ; preds = %20
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str.3, i64 0, i64 0), i32 %22, i32 %5)
br label %79
26: ; preds = %20
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.13, i64 0, i64 0))
%28 = load i32, i32* %9
%29 = icmp eq i32 %28, 0
br i1 %29, label %46, label %30
30: ; preds = %26
%31 = add i32 %28, -1
%32 = zext i32 %31 to i64
%33 = getelementptr [1024 x i8], [1024 x i8]* %7, i64 0, i64 %32
br label %34
34: ; preds = %30, %42
%35 = phi i8* [ %43, %42 ], [ %4, %30 ]
%36 = phi i8* [ %44, %42 ], [ %11, %30 ]
%37 = load i8, i8* %36
%38 = load i8, i8* %35
%39 = icmp eq i8 %37, %38
br i1 %39, label %42, label %40
40: ; preds = %34
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str.19, i64 0, i64 0))
br label %79
42: ; preds = %34
%43 = getelementptr inbounds i8, i8* %35, i64 1
%44 = getelementptr inbounds i8, i8* %36, i64 1
%45 = icmp eq i8* %36, %33
br i1 %45, label %46, label %34
46: ; preds = %42, %26
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.14, i64 0, i64 0))
%48 = load i32, i32* %9
%49 = call i64 @aes_key_unwrap(i8* %0, i32 %1, i8* %11, i32 %48, i32* null, i8* %12, i32* %10, i32* null)
%50 = icmp eq i64 %49, 0
br i1 %50, label %53, label %51
51: ; preds = %46
%52 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.18, i64 0, i64 0))
br label %79
53: ; preds = %46
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.15, i64 0, i64 0))
%55 = load i32, i32* %10
%56 = icmp eq i32 %55, %3
br i1 %56, label %59, label %57
57: ; preds = %53
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0), i32 %55, i32 %3)
br label %79
59: ; preds = %53
%60 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.16, i64 0, i64 0))
%61 = load i32, i32* %10
%62 = icmp eq i32 %61, 0
br i1 %62, label %79, label %63
63: ; preds = %59
%64 = add i32 %61, -1
%65 = zext i32 %64 to i64
%66 = getelementptr [1024 x i8], [1024 x i8]* %8, i64 0, i64 %65
br label %67
67: ; preds = %63, %75
%68 = phi i8* [ %76, %75 ], [ %12, %63 ]
%69 = phi i8* [ %77, %75 ], [ %2, %63 ]
%70 = load i8, i8* %69
%71 = load i8, i8* %68
%72 = icmp eq i8 %70, %71
br i1 %72, label %75, label %73
73: ; preds = %67
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.17, i64 0, i64 0))
br label %79
75: ; preds = %67
%76 = getelementptr inbounds i8, i8* %68, i64 1
%77 = getelementptr inbounds i8, i8* %69, i64 1
%78 = icmp eq i8* %68, %66
br i1 %78, label %79, label %67
79: ; preds = %75, %59, %73, %57, %51, %40, %24, %18
%80 = phi i32 [ -1, %18 ], [ -1, %24 ], [ -1, %40 ], [ -1, %51 ], [ -1, %57 ], [ -1, %73 ], [ 0, %59 ], [ 0, %75 ]
ret i32 %80
}