#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*/ set(int, int, int /*<<< orphan*/, int /*<<< orphan*/, int,
                       int);
void hstart_vs_alpha_twostep(int y, int invert) {
  set(240, y, 0, 0, (invert ? 0x7F : 0), 0x0002 | 0x0010);
  set(120, y, 0, 0, (invert ? 0x7F : 0), 0x0002 | 0x0010);
  set(-120, y, 0, 0, (invert ? 0 : 0x7F), 0x0002 | 0x0010);
  set(-240, y, 0, 0, (invert ? 0 : 0x7F), 0x0002 | 0x0010);
}


x86 assembly (clang, -O0):
<hstart_vs_alpha_twostep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7f,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0xf0,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
xor    %r8d,%r8d
mov    $0x7f,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0x78,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7f,%r8d
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0xffffff88,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%ecx
mov    $0x7f,%r8d
xor    %eax,%eax
cmp    $0x0,%ecx
cmovne %eax,%r8d
mov    $0xffffff10,%edi
xor    %ecx,%ecx
mov    $0x12,%r9d
mov    %ecx,%edx
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hstart_vs_alpha_twostep>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
xor    %eax,%eax
test   %esi,%esi
mov    $0x7f,%ebp
cmovne %ebp,%ebx
cmovne %eax,%ebp
mov    $0xf0,%edi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
mov    $0x12,%r9d
call   1030 <set@plt>
mov    $0x78,%edi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebx,%r8d
mov    $0x12,%r9d
call   1030 <set@plt>
mov    $0xffffff88,%edi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    $0x12,%r9d
call   1030 <set@plt>
mov    $0xffffff10,%edi
mov    %r14d,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %ebp,%r8d
mov    $0x12,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @hstart_vs_alpha_twostep(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i32 127, i32 0
%10 = call i32 @set(i32 240, i32 %5, i32 0, i32 0, i32 %9, i32 18)
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 127, i32 0
%16 = call i32 @set(i32 120, i32 %11, i32 0, i32 0, i32 %15, i32 18)
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 0, i32 127
%22 = call i32 @set(i32 -120, i32 %17, i32 0, i32 0, i32 %21, i32 18)
%23 = load i32, i32* %3
%24 = load i32, i32* %4
%25 = icmp ne i32 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i32 0, i32 127
%28 = call i32 @set(i32 -240, i32 %23, i32 0, i32 0, i32 %27, i32 18)
ret void
}

LLVM IR (-O2):
define void @hstart_vs_alpha_twostep(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = select i1 %3, i32 0, i32 127
%5 = tail call i32 @set(i32 240, i32 %0, i32 0, i32 0, i32 %4, i32 18)
%6 = tail call i32 @set(i32 120, i32 %0, i32 0, i32 0, i32 %4, i32 18)
%7 = select i1 %3, i32 127, i32 0
%8 = tail call i32 @set(i32 -120, i32 %0, i32 0, i32 0, i32 %7, i32 18)
%9 = tail call i32 @set(i32 -240, i32 %0, i32 0, i32 0, i32 %7, i32 18)
ret void
}