#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();
  int i;
  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    $0x20,%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    $0x20,%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]
%4 = alloca i32
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
%6 = getelementptr inbounds i8*, i8** %5, i64 0
%7 = load i8*, i8** %6
%8 = call zeroext i16 @atoi(i8* %7)
%9 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
store i16 %8, i16* %9
%10 = load i8**, i8*** %2
%11 = getelementptr inbounds i8*, i8** %10, i64 1
%12 = load i8*, i8** %11
%13 = call zeroext i16 @atoi(i8* %12)
%14 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
store i16 %13, i16* %14
%15 = load i8**, i8*** %2
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call zeroext i16 @atoi(i8* %17)
%19 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 2
store i16 %18, i16* %19
%20 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%21 = load i16, i16* %20
%22 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 1
%23 = load i16, i16* %22
%24 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 2
%25 = load i16, i16* %24
%26 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %21, i16 zeroext %23, i16 zeroext %25)
%27 = getelementptr inbounds [3 x i16], [3 x i16]* %3, i64 0, i64 0
%28 = call i16* (i16*, ...) bitcast (i16* (...)* @seed48 to i16* (i16*, ...)*)(i16* %27)
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
}