#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 */
void *malloc(int);
void s_zeros(float **pA, int row, int col) {
  void *temp = malloc((row * col) * sizeof(float));
  *pA = temp;
  float *A = *pA;
  int i;
  for (i = 0; i < row * col; i++)
    A[i] = 0.0;
}


x86 assembly (clang, -O0):
<s_zeros>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0xc(%rbp),%ecx
imul   -0x10(%rbp),%ecx
cmp    %ecx,%eax
jge    1187 <s_zeros+0x77>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1157 <s_zeros+0x47>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s_zeros>:
push   %r14
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %rdi,%r14
imul   %edx,%ebx
lea    0x0(,%rbx,4),%edi
call   1040 <malloc@plt>
mov    %rax,(%r14)
test   %ebx,%ebx
jle    114f <s_zeros+0x2f>
mov    %ebx,%edx
shl    $0x2,%rdx
mov    %rax,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @s_zeros(float** %0, i32 %1, i32 %2) {
%4 = alloca float**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca float*
%9 = alloca i32
store float** %0, float*** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = mul nsw i32 %10, %11
%13 = sext i32 %12 to i64
%14 = mul i64 %13, 4
%15 = trunc i64 %14 to i32
%16 = call i8* @malloc(i32 %15)
store i8* %16, i8** %7
%17 = load i8*, i8** %7
%18 = bitcast i8* %17 to float*
%19 = load float**, float*** %4
store float* %18, float** %19
%20 = load float**, float*** %4
%21 = load float*, float** %20
store float* %21, float** %8
store i32 0, i32* %9
br label %22
22: ; preds = %33, %3
%23 = load i32, i32* %9
%24 = load i32, i32* %5
%25 = load i32, i32* %6
%26 = mul nsw i32 %24, %25
%27 = icmp slt i32 %23, %26
br i1 %27, label %28, label %36
28: ; preds = %22
%29 = load float*, float** %8
%30 = load i32, i32* %9
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds float, float* %29, i64 %31
store float 0.000000e+00, float* %32
br label %33
33: ; preds = %28
%34 = load i32, i32* %9
%35 = add nsw i32 %34, 1
store i32 %35, i32* %9
br label %22
36: ; preds = %22
ret void
}

LLVM IR (-O2):
define void @s_zeros(float** nocapture writeonly %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %2, %1
%5 = shl i32 %4, 2
%6 = tail call i8* @malloc(i32 %5)
%7 = bitcast float** %0 to i8**
store i8* %6, i8** %7
%8 = icmp sgt i32 %4, 0
br i1 %8, label %9, label %12
9: ; preds = %3
%10 = zext i32 %4 to i64
%11 = shl nuw nsw i64 %10, 2
br label %12
12: ; preds = %9, %3
ret void
}