#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*/ xtea_decipher(int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ const *);
void xtea_decipher_cbc(uint32_t v[2], const uint32_t key[4], uint32_t iv[2]) {
  uint32_t c0 = v[0];
  uint32_t c1 = v[1];
  xtea_decipher(v, key);
  v[0] ^= iv[0];
  v[1] ^= iv[1];
  iv[0] = c0;
  iv[1] = c1;
}


x86 assembly (clang, -O0):
<xtea_decipher_cbc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <xtea_decipher@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
mov    -0x8(%rbp),%rax
xor    (%rax),%ecx
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x8(%rbp),%rax
xor    0x4(%rax),%ecx
mov    %ecx,0x4(%rax)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,0x4(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xtea_decipher_cbc>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
mov    (%rdi),%r15
call   1030 <xtea_decipher@plt>
mov    (%r14),%eax
xor    %eax,(%rbx)
mov    0x4(%r14),%eax
xor    %eax,0x4(%rbx)
mov    %r15,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @xtea_decipher_cbc(i32* %0, i32* %1, i32* nocapture %2) {
%4 = load i32, i32* %0
%5 = getelementptr inbounds i32, i32* %0, i64 1
%6 = load i32, i32* %5
%7 = tail call i32 @xtea_decipher(i32* %0, i32* %1)
%8 = load i32, i32* %2
%9 = load i32, i32* %0
%10 = xor i32 %9, %8
store i32 %10, i32* %0
%11 = getelementptr inbounds i32, i32* %2, i64 1
%12 = load i32, i32* %11
%13 = load i32, i32* %5
%14 = xor i32 %13, %12
store i32 %14, i32* %5
store i32 %4, i32* %2
store i32 %6, i32* %11
ret void
}