#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*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
void compress(char names[11][100], int *length) {
  for (int i = 0; i < 11; i++) {
    if (strlen(names[i]) == 0) {
      for (int j = i; j < *length; j++) {
        strcpy(names[j], names[j + 1]);
      }
      names[*length][0] = '\0';
    }
  }
}


x86 assembly (clang, -O0):
<compress>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0xb,-0x14(%rbp)
jge    11d1 <compress+0xb1>
mov    -0x8(%rbp),%rdi
movslq -0x14(%rbp),%rax
imul   $0x64,%rax,%rax
add    %rax,%rdi
call   1040 <strlen@plt>
cmp    $0x0,%rax
jne    11be <compress+0x9e>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
jge    11a9 <compress+0x89>
mov    -0x8(%rbp),%rdi
movslq -0x18(%rbp),%rax
imul   $0x64,%rax,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
imul   $0x64,%rax,%rax
add    %rax,%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1165 <compress+0x45>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
imul   $0x64,%rcx,%rcx
add    %rcx,%rax
movb   $0x0,(%rax)
jmp    11c3 <compress+0xa3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <compress+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compress>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
xor    %r12d,%r12d
mov    %rdi,%r13
jmp    1157 <compress+0x37>
nopl   0x0(%rax)
imul   $0x64,%rax,%rax
movb   $0x0,(%r14,%rax,1)
add    $0x1,%r12
add    $0x64,%r13
cmp    $0xb,%r12
je     119d <compress+0x7d>
imul   $0x64,%r12,%rdi
add    %r14,%rdi
call   1040 <strlen@plt>
test   %rax,%rax
jne    1149 <compress+0x29>
movslq (%r15),%rax
mov    %r13,%rdi
mov    %r12,%rbp
cmp    %rax,%r12
jge    1140 <compress+0x20>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%rbp
lea    0x64(%rdi),%rbx
mov    %rbx,%rsi
call   1030 <strcpy@plt>
movslq (%r15),%rax
mov    %rbx,%rdi
cmp    %rax,%rbp
jl     1180 <compress+0x60>
jmp    1140 <compress+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @compress([100 x i8]* %0, i32* %1) {
%3 = alloca [100 x i8]*
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store [100 x i8]* %0, [100 x i8]** %3
store i32* %1, i32** %4
store i32 0, i32* %5
br label %7
7: ; preds = %49, %2
%8 = load i32, i32* %5
%9 = icmp slt i32 %8, 11
br i1 %9, label %10, label %52
10: ; preds = %7
%11 = load [100 x i8]*, [100 x i8]** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 %13
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %14, i64 0, i64 0
%16 = call i64 @strlen(i8* %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %48
18: ; preds = %10
%19 = load i32, i32* %5
store i32 %19, i32* %6
br label %20
20: ; preds = %38, %18
%21 = load i32, i32* %6
%22 = load i32*, i32** %4
%23 = load i32, i32* %22
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %41
25: ; preds = %20
%26 = load [100 x i8]*, [100 x i8]** %3
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds [100 x i8], [100 x i8]* %26, i64 %28
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %29, i64 0, i64 0
%31 = load [100 x i8]*, [100 x i8]** %3
%32 = load i32, i32* %6
%33 = add nsw i32 %32, 1
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds [100 x i8], [100 x i8]* %31, i64 %34
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %35, i64 0, i64 0
%37 = call i32 @strcpy(i8* %30, i8* %36)
br label %38
38: ; preds = %25
%39 = load i32, i32* %6
%40 = add nsw i32 %39, 1
store i32 %40, i32* %6
br label %20
41: ; preds = %20
%42 = load [100 x i8]*, [100 x i8]** %3
%43 = load i32*, i32** %4
%44 = load i32, i32* %43
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [100 x i8], [100 x i8]* %42, i64 %45
%47 = getelementptr inbounds [100 x i8], [100 x i8]* %46, i64 0, i64 0
store i8 0, i8* %47
br label %48
48: ; preds = %41, %10
br label %49
49: ; preds = %48
%50 = load i32, i32* %5
%51 = add nsw i32 %50, 1
store i32 %51, i32* %5
br label %7
52: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @compress([100 x i8]* %0, i32* nocapture %1) {
br label %4
3: ; preds = %27
ret void
4: ; preds = %2, %27
%5 = phi i64 [ 0, %2 ], [ %28, %27 ]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %0, i64 %5, i64 0
%7 = tail call i64 @strlen(i8* dereferenceable(1) %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %27
9: ; preds = %4
%10 = load i32, i32* %1
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %5, %11
br i1 %12, label %18, label %15
13: ; preds = %18
%14 = sext i32 %24 to i64
br label %15
15: ; preds = %13, %9
%16 = phi i64 [ %11, %9 ], [ %14, %13 ]
%17 = getelementptr inbounds [100 x i8], [100 x i8]* %0, i64 %16, i64 0
store i8 0, i8* %17
br label %27
18: ; preds = %9, %18
%19 = phi i64 [ %21, %18 ], [ %5, %9 ]
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %0, i64 %19, i64 0
%21 = add nuw nsw i64 %19, 1
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %0, i64 %21, i64 0
%23 = tail call i32 @strcpy(i8* %20, i8* %22)
%24 = load i32, i32* %1
%25 = sext i32 %24 to i64
%26 = icmp slt i64 %21, %25
br i1 %26, label %18, label %13
27: ; preds = %4, %15
%28 = add nuw nsw i64 %5, 1
%29 = icmp eq i64 %28, 11
br i1 %29, label %3, label %4
}