#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, int, int, int);
void vlen_vs_alpha_twostep(int y, int invert) {
  set(100, y, 620, 240, (invert ? 0x7F : 0), 0x0001 | 0x0010);
  set(100, y, 620, 300, (invert ? 0x7F : 0), 0x0001 | 0x0010);
  set(100, y, 620, 360, (invert ? 0 : 0x7F), 0x0001 | 0x0010);
  set(100, y, 620, 420, (invert ? 0 : 0x7F), 0x0001 | 0x0010);
}


x86 assembly (clang, -O0):
<vlen_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    $0x64,%edi
mov    $0x26c,%edx
mov    $0xf0,%ecx
mov    $0x11,%r9d
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    $0x64,%edi
mov    $0x26c,%edx
mov    $0x12c,%ecx
mov    $0x11,%r9d
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    $0x64,%edi
mov    $0x26c,%edx
mov    $0x168,%ecx
mov    $0x11,%r9d
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    $0x64,%edi
mov    $0x26c,%edx
mov    $0x1a4,%ecx
mov    $0x11,%r9d
call   1030 <set@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vlen_vs_alpha_twostep>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%ebp
xor    %r14d,%r14d
test   %esi,%esi
mov    $0x7f,%eax
cmovne %eax,%ebx
cmove  %eax,%r14d
mov    $0x64,%edi
mov    %ebp,%esi
mov    $0x26c,%edx
mov    $0xf0,%ecx
mov    %ebx,%r8d
mov    $0x11,%r9d
call   1030 <set@plt>
mov    $0x64,%edi
mov    %ebp,%esi
mov    $0x26c,%edx
mov    $0x12c,%ecx
mov    %ebx,%r8d
mov    $0x11,%r9d
call   1030 <set@plt>
mov    $0x64,%edi
mov    %ebp,%esi
mov    $0x26c,%edx
mov    $0x168,%ecx
mov    %r14d,%r8d
mov    $0x11,%r9d
call   1030 <set@plt>
mov    $0x64,%edi
mov    %ebp,%esi
mov    $0x26c,%edx
mov    $0x1a4,%ecx
mov    %r14d,%r8d
mov    $0x11,%r9d
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <set@plt>

LLVM IR (-O0):
define void @vlen_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 100, i32 %5, i32 620, i32 240, i32 %9, i32 17)
%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 100, i32 %11, i32 620, i32 300, i32 %15, i32 17)
%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 100, i32 %17, i32 620, i32 360, i32 %21, i32 17)
%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 100, i32 %23, i32 620, i32 420, i32 %27, i32 17)
ret void
}

LLVM IR (-O2):
define void @vlen_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 100, i32 %0, i32 620, i32 240, i32 %4, i32 17)
%6 = tail call i32 @set(i32 100, i32 %0, i32 620, i32 300, i32 %4, i32 17)
%7 = select i1 %3, i32 127, i32 0
%8 = tail call i32 @set(i32 100, i32 %0, i32 620, i32 360, i32 %7, i32 17)
%9 = tail call i32 @set(i32 100, i32 %0, i32 620, i32 420, i32 %7, i32 17)
ret void
}