#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 */
unsigned short pgm_read_byte(unsigned char *);
unsigned short getFieldInfo(unsigned char *method_code, unsigned short *offset,
                            unsigned char *size) {
  unsigned char fsize;
  unsigned short foffset;
  unsigned short classIndex = pgm_read_byte(++method_code) << 8;
  classIndex |= pgm_read_byte(++method_code);
  fsize = pgm_read_byte(++method_code);
  foffset = pgm_read_byte(++method_code) << 8;
  foffset |= pgm_read_byte(++method_code);
  *offset = foffset;
  *size = fsize;
  return classIndex;
}


x86 assembly (clang, -O0):
<getFieldInfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <pgm_read_byte@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x1e(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <pgm_read_byte@plt>
movzwl %ax,%ecx
movzwl -0x1e(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x1e(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <pgm_read_byte@plt>
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <pgm_read_byte@plt>
movzwl %ax,%eax
shl    $0x8,%eax
mov    %ax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    %rdi,-0x8(%rbp)
call   1030 <pgm_read_byte@plt>
movzwl %ax,%ecx
movzwl -0x1c(%rbp),%eax
or     %ecx,%eax
mov    %ax,-0x1c(%rbp)
mov    -0x1c(%rbp),%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x19(%rbp),%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
movzwl -0x1e(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFieldInfo>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
add    $0x1,%rdi
call   1030 <pgm_read_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
lea    0x2(%rbx),%rdi
call   1030 <pgm_read_byte@plt>
mov    %eax,%r12d
or     %ebp,%r12d
lea    0x3(%rbx),%rdi
call   1030 <pgm_read_byte@plt>
mov    %eax,%r13d
lea    0x4(%rbx),%rdi
call   1030 <pgm_read_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x5,%rbx
mov    %rbx,%rdi
call   1030 <pgm_read_byte@plt>
or     %ebp,%eax
mov    %ax,(%r15)
mov    %r13b,(%r14)
mov    %r12d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i16 @getFieldInfo(i8* %0, i16* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i16
%9 = alloca i16
store i8* %0, i8** %4
store i16* %1, i16** %5
store i8* %2, i8** %6
%10 = load i8*, i8** %4
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %4
%12 = call zeroext i16 @pgm_read_byte(i8* %11)
%13 = zext i16 %12 to i32
%14 = shl i32 %13, 8
%15 = trunc i32 %14 to i16
store i16 %15, i16* %9
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i32 1
store i8* %17, i8** %4
%18 = call zeroext i16 @pgm_read_byte(i8* %17)
%19 = zext i16 %18 to i32
%20 = load i16, i16* %9
%21 = zext i16 %20 to i32
%22 = or i32 %21, %19
%23 = trunc i32 %22 to i16
store i16 %23, i16* %9
%24 = load i8*, i8** %4
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %4
%26 = call zeroext i16 @pgm_read_byte(i8* %25)
%27 = trunc i16 %26 to i8
store i8 %27, i8* %7
%28 = load i8*, i8** %4
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %4
%30 = call zeroext i16 @pgm_read_byte(i8* %29)
%31 = zext i16 %30 to i32
%32 = shl i32 %31, 8
%33 = trunc i32 %32 to i16
store i16 %33, i16* %8
%34 = load i8*, i8** %4
%35 = getelementptr inbounds i8, i8* %34, i32 1
store i8* %35, i8** %4
%36 = call zeroext i16 @pgm_read_byte(i8* %35)
%37 = zext i16 %36 to i32
%38 = load i16, i16* %8
%39 = zext i16 %38 to i32
%40 = or i32 %39, %37
%41 = trunc i32 %40 to i16
store i16 %41, i16* %8
%42 = load i16, i16* %8
%43 = load i16*, i16** %5
store i16 %42, i16* %43
%44 = load i8, i8* %7
%45 = load i8*, i8** %6
store i8 %44, i8* %45
%46 = load i16, i16* %9
ret i16 %46
}

LLVM IR (-O2):
define zeroext i16 @getFieldInfo(i8* %0, i16* nocapture writeonly %1, i8* nocapture writeonly %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = tail call zeroext i16 @pgm_read_byte(i8* %4)
%6 = shl i16 %5, 8
%7 = getelementptr inbounds i8, i8* %0, i64 2
%8 = tail call zeroext i16 @pgm_read_byte(i8* %7)
%9 = or i16 %6, %8
%10 = getelementptr inbounds i8, i8* %0, i64 3
%11 = tail call zeroext i16 @pgm_read_byte(i8* %10)
%12 = trunc i16 %11 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 4
%14 = tail call zeroext i16 @pgm_read_byte(i8* %13)
%15 = shl i16 %14, 8
%16 = getelementptr inbounds i8, i8* %0, i64 5
%17 = tail call zeroext i16 @pgm_read_byte(i8* %16)
%18 = or i16 %15, %17
store i16 %18, i16* %1
store i8 %12, i8* %2
ret i16 %9
}