#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 /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned short, unsigned short,
                          unsigned short);
scalar_t__ time(int /*<<< orphan*/ *);
void seedit(char *flag) {
  FILE *fopen(), *pfseed;
  unsigned short seedv[3], seedv2[3], *seed48(), *pseed;
  int i;
  if (flag[0] == 's') {
    seedv[0] = (unsigned short)time(NULL);
    seedv[1] = 27011;
    seedv[2] = 59243;
    seed48(seedv);
    printf("\n%d %d %d\n", seedv[0], seedv[1], seedv[2]);
  }
}


x86 assembly (clang, -O0):
<seedit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x73,%eax
jne    118e <seedit+0x5e>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %ax,-0x16(%rbp)
movw   $0x6983,-0x14(%rbp)
movw   $0xe76b,-0x12(%rbp)
lea    -0x16(%rbp),%rdi
mov    $0x0,%al
call   1050 <seed48@plt>
mov    -0x16(%rbp),%cx
mov    -0x14(%rbp),%ax
lea    0xe81(%rip),%rdi
movzwl %cx,%esi
movzwl %ax,%edx
movzwl -0x12(%rbp),%ecx
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<seedit>:
push   %rax
cmpb   $0x73,(%rdi)
jne    1171 <seedit+0x41>
xor    %edi,%edi
call   1040 <time@plt>
mov    %ax,0x2(%rsp)
movl   $0xe76b6983,0x4(%rsp)
e7
lea    0x2(%rsp),%rdi
xor    %eax,%eax
call   1050 <seed48@plt>
movzwl 0x2(%rsp),%esi
movzwl 0x4(%rsp),%edx
movzwl 0x6(%rsp),%ecx
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [11 x i8] c"\0A%d %d %d\0A\00"
define void @seedit(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
%4 = alloca [3 x i16]
%5 = alloca [3 x i16]
%6 = alloca i16*
%7 = alloca i32
store i8* %0, i8** %2
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 0
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 115
br i1 %12, label %13, label %28
13: ; preds = %1
%14 = call i64 @time(i32* null)
%15 = trunc i64 %14 to i16
%16 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 0
store i16 %15, i16* %16
%17 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 1
store i16 27011, i16* %17
%18 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 2
store i16 -6293, i16* %18
%19 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 0
%20 = call i16* (i16*, ...) bitcast (i16* (...)* @seed48 to i16* (i16*, ...)*)(i16* %19)
%21 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 0
%22 = load i16, i16* %21
%23 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 1
%24 = load i16, i16* %23
%25 = getelementptr inbounds [3 x i16], [3 x i16]* %4, i64 0, i64 2
%26 = load i16, i16* %25
%27 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %22, i16 zeroext %24, i16 zeroext %26)
br label %28
28: ; preds = %13, %1
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\0A%d %d %d\0A\00"
define void @seedit(i8* nocapture %0) {
%2 = alloca [3 x i16]
%3 = bitcast [3 x i16]* %2 to i8*
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 115
br i1 %5, label %6, label %17
6: ; preds = %1
%7 = tail call i64 @time(i32* null)
%8 = trunc i64 %7 to i16
%9 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 0
store i16 %8, i16* %9
%10 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 1
store i16 27011, i16* %10
%11 = getelementptr inbounds [3 x i16], [3 x i16]* %2, i64 0, i64 2
store i16 -6293, i16* %11
%12 = call i16* (i16*, ...) bitcast (i16* (...)* @seed48 to i16* (i16*, ...)*)(i16* %9)
%13 = load i16, i16* %9
%14 = load i16, i16* %10
%15 = load i16, i16* %11
%16 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i16 zeroext %13, i16 zeroext %14, i16 zeroext %15)
br label %17
17: ; preds = %6, %1
ret void
}