#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*/ assert(int);
int /*<<< orphan*/ io_clear_bit(int);
int /*<<< orphan*/ io_set_bit(int);
void elev_set_floor_indicator(int floor) {
  assert(floor >= 0);
  assert(floor < 4);
  if (floor & 0x02)
    io_set_bit((0x300 + 0));
  else
    io_clear_bit((0x300 + 0));
  if (floor & 0x01)
    io_set_bit((0x300 + 1));
  else
    io_clear_bit((0x300 + 1));
}


x86 assembly (clang, -O0):
<elev_set_floor_indicator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x4,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x4(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
je     117b <elev_set_floor_indicator+0x4b>
mov    $0x300,%edi
call   1040 <io_set_bit@plt>
jmp    1185 <elev_set_floor_indicator+0x55>
mov    $0x300,%edi
call   1050 <io_clear_bit@plt>
mov    -0x4(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     11a3 <elev_set_floor_indicator+0x73>
mov    $0x301,%edi
call   1040 <io_set_bit@plt>
jmp    11ad <elev_set_floor_indicator+0x7d>
mov    $0x301,%edi
call   1050 <io_clear_bit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<elev_set_floor_indicator>:
push   %rbx
mov    %edi,%ebx
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
xor    %edi,%edi
cmp    $0x4,%ebx
setl   %dil
call   1030 <assert@plt>
mov    $0x300,%edi
test   $0x2,%bl
jne    115c <elev_set_floor_indicator+0x2c>
call   1050 <io_clear_bit@plt>
jmp    1161 <elev_set_floor_indicator+0x31>
call   1040 <io_set_bit@plt>
mov    $0x301,%edi
test   $0x1,%bl
jne    1171 <elev_set_floor_indicator+0x41>
pop    %rbx
jmp    1050 <io_clear_bit@plt>
pop    %rbx
jmp    1040 <io_set_bit@plt>

LLVM IR (-O0):
define void @elev_set_floor_indicator(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 4
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i32, i32* %2
%12 = and i32 %11, 2
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = call i32 @io_set_bit(i32 768)
br label %18
16: ; preds = %1
%17 = call i32 @io_clear_bit(i32 768)
br label %18
18: ; preds = %16, %14
%19 = load i32, i32* %2
%20 = and i32 %19, 1
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @io_set_bit(i32 769)
br label %26
24: ; preds = %18
%25 = call i32 @io_clear_bit(i32 769)
br label %26
26: ; preds = %24, %22
ret void
}

LLVM IR (-O2):
define void @elev_set_floor_indicator(i32 %0) {
%2 = xor i32 %0, -1
%3 = lshr i32 %2, 31
%4 = tail call i32 @assert(i32 %3)
%5 = icmp slt i32 %0, 4
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = and i32 %0, 2
%9 = icmp eq i32 %8, 0
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 @io_set_bit(i32 768)
br label %14
12: ; preds = %1
%13 = tail call i32 @io_clear_bit(i32 768)
br label %14
14: ; preds = %12, %10
%15 = and i32 %0, 1
%16 = icmp eq i32 %15, 0
br i1 %16, label %19, label %17
17: ; preds = %14
%18 = tail call i32 @io_set_bit(i32 769)
br label %21
19: ; preds = %14
%20 = tail call i32 @io_clear_bit(i32 769)
br label %21
21: ; preds = %19, %17
ret void
}