char *print_nlist(nlp)
short *nlp;
{
  static char s[80], s1[10];
  *s = '\0';
  while (*nlp)
    if (*nlp > 010000) {
      sprintf(s1, " %d", *nlp++ - 010000);
      strcat(s, s1);
    } else {
      sprintf(s1, " %d-%d", *nlp, nlp[1]);
      nlp += 2;
      strcat(s, s1);
      if (*nlp++ != 1) {
        sprintf(s1, "(%d)", nlp[-1]);
        strcat(s, s1);
      }
    }
  return s;
}


x86 assembly (clang, -O0):
<print_nlist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,0x2f0d(%rip)
mov    -0x8(%rbp),%rax
cmpw   $0x0,(%rax)
je     1230 <print_nlist+0x110>
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cmp    $0x1000,%eax
jle    1198 <print_nlist+0x78>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movswl (%rax),%edx
sub    $0x1000,%edx
lea    0x2f1e(%rip),%rdi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    0x2eb9(%rip),%rdi
lea    0x2f02(%rip),%rsi
call   1030 <strcat@plt>
jmp    122b <print_nlist+0x10b>
mov    -0x8(%rbp),%rax
movswl (%rax),%edx
mov    -0x8(%rbp),%rax
movswl 0x2(%rax),%ecx
lea    0x2ee2(%rip),%rdi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
lea    0x2e71(%rip),%rdi
lea    0x2eba(%rip),%rsi
call   1030 <strcat@plt>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x2,%rcx
mov    %rcx,-0x8(%rbp)
movswl (%rax),%eax
cmp    $0x1,%eax
je     1226 <print_nlist+0x106>
mov    -0x8(%rbp),%rax
movswl -0x2(%rax),%edx
lea    0x2e8b(%rip),%rdi
lea    0xdff(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
lea    0x2e26(%rip),%rdi
lea    0x2e6f(%rip),%rsi
call   1030 <strcat@plt>
jmp    122b <print_nlist+0x10b>
jmp    1133 <print_nlist+0x13>
lea    0x2e09(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_nlist>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movb   $0x0,0x2f0e(%rip)
movzwl (%rdi),%eax
test   %ax,%ax
je     11d6 <print_nlist+0xb6>
mov    %rdi,%rbx
lea    0x2f48(%rip),%r14
lea    0xeb1(%rip),%r15
lea    0x2eea(%rip),%r12
lea    0xea7(%rip),%r13
lea    0xea7(%rip),%rbp
jmp    119a <print_nlist+0x7a>
cs nopw 0x0(%rax,%rax,1)
add    $0x2,%rbx
add    $0xfffff000,%edx
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
movzwl (%rbx),%eax
test   %ax,%ax
je     11d6 <print_nlist+0xb6>
movswl %ax,%edx
cmp    $0x1001,%edx
jge    1170 <print_nlist+0x50>
movswl 0x2(%rbx),%ecx
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
call   1030 <strcat@plt>
movswl 0x4(%rbx),%edx
add    $0x6,%rbx
cmp    $0x1,%edx
je     1192 <print_nlist+0x72>
mov    %r14,%rdi
mov    %rbp,%rsi
jmp    1180 <print_nlist+0x60>
lea    0x2e63(%rip),%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@print_nlist.s = internal global [80 x i8] zeroinitializer
@print_nlist.s1 = internal global [10 x i8] zeroinitializer
@.str = [4 x i8] c" %d\00"
@.str.1 = [7 x i8] c" %d-%d\00"
@.str.2 = [5 x i8] c"(%d)\00"
define i8* @print_nlist(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0)
br label %3
3: ; preds = %45, %1
%4 = load i16*, i16** %2
%5 = load i16, i16* %4
%6 = icmp ne i16 %5, 0
br i1 %6, label %7, label %46
7: ; preds = %3
%8 = load i16*, i16** %2
%9 = load i16, i16* %8
%10 = sext i16 %9 to i32
%11 = icmp sgt i32 %10, 4096
br i1 %11, label %12, label %20
12: ; preds = %7
%13 = load i16*, i16** %2
%14 = getelementptr inbounds i16, i16* %13, i32 1
store i16* %14, i16** %2
%15 = load i16, i16* %13
%16 = sext i16 %15 to i32
%17 = sub nsw i32 %16, 4096
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %17)
%19 = call i8* @strcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0))
br label %45
20: ; preds = %7
%21 = load i16*, i16** %2
%22 = load i16, i16* %21
%23 = sext i16 %22 to i32
%24 = load i16*, i16** %2
%25 = getelementptr inbounds i16, i16* %24, i64 1
%26 = load i16, i16* %25
%27 = sext i16 %26 to i32
%28 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %23, i32 %27)
%29 = load i16*, i16** %2
%30 = getelementptr inbounds i16, i16* %29, i64 2
store i16* %30, i16** %2
%31 = call i8* @strcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0))
%32 = load i16*, i16** %2
%33 = getelementptr inbounds i16, i16* %32, i32 1
store i16* %33, i16** %2
%34 = load i16, i16* %32
%35 = sext i16 %34 to i32
%36 = icmp ne i32 %35, 1
br i1 %36, label %37, label %44
37: ; preds = %20
%38 = load i16*, i16** %2
%39 = getelementptr inbounds i16, i16* %38, i64 -1
%40 = load i16, i16* %39
%41 = sext i16 %40 to i32
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %41)
%43 = call i8* @strcat(i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0))
br label %44
44: ; preds = %37, %20
br label %45
45: ; preds = %44, %12
br label %3
46: ; preds = %3
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0)
}

