#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*/ memset(double *, int /*<<< orphan*/, unsigned int);
void c_us(const double o_data[], const int o_size[2], double u_data[],
          int u_size[2]) {
  int ix;
  int iy;
  int k;
  u_size[0] = 1;
  u_size[1] = (signed char)o_size[1];
  ix = (signed char)o_size[1];
  if (0 <= ix - 1) {
    memset(&u_data[0], 0, (unsigned int)(ix * (int)sizeof(double)));
  }
  ix = 0;
  iy = 0;
  for (k = 1; k <= o_size[1]; k++) {
    u_data[iy] = o_data[ix];
    ix++;
    iy++;
  }
}


x86 assembly (clang, -O0):
<c_us>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
movsbl %al,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
movsbl %al,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jg     1171 <c_us+0x61>
mov    -0x18(%rbp),%rdi
mov    -0x24(%rbp),%edx
shl    $0x3,%edx
xor    %esi,%esi
call   1030 <memset@plt>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x1,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    0x4(%rcx),%eax
jg     11d0 <c_us+0xc0>
mov    -0x8(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x28(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1186 <c_us+0x76>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_us>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rdi,%rbx
movl   $0x1,(%rcx)
movsbl 0x4(%rsi),%eax
mov    %eax,0x4(%rcx)
mov    0x4(%rsi),%ecx
mov    %ecx,%edx
shl    $0x18,%edx
test   %edx,%edx
jle    1148 <c_us+0x38>
mov    %rsi,%r15
shr    $0x15,%edx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    0x4(%r15),%ecx
test   %ecx,%ecx
jle    12c4 <c_us+0x1b4>
mov    %ecx,%eax
cmp    $0x4,%ecx
jb     1171 <c_us+0x61>
lea    (%rbx,%rax,8),%rcx
cmp    %r14,%rcx
jbe    11f0 <c_us+0xe0>
lea    (%r14,%rax,8),%rcx
cmp    %rbx,%rcx
jbe    11f0 <c_us+0xe0>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
mov    %rax,%rsi
and    $0x3,%rsi
je     11a5 <c_us+0x95>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1190 <c_us+0x80>
cmp    $0x3,%rdx
jb     12c4 <c_us+0x1b4>
nop
movsd  (%rbx,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r14,%rcx,8)
movsd  0x10(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r14,%rcx,8)
movsd  0x18(%rbx,%rcx,8),%xmm0
movsd  %xmm0,0x18(%r14,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    11b0 <c_us+0xa0>
jmp    12c4 <c_us+0x1b4>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
mov    %esi,%r8d
and    $0x3,%r8d
cmp    $0xc,%rdx
jae    1215 <c_us+0x105>
xor    %edi,%edi
jmp    1280 <c_us+0x170>
and    $0xfffffffffffffffc,%rsi
xor    %edi,%edi
nopl   0x0(%rax,%rax,1)
movups (%rbx,%rdi,8),%xmm0
movups 0x10(%rbx,%rdi,8),%xmm1
movups %xmm0,(%r14,%rdi,8)
movups %xmm1,0x10(%r14,%rdi,8)
movups 0x20(%rbx,%rdi,8),%xmm0
movups 0x30(%rbx,%rdi,8),%xmm1
movups %xmm0,0x20(%r14,%rdi,8)
movups %xmm1,0x30(%r14,%rdi,8)
movups 0x40(%rbx,%rdi,8),%xmm0
movups 0x50(%rbx,%rdi,8),%xmm1
movups %xmm0,0x40(%r14,%rdi,8)
movups %xmm1,0x50(%r14,%rdi,8)
movups 0x60(%rbx,%rdi,8),%xmm0
movups 0x70(%rbx,%rdi,8),%xmm1
movups %xmm0,0x60(%r14,%rdi,8)
movups %xmm1,0x70(%r14,%rdi,8)
add    $0x10,%rdi
add    $0xfffffffffffffffc,%rsi
jne    1220 <c_us+0x110>
test   %r8,%r8
je     12bb <c_us+0x1ab>
lea    (%r14,%rdi,8),%rsi
add    $0x10,%rsi
lea    (%rbx,%rdi,8),%rdi
add    $0x10,%rdi
shl    $0x5,%r8
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movups -0x10(%rdi,%rdx,1),%xmm0
movups (%rdi,%rdx,1),%xmm1
movups %xmm0,-0x10(%rsi,%rdx,1)
movups %xmm1,(%rsi,%rdx,1)
add    $0x20,%rdx
cmp    %rdx,%r8
jne    12a0 <c_us+0x190>
cmp    %rax,%rcx
jne    1173 <c_us+0x63>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @c_us(double* %0, i32* %1, double* %2, i32* %3) {
%5 = alloca double*
%6 = alloca i32*
%7 = alloca double*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store double* %0, double** %5
store i32* %1, i32** %6
store double* %2, double** %7
store i32* %3, i32** %8
%12 = load i32*, i32** %8
%13 = getelementptr inbounds i32, i32* %12, i64 0
store i32 1, i32* %13
%14 = load i32*, i32** %6
%15 = getelementptr inbounds i32, i32* %14, i64 1
%16 = load i32, i32* %15
%17 = trunc i32 %16 to i8
%18 = sext i8 %17 to i32
%19 = load i32*, i32** %8
%20 = getelementptr inbounds i32, i32* %19, i64 1
store i32 %18, i32* %20
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
%23 = load i32, i32* %22
%24 = trunc i32 %23 to i8
%25 = sext i8 %24 to i32
store i32 %25, i32* %9
%26 = load i32, i32* %9
%27 = sub nsw i32 %26, 1
%28 = icmp sle i32 0, %27
br i1 %28, label %29, label %35
29: ; preds = %4
%30 = load double*, double** %7
%31 = getelementptr inbounds double, double* %30, i64 0
%32 = load i32, i32* %9
%33 = mul nsw i32 %32, 8
%34 = call i32 @memset(double* %31, i32 0, i32 %33)
br label %35
35: ; preds = %29, %4
store i32 0, i32* %9
store i32 0, i32* %10
store i32 1, i32* %11
br label %36
36: ; preds = %56, %35
%37 = load i32, i32* %11
%38 = load i32*, i32** %6
%39 = getelementptr inbounds i32, i32* %38, i64 1
%40 = load i32, i32* %39
%41 = icmp sle i32 %37, %40
br i1 %41, label %42, label %59
42: ; preds = %36
%43 = load double*, double** %5
%44 = load i32, i32* %9
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %43, i64 %45
%47 = load double, double* %46
%48 = load double*, double** %7
%49 = load i32, i32* %10
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
store double %47, double* %51
%52 = load i32, i32* %9
%53 = add nsw i32 %52, 1
store i32 %53, i32* %9
%54 = load i32, i32* %10
%55 = add nsw i32 %54, 1
store i32 %55, i32* %10
br label %56
56: ; preds = %42
%57 = load i32, i32* %11
%58 = add nsw i32 %57, 1
store i32 %58, i32* %11
br label %36
59: ; preds = %36
ret void
}

LLVM IR (-O2):
define void @c_us(double* nocapture %0, i32* nocapture %1, double* %2, i32* nocapture writeonly %3) {
store i32 1, i32* %3
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = shl i32 %6, 24
%8 = ashr exact i32 %7, 24
%9 = getelementptr inbounds i32, i32* %3, i64 1
store i32 %8, i32* %9
%10 = load i32, i32* %5
%11 = shl i32 %10, 24
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = lshr exact i32 %11, 21
%15 = tail call i32 @memset(double* %2, i32 0, i32 %14)
%16 = load i32, i32* %5
br label %17
17: ; preds = %13, %4
%18 = phi i32 [ %16, %13 ], [ %10, %4 ]
%19 = icmp slt i32 %18, 1
br i1 %19, label %145, label %20
20: ; preds = %17
%21 = zext i32 %18 to i64
%22 = icmp ult i32 %18, 4
br i1 %22, label %108, label %23
23: ; preds = %20
%24 = getelementptr double, double* %2, i64 %21
%25 = getelementptr double, double* %0, i64 %21
%26 = icmp ugt double* %25, %2
%27 = icmp ugt double* %24, %0
%28 = and i1 %26, %27
br i1 %28, label %108, label %29
29: ; preds = %23
%30 = and i64 %21, 4294967292
%31 = add nsw i64 %30, -4
%32 = lshr exact i64 %31, 2
%33 = add nuw nsw i64 %32, 1
%34 = and i64 %33, 3
%35 = icmp ult i64 %31, 12
br i1 %35, label %87, label %36
36: ; preds = %29
%37 = and i64 %33, 9223372036854775804
br label %38
38: ; preds = %38, %36
%39 = phi i64 [ 0, %36 ], [ %84, %38 ]
%40 = phi i64 [ 0, %36 ], [ %85, %38 ]
%41 = getelementptr inbounds double, double* %0, i64 %39
%42 = bitcast double* %41 to <2 x double>*
%43 = load <2 x double>, <2 x double>* %42
%44 = getelementptr inbounds double, double* %41, i64 2
%45 = bitcast double* %44 to <2 x double>*
%46 = load <2 x double>, <2 x double>* %45
%47 = getelementptr inbounds double, double* %2, i64 %39
%48 = bitcast double* %47 to <2 x double>*
store <2 x double> %43, <2 x double>* %48
%49 = getelementptr inbounds double, double* %47, i64 2
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> %46, <2 x double>* %50
%51 = or i64 %39, 4
%52 = getelementptr inbounds double, double* %0, i64 %51
%53 = bitcast double* %52 to <2 x double>*
%54 = load <2 x double>, <2 x double>* %53
%55 = getelementptr inbounds double, double* %52, i64 2
%56 = bitcast double* %55 to <2 x double>*
%57 = load <2 x double>, <2 x double>* %56
%58 = getelementptr inbounds double, double* %2, i64 %51
%59 = bitcast double* %58 to <2 x double>*
store <2 x double> %54, <2 x double>* %59
%60 = getelementptr inbounds double, double* %58, i64 2
%61 = bitcast double* %60 to <2 x double>*
store <2 x double> %57, <2 x double>* %61
%62 = or i64 %39, 8
%63 = getelementptr inbounds double, double* %0, i64 %62
%64 = bitcast double* %63 to <2 x double>*
%65 = load <2 x double>, <2 x double>* %64
%66 = getelementptr inbounds double, double* %63, i64 2
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %2, i64 %62
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %65, <2 x double>* %70
%71 = getelementptr inbounds double, double* %69, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %68, <2 x double>* %72
%73 = or i64 %39, 12
%74 = getelementptr inbounds double, double* %0, i64 %73
%75 = bitcast double* %74 to <2 x double>*
%76 = load <2 x double>, <2 x double>* %75
%77 = getelementptr inbounds double, double* %74, i64 2
%78 = bitcast double* %77 to <2 x double>*
%79 = load <2 x double>, <2 x double>* %78
%80 = getelementptr inbounds double, double* %2, i64 %73
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %76, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> %79, <2 x double>* %83
%84 = add nuw i64 %39, 16
%85 = add nuw i64 %40, 4
%86 = icmp eq i64 %85, %37
br i1 %86, label %87, label %38
87: ; preds = %38, %29
%88 = phi i64 [ 0, %29 ], [ %84, %38 ]
%89 = icmp eq i64 %34, 0
br i1 %89, label %106, label %90
90: ; preds = %87, %90
%91 = phi i64 [ %103, %90 ], [ %88, %87 ]
%92 = phi i64 [ %104, %90 ], [ 0, %87 ]
%93 = getelementptr inbounds double, double* %0, i64 %91
%94 = bitcast double* %93 to <2 x double>*
%95 = load <2 x double>, <2 x double>* %94
%96 = getelementptr inbounds double, double* %93, i64 2
%97 = bitcast double* %96 to <2 x double>*
%98 = load <2 x double>, <2 x double>* %97
%99 = getelementptr inbounds double, double* %2, i64 %91
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %95, <2 x double>* %100
%101 = getelementptr inbounds double, double* %99, i64 2
%102 = bitcast double* %101 to <2 x double>*
store <2 x double> %98, <2 x double>* %102
%103 = add nuw i64 %91, 4
%104 = add i64 %92, 1
%105 = icmp eq i64 %104, %34
br i1 %105, label %106, label %90
106: ; preds = %90, %87
%107 = icmp eq i64 %30, %21
br i1 %107, label %145, label %108
108: ; preds = %23, %20, %106
%109 = phi i64 [ 0, %23 ], [ 0, %20 ], [ %30, %106 ]
%110 = xor i64 %109, -1
%111 = add nsw i64 %110, %21
%112 = and i64 %21, 3
%113 = icmp eq i64 %112, 0
br i1 %113, label %123, label %114
114: ; preds = %108, %114
%115 = phi i64 [ %120, %114 ], [ %109, %108 ]
%116 = phi i64 [ %121, %114 ], [ 0, %108 ]
%117 = getelementptr inbounds double, double* %0, i64 %115
%118 = load double, double* %117
%119 = getelementptr inbounds double, double* %2, i64 %115
store double %118, double* %119
%120 = add nuw nsw i64 %115, 1
%121 = add i64 %116, 1
%122 = icmp eq i64 %121, %112
br i1 %122, label %123, label %114
123: ; preds = %114, %108
%124 = phi i64 [ %109, %108 ], [ %120, %114 ]
%125 = icmp ult i64 %111, 3
br i1 %125, label %145, label %126
126: ; preds = %123, %126
%127 = phi i64 [ %143, %126 ], [ %124, %123 ]
%128 = getelementptr inbounds double, double* %0, i64 %127
%129 = load double, double* %128
%130 = getelementptr inbounds double, double* %2, i64 %127
store double %129, double* %130
%131 = add nuw nsw i64 %127, 1
%132 = getelementptr inbounds double, double* %0, i64 %131
%133 = load double, double* %132
%134 = getelementptr inbounds double, double* %2, i64 %131
store double %133, double* %134
%135 = add nuw nsw i64 %127, 2
%136 = getelementptr inbounds double, double* %0, i64 %135
%137 = load double, double* %136
%138 = getelementptr inbounds double, double* %2, i64 %135
store double %137, double* %138
%139 = add nuw nsw i64 %127, 3
%140 = getelementptr inbounds double, double* %0, i64 %139
%141 = load double, double* %140
%142 = getelementptr inbounds double, double* %2, i64 %139
store double %141, double* %142
%143 = add nuw nsw i64 %127, 4
%144 = icmp eq i64 %143, %21
br i1 %144, label %145, label %126
145: ; preds = %123, %126, %106, %17
ret void
}