int delete_vtx(double x[], double y[], int n, int n_del) {
  for (; n_del < n - 1; n_del++) {
    x[n_del] = x[n_del + 1];
    y[n_del] = y[n_del + 1];
  }
  return (n - 1);
}


x86 assembly (clang, -O0):
<delete_vtx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    116f <delete_vtx+0x6f>
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <delete_vtx+0x12>
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<delete_vtx>:
push   %r15
push   %r14
push   %rbx
mov    %edx,%eax
add    $0xffffffff,%eax
cmp    %ecx,%eax
jle    129a <delete_vtx+0x19a>
movslq %ecx,%rdx
movslq %eax,%r10
mov    %r10,%r8
sub    %rdx,%r8
cmp    $0x4,%r8
jb     1227 <delete_vtx+0x127>
lea    (%rdi,%rdx,8),%rcx
lea    (%rsi,%r10,8),%rbx
add    $0x8,%rbx
cmp    %rbx,%rcx
jae    114e <delete_vtx+0x4e>
lea    (%rdi,%r10,8),%rcx
add    $0x8,%rcx
lea    (%rsi,%rdx,8),%rbx
cmp    %rcx,%rbx
jb     1227 <delete_vtx+0x127>
mov    %r8,%r9
and    $0xfffffffffffffffc,%r9
lea    -0x4(%r9),%rcx
mov    %rcx,%r11
shr    $0x2,%r11
add    $0x1,%r11
test   %rcx,%rcx
je     12a0 <delete_vtx+0x1a0>
mov    %r11,%r14
and    $0xfffffffffffffffe,%r14
lea    (%rsi,%rdx,8),%r15
add    $0x38,%r15
lea    (%rdi,%rdx,8),%rbx
add    $0x38,%rbx
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
movups -0x30(%rbx,%rcx,8),%xmm0
movups -0x20(%rbx,%rcx,8),%xmm1
movups %xmm0,-0x38(%rbx,%rcx,8)
movups %xmm1,-0x28(%rbx,%rcx,8)
movups -0x30(%r15,%rcx,8),%xmm0
movups -0x20(%r15,%rcx,8),%xmm1
movups %xmm0,-0x38(%r15,%rcx,8)
movups %xmm1,-0x28(%r15,%rcx,8)
movups -0x10(%rbx,%rcx,8),%xmm0
movups (%rbx,%rcx,8),%xmm1
movups %xmm0,-0x18(%rbx,%rcx,8)
movups %xmm1,-0x8(%rbx,%rcx,8)
movups -0x10(%r15,%rcx,8),%xmm0
movups (%r15,%rcx,8),%xmm1
movups %xmm0,-0x18(%r15,%rcx,8)
movups %xmm1,-0x8(%r15,%rcx,8)
add    $0x8,%rcx
add    $0xfffffffffffffffe,%r14
jne    1190 <delete_vtx+0x90>
test   $0x1,%r11b
je     121f <delete_vtx+0x11f>
add    %rdx,%rcx
movups 0x8(%rdi,%rcx,8),%xmm0
movups 0x18(%rdi,%rcx,8),%xmm1
movups %xmm0,(%rdi,%rcx,8)
movups %xmm1,0x10(%rdi,%rcx,8)
movups 0x8(%rsi,%rcx,8),%xmm0
movups 0x18(%rsi,%rcx,8),%xmm1
movups %xmm0,(%rsi,%rcx,8)
movups %xmm1,0x10(%rsi,%rcx,8)
cmp    %r9,%r8
je     129a <delete_vtx+0x19a>
add    %r9,%rdx
mov    %eax,%ebx
sub    %edx,%ebx
mov    %rdx,%rcx
not    %rcx
test   $0x1,%bl
je     1250 <delete_vtx+0x150>
movsd  0x8(%rdi,%rdx,8),%xmm0
movsd  %xmm0,(%rdi,%rdx,8)
movsd  0x8(%rsi,%rdx,8),%xmm0
movsd  %xmm0,(%rsi,%rdx,8)
add    $0x1,%rdx
add    %r10,%rcx
je     129a <delete_vtx+0x19a>
cs nopw 0x0(%rax,%rax,1)
nop
movsd  0x8(%rdi,%rdx,8),%xmm0
movsd  %xmm0,(%rdi,%rdx,8)
movsd  0x8(%rsi,%rdx,8),%xmm0
movsd  %xmm0,(%rsi,%rdx,8)
movsd  0x10(%rdi,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rdi,%rdx,8)
movsd  0x10(%rsi,%rdx,8),%xmm0
movsd  %xmm0,0x8(%rsi,%rdx,8)
lea    0x2(%rdx),%rcx
mov    %rcx,%rdx
cmp    %rcx,%r10
jne    1260 <delete_vtx+0x160>
pop    %rbx
pop    %r14
pop    %r15
ret
xor    %ecx,%ecx
test   $0x1,%r11b
jne    11f6 <delete_vtx+0xf6>
jmp    121f <delete_vtx+0x11f>

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

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