#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 atoi(char *);
int /*<<< orphan*/ printf(char *, unsigned short, unsigned short,
                          unsigned short);
int commandlineseed(char **seeds) {
  unsigned short seedv[3], *seed48();
  seedv[0] = atoi(seeds[0]);
  seedv[1] = atoi(seeds[1]);
  seedv[2] = atoi(seeds[2]);
  printf("\n%d %d %d\n", seedv[0], seedv[1], seedv[2]);
  seed48(seedv);
  return (3);
}


x86 assembly (clang, -O0):
<commandlineseed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1050 <atoi@plt>
mov    %ax,-0xe(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <atoi@plt>
mov    %ax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <atoi@plt>
mov    %ax,-0xa(%rbp)
mov    -0xe(%rbp),%cx
mov    -0xc(%rbp),%ax
lea    0xe83(%rip),%rdi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0xa(%rbp),%ecx
call   1030 <printf@plt>
lea    -0xe(%rbp),%rdi
mov    $0x0,%al
call   1040 <seed48@plt>
mov    $0x3,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<commandlineseed>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1050 <atoi@plt>
mov    %eax,%r14d
mov    %ax,0xa(%rsp)
mov    0x8(%rbx),%rdi
call   1050 <atoi@plt>
mov    %eax,%ebp
mov    %ax,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   1050 <atoi@plt>
mov    %ax,0xe(%rsp)
movzwl %r14w,%esi
movzwl %bp,%edx
movzwl %ax,%ecx
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
lea    0xa(%rsp),%rdi
xor    %eax,%eax
call   1040 <seed48@plt>
mov    $0x3,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A%d %d %d\0A\00"
define i32 @commandlineseed(i8** %0) {
%2 = alloca i8**
%3 = alloca [3 x i16]
store i8** %0, i8*** %2
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call zeroext i16 @atoi(i8* %6)
%8 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
store i16 %7, i16* %8
%9 = load i8**, i8*** %2
%10 = getelementptr inbounds i8*, i8** %9, i64 1
%11 = load i8*, i8** %10
%12 = call zeroext i16 @atoi(i8* %11)
%13 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
store i16 %12, i16* %13
%14 = load i8**, i8*** %2
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call zeroext i16 @atoi(i8* %16)
%18 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 2
store i16 %17, i16* %18
%19 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%20 = load i16, i16* %19
%21 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
%22 = load i16, i16* %21
%23 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 2
%24 = load i16, i16* %23
%25 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %20, i16 zeroext %22, i16 zeroext %24)
%26 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%27 = call i16* (i16*, ...) bitcast (i16* (...)* @seed48 to i16* (i16*, ...)*)(i16* %26)
ret i32 3
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%d %d %d\0A\00"
define i32 @commandlineseed(i8** nocapture %0) {
%2 = alloca [3 x i16]
%3 = bitcast [3 x i16]* %2 to i8*
%4 = load i8*, i8** %0
%5 = tail call zeroext i16 @atoi(i8* %4)
%6 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 0
store i16 %5, i16* %6
%7 = getelementptr inbounds i8*, i8** %0, i64 1
%8 = load i8*, i8** %7
%9 = tail call zeroext i16 @atoi(i8* %8)
%10 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 1
store i16 %9, i16* %10
%11 = getelementptr inbounds i8*, i8** %0, i64 2
%12 = load i8*, i8** %11
%13 = tail call zeroext i16 @atoi(i8* %12)
%14 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 2
store i16 %13, i16* %14
%15 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %5, i16 zeroext %9, i16 zeroext %13)
%16 = call i16* (i16*, ...) bitcast (i16* (...)* @seed48 to i16* (i16*, ...)*)(i16* %6)
ret i32 3
}