#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*/ uint8_t;
struct lcpa_metapack {
  int dummy;
};

/* Variables and functions */
struct lcpa_metapack *lcpa_append_copy(struct lcpa_metapack *, char *, int,
                                       int /*<<< orphan*/ *);
int /*<<< orphan*/ lcpf_80211ctrlheaders(struct lcpa_metapack *, int, int, int,
                                         int, int /*<<< orphan*/ *);
void lcpf_rts(struct lcpa_metapack *pack, uint8_t *recvmac, uint8_t *transmac,
              int framecontrol, int duration) {
  lcpf_80211ctrlheaders(pack, 1, 11, framecontrol, duration, recvmac);
  pack = lcpa_append_copy(pack, "TRANSMITTERMAC", 6, transmac);
}


x86 assembly (clang, -O0):
<lcpf_rts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%ecx
mov    -0x20(%rbp),%r8d
mov    -0x10(%rbp),%r9
mov    $0x1,%esi
mov    $0xb,%edx
call   1040 <lcpf_80211ctrlheaders@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    0xe98(%rip),%rsi
mov    $0x6,%edx
call   1030 <lcpa_append_copy@plt>
mov    %rax,-0x8(%rbp)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcpf_rts>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r9
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0xb,%edx
call   1040 <lcpf_80211ctrlheaders@plt>
lea    0xebd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x6,%edx
mov    %r14,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <lcpa_append_copy@plt>

LLVM IR (-O0):
%struct.lcpa_metapack = type { i32 }
@.str = [15 x i8] c"TRANSMITTERMAC\00"
define void @lcpf_rts(%struct.lcpa_metapack* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = alloca %struct.lcpa_metapack*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store %struct.lcpa_metapack* %0, %struct.lcpa_metapack** %6
store i32* %1, i32** %7
store i32* %2, i32** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.lcpa_metapack*, %struct.lcpa_metapack** %6
%12 = load i32, i32* %9
%13 = load i32, i32* %10
%14 = load i32*, i32** %7
%15 = call i32 @lcpf_80211ctrlheaders(%struct.lcpa_metapack* %11, i32 1, i32 11, i32 %12, i32 %13, i32* %14)
%16 = load %struct.lcpa_metapack*, %struct.lcpa_metapack** %6
%17 = load i32*, i32** %8
%18 = call %struct.lcpa_metapack* @lcpa_append_copy(%struct.lcpa_metapack* %16, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 6, i32* %17)
store %struct.lcpa_metapack* %18, %struct.lcpa_metapack** %6
ret void
}

LLVM IR (-O2):
%struct.lcpa_metapack = type { i32 }
@.str = [15 x i8] c"TRANSMITTERMAC\00"
define void @lcpf_rts(%struct.lcpa_metapack* %0, i32* %1, i32* %2, i32 %3, i32 %4) {
%6 = tail call i32 @lcpf_80211ctrlheaders(%struct.lcpa_metapack* %0, i32 1, i32 11, i32 %3, i32 %4, i32* %1)
%7 = tail call %struct.lcpa_metapack* @lcpa_append_copy(%struct.lcpa_metapack* %0, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 6, i32* %2)
ret void
}