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

/* Variables and functions */
int /*<<< orphan*/ gsm0710_write_frame(struct gsm0710_context *,
                                       int /*<<< orphan*/, int, char *, int);
void gsm0710_set_status(struct gsm0710_context *ctx, int channel, int status) {
  char data[4];
  data[0] = (char)0xE3;
  data[1] = (char)0x03;
  data[2] = (char)((channel << 2) | 0x03);
  data[3] = (char)status;
  gsm0710_write_frame(ctx, 0, 0xEF, data, 4);
}


x86 assembly (clang, -O0):
<gsm0710_set_status>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movb   $0xe3,-0x14(%rbp)
movb   $0x3,-0x13(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
or     $0x3,%eax
mov    %al,-0x12(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x14(%rbp),%rcx
xor    %esi,%esi
mov    $0xef,%edx
mov    $0x4,%r8d
call   1030 <gsm0710_write_frame@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsm0710_set_status>:
push   %rax
movw   $0x3e3,0x4(%rsp)
shl    $0x2,%sil
or     $0x3,%sil
mov    %sil,0x6(%rsp)
mov    %dl,0x7(%rsp)
lea    0x4(%rsp),%rcx
xor    %esi,%esi
mov    $0xef,%edx
mov    $0x4,%r8d
call   1030 <gsm0710_write_frame@plt>
pop    %rax
ret

LLVM IR (-O0):
%struct.gsm0710_context = type { i32 }
define void @gsm0710_set_status(%struct.gsm0710_context* %0, i32 %1, i32 %2) {
%4 = alloca %struct.gsm0710_context*
%5 = alloca i32
%6 = alloca i32
%7 = alloca [4 x i8]
store %struct.gsm0710_context* %0, %struct.gsm0710_context** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
store i8 -29, i8* %8
%9 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 1
store i8 3, i8* %9
%10 = load i32, i32* %5
%11 = shl i32 %10, 2
%12 = or i32 %11, 3
%13 = trunc i32 %12 to i8
%14 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 2
store i8 %13, i8* %14
%15 = load i32, i32* %6
%16 = trunc i32 %15 to i8
%17 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 3
store i8 %16, i8* %17
%18 = load %struct.gsm0710_context*, %struct.gsm0710_context** %4
%19 = getelementptr inbounds [4 x i8], [4 x i8]* %7, i64 0, i64 0
%20 = call i32 @gsm0710_write_frame(%struct.gsm0710_context* %18, i32 0, i32 239, i8* %19, i32 4)
ret void
}

LLVM IR (-O2):
%struct.gsm0710_context = type { i32 }
define void @gsm0710_set_status(%struct.gsm0710_context* %0, i32 %1, i32 %2) {
%4 = alloca [4 x i8]
%5 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 0
store i8 -29, i8* %5
%6 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 1
store i8 3, i8* %6
%7 = trunc i32 %1 to i8
%8 = shl i8 %7, 2
%9 = or i8 %8, 3
%10 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %2 to i8
%12 = getelementptr inbounds [4 x i8], [4 x i8]* %4, i64 0, i64 3
store i8 %11, i8* %12
%13 = call i32 @gsm0710_write_frame(%struct.gsm0710_context* %0, i32 0, i32 239, i8* %5, i32 4)
ret void
}