#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 */
double prox_scalar(double, double const, double (*)(double), double, double,
                   int /*<<< orphan*/);
void prox_separable(double *x, const int n, const double rho,
                    double (*oracle)(double), double l, double u) {
  int i;
#pragma omp parallel for
  for (i = 0; i < n; i++) {
    x[i] = prox_scalar(x[i], rho, oracle, l, u, 0);
  }
}


x86 assembly (clang, -O0):
<prox_separable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  %xmm2,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1187 <prox_separable+0x77>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rdi
movsd  -0x28(%rbp),%xmm2
movsd  -0x30(%rbp),%xmm3
xor    %esi,%esi
call   1030 <prox_scalar@plt>
mov    -0x8(%rbp),%rax
movslq -0x34(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1139 <prox_separable+0x29>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<prox_separable>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    1183 <prox_separable+0x73>
movaps %xmm1,%xmm3
mov    %rdx,%r14
movaps %xmm0,%xmm1
mov    %rdi,%r12
mov    %esi,%r15d
xor    %ebx,%ebx
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x8(%rsp)
movsd  %xmm0,(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm0
movsd  (%rsp),%xmm1
mov    %r14,%rdi
movaps %xmm3,%xmm2
movsd  0x10(%rsp),%xmm3
xor    %esi,%esi
call   1030 <prox_scalar@plt>
movsd  0x8(%rsp),%xmm3
movsd  %xmm0,(%r12,%rbx,8)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1150 <prox_separable+0x40>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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