#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_writeword_dualindexedx4(int, int, int);
int /*<<< orphan*/ emit_writeword_indexed(int, int, int);
void emit_writeword_indexed_tlb(int rt, int addr, int rs, int map, int temp) {
  if (map < 0)
    emit_writeword_indexed(rt, addr, rs);
  else {
    assert(addr == 0);
    emit_writeword_dualindexedx4(rt, rs, map);
  }
}


x86 assembly (clang, -O0):
<emit_writeword_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,-0x10(%rbp)
jge    1165 <emit_writeword_indexed_tlb+0x35>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <emit_writeword_indexed@plt>
jmp    1184 <emit_writeword_indexed_tlb+0x54>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <emit_writeword_dualindexedx4@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_writeword_indexed_tlb>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %edi,%ebx
test   %ecx,%ecx
js     115c <emit_writeword_indexed_tlb+0x2c>
mov    %ecx,%ebp
xor    %edi,%edi
test   %esi,%esi
sete   %dil
call   1050 <assert@plt>
mov    %ebx,%edi
mov    %r14d,%esi
mov    %ebp,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <emit_writeword_dualindexedx4@plt>
mov    %ebx,%edi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_writeword_indexed@plt>

LLVM IR (-O0):
define void @emit_writeword_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 = icmp slt i32 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %5
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = load i32, i32* %8
%17 = call i32 @emit_writeword_indexed(i32 %14, i32 %15, i32 %16)
br label %27
18: ; preds = %5
%19 = load i32, i32* %7
%20 = icmp eq i32 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load i32, i32* %6
%24 = load i32, i32* %8
%25 = load i32, i32* %9
%26 = call i32 @emit_writeword_dualindexedx4(i32 %23, i32 %24, i32 %25)
br label %27
27: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
define void @emit_writeword_indexed_tlb(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = icmp slt i32 %3, 0
br i1 %6, label %7, label %9
7: ; preds = %5
%8 = tail call i32 @emit_writeword_indexed(i32 %0, i32 %1, i32 %2)
br label %14
9: ; preds = %5
%10 = icmp eq i32 %1, 0
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32 @emit_writeword_dualindexedx4(i32 %0, i32 %2, i32 %3)
br label %14
14: ; preds = %9, %7
ret void
}