#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 /*<<< orphan*/ EXIT_SUCCESS;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ free(double *);
double *malloc(int);
int /*<<< orphan*/ memset(double *, float, int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 1) {
    printf("No args for now\n");
    exit(EXIT_SUCCESS);
  }
  float somef = 3.0;
  double *ma = malloc(100 * sizeof(double));
  memset(ma, (long int)somef, 100 * sizeof(double));
  memset(ma, somef, 100 * sizeof(double));
  printf("ma[N/10]=%4.6f\n", ma[100 / 10]);
  free(ma);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
je     118c <main+0x3c>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e5b(%rip),%rax
mov    (%rax),%edi
call   1070 <exit@plt>
movss  0xe6c(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
mov    $0x320,%edi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
cvttss2si -0x14(%rbp),%rax
cvtsi2ss %rax,%xmm0
mov    $0x320,%esi
call   1050 <memset@plt>
mov    -0x20(%rbp),%rdi
movss  -0x14(%rbp),%xmm0
mov    $0x320,%esi
call   1050 <memset@plt>
mov    -0x20(%rbp),%rax
movsd  0x50(%rax),%xmm0
lea    0xe32(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
cmp    $0x1,%edi
jne    11bc <main+0x5c>
mov    $0x320,%edi
call   1070 <malloc@plt>
mov    %rax,%rbx
movss  0xe85(%rip),%xmm0
mov    %rax,%rdi
mov    $0x320,%esi
call   1060 <memset@plt>
mov    %rbx,%rdi
movss  0xe6d(%rip),%xmm0
mov    $0x320,%esi
call   1060 <memset@plt>
movsd  0x50(%rbx),%xmm0
lea    0xe5b(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rbx
ret
lea    0xe51(%rip),%rdi
call   1040 <puts@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
call   1080 <exit@plt>

LLVM IR (-O0):
@.str = [17 x i8] c"No args for now\0A\00"
@EXIT_SUCCESS = global i32 0
@.str.1 = [16 x i8] c"ma[N/10]=%4.6f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float
%7 = alloca double*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 1
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @EXIT_SUCCESS
%13 = call i32 @exit(i32 %12)
unreachable
14: ; preds = %2
store float 3.000000e+00, float* %6
%15 = call double* @malloc(i32 800)
store double* %15, double** %7
%16 = load double*, double** %7
%17 = load float, float* %6
%18 = fptosi float %17 to i64
%19 = sitofp i64 %18 to float
%20 = call i32 @memset(double* %16, float %19, i32 800)
%21 = load double*, double** %7
%22 = load float, float* %6
%23 = call i32 @memset(double* %21, float %22, i32 800)
%24 = load double*, double** %7
%25 = getelementptr inbounds double, double* %24, i64 10
%26 = load double, double* %25
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %26)
%28 = load double*, double** %7
%29 = call i32 @free(double* %28)
ret i32 0
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@.str.1 = [16 x i8] c"ma[N/10]=%4.6f\0A\00"
@str = [16 x i8] c"No args for now\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp eq i32 %0, 1
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%6 = load i32, i32* @EXIT_SUCCESS
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
%9 = tail call double* @malloc(i32 800)
%10 = tail call i32 @memset(double* %9, float 3.000000e+00, i32 800)
%11 = tail call i32 @memset(double* %9, float 3.000000e+00, i32 800)
%12 = getelementptr inbounds double, double* %9, i64 10
%13 = load double, double* %12
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = tail call i32 @free(double* %9)
ret i32 0
}