void raw_linear_bulk_derivative_at(int n, float *func_ptr, float *deriv_ptr) {
  int i;
  for (i = 0; i < n; i++) {
    deriv_ptr[i] = 1.0;
  }
}


x86 assembly (clang, -O0):
<raw_linear_bulk_derivative_at>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1145 <raw_linear_bulk_derivative_at+0x45>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movss  0xece(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1116 <raw_linear_bulk_derivative_at+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<raw_linear_bulk_derivative_at>:
test   %edi,%edi
jle    1210 <raw_linear_bulk_derivative_at+0x110>
mov    %edi,%eax
cmp    $0x8,%edi
jae    1116 <raw_linear_bulk_derivative_at+0x16>
xor    %ecx,%ecx
jmp    1200 <raw_linear_bulk_derivative_at+0x100>
mov    %eax,%ecx
and    $0xfffffff8,%ecx
lea    -0x8(%rcx),%rsi
mov    %rsi,%rdi
shr    $0x3,%rdi
add    $0x1,%rdi
mov    %edi,%r8d
and    $0x7,%r8d
cmp    $0x38,%rsi
jae    113e <raw_linear_bulk_derivative_at+0x3e>
xor    %esi,%esi
jmp    11c1 <raw_linear_bulk_derivative_at+0xc1>
and    $0xfffffffffffffff8,%rdi
xor    %esi,%esi
movaps 0xeb5(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,(%rdx,%rsi,4)
movups %xmm0,0x10(%rdx,%rsi,4)
movups %xmm0,0x20(%rdx,%rsi,4)
movups %xmm0,0x30(%rdx,%rsi,4)
movups %xmm0,0x40(%rdx,%rsi,4)
movups %xmm0,0x50(%rdx,%rsi,4)
movups %xmm0,0x60(%rdx,%rsi,4)
movups %xmm0,0x70(%rdx,%rsi,4)
movups %xmm0,0x80(%rdx,%rsi,4)
movups %xmm0,0x90(%rdx,%rsi,4)
movups %xmm0,0xa0(%rdx,%rsi,4)
movups %xmm0,0xb0(%rdx,%rsi,4)
movups %xmm0,0xc0(%rdx,%rsi,4)
movups %xmm0,0xd0(%rdx,%rsi,4)
movups %xmm0,0xe0(%rdx,%rsi,4)
movups %xmm0,0xf0(%rdx,%rsi,4)
add    $0x40,%rsi
add    $0xfffffffffffffff8,%rdi
jne    1150 <raw_linear_bulk_derivative_at+0x50>
test   %r8,%r8
je     11f2 <raw_linear_bulk_derivative_at+0xf2>
lea    (%rdx,%rsi,4),%rsi
add    $0x10,%rsi
shl    $0x5,%r8
xor    %edi,%edi
movaps 0xe25(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movups %xmm0,-0x10(%rsi,%rdi,1)
movups %xmm0,(%rsi,%rdi,1)
add    $0x20,%rdi
cmp    %rdi,%r8
jne    11e0 <raw_linear_bulk_derivative_at+0xe0>
cmp    %rax,%rcx
je     1210 <raw_linear_bulk_derivative_at+0x110>
nopw   0x0(%rax,%rax,1)
movl   $0x3f800000,(%rdx,%rcx,4)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1200 <raw_linear_bulk_derivative_at+0x100>
ret

LLVM IR (-O0):
define void @raw_linear_bulk_derivative_at(i32 %0, float* %1, float* %2) {
%4 = alloca i32
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
store i32 %0, i32* %4
store float* %1, float** %5
store float* %2, float** %6
store i32 0, i32* %7
br label %8
8: ; preds = %17, %3
%9 = load i32, i32* %7
%10 = load i32, i32* %4
%11 = icmp slt i32 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load float*, float** %6
%14 = load i32, i32* %7
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds float, float* %13, i64 %15
store float 1.000000e+00, float* %16
br label %17
17: ; preds = %12
%18 = load i32, i32* %7
%19 = add nsw i32 %18, 1
store i32 %19, i32* %7
br label %8
20: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @raw_linear_bulk_derivative_at(i32 %0, float* nocapture readnone %1, float* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %84
5: ; preds = %3
%6 = zext i32 %0 to i64
%7 = icmp ult i32 %0, 8
br i1 %7, label %77, label %8
8: ; preds = %5
%9 = and i64 %6, 4294967288
%10 = add nsw i64 %9, -8
%11 = lshr exact i64 %10, 3
%12 = add nuw nsw i64 %11, 1
%13 = and i64 %12, 7
%14 = icmp ult i64 %10, 56
br i1 %14, label %62, label %15
15: ; preds = %8
%16 = and i64 %12, 4611686018427387896
br label %17
17: ; preds = %17, %15
%18 = phi i64 [ 0, %15 ], [ %59, %17 ]
%19 = phi i64 [ 0, %15 ], [ %60, %17 ]
%20 = getelementptr inbounds float, float* %2, i64 %18
%21 = bitcast float* %20 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %21
%22 = getelementptr inbounds float, float* %20, i64 4
%23 = bitcast float* %22 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %23
%24 = or i64 %18, 8
%25 = getelementptr inbounds float, float* %2, i64 %24
%26 = bitcast float* %25 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %26
%27 = getelementptr inbounds float, float* %25, i64 4
%28 = bitcast float* %27 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %28
%29 = or i64 %18, 16
%30 = getelementptr inbounds float, float* %2, i64 %29
%31 = bitcast float* %30 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %31
%32 = getelementptr inbounds float, float* %30, i64 4
%33 = bitcast float* %32 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %33
%34 = or i64 %18, 24
%35 = getelementptr inbounds float, float* %2, i64 %34
%36 = bitcast float* %35 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %36
%37 = getelementptr inbounds float, float* %35, i64 4
%38 = bitcast float* %37 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %38
%39 = or i64 %18, 32
%40 = getelementptr inbounds float, float* %2, i64 %39
%41 = bitcast float* %40 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %41
%42 = getelementptr inbounds float, float* %40, i64 4
%43 = bitcast float* %42 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %43
%44 = or i64 %18, 40
%45 = getelementptr inbounds float, float* %2, i64 %44
%46 = bitcast float* %45 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %46
%47 = getelementptr inbounds float, float* %45, i64 4
%48 = bitcast float* %47 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %48
%49 = or i64 %18, 48
%50 = getelementptr inbounds float, float* %2, i64 %49
%51 = bitcast float* %50 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %51
%52 = getelementptr inbounds float, float* %50, i64 4
%53 = bitcast float* %52 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %53
%54 = or i64 %18, 56
%55 = getelementptr inbounds float, float* %2, i64 %54
%56 = bitcast float* %55 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %56
%57 = getelementptr inbounds float, float* %55, i64 4
%58 = bitcast float* %57 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %58
%59 = add nuw i64 %18, 64
%60 = add nuw i64 %19, 8
%61 = icmp eq i64 %60, %16
br i1 %61, label %62, label %17
62: ; preds = %17, %8
%63 = phi i64 [ 0, %8 ], [ %59, %17 ]
%64 = icmp eq i64 %13, 0
br i1 %64, label %75, label %65
65: ; preds = %62, %65
%66 = phi i64 [ %72, %65 ], [ %63, %62 ]
%67 = phi i64 [ %73, %65 ], [ 0, %62 ]
%68 = getelementptr inbounds float, float* %2, i64 %66
%69 = bitcast float* %68 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %69
%70 = getelementptr inbounds float, float* %68, i64 4
%71 = bitcast float* %70 to <4 x float>*
store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00>, <4 x float>* %71
%72 = add nuw i64 %66, 8
%73 = add i64 %67, 1
%74 = icmp eq i64 %73, %13
br i1 %74, label %75, label %65
75: ; preds = %65, %62
%76 = icmp eq i64 %9, %6
br i1 %76, label %84, label %77
77: ; preds = %5, %75
%78 = phi i64 [ 0, %5 ], [ %9, %75 ]
br label %79
79: ; preds = %77, %79
%80 = phi i64 [ %82, %79 ], [ %78, %77 ]
%81 = getelementptr inbounds float, float* %2, i64 %80
store float 1.000000e+00, float* %81
%82 = add nuw nsw i64 %80, 1
%83 = icmp eq i64 %82, %6
br i1 %83, label %84, label %79
84: ; preds = %79, %75, %3
ret void
}