#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 options;

/* Variables and functions */
int /*<<< orphan*/ SendChar(int);
void SetTouchPaneOption(unsigned char enbale, unsigned char beep_on,
                        unsigned char work_mode,
                        unsigned char press_calibration) {
  unsigned char options = 0;
  if (enbale)
    options |= 0x01;
  if (beep_on)
    options |= 0x02;
  if (work_mode)
    options |= (work_mode << 2);
  if (press_calibration)
    options |= (press_calibration << 5);
  SendChar((0XEE) & 0xFF);
  SendChar((0x70) & 0xFF);
  SendChar((options)&0xFF);
  SendChar((((0XFFFCFFFF) >> 16) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) >> 16) & 0xFF);
  SendChar((((0XFFFCFFFF) & 0xFFFF) >> 8) & 0xFF);
  SendChar(((0XFFFCFFFF) & 0xFFFF) & 0xFF);
}


x86 assembly (clang, -O0):
<SetTouchPaneOption>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %cl,-0x3(%rbp)
mov    %al,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
cmpb   $0x0,-0x1(%rbp)
je     1147 <SetTouchPaneOption+0x37>
movzbl -0x5(%rbp),%eax
or     $0x1,%eax
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x2(%rbp)
je     115b <SetTouchPaneOption+0x4b>
movzbl -0x5(%rbp),%eax
or     $0x2,%eax
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x3(%rbp)
je     1175 <SetTouchPaneOption+0x65>
movzbl -0x3(%rbp),%ecx
shl    $0x2,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
cmpb   $0x0,-0x4(%rbp)
je     118f <SetTouchPaneOption+0x7f>
movzbl -0x4(%rbp),%ecx
shl    $0x5,%ecx
movzbl -0x5(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x5(%rbp)
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x70,%edi
call   1030 <SendChar@plt>
movzbl -0x5(%rbp),%edi
and    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SetTouchPaneOption>:
push   %rbx
mov    %ecx,%ebx
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0x2(%rax),%ecx
test   %esi,%esi
movzbl %cl,%ecx
cmove  %eax,%ecx
shl    $0x2,%dl
or     %cl,%dl
shl    $0x5,%bl
or     %dl,%bl
mov    $0xee,%edi
call   1030 <SendChar@plt>
mov    $0x70,%edi
call   1030 <SendChar@plt>
movzbl %bl,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xfc,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
call   1030 <SendChar@plt>
mov    $0xff,%edi
pop    %rbx
jmp    1030 <SendChar@plt>

LLVM IR (-O0):
define void @SetTouchPaneOption(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i8 %3, i8* %8
store i8 0, i8* %9
%10 = load i8, i8* %5
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8, i8* %9
%14 = zext i8 %13 to i32
%15 = or i32 %14, 1
%16 = trunc i32 %15 to i8
store i8 %16, i8* %9
br label %17
17: ; preds = %12, %4
%18 = load i8, i8* %6
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i8, i8* %9
%22 = zext i8 %21 to i32
%23 = or i32 %22, 2
%24 = trunc i32 %23 to i8
store i8 %24, i8* %9
br label %25
25: ; preds = %20, %17
%26 = load i8, i8* %7
%27 = icmp ne i8 %26, 0
br i1 %27, label %28, label %36
28: ; preds = %25
%29 = load i8, i8* %7
%30 = zext i8 %29 to i32
%31 = shl i32 %30, 2
%32 = load i8, i8* %9
%33 = zext i8 %32 to i32
%34 = or i32 %33, %31
%35 = trunc i32 %34 to i8
store i8 %35, i8* %9
br label %36
36: ; preds = %28, %25
%37 = load i8, i8* %8
%38 = icmp ne i8 %37, 0
br i1 %38, label %39, label %47
39: ; preds = %36
%40 = load i8, i8* %8
%41 = zext i8 %40 to i32
%42 = shl i32 %41, 5
%43 = load i8, i8* %9
%44 = zext i8 %43 to i32
%45 = or i32 %44, %42
%46 = trunc i32 %45 to i8
store i8 %46, i8* %9
br label %47
47: ; preds = %39, %36
%48 = call i32 @SendChar(i32 238)
%49 = call i32 @SendChar(i32 112)
%50 = load i8, i8* %9
%51 = zext i8 %50 to i32
%52 = and i32 %51, 255
%53 = call i32 @SendChar(i32 %52)
%54 = call i32 @SendChar(i32 255)
%55 = call i32 @SendChar(i32 252)
%56 = call i32 @SendChar(i32 255)
%57 = call i32 @SendChar(i32 255)
ret void
}

LLVM IR (-O2):
define void @SetTouchPaneOption(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i8 zeroext %3) {
%5 = icmp ne i8 %0, 0
%6 = zext i1 %5 to i8
%7 = icmp eq i8 %1, 0
%8 = or i8 %6, 2
%9 = select i1 %7, i8 %6, i8 %8
%10 = shl i8 %2, 2
%11 = or i8 %9, %10
%12 = shl i8 %3, 5
%13 = or i8 %11, %12
%14 = tail call i32 @SendChar(i32 238)
%15 = tail call i32 @SendChar(i32 112)
%16 = zext i8 %13 to i32
%17 = tail call i32 @SendChar(i32 %16)
%18 = tail call i32 @SendChar(i32 255)
%19 = tail call i32 @SendChar(i32 252)
%20 = tail call i32 @SendChar(i32 255)
%21 = tail call i32 @SendChar(i32 255)
ret void
}