#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*/ emit_readword_indexed_tlb(int, int, int, int);
void emit_readdword_indexed_tlb(int addr, int rs, int map, int rh, int rl) {
  assert(map >= 0);
  assert(rh != rs);
  if (rh >= 0)
    emit_readword_indexed_tlb(addr, rs, map, rh);
  emit_readword_indexed_tlb(addr + 4, rs, map, rl);
}


x86 assembly (clang, -O0):
<emit_readdword_indexed_tlb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
cmpl   $0x0,-0x10(%rbp)
jl     1177 <emit_readdword_indexed_tlb+0x57>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1030 <emit_readword_indexed_tlb@plt>
mov    -0x4(%rbp),%edi
add    $0x4,%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1030 <emit_readword_indexed_tlb@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_readdword_indexed_tlb>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r8d,%r14d
mov    %ecx,%ebx
mov    %edx,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
mov    %edx,%edi
not    %edi
shr    $0x1f,%edi
call   1040 <assert@plt>
xor    %edi,%edi
cmp    %r12d,%ebx
setne  %dil
call   1040 <assert@plt>
test   %ebx,%ebx
js     1162 <emit_readdword_indexed_tlb+0x42>
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %ebx,%ecx
call   1030 <emit_readword_indexed_tlb@plt>
add    $0x4,%ebp
mov    %ebp,%edi
mov    %r12d,%esi
mov    %r15d,%edx
mov    %r14d,%ecx
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <emit_readword_indexed_tlb@plt>

LLVM IR (-O0):
define void @emit_readdword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32, i32* %8
%12 = icmp sge i32 %11, 0
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i32, i32* %9
%16 = load i32, i32* %7
%17 = icmp ne i32 %15, %16
%18 = zext i1 %17 to i32
%19 = call i32 @assert(i32 %18)
%20 = load i32, i32* %9
%21 = icmp sge i32 %20, 0
br i1 %21, label %22, label %28
22: ; preds = %5
%23 = load i32, i32* %6
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = load i32, i32* %9
%27 = call i32 @emit_readword_indexed_tlb(i32 %23, i32 %24, i32 %25, i32 %26)
br label %28
28: ; preds = %22, %5
%29 = load i32, i32* %6
%30 = add nsw i32 %29, 4
%31 = load i32, i32* %7
%32 = load i32, i32* %8
%33 = load i32, i32* %10
%34 = call i32 @emit_readword_indexed_tlb(i32 %30, i32 %31, i32 %32, i32 %33)
ret void
}

LLVM IR (-O2):
define void @emit_readdword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = xor i32 %2, -1
%7 = lshr i32 %6, 31
%8 = tail call i32 @assert(i32 %7)
%9 = icmp ne i32 %3, %1
%10 = zext i1 %9 to i32
%11 = tail call i32 @assert(i32 %10)
%12 = icmp sgt i32 %3, -1
br i1 %12, label %13, label %15
13: ; preds = %5
%14 = tail call i32 @emit_readword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3)
br label %15
15: ; preds = %13, %5
%16 = add nsw i32 %0, 4
%17 = tail call i32 @emit_readword_indexed_tlb(i32 %16, i32 %1, i32 %2, i32 %4)
ret void
}