LLVM IR (-O2):
@print_nlist.s = internal global [80 x i8] zeroinitializer
@print_nlist.s1 = internal global [10 x i8] zeroinitializer
@.str = [4 x i8] c" %d\00"
@.str.1 = [7 x i8] c" %d-%d\00"
@.str.2 = [5 x i8] c"(%d)\00"
define i8* @print_nlist(i16* nocapture %0) {
store i8 0, i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0)
%2 = load i16, i16* %0
%3 = icmp eq i16 %2, 0
br i1 %3, label %32, label %4
4: ; preds = %1, %28
%5 = phi i16 [ %30, %28 ], [ %2, %1 ]
%6 = phi i16* [ %29, %28 ], [ %0, %1 ]
%7 = sext i16 %5 to i32
%8 = icmp sgt i16 %5, 4096
%9 = getelementptr inbounds i16, i16* %6, i64 1
br i1 %8, label %10, label %13
10: ; preds = %4
%11 = add nsw i32 %7, -4096
%12 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
br label %25
13: ; preds = %4
%14 = load i16, i16* %9
%15 = sext i16 %14 to i32
%16 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %15)
%17 = getelementptr inbounds i16, i16* %6, i64 2
%18 = tail call i8* @strcat(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0))
%19 = getelementptr inbounds i16, i16* %6, i64 3
%20 = load i16, i16* %17
%21 = icmp eq i16 %20, 1
br i1 %21, label %28, label %22
22: ; preds = %13
%23 = sext i16 %20 to i32
%24 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %10, %22
%26 = phi i16* [ %19, %22 ], [ %9, %10 ]
%27 = tail call i8* @strcat(i8* dereferenceable(1) getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0), i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @print_nlist.s1, i64 0, i64 0))
br label %28
28: ; preds = %25, %13
%29 = phi i16* [ %19, %13 ], [ %26, %25 ]
%30 = load i16, i16* %29
%31 = icmp eq i16 %30, 0
br i1 %31, label %32, label %4
32: ; preds = %28, %1
ret i8* getelementptr inbounds ([80 x i8], [80 x i8]* @print_nlist.s, i64 0, i64 0)
}