#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(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)
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     1166 <emit_readdword_indexed_tlb+0x46>
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
xor    %edi,%edi
cmp    %esi,%ecx
setne  %dil
call   1040 <assert@plt>
test   %ebx,%ebx
js     1155 <emit_readdword_indexed_tlb+0x35>
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* %9
%12 = load i32, i32* %7
%13 = icmp ne i32 %11, %12
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
%16 = load i32, i32* %9
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %5
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = call i32 @emit_readword_indexed_tlb(i32 %19, i32 %20, i32 %21, i32 %22)
br label %24
24: ; preds = %18, %5
%25 = load i32, i32* %6
%26 = add nsw i32 %25, 4
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = load i32, i32* %10
%30 = call i32 @emit_readword_indexed_tlb(i32 %26, i32 %27, i32 %28, i32 %29)
ret void
}

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