#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, char, char, char, char);
char random();
int /*<<< orphan*/ srand(unsigned int);
scalar_t__ time(int /*<<< orphan*/ *);
int main(void) {
  char r1 = random();
  char r2 = random();
  char r3 = random();
  char r4 = random();
  printf("These are random numbers : %i %i %i %i", r1, r2, r3, r4);
  unsigned int iseed = (unsigned int)time(NULL);
  srand(iseed);
  char r12 = random();
  char r22 = random();
  char r32 = random();
  char r42 = random();
  printf("\nThese are random numbers : %i %i %i %i", r12, r22, r32, r42);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0x5(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0x6(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0x7(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0x8(%rbp)
mov    -0x5(%rbp),%dl
mov    -0x6(%rbp),%cl
mov    -0x7(%rbp),%al
lea    0xe7a(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x8(%rbp),%r8d
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0xd(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0xe(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0xf(%rbp)
mov    $0x0,%al
call   1060 <random@plt>
mov    %al,-0x10(%rbp)
mov    -0xd(%rbp),%dl
mov    -0xe(%rbp),%cl
mov    -0xf(%rbp),%al
lea    0xe1a(%rip),%rdi
movsbl %dl,%esi
movsbl %cl,%edx
movsbl %al,%ecx
movsbl -0x10(%rbp),%r8d
call   1030 <printf@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <random@plt>
movsbl %bpl,%esi
movsbl %r14b,%edx
movsbl %bl,%ecx
movsbl %al,%r8d
lea    0xe84(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%ebp
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%r14d
xor    %eax,%eax
call   1060 <random@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1060 <random@plt>
movsbl %bpl,%esi
movsbl %r14b,%edx
movsbl %bl,%ecx
movsbl %al,%r8d
lea    0xe37(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e0b(%rip),%rax
mov    (%rax),%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"These are random numbers : %i %i %i %i\00"
@.str.1 = [40 x i8] c"\0AThese are random numbers : %i %i %i %i\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i32 0, i32* %1
%11 = call signext i8 (...) @random()
store i8 %11, i8* %2
%12 = call signext i8 (...) @random()
store i8 %12, i8* %3
%13 = call signext i8 (...) @random()
store i8 %13, i8* %4
%14 = call signext i8 (...) @random()
store i8 %14, i8* %5
%15 = load i8, i8* %2
%16 = load i8, i8* %3
%17 = load i8, i8* %4
%18 = load i8, i8* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext %15, i8 signext %16, i8 signext %17, i8 signext %18)
%20 = call i64 @time(i32* null)
%21 = trunc i64 %20 to i32
store i32 %21, i32* %6
%22 = load i32, i32* %6
%23 = call i32 @srand(i32 %22)
%24 = call signext i8 (...) @random()
store i8 %24, i8* %7
%25 = call signext i8 (...) @random()
store i8 %25, i8* %8
%26 = call signext i8 (...) @random()
store i8 %26, i8* %9
%27 = call signext i8 (...) @random()
store i8 %27, i8* %10
%28 = load i8, i8* %7
%29 = load i8, i8* %8
%30 = load i8, i8* %9
%31 = load i8, i8* %10
%32 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8 signext %28, i8 signext %29, i8 signext %30, i8 signext %31)
%33 = load i32, i32* @EXIT_SUCCESS
ret i32 %33
}

LLVM IR (-O2):
@.str = [39 x i8] c"These are random numbers : %i %i %i %i\00"
@.str.1 = [40 x i8] c"\0AThese are random numbers : %i %i %i %i\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call signext i8 (...) @random()
%2 = tail call signext i8 (...) @random()
%3 = tail call signext i8 (...) @random()
%4 = tail call signext i8 (...) @random()
%5 = tail call i32 @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0), i8 signext %1, i8 signext %2, i8 signext %3, i8 signext %4)
%6 = tail call i64 @time(i32* null)
%7 = trunc i64 %6 to i32
%8 = tail call i32 @srand(i32 %7)
%9 = tail call signext i8 (...) @random()
%10 = tail call signext i8 (...) @random()
%11 = tail call signext i8 (...) @random()
%12 = tail call signext i8 (...) @random()
%13 = tail call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0), i8 signext %9, i8 signext %10, i8 signext %11, i8 signext %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}