#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 lSOne(unsigned short);
unsigned short pEight(unsigned short);
unsigned short pTen(unsigned short);
void keygen(unsigned short seed, unsigned short *kOne, unsigned short *kTwo) {
  *kOne = pTen(seed);
  *kOne = lSOne(*kOne);
  *kTwo = *kOne;
  *kOne = pEight(*kOne);
  *kTwo = lSOne(*kTwo);
  *kTwo = lSOne(*kTwo);
  *kTwo = pEight(*kTwo);
}


x86 assembly (clang, -O0):
<keygen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movzwl -0x2(%rbp),%edi
call   1040 <pTen@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%edi
call   1050 <lSOne@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x10(%rbp),%rax
movzwl (%rax),%edi
call   1030 <pEight@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1050 <lSOne@plt>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1050 <lSOne@plt>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x18(%rbp),%rax
movzwl (%rax),%edi
call   1030 <pEight@plt>
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<keygen>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
call   1040 <pTen@plt>
mov    %ax,(%rbx)
movzwl %ax,%edi
call   1050 <lSOne@plt>
mov    %ax,(%rbx)
mov    %ax,(%r14)
movzwl (%rbx),%edi
call   1030 <pEight@plt>
mov    %ax,(%rbx)
movzwl (%r14),%edi
call   1050 <lSOne@plt>
mov    %ax,(%r14)
movzwl %ax,%edi
call   1050 <lSOne@plt>
mov    %ax,(%r14)
movzwl %ax,%edi
call   1030 <pEight@plt>
mov    %ax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @keygen(i16 zeroext %0, i16* %1, i16* %2) {
%4 = alloca i16
%5 = alloca i16*
%6 = alloca i16*
store i16 %0, i16* %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16, i16* %4
%8 = call zeroext i16 @pTen(i16 zeroext %7)
%9 = load i16*, i16** %5
store i16 %8, i16* %9
%10 = load i16*, i16** %5
%11 = load i16, i16* %10
%12 = call zeroext i16 @lSOne(i16 zeroext %11)
%13 = load i16*, i16** %5
store i16 %12, i16* %13
%14 = load i16*, i16** %5
%15 = load i16, i16* %14
%16 = load i16*, i16** %6
store i16 %15, i16* %16
%17 = load i16*, i16** %5
%18 = load i16, i16* %17
%19 = call zeroext i16 @pEight(i16 zeroext %18)
%20 = load i16*, i16** %5
store i16 %19, i16* %20
%21 = load i16*, i16** %6
%22 = load i16, i16* %21
%23 = call zeroext i16 @lSOne(i16 zeroext %22)
%24 = load i16*, i16** %6
store i16 %23, i16* %24
%25 = load i16*, i16** %6
%26 = load i16, i16* %25
%27 = call zeroext i16 @lSOne(i16 zeroext %26)
%28 = load i16*, i16** %6
store i16 %27, i16* %28
%29 = load i16*, i16** %6
%30 = load i16, i16* %29
%31 = call zeroext i16 @pEight(i16 zeroext %30)
%32 = load i16*, i16** %6
store i16 %31, i16* %32
ret void
}

LLVM IR (-O2):
define void @keygen(i16 zeroext %0, i16* nocapture %1, i16* nocapture %2) {
%4 = tail call zeroext i16 @pTen(i16 zeroext %0)
store i16 %4, i16* %1
%5 = tail call zeroext i16 @lSOne(i16 zeroext %4)
store i16 %5, i16* %1
store i16 %5, i16* %2
%6 = load i16, i16* %1
%7 = tail call zeroext i16 @pEight(i16 zeroext %6)
store i16 %7, i16* %1
%8 = load i16, i16* %2
%9 = tail call zeroext i16 @lSOne(i16 zeroext %8)
store i16 %9, i16* %2
%10 = tail call zeroext i16 @lSOne(i16 zeroext %9)
store i16 %10, i16* %2
%11 = tail call zeroext i16 @pEight(i16 zeroext %10)
store i16 %11, i16* %2
ret void
}