#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*/ set_realnums_constant(double *, int, double);
void set_2d_realnums_constant(double **tdarr, int rows, int cols, double val) {
  int i;
  for (i = 0; i < rows; i++)
    set_realnums_constant(tdarr[i], cols, val);
}


x86 assembly (clang, -O0):
<set_2d_realnums_constant>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1161 <set_2d_realnums_constant+0x51>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x10(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
call   1030 <set_realnums_constant@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112e <set_2d_realnums_constant+0x1e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_2d_realnums_constant>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    114a <set_2d_realnums_constant+0x3a>
mov    %edx,%r14d
mov    %rdi,%r15
mov    %esi,%ebp
xor    %ebx,%ebx
movsd  %xmm0,(%rsp)
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,8),%rdi
mov    %r14d,%esi
movsd  (%rsp),%xmm0
call   1030 <set_realnums_constant@plt>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1130 <set_2d_realnums_constant+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @set_2d_realnums_constant(double** %0, i32 %1, i32 %2, double %3) {
%5 = alloca double**
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca i32
store double** %0, double*** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store double %3, double* %8
store i32 0, i32* %9
br label %10
10: ; preds = %23, %4
%11 = load i32, i32* %9
%12 = load i32, i32* %6
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %26
14: ; preds = %10
%15 = load double**, double*** %5
%16 = load i32, i32* %9
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds double*, double** %15, i64 %17
%19 = load double*, double** %18
%20 = load i32, i32* %7
%21 = load double, double* %8
%22 = call i32 @set_realnums_constant(double* %19, i32 %20, double %21)
br label %23
23: ; preds = %14
%24 = load i32, i32* %9
%25 = add nsw i32 %24, 1
store i32 %25, i32* %9
br label %10
26: ; preds = %10
ret void
}

LLVM IR (-O2):
define void @set_2d_realnums_constant(double** nocapture %0, i32 %1, i32 %2, double %3) {
%5 = icmp sgt i32 %1, 0
br i1 %5, label %6, label %15
6: ; preds = %4
%7 = zext i32 %1 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %13, %8 ]
%10 = getelementptr inbounds double*, double** %0, i64 %9
%11 = load double*, double** %10
%12 = tail call i32 @set_realnums_constant(double* %11, i32 %2, double %3)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %7
br i1 %14, label %15, label %8
15: ; preds = %8, %4
ret void
}