#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*/ printf(char *, char *, char *, int, int, int, int);
int /*<<< orphan*/ scanf(char *, char *, char *);
int strlen(char *);
int main(void) {
  char fname[10], lname[10];
  scanf("%s%s", fname, lname);
  int len1 = strlen(fname);
  int len2 = strlen(lname);
  printf("%s %s\n%*d %*d\n", fname, lname, len1, len1, len2, len2);
  printf("%s %s\n%-*d %-*d\n", fname, lname, len1, len1, len2, len2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xe(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    0xeb2(%rip),%rdi
call   1050 <scanf@plt>
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x20(%rbp)
lea    -0xe(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x20(%rbp),%eax
lea    0xe7d(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
lea    -0xe(%rbp),%rsi
lea    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
mov    -0x20(%rbp),%eax
lea    0xe67(%rip),%rdi
mov    %eax,(%rsp)
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x28,%rsp
lea    0xebf(%rip),%rdi
lea    0x1e(%rsp),%r15
lea    0x14(%rsp),%r14
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <scanf@plt>
mov    %r15,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebx
mov    %eax,(%rsp)
lea    0xe91(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %ebp,%r8d
mov    %eax,%r9d
call   1040 <printf@plt>
mov    %ebx,(%rsp)
lea    0xe83(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [15 x i8] c"%s %s\0A%*d %*d\0A\00"
@.str.2 = [17 x i8] c"%s %s\0A%-*d %-*d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
store i32 %10, i32* %4
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%12 = call i32 @strlen(i8* %11)
store i32 %12, i32* %5
%13 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%15 = load i32, i32* %4
%16 = load i32, i32* %4
%17 = load i32, i32* %5
%18 = load i32, i32* %5
%19 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %13, i8* %14, i32 %15, i32 %16, i32 %17, i32 %18)
%20 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%21 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%22 = load i32, i32* %4
%23 = load i32, i32* %4
%24 = load i32, i32* %5
%25 = load i32, i32* %5
%26 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %20, i8* %21, i32 %22, i32 %23, i32 %24, i32 %25)
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@.str.1 = [15 x i8] c"%s %s\0A%*d %*d\0A\00"
@.str.2 = [17 x i8] c"%s %s\0A%-*d %-*d\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%5 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = call i32 @strlen(i8* %3)
%7 = call i32 @strlen(i8* %4)
%8 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i8* %3, i8* %4, i32 %6, i32 %6, i32 %7, i32 %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4, i32 %6, i32 %6, i32 %7, i32 %7)
ret i32 0
}