void pretty_print(name, time, index) char *name;
int time;
int index;
{
  int flag = 0, i;
  printf("%d.%d ", time, index);
  for (i = 0; i < strlen(name); i++) {
    if (name[i] != '_')
      printf("%c", name[i]);
    else {
      if (flag == 0) {
        printf("%c ", '(');
        flag = 1;
      } else
        printf("%c ", ',');
    }
  }
  printf(" )\n");
}


x86 assembly (clang, -O0):
<pretty_print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
movslq -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jae    11fd <pretty_print+0xdd>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x5f,%eax
je     11a9 <pretty_print+0x89>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ea <pretty_print+0xca>
cmpl   $0x0,-0x14(%rbp)
jne    11d2 <pretty_print+0xb2>
lea    0xe50(%rip),%rdi
mov    $0x28,%esi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    11e5 <pretty_print+0xc5>
lea    0xe31(%rip),%rdi
mov    $0x2c,%esi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11ea <pretty_print+0xca>
jmp    11ef <pretty_print+0xcf>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1154 <pretty_print+0x34>
lea    0xe0a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pretty_print>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r15
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    (%r15),%al
test   %al,%al
je     11cc <pretty_print+0x8c>
mov    $0x1,%ebx
lea    0xe9c(%rip),%r14
xor    %ebp,%ebp
cmp    $0x5f,%al
jne    1190 <pretty_print+0x50>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
test   %ebp,%ebp
je     11a0 <pretty_print+0x60>
mov    $0x2c,%esi
jmp    11a5 <pretty_print+0x65>
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <putchar@plt>
jmp    11b1 <pretty_print+0x71>
nopw   0x0(%rax,%rax,1)
mov    $0x28,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebp
mov    %r15,%rdi
call   1050 <strlen@plt>
cmp    %rbx,%rax
jbe    11cc <pretty_print+0x8c>
mov    (%r15,%rbx,1),%al
add    $0x1,%rbx
cmp    $0x5f,%al
jne    1190 <pretty_print+0x50>
jmp    1180 <pretty_print+0x40>
lea    0xe38(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

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

LLVM IR (-O2):
@.str = [7 x i8] c"%d.%d \00"
@.str.2 = [4 x i8] c"%c \00"
@str = [3 x i8] c" )\00"
define void @pretty_print(i8* nocapture %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2)
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 0
br i1 %6, label %29, label %7
7: ; preds = %3, %26
%8 = phi i8 [ %28, %26 ], [ %5, %3 ]
%9 = phi i64 [ %23, %26 ], [ 0, %3 ]
%10 = phi i32 [ %22, %26 ], [ 0, %3 ]
%11 = icmp eq i8 %8, 95
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = sext i8 %8 to i32
%14 = tail call i32 @putchar(i32 %13)
br label %21
15: ; preds = %7
%16 = icmp eq i32 %10, 0
br i1 %16, label %17, label %19
17: ; preds = %15
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 40)
br label %21
19: ; preds = %15
%20 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 44)
br label %21
21: ; preds = %12, %19, %17
%22 = phi i32 [ %10, %12 ], [ 1, %17 ], [ 1, %19 ]
%23 = add nuw i64 %9, 1
%24 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%25 = icmp ugt i64 %24, %23
br i1 %25, label %26, label %29
26: ; preds = %21
%27 = getelementptr inbounds i8, i8* %0, i64 %23
%28 = load i8, i8* %27
br label %7
29: ; preds = %21, %3
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}