#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_dualindexedx4(int, int, int);
int /*<<< orphan*/ emit_readword_indexed(int, int, int);
void emit_readword_indexed_map(int addr, int rs, int map, int rt) {
  if (map < 0)
    emit_readword_indexed(addr, rs, rt);
  else {
    assert(addr == 0);
    emit_readword_dualindexedx4(rs, map, rt);
  }
}


x86 assembly (clang, -O0):
<emit_readword_indexed_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1161 <emit_readword_indexed_map+0x31>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <emit_readword_indexed@plt>
jmp    1180 <emit_readword_indexed_map+0x50>
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <emit_readword_dualindexedx4@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_readword_indexed_map>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
test   %edx,%edx
js     115d <emit_readword_indexed_map+0x2d>
mov    %edx,%ebx
xor    %eax,%eax
test   %edi,%edi
sete   %al
mov    %eax,%edi
call   1040 <assert@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_readword_dualindexedx4@plt>
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <emit_readword_indexed@plt>

LLVM IR (-O0):
define void @emit_readword_indexed_map(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %4
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = call i32 @emit_readword_indexed(i32 %12, i32 %13, i32 %14)
br label %25
16: ; preds = %4
%17 = load i32, i32* %5
%18 = icmp eq i32 %17, 0
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %6
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = call i32 @emit_readword_dualindexedx4(i32 %21, i32 %22, i32 %23)
br label %25
25: ; preds = %16, %11
ret void
}

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