#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 */
unsigned char *expansion_function(unsigned char *);
int /*<<< orphan*/ free(unsigned char *);
unsigned char *p_function(unsigned char *);
unsigned char *s_box_function(unsigned char *);
unsigned char *string_xor(unsigned char *, unsigned char *);
unsigned char *f_function(unsigned char *right_block, unsigned char *key) {
  unsigned char *expanded_block;
  unsigned char *xor_string;
  unsigned char *f_string;
  unsigned char *s_string;
  expanded_block = expansion_function(right_block);
  xor_string = string_xor(expanded_block, key);
  s_string = s_box_function(xor_string);
  f_string = p_function(s_string);
  free(expanded_block);
  free(xor_string);
  free(s_string);
  return f_string;
}


x86 assembly (clang, -O0):
<f_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <expansion_function@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <string_xor@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <s_box_function@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <p_function@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x30(%rbp),%rdi
call   1030 <free@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_function>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
call   1050 <expansion_function@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
call   1060 <string_xor@plt>
mov    %rax,%r14
mov    %rax,%rdi
call   1070 <s_box_function@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <p_function@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r12,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @f_function(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = call i8* @expansion_function(i8* %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8*, i8** %4
%13 = call i8* @string_xor(i8* %11, i8* %12)
store i8* %13, i8** %6
%14 = load i8*, i8** %6
%15 = call i8* @s_box_function(i8* %14)
store i8* %15, i8** %8
%16 = load i8*, i8** %8
%17 = call i8* @p_function(i8* %16)
store i8* %17, i8** %7
%18 = load i8*, i8** %5
%19 = call i32 @free(i8* %18)
%20 = load i8*, i8** %6
%21 = call i32 @free(i8* %20)
%22 = load i8*, i8** %8
%23 = call i32 @free(i8* %22)
%24 = load i8*, i8** %7
ret i8* %24
}

LLVM IR (-O2):
define i8* @f_function(i8* %0, i8* %1) {
%3 = tail call i8* @expansion_function(i8* %0)
%4 = tail call i8* @string_xor(i8* %3, i8* %1)
%5 = tail call i8* @s_box_function(i8* %4)
%6 = tail call i8* @p_function(i8* %5)
%7 = tail call i32 @free(i8* %3)
%8 = tail call i32 @free(i8* %4)
%9 = tail call i32 @free(i8* %5)
ret i8* %6
}