#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 */
float atof(char *);
int atoi(char *);
int linspace(float *, float, float, int);
scalar_t__ malloc(int);
int /*<<< orphan*/ print(float *, int);
int main(int argc, char **argv) {
  float start = atof(argv[1]);
  float finish = atof(argv[2]);
  int num = atoi(argv[3]);
  float *array = (float *)malloc(num * sizeof(float));
  int res = linspace(array, start, finish, num);
  print(array, num);
  return res;
}


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   1030 <atof@plt>
movss  %xmm0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1030 <atof@plt>
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
movslq -0x1c(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
movss  -0x18(%rbp),%xmm1
mov    -0x1c(%rbp),%esi
call   1060 <linspace@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <print@plt>
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movss  %xmm0,0xc(%rsp)
mov    0x10(%rbx),%rdi
call   1030 <atof@plt>
movss  %xmm0,0x8(%rsp)
mov    0x18(%rbx),%rdi
call   1070 <atoi@plt>
mov    %eax,%ebx
lea    0x0(,%rbx,4),%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    %rax,%rdi
movss  0xc(%rsp),%xmm0
movss  0x8(%rsp),%xmm1
mov    %ebx,%esi
call   1060 <linspace@plt>
mov    %eax,%ebp
mov    %r14,%rdi
mov    %ebx,%esi
call   1040 <print@plt>
mov    %ebp,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca float
%8 = alloca i32
%9 = alloca float*
%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 float @atof(i8* %13)
store float %14, float* %6
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 2
%17 = load i8*, i8** %16
%18 = call float @atof(i8* %17)
store float %18, float* %7
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 3
%21 = load i8*, i8** %20
%22 = call i32 @atoi(i8* %21)
store i32 %22, i32* %8
%23 = load i32, i32* %8
%24 = sext i32 %23 to i64
%25 = mul i64 %24, 4
%26 = trunc i64 %25 to i32
%27 = call i64 @malloc(i32 %26)
%28 = inttoptr i64 %27 to float*
store float* %28, float** %9
%29 = load float*, float** %9
%30 = load float, float* %6
%31 = load float, float* %7
%32 = load i32, i32* %8
%33 = call i32 @linspace(float* %29, float %30, float %31, i32 %32)
store i32 %33, i32* %10
%34 = load float*, float** %9
%35 = load i32, i32* %8
%36 = call i32 @print(float* %34, i32 %35)
%37 = load i32, i32* %10
ret i32 %37
}

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 float @atof(i8* %4)
%6 = getelementptr inbounds i8*, i8** %1, i64 2
%7 = load i8*, i8** %6
%8 = tail call float @atof(i8* %7)
%9 = getelementptr inbounds i8*, i8** %1, i64 3
%10 = load i8*, i8** %9
%11 = tail call i32 @atoi(i8* %10)
%12 = shl i32 %11, 2
%13 = tail call i64 @malloc(i32 %12)
%14 = inttoptr i64 %13 to float*
%15 = tail call i32 @linspace(float* %14, float %5, float %8, i32 %11)
%16 = tail call i32 @print(float* %14, i32 %11)
ret i32 %15
}