#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(unsigned char const *, unsigned int,
                                       unsigned char *, unsigned int,
                                       int /*<<< orphan*/ *, unsigned char *,
                                       unsigned int *);
scalar_t__ aes_key_wrap_with_padding(unsigned char const *, unsigned int,
                                     unsigned char const *, unsigned int,
                                     int /*<<< orphan*/ *, unsigned char *,
                                     unsigned int *);
int /*<<< orphan*/ printf(char *, ...);
int aeskw_with_padding_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_with_padding()\n");
  if (aes_key_wrap_with_padding(key, key_length, plaintext, plaintext_length,
                                NULL, ciphertext, &ciphertext_length)) {
    printf("Error encrypting using aes_key_wrap_with_padding()\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()\n");
  if (aes_key_unwrap_with_padding(key, key_length, ciphertext,
                                  ciphertext_length, NULL, plaintext_check,
                                  &plaintext_check_length)) {
    printf("Error decrypting using aes_key_unwrap_with_padding()\n");
    return (-1);
  }
  printf("Checking aes_key_unwrap_with_padding()\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>:
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   1040 <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   1030 <aes_key_wrap_with_padding@plt>
cmp    $0x0,%rax
je     11ad <aeskw_with_padding_test+0x7d>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x844(%rbp),%eax
cmp    -0x34(%rbp),%eax
je     11ed <aeskw_with_padding_test+0xbd>
mov    -0x844(%rbp),%esi
mov    -0x34(%rbp),%edx
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
lea    0xec5(%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    129b <aeskw_with_padding_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_with_padding_test+0x152>
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
jmp    1287 <aeskw_with_padding_test+0x157>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    121e <aeskw_with_padding_test+0xee>
lea    0xe5b(%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),%r9
xor    %eax,%eax
mov    %eax,%r8d
lea    -0x848(%rbp),%rax
mov    %rax,(%rsp)
call   1050 <aes_key_unwrap_with_padding@plt>
cmp    $0x0,%rax
je     12fd <aeskw_with_padding_test+0x1cd>
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
lea    0xe5f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x848(%rbp),%eax
cmp    -0x24(%rbp),%eax
je     133d <aeskw_with_padding_test+0x20d>
mov    -0x848(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
lea    0xe82(%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    13eb <aeskw_with_padding_test+0x2bb>
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     13d2 <aeskw_with_padding_test+0x2a2>
lea    0xe20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    13f2 <aeskw_with_padding_test+0x2c2>
jmp    13d7 <aeskw_with_padding_test+0x2a7>
mov    -0x84c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x84c(%rbp)
jmp    136e <aeskw_with_padding_test+0x23e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x870,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<aeskw_with_padding_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>
lea    0x8(%rsp),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
mov    %r14,%rdx
mov    %r15d,%ecx
xor    %r8d,%r8d
call   1040 <aes_key_wrap_with_padding@plt>
test   %rax,%rax
je     11a7 <aeskw_with_padding_test+0x67>
lea    0x102f(%rip),%rdi
call   1030 <puts@plt>
jmp    1248 <aeskw_with_padding_test+0x108>
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%esi
cmp    %ebp,%esi
jne    1238 <aeskw_with_padding_test+0xf8>
lea    0xefc(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
je     11f3 <aeskw_with_padding_test+0xb3>
add    $0xffffffff,%eax
add    $0x1,%rax
xor    %ecx,%ecx
nopl   0x0(%rax,%rax,1)
movzbl 0x10(%rsp,%rcx,1),%edx
cmp    (%rbx,%rcx,1),%dl
jne    125f <aeskw_with_padding_test+0x11f>
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11e0 <aeskw_with_padding_test+0xa0>
lea    0xedc(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rsp),%ecx
lea    0xc(%rsp),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%rdx
lea    0x410(%rsp),%r9
mov    %r13,%rdi
mov    %r12d,%esi
xor    %r8d,%r8d
call   1060 <aes_key_unwrap_with_padding@plt>
test   %rax,%rax
je     126b <aeskw_with_padding_test+0x12b>
lea    0xf3a(%rip),%rdi
jmp    119d <aeskw_with_padding_test+0x5d>
lea    0xdc1(%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    0xf3c(%rip),%rdi
jmp    119d <aeskw_with_padding_test+0x5d>
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%esi
cmp    %r15d,%esi
jne    12bb <aeskw_with_padding_test+0x17b>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
mov    0xc(%rsp),%ecx
test   %ecx,%ecx
je     12ca <aeskw_with_padding_test+0x18a>
add    $0xffffffff,%ecx
add    $0x1,%rcx
xor    %edx,%edx
nopl   (%rax)
movzbl (%r14,%rdx,1),%eax
cmp    0x410(%rsp,%rdx,1),%al
jne    12d1 <aeskw_with_padding_test+0x191>
add    $0x1,%rdx
xor    %eax,%eax
cmp    %rdx,%rcx
jne    12a0 <aeskw_with_padding_test+0x160>
jmp    124d <aeskw_with_padding_test+0x10d>
lea    0xd7a(%rip),%rdi
mov    %r15d,%edx
jmp    1241 <aeskw_with_padding_test+0x101>
xor    %eax,%eax
jmp    124d <aeskw_with_padding_test+0x10d>
lea    0xe6c(%rip),%rdi
jmp    119d <aeskw_with_padding_test+0x5d>

LLVM IR (-O0):
@.str = [46 x i8] c"Encrypting using aes_key_wrap_with_padding()\0A\00"
@.str.1 = [52 x i8] c"Error encrypting using aes_key_wrap_with_padding()\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 = [48 x i8] c"Decrypting using aes_key_unwrap_with_padding()\0A\00"
@.str.7 = [54 x i8] c"Error decrypting using aes_key_unwrap_with_padding()\0A\00"
@.str.8 = [40 x i8] c"Checking aes_key_unwrap_with_padding()\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(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 ([46 x i8], [46 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(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 ([52 x i8], [52 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 ([48 x i8], [48 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(i8* %67, i32 %68, i8* %69, i32 %70, i32* null, 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 ([54 x i8], [54 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 ([40 x i8], [40 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 = [45 x i8] c"Encrypting using aes_key_wrap_with_padding()\00"
@str.12 = [26 x i8] c"Checking known ciphertext\00"
@str.13 = [24 x i8] c"Encrypted lengths match\00"
@str.14 = [47 x i8] c"Decrypting using aes_key_unwrap_with_padding()\00"
@str.15 = [39 x i8] c"Checking aes_key_unwrap_with_padding()\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 = [53 x i8] c"Error decrypting using aes_key_unwrap_with_padding()\00"
@str.19 = [42 x i8] c"Error: ciphertext does not match expected\00"
@str.20 = [51 x i8] c"Error encrypting using aes_key_wrap_with_padding()\00"
define i32 @aeskw_with_padding_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 ([45 x i8], [45 x i8]* @str, i64 0, i64 0))
%16 = call i64 @aes_key_wrap_with_padding(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 ([51 x i8], [51 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 ([47 x i8], [47 x i8]* @str.14, i64 0, i64 0))
%48 = load i32, i32* %9
%49 = call i64 @aes_key_unwrap_with_padding(i8* %0, i32 %1, i8* %11, i32 %48, i32* null, 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 ([53 x i8], [53 x i8]* @str.18, i64 0, i64 0))
br label %79
53: ; preds = %46
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 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
}