#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 */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ camellia_setup256(unsigned char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ memcpy(unsigned char *, unsigned char const *, int);
void camellia_setup192(const unsigned char *key, uint32_t *subkey) {
  unsigned char kk[32];
  uint32_t krll, krlr, krrl, krrr;
  memcpy(kk, key, 24);
  memcpy((unsigned char *)&krll, key + 16, 4);
  memcpy((unsigned char *)&krlr, key + 20, 4);
  krrl = ~krll;
  krrr = ~krlr;
  memcpy(kk + 24, (unsigned char *)&krrl, 4);
  memcpy(kk + 28, (unsigned char *)&krrr, 4);
  camellia_setup256(kk, subkey);
  return;
}


x86 assembly (clang, -O0):
<camellia_setup192>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x18,%edx
call   1030 <memcpy@plt>
lea    -0x34(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x10,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x38(%rbp),%rdi
mov    -0x8(%rbp),%rsi
add    $0x14,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0x34(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x38(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x40(%rbp)
lea    -0x30(%rbp),%rdi
add    $0x18,%rdi
lea    -0x3c(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
add    $0x1c,%rdi
lea    -0x40(%rbp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <camellia_setup256@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<camellia_setup192>:
push   %r15
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x18,%edx
call   1030 <memcpy@plt>
lea    0x10(%rbx),%rsi
lea    0xc(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
add    $0x14,%rbx
lea    0x8(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0xc(%rsp),%eax
not    %eax
mov    %eax,0x4(%rsp)
mov    0x8(%rsp),%eax
not    %eax
mov    %eax,(%rsp)
lea    0x28(%rsp),%rdi
lea    0x4(%rsp),%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
lea    0x2c(%rsp),%rdi
mov    %rsp,%rsi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <camellia_setup256@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @camellia_setup192(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca [32 x i8]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i8* %0, i8** %3
store i32* %1, i32** %4
%10 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%11 = load i8*, i8** %3
%12 = call i32 @memcpy(i8* %10, i8* %11, i32 24)
%13 = bitcast i32* %6 to i8*
%14 = load i8*, i8** %3
%15 = getelementptr inbounds i8, i8* %14, i64 16
%16 = call i32 @memcpy(i8* %13, i8* %15, i32 4)
%17 = bitcast i32* %7 to i8*
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 20
%20 = call i32 @memcpy(i8* %17, i8* %19, i32 4)
%21 = load i32, i32* %6
%22 = xor i32 %21, -1
store i32 %22, i32* %8
%23 = load i32, i32* %7
%24 = xor i32 %23, -1
store i32 %24, i32* %9
%25 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%26 = getelementptr inbounds i8, i8* %25, i64 24
%27 = bitcast i32* %8 to i8*
%28 = call i32 @memcpy(i8* %26, i8* %27, i32 4)
%29 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%30 = getelementptr inbounds i8, i8* %29, i64 28
%31 = bitcast i32* %9 to i8*
%32 = call i32 @memcpy(i8* %30, i8* %31, i32 4)
%33 = getelementptr inbounds [32 x i8], [32 x i8]* %5, i64 0, i64 0
%34 = load i32*, i32** %4
%35 = call i32 @camellia_setup256(i8* %33, i32* %34)
ret void
}

LLVM IR (-O2):
define void @camellia_setup192(i8* %0, i32* %1) {
%3 = alloca [32 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 0
%9 = bitcast i32* %4 to i8*
%10 = bitcast i32* %5 to i8*
%11 = bitcast i32* %6 to i8*
%12 = bitcast i32* %7 to i8*
%13 = call i32 @memcpy(i8* %8, i8* %0, i32 24)
%14 = getelementptr inbounds i8, i8* %0, i64 16
%15 = call i32 @memcpy(i8* %9, i8* %14, i32 4)
%16 = getelementptr inbounds i8, i8* %0, i64 20
%17 = call i32 @memcpy(i8* %10, i8* %16, i32 4)
%18 = load i32, i32* %4
%19 = xor i32 %18, -1
store i32 %19, i32* %6
%20 = load i32, i32* %5
%21 = xor i32 %20, -1
store i32 %21, i32* %7
%22 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 24
%23 = call i32 @memcpy(i8* %22, i8* %11, i32 4)
%24 = getelementptr inbounds [32 x i8], [32 x i8]* %3, i64 0, i64 28
%25 = call i32 @memcpy(i8* %24, i8* %12, i32 4)
%26 = call i32 @camellia_setup256(i8* %8, i32* %1)
ret void
}