#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;

/* Variables and functions */
void readIDRequestPacket(uint8_t *data, uint8_t **parent_key, uint8_t **name,
                         uint8_t *get_children, uint8_t *get_children_all) {
  (*parent_key) = data + 2;
  (*name) = data + (*parent_key)[0] + 3;
  (*get_children) = !!(data[1] & 0x01);
  (*get_children_all) = !!(data[1] & 0x02);
}


x86 assembly (clang, -O0):
<readIDRequestPacket>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rcx
add    $0x8,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq (%rax),%rax
shl    $0x2,%rax
add    %rax,%rcx
add    $0xc,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<readIDRequestPacket>:
lea    0x8(%rdi),%rax
mov    %rax,(%rsi)
movslq 0x8(%rdi),%rax
lea    (%rdi,%rax,4),%rax
add    $0xc,%rax
mov    %rax,(%rdx)
mov    0x4(%rdi),%eax
and    $0x1,%eax
mov    %eax,(%rcx)
mov    0x4(%rdi),%eax
shr    %eax
and    $0x1,%eax
mov    %eax,(%r8)
ret

LLVM IR (-O0):
define void @readIDRequestPacket(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** %6
%12 = getelementptr inbounds i32, i32* %11, i64 2
%13 = load i32**, i32*** %7
store i32* %12, i32** %13
%14 = load i32*, i32** %6
%15 = load i32**, i32*** %7
%16 = load i32*, i32** %15
%17 = getelementptr inbounds i32, i32* %16, i64 0
%18 = load i32, i32* %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %14, i64 %19
%21 = getelementptr inbounds i32, i32* %20, i64 3
%22 = load i32**, i32*** %8
store i32* %21, i32** %22
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 1
%25 = load i32, i32* %24
%26 = and i32 %25, 1
%27 = icmp ne i32 %26, 0
%28 = xor i1 %27, true
%29 = xor i1 %28, true
%30 = zext i1 %29 to i32
%31 = load i32*, i32** %9
store i32 %30, i32* %31
%32 = load i32*, i32** %6
%33 = getelementptr inbounds i32, i32* %32, i64 1
%34 = load i32, i32* %33
%35 = and i32 %34, 2
%36 = icmp ne i32 %35, 0
%37 = xor i1 %36, true
%38 = xor i1 %37, true
%39 = zext i1 %38 to i32
%40 = load i32*, i32** %10
store i32 %39, i32* %40
ret void
}

LLVM IR (-O2):
define void @readIDRequestPacket(i32* %0, i32** nocapture writeonly %1, i32** nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4) {
%6 = getelementptr inbounds i32, i32* %0, i64 2
store i32* %6, i32** %1
%7 = load i32, i32* %6
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = getelementptr inbounds i32, i32* %9, i64 3
store i32* %10, i32** %2
%11 = getelementptr inbounds i32, i32* %0, i64 1
%12 = load i32, i32* %11
%13 = and i32 %12, 1
store i32 %13, i32* %3
%14 = load i32, i32* %11
%15 = lshr i32 %14, 1
%16 = and i32 %15, 1
store i32 %16, i32* %4
ret void
}