#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 atoi(char *);
int /*<<< orphan*/ make_points(double *, double *, double *, int);
double *malloc(int);
int /*<<< orphan*/ print_points(double *, double *, double *, int);
int /*<<< orphan*/ srand48(int);
int main(int argc, char **argv) {
  double *x, *y, *z;
  int npoints;
  int semilla;
  semilla = atoi(argv[1]);
  srand48(semilla);
  npoints = atoi(argv[1]);
  x = malloc(npoints * sizeof(double));
  y = malloc(npoints * sizeof(double));
  z = malloc(npoints * sizeof(double));
  make_points(x, y, z, npoints);
  print_points(x, y, z, npoints);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%edi
call   1060 <srand48@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x2c(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x18(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1030 <make_points@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
call   1050 <print_points@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1070 <atoi@plt>
mov    %eax,%edi
call   1060 <srand48@plt>
mov    0x8(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%r15d
lea    0x0(,%r15,8),%ebp
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%r14
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <malloc@plt>
mov    %rax,%rbp
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rax,%rdx
mov    %r15d,%ecx
call   1030 <make_points@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %rbp,%rdx
mov    %r15d,%ecx
call   1050 <print_points@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @atoi(i8* %13)
store i32 %14, i32* %10
%15 = load i32, i32* %10
%16 = call i32 @srand48(i32 %15)
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i32 @atoi(i8* %19)
store i32 %20, i32* %9
%21 = load i32, i32* %9
%22 = sext i32 %21 to i64
%23 = mul i64 %22, 8
%24 = trunc i64 %23 to i32
%25 = call double* @malloc(i32 %24)
store double* %25, double** %6
%26 = load i32, i32* %9
%27 = sext i32 %26 to i64
%28 = mul i64 %27, 8
%29 = trunc i64 %28 to i32
%30 = call double* @malloc(i32 %29)
store double* %30, double** %7
%31 = load i32, i32* %9
%32 = sext i32 %31 to i64
%33 = mul i64 %32, 8
%34 = trunc i64 %33 to i32
%35 = call double* @malloc(i32 %34)
store double* %35, double** %8
%36 = load double*, double** %6
%37 = load double*, double** %7
%38 = load double*, double** %8
%39 = load i32, i32* %9
%40 = call i32 @make_points(double* %36, double* %37, double* %38, i32 %39)
%41 = load double*, double** %6
%42 = load double*, double** %7
%43 = load double*, double** %8
%44 = load i32, i32* %9
%45 = call i32 @print_points(double* %41, double* %42, double* %43, i32 %44)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i32 @atoi(i8* %4)
%6 = tail call i32 @srand48(i32 %5)
%7 = load i8*, i8** %3
%8 = tail call i32 @atoi(i8* %7)
%9 = shl i32 %8, 3
%10 = tail call double* @malloc(i32 %9)
%11 = tail call double* @malloc(i32 %9)
%12 = tail call double* @malloc(i32 %9)
%13 = tail call i32 @make_points(double* %10, double* %11, double* %12, i32 %8)
%14 = tail call i32 @print_points(double* %10, double* %11, double* %12, i32 %8)
ret i32 0
}