#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 */
int /*<<< orphan*/ port_out(int, unsigned char);
int /*<<< orphan*/ timing_uPause(int);
void _sdec_control_wait(unsigned char register_select, unsigned char backlight,
                        unsigned char data, int usec) {
  port_out((0x0378 + 2), (register_select | backlight | 0x02) ^ 0x0B);
  port_out(0x0378, data);
  timing_uPause(1);
  port_out((0x0378 + 2), (register_select | backlight) ^ 0x0B);
  timing_uPause(usec);
}


x86 assembly (clang, -O0):
<_sdec_control_wait>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dl,%al
mov    %sil,%dl
mov    %dil,%sil
mov    %sil,-0x1(%rbp)
mov    %dl,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    %ecx,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
or     $0x2,%eax
xor    $0xb,%eax
mov    $0x37a,%edi
movzbl %al,%esi
call   1040 <port_out@plt>
mov    $0x378,%edi
movzbl -0x3(%rbp),%esi
call   1040 <port_out@plt>
mov    $0x1,%edi
call   1030 <timing_uPause@plt>
movzbl -0x1(%rbp),%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
xor    $0xb,%eax
mov    $0x37a,%edi
movzbl %al,%esi
call   1040 <port_out@plt>
mov    -0x8(%rbp),%edi
call   1030 <timing_uPause@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_sdec_control_wait>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %edi,%ebx
or     %esi,%ebx
mov    %ebx,%eax
or     $0x2,%al
xor    $0xb,%al
movzbl %al,%esi
mov    $0x37a,%edi
call   1040 <port_out@plt>
mov    $0x378,%edi
mov    %ebp,%esi
call   1040 <port_out@plt>
mov    $0x1,%edi
call   1030 <timing_uPause@plt>
xor    $0xb,%bl
movzbl %bl,%esi
mov    $0x37a,%edi
call   1040 <port_out@plt>
mov    %r14d,%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <timing_uPause@plt>

LLVM IR (-O0):
define void @_sdec_control_wait(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i32 %3) {
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
store i8 %0, i8* %5
store i8 %1, i8* %6
store i8 %2, i8* %7
store i32 %3, i32* %8
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = load i8, i8* %6
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = or i32 %13, 2
%15 = xor i32 %14, 11
%16 = trunc i32 %15 to i8
%17 = call i32 @port_out(i32 890, i8 zeroext %16)
%18 = load i8, i8* %7
%19 = call i32 @port_out(i32 888, i8 zeroext %18)
%20 = call i32 @timing_uPause(i32 1)
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %6
%24 = zext i8 %23 to i32
%25 = or i32 %22, %24
%26 = xor i32 %25, 11
%27 = trunc i32 %26 to i8
%28 = call i32 @port_out(i32 890, i8 zeroext %27)
%29 = load i32, i32* %8
%30 = call i32 @timing_uPause(i32 %29)
ret void
}

LLVM IR (-O2):
define void @_sdec_control_wait(i8 zeroext %0, i8 zeroext %1, i8 zeroext %2, i32 %3) {
%5 = or i8 %1, %0
%6 = or i8 %5, 2
%7 = xor i8 %6, 11
%8 = tail call i32 @port_out(i32 890, i8 zeroext %7)
%9 = tail call i32 @port_out(i32 888, i8 zeroext %2)
%10 = tail call i32 @timing_uPause(i32 1)
%11 = xor i8 %5, 11
%12 = tail call i32 @port_out(i32 890, i8 zeroext %11)
%13 = tail call i32 @timing_uPause(i32 %3)
ret void
}