#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 */
typedef int uint8_t;
typedef int uint16_t;

/* Variables and functions */
int read8low(int /*<<< orphan*/);
void dictionary_get(uint16_t addr, uint16_t *p) {
  uint8_t c = 3 > 3 ? 3 : 2;
  uint16_t w;
  while (c--) {
    w = read8low(addr++);
    *p++ = (w << 8) | read8low(addr++);
  }
}


x86 assembly (clang, -O0):
<dictionary_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x2,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x14(%rbp)
cmp    $0x0,%eax
je     1181 <dictionary_get+0x71>
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <read8low@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0x8,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    %edi,%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
call   1030 <read8low@plt>
mov    -0x1c(%rbp),%ecx
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x10(%rbp)
mov    %ecx,(%rax)
jmp    1126 <dictionary_get+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dictionary_get>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebx
lea    0x1(%rbx),%r15d
call   1030 <read8low@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
lea    0x2(%rbx),%r12d
mov    %r15d,%edi
call   1030 <read8low@plt>
or     %ebp,%eax
mov    %eax,(%r14)
add    $0x3,%ebx
mov    %r12d,%edi
call   1030 <read8low@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %ebx,%edi
call   1030 <read8low@plt>
or     %ebp,%eax
mov    %eax,0x4(%r14)
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dictionary_get(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32* %1, i32** %4
store i32 2, i32* %5
br label %7
7: ; preds = %11, %2
%8 = load i32, i32* %5
%9 = add nsw i32 %8, -1
store i32 %9, i32* %5
%10 = icmp ne i32 %8, 0
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
%14 = call i32 @read8low(i32 %12)
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = shl i32 %15, 8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
%19 = call i32 @read8low(i32 %17)
%20 = or i32 %16, %19
%21 = load i32*, i32** %4
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %4
store i32 %20, i32* %21
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @dictionary_get(i32 %0, i32* nocapture writeonly %1) {
%3 = add nsw i32 %0, 1
%4 = tail call i32 @read8low(i32 %0)
%5 = shl i32 %4, 8
%6 = add nsw i32 %0, 2
%7 = tail call i32 @read8low(i32 %3)
%8 = or i32 %5, %7
%9 = getelementptr inbounds i32, i32* %1, i64 1
store i32 %8, i32* %1
%10 = add nsw i32 %0, 3
%11 = tail call i32 @read8low(i32 %6)
%12 = shl i32 %11, 8
%13 = tail call i32 @read8low(i32 %10)
%14 = or i32 %12, %13
store i32 %14, i32* %9
ret void
}