#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_with_padding_openssl(unsigned char const *,
                                               unsigned int, unsigned char *,
                                               unsigned int, unsigned char *,
                                               unsigned int *);
scalar_t__ aes_key_wrap_with_padding_openssl(unsigned char const *,
                                             unsigned int,
                                             unsigned char const *,
                                             unsigned int, unsigned char *,
                                             unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
int aeskw_with_padding_test_openssl(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_with_padding_openssl()\n");
  if (aes_key_wrap_with_padding_openssl(key, key_length, plaintext,
                                        plaintext_length, ciphertext,
                                        &ciphertext_length)) {
    printf("Error encrypting using aes_key_wrap_with_padding_openssl()\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_with_padding_openssl()\n");
  if (aes_key_unwrap_with_padding_openssl(key, key_length, ciphertext,
                                          ciphertext_length, plaintext_check,
                                          &plaintext_check_length)) {
    printf("Error decrypting using aes_key_unwrap_with_padding_openssl()\n");
    return (-1);
  }
  printf("Checking aes_key_unwrap_with_padding_openssl()\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_with_padding_test_openssl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x860,%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   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
mov    -0x24(%rbp),%ecx
lea    -0x440(%rbp),%r8
lea    -0x844(%rbp),%r9
call   1030 <aes_key_wrap_with_padding_openssl@plt>
cmp    $0x0,%rax
je     11a4 <aeskw_with_padding_test_openssl+0x74>
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x844(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     11e4 <aeskw_with_padding_test_openssl+0xb4>
mov    -0x844(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1040 <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    1292 <aeskw_with_padding_test_openssl+0x162>
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     1279 <aeskw_with_padding_test_openssl+0x149>
lea    0xe7c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
jmp    127e <aeskw_with_padding_test_openssl+0x14e>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    1215 <aeskw_with_padding_test_openssl+0xe5>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
lea    -0x440(%rbp),%rdx
mov    -0x844(%rbp),%ecx
lea    -0x840(%rbp),%r8
lea    -0x848(%rbp),%r9
call   1050 <aes_key_unwrap_with_padding_openssl@plt>
cmp    $0x0,%rax
je     12eb <aeskw_with_padding_test_openssl+0x1bb>
lea    0xe6d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x848(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     132b <aeskw_with_padding_test_openssl+0x1fb>
mov    -0x848(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1040 <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    13d9 <aeskw_with_padding_test_openssl+0x2a9>
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     13c0 <aeskw_with_padding_test_openssl+0x290>
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13e0 <aeskw_with_padding_test_openssl+0x2b0>
jmp    13c5 <aeskw_with_padding_test_openssl+0x295>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    135c <aeskw_with_padding_test_openssl+0x22c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeskw_with_padding_test_openssl>:
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   1040 <puts@plt>
lea    0x10(%rsp),%r8
lea    0x8(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
call   1030 <aes_key_wrap_with_padding_openssl@plt>
test   %rax,%rax
je     11a0 <aeskw_with_padding_test_openssl+0x60>
lea    0x1056(%rip),%rdi
call   1040 <puts@plt>
jmp    1241 <aeskw_with_padding_test_openssl+0x101>
lea    0xf05(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%esi
cmp    %ebp,%esi
jne    1231 <aeskw_with_padding_test_openssl+0xf1>
lea    0xf0b(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11f3 <aeskw_with_padding_test_openssl+0xb3>
add    $0xffffffff,%eax
add    $0x1,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%rcx,1),%edx
cmp    (%rbx,%rcx,1),%dl
jne    1258 <aeskw_with_padding_test_openssl+0x118>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11e0 <aeskw_with_padding_test_openssl+0xa0>
lea    0xee4(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%ecx
lea    0x10(%rsp),%rdx
lea    0x410(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
call   1060 <aes_key_unwrap_with_padding_openssl@plt>
test   %rax,%rax
je     1264 <aeskw_with_padding_test_openssl+0x124>
lea    0xf59(%rip),%rdi
jmp    1196 <aeskw_with_padding_test_openssl+0x56>
lea    0xdc8(%rip),%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0xffffffff,%eax
add    $0x818,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xf63(%rip),%rdi
jmp    1196 <aeskw_with_padding_test_openssl+0x56>
lea    0xeaa(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%esi
cmp    %r15d,%esi
jne    12bb <aeskw_with_padding_test_openssl+0x17b>
lea    0xec4(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     12ca <aeskw_with_padding_test_openssl+0x18a>
add    $0xffffffff,%ecx
add    $0x1,%rcx
xor    %edx,%edx
cs nopw 0x0(%rax,%rax,1)
movzbl (%r14,%rdx,1),%eax
cmp    0x410(%rsp,%rdx,1),%al
jne    12d1 <aeskw_with_padding_test_openssl+0x191>
add    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
jne    12a0 <aeskw_with_padding_test_openssl+0x160>
jmp    1246 <aeskw_with_padding_test_openssl+0x106>
lea    0xd7a(%rip),%rdi
mov    %r15d,%edx
jmp    123a <aeskw_with_padding_test_openssl+0xfa>
xor    %eax,%eax
jmp    1246 <aeskw_with_padding_test_openssl+0x106>
lea    0xe84(%rip),%rdi
jmp    1196 <aeskw_with_padding_test_openssl+0x56>

LLVM IR (-O0):
@.str = [54 x i8] c"Encrypting using aes_key_wrap_with_padding_openssl()\0A\00"
@.str.1 = [60 x i8] c"Error encrypting using aes_key_wrap_with_padding_openssl()\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 = [56 x i8] c"Decrypting using aes_key_unwrap_with_padding_openssl()\0A\00"
@.str.7 = [62 x i8] c"Error decrypting using aes_key_unwrap_with_padding_openssl()\0A\00"
@.str.8 = [48 x i8] c"Checking aes_key_unwrap_with_padding_openssl()\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_with_padding_test_openssl(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 ([54 x i8], [54 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_with_padding_openssl(i8* %22, i32 %23, i8* %24, i32 %25, 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 ([60 x i8], [60 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 ([56 x i8], [56 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_with_padding_openssl(i8* %67, i32 %68, i8* %69, i32 %70, i8* %71, i32* %17)
%73 = icmp ne i64 %72, 0
br i1 %73, label %74, label %76
74: ; preds = %65
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 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 ([48 x i8], [48 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 = [53 x i8] c"Encrypting using aes_key_wrap_with_padding_openssl()\00"
@str.12 = [26 x i8] c"Checking known ciphertext\00"
@str.13 = [24 x i8] c"Encrypted lengths match\00"
@str.14 = [55 x i8] c"Decrypting using aes_key_unwrap_with_padding_openssl()\00"
@str.15 = [47 x i8] c"Checking aes_key_unwrap_with_padding_openssl()\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 = [61 x i8] c"Error decrypting using aes_key_unwrap_with_padding_openssl()\00"
@str.19 = [42 x i8] c"Error: ciphertext does not match expected\00"
@str.20 = [59 x i8] c"Error encrypting using aes_key_wrap_with_padding_openssl()\00"
define i32 @aeskw_with_padding_test_openssl(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 ([53 x i8], [53 x i8]* @str, i64 0, i64 0))
%16 = call i64 @aes_key_wrap_with_padding_openssl(i8* %0, i32 %1, i8* %2, i32 %3, 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 ([59 x i8], [59 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 ([55 x i8], [55 x i8]* @str.14, i64 0, i64 0))
%48 = load i32, i32* %9
%49 = call i64 @aes_key_unwrap_with_padding_openssl(i8* %0, i32 %1, i8* %11, i32 %48, i8* %12, i32* %10)
%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 ([61 x i8], [61 x i8]* @str.18, i64 0, i64 0))
br label %79
53: ; preds = %46
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 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
}