#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*/ printf(char *, unsigned int, unsigned int);
int simdl_getvalue(void *gen, unsigned int mode, unsigned int PID,
                   unsigned int *A, unsigned int *B, unsigned int *C,
                   unsigned int *D) {
  printf("In simdl_getvalue. Requested %02X %02X\n", mode, PID);
  if (0x00 == PID) {
    *A = 0xFF;
    *B = 0xFF;
    *C = 0xFF;
    *D = 0xFE;
  } else {
    *A = 0x11;
    *B = 0x22;
    *C = 0x33;
    *D = 0x44;
  }
  return 4;
}


x86 assembly (clang, -O0):
<simdl_getvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
cmp    -0x10(%rbp),%eax
jne    117c <simdl_getvalue+0x6c>
mov    -0x18(%rbp),%rax
movl   $0xff,(%rax)
mov    -0x20(%rbp),%rax
movl   $0xff,(%rax)
mov    -0x28(%rbp),%rax
movl   $0xff,(%rax)
mov    0x10(%rbp),%rax
movl   $0xfe,(%rax)
jmp    11a4 <simdl_getvalue+0x94>
mov    -0x18(%rbp),%rax
movl   $0x11,(%rax)
mov    -0x20(%rbp),%rax
movl   $0x22,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x33,(%rax)
mov    0x10(%rbp),%rax
movl   $0x44,(%rax)
mov    $0x4,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<simdl_getvalue>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%rbx
mov    %edx,%ebp
mov    0x30(%rsp),%r12
lea    0xed1(%rip),%rdi
call   1030 <printf@plt>
test   %ebp,%ebp
mov    $0xff,%eax
mov    $0x11,%ecx
cmove  %eax,%ecx
mov    $0x22,%edx
cmove  %eax,%edx
mov    $0x33,%esi
cmove  %eax,%esi
mov    $0xfe,%eax
mov    $0x44,%edi
cmove  %eax,%edi
mov    %ecx,(%rbx)
mov    %edx,(%r15)
mov    %esi,(%r14)
mov    %edi,(%r12)
mov    $0x4,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [40 x i8] c"In simdl_getvalue. Requested %02X %02X\0A\00"
define i32 @simdl_getvalue(i8* %0, i32 %1, i32 %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16)
%18 = load i32, i32* %10
%19 = icmp eq i32 0, %18
br i1 %19, label %20, label %25
20: ; preds = %7
%21 = load i32*, i32** %11
store i32 255, i32* %21
%22 = load i32*, i32** %12
store i32 255, i32* %22
%23 = load i32*, i32** %13
store i32 255, i32* %23
%24 = load i32*, i32** %14
store i32 254, i32* %24
br label %30
25: ; preds = %7
%26 = load i32*, i32** %11
store i32 17, i32* %26
%27 = load i32*, i32** %12
store i32 34, i32* %27
%28 = load i32*, i32** %13
store i32 51, i32* %28
%29 = load i32*, i32** %14
store i32 68, i32* %29
br label %30
30: ; preds = %25, %20
ret i32 4
}

LLVM IR (-O2):
@.str = [40 x i8] c"In simdl_getvalue. Requested %02X %02X\0A\00"
define i32 @simdl_getvalue(i8* nocapture readnone %0, i32 %1, i32 %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6) {
%8 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%9 = icmp eq i32 %2, 0
%10 = select i1 %9, i32 255, i32 17
%11 = select i1 %9, i32 255, i32 34
%12 = select i1 %9, i32 255, i32 51
%13 = select i1 %9, i32 254, i32 68
store i32 %10, i32* %3
store i32 %11, i32* %4
store i32 %12, i32* %5
store i32 %13, i32* %6
ret i32 4
}