#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 */
scalar_t__ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ stdin;
int strlen(char *);
char *strtok(char *, char *);
int main() {
  int pos, len1, len2, i;
  char input[120];
  char *delim = ":", *ch1, *ch2;
  scanf("%d\n", &pos);
  while (fgets(input, 100, stdin)) {
    ch1 = strtok(input, delim);
    ch2 = strtok(NULL, delim);
    len1 = strlen(ch1);
    len2 = strlen(ch2);
    printf("%s", ch1);
    for (i = 0; i < pos - len1 - 1; i++)
      printf(" ");
    printf(": %s", ch2);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe97(%rip),%rax
mov    %rax,-0x98(%rbp)
lea    0xe8b(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
lea    -0x90(%rbp),%rdi
mov    0x2e5a(%rip),%rax
mov    (%rax),%edx
mov    $0x64,%esi
call   1050 <fgets@plt>
cmp    $0x0,%rax
je     1259 <main+0x109>
lea    -0x90(%rbp),%rdi
mov    -0x98(%rbp),%rsi
call   1070 <strtok@plt>
mov    %rax,-0xa0(%rbp)
mov    -0x98(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1070 <strtok@plt>
mov    %rax,-0xa8(%rbp)
mov    -0xa0(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xa8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x10(%rbp)
mov    -0xa0(%rbp),%rsi
lea    0xe09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    123f <main+0xef>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    120f <main+0xbf>
mov    -0xa8(%rbp),%rsi
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1180 <main+0x30>
xor    %eax,%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
lea    0xe8a(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1070 <scanf@plt>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edx
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     125c <main+0xfc>
lea    0xe56(%rip),%r14
lea    0x10(%rsp),%r13
jmp    11ec <main+0x8c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xe3f(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x2e10(%rip),%rax
mov    (%rax),%edx
mov    %r13,%rdi
mov    $0x64,%esi
call   1060 <fgets@plt>
test   %rax,%rax
je     125c <main+0xfc>
mov    %r13,%rdi
mov    %r14,%rsi
call   1080 <strtok@plt>
mov    %rax,%r15
xor    %edi,%edi
mov    %r14,%rsi
call   1080 <strtok@plt>
mov    %rax,%r12
mov    %r15,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    0xde8(%rip),%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
not    %ebp
mov    0xc(%rsp),%eax
add    %ebp,%eax
test   %eax,%eax
jle    11c0 <main+0x60>
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0xc(%rsp),%eax
add    %ebp,%eax
cmp    %eax,%ebx
jl     1240 <main+0xe0>
jmp    11c0 <main+0x60>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c":\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [2 x i8] c" \00"
@.str.4 = [5 x i8] c": %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [120 x i8]
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8** %7
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %2)
br label %11
11: ; preds = %40, %0
%12 = getelementptr inbounds [120 x i8], [120 x i8]* %6, i64 0, i64 0
%13 = load i32, i32* @stdin
%14 = call i64 @fgets(i8* %12, i32 100, i32 %13)
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %43
16: ; preds = %11
%17 = getelementptr inbounds [120 x i8], [120 x i8]* %6, i64 0, i64 0
%18 = load i8*, i8** %7
%19 = call i8* @strtok(i8* %17, i8* %18)
store i8* %19, i8** %8
%20 = load i8*, i8** %7
%21 = call i8* @strtok(i8* null, i8* %20)
store i8* %21, i8** %9
%22 = load i8*, i8** %8
%23 = call i32 @strlen(i8* %22)
store i32 %23, i32* %3
%24 = load i8*, i8** %9
%25 = call i32 @strlen(i8* %24)
store i32 %25, i32* %4
%26 = load i8*, i8** %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %26)
store i32 0, i32* %5
br label %28
28: ; preds = %37, %16
%29 = load i32, i32* %5
%30 = load i32, i32* %2
%31 = load i32, i32* %3
%32 = sub nsw i32 %30, %31
%33 = sub nsw i32 %32, 1
%34 = icmp slt i32 %29, %33
br i1 %34, label %35, label %40
35: ; preds = %28
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35
%38 = load i32, i32* %5
%39 = add nsw i32 %38, 1
store i32 %39, i32* %5
br label %28
40: ; preds = %28
%41 = load i8*, i8** %9
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %41)
br label %11
43: ; preds = %11
ret i32 0
}

LLVM IR (-O2):
@.str = [2 x i8] c":\00"
@.str.1 = [4 x i8] c"%d\0A\00"
@stdin = global i32 0
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [5 x i8] c": %s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [120 x i8]
%3 = bitcast i32* %1 to i8*
%4 = getelementptr inbounds [120 x i8], [120 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%6 = load i32, i32* @stdin
%7 = call i64 @fgets(i8* %4, i32 100, i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %31, label %9
9: ; preds = %0, %26
%10 = call i8* @strtok(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = call i8* @strtok(i8* null, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @strlen(i8* %10)
%13 = call i32 @strlen(i8* %11)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%15 = xor i32 %12, -1
%16 = load i32, i32* %1
%17 = add i32 %16, %15
%18 = icmp sgt i32 %17, 0
br i1 %18, label %19, label %26
19: ; preds = %9, %19
%20 = phi i32 [ %22, %19 ], [ 0, %9 ]
%21 = call i32 @putchar(i32 32)
%22 = add nuw nsw i32 %20, 1
%23 = load i32, i32* %1
%24 = add i32 %23, %15
%25 = icmp slt i32 %22, %24
br i1 %25, label %19, label %26
26: ; preds = %19, %9
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8* %11)
%28 = load i32, i32* @stdin
%29 = call i64 @fgets(i8* %4, i32 100, i32 %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %9
31: ; preds = %26, %0
ret i32 0
}