#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 */
size_t strlen(char *);
void condense_v6(char *s) {
  size_t len = strlen(s);
  char *p, *q;
  if (len <= 16)
    return;
  p = s + 7;
  *p++ = '.';
  *p++ = '.';
  q = s + len - 7;
  while (*q) {
    *p++ = *q++;
  }
  *p = 0;
}


x86 assembly (clang, -O0):
<condense_v6>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x10,-0x10(%rbp)
ja     1139 <condense_v6+0x29>
jmp    11b4 <condense_v6+0xa4>
mov    -0x8(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2e,(%rax)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
movb   $0x2e,(%rax)
mov    -0x8(%rbp),%rax
add    -0x10(%rbp),%rax
add    $0xfffffffffffffff9,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
je     11ad <condense_v6+0x9d>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x18(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x18(%rbp)
mov    %cl,(%rax)
jmp    1179 <condense_v6+0x69>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<condense_v6>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x11,%rax
jb     115a <condense_v6+0x4a>
movw   $0x2e2e,0x7(%rbx)
mov    -0x7(%rbx,%rax,1),%cl
add    $0x9,%rbx
test   %cl,%cl
je     1154 <condense_v6+0x44>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1(%rbx),%rdx
mov    %cl,(%rbx)
movzbl -0xf(%rbx,%rax,1),%ecx
mov    %rdx,%rbx
test   %cl,%cl
jne    1140 <condense_v6+0x30>
jmp    1157 <condense_v6+0x47>
mov    %rbx,%rdx
movb   $0x0,(%rdx)
pop    %rbx
ret

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

LLVM IR (-O2):
define void @condense_v6(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = icmp ult i64 %2, 17
br i1 %3, label %22, label %4
4: ; preds = %1
%5 = getelementptr inbounds i8, i8* %0, i64 7
%6 = getelementptr inbounds i8, i8* %0, i64 8
store i8 46, i8* %5
%7 = getelementptr inbounds i8, i8* %0, i64 9
store i8 46, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 %2
%9 = getelementptr inbounds i8, i8* %8, i64 -7
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %20, label %12
12: ; preds = %4, %12
%13 = phi i8 [ %18, %12 ], [ %10, %4 ]
%14 = phi i8* [ %16, %12 ], [ %9, %4 ]
%15 = phi i8* [ %17, %12 ], [ %7, %4 ]
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %13, i8* %15
%18 = load i8, i8* %16
%19 = icmp eq i8 %18, 0
br i1 %19, label %20, label %12
20: ; preds = %12, %4
%21 = phi i8* [ %7, %4 ], [ %17, %12 ]
store i8 0, i8* %21
br label %22
22: ; preds = %1, %20
ret void
}