#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 *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int strlen(char *);
int main() {
  char first[20];
  char last[20];
  printf("Please input your first name:\n");
  scanf("%s", first);
  printf("Please input your last name:\n");
  scanf("%s", last);
  printf("%s %s\n", first, last);
  printf("%*d %*d\n", strlen(first), strlen(first), strlen(last), strlen(last));
  printf("%s %s\n", first, last);
  printf("%-*d %-*d\n", strlen(first), strlen(first), strlen(last),
         strlen(last));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    0xec7(%rip),%rdi
call   1050 <scanf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x40(%rbp),%rsi
lea    0xea9(%rip),%rdi
call   1050 <scanf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x58(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x54(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x50(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x58(%rbp),%esi
mov    -0x54(%rbp),%edx
mov    -0x50(%rbp),%ecx
mov    %eax,%r8d
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rsi
lea    -0x40(%rbp),%rdx
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x4c(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x48(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0x44(%rbp)
lea    -0x40(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x4c(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x44(%rbp),%ecx
mov    %eax,%r8d
lea    0xe22(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xec9(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%r15
lea    0x20(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
call   1060 <scanf@plt>
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%r12
mov    %r15,%rdi
mov    %r12,%rsi
call   1060 <scanf@plt>
lea    0xe71(%rip),%r15
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r13d
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    0xe3a(%rip),%rdi
mov    %r13d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebp
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    %eax,%ebx
mov    %r12,%rdi
call   1040 <strlen@plt>
lea    0xdf4(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.3 = [7 x i8] c"%s %s\0A\00"
@.str.4 = [9 x i8] c"%*d %*d\0A\00"
@.str.5 = [11 x i8] c"%-*d %-*d\0A\00"
@str = [30 x i8] c"Please input your first name:\00"
@str.6 = [29 x i8] c"Please input your last name:\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = alloca [20 x i8]
%3 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%7 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %3, i8* %4)
%10 = call i32 @strlen(i8* %3)
%11 = call i32 @strlen(i8* %3)
%12 = call i32 @strlen(i8* %4)
%13 = call i32 @strlen(i8* %4)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %10, i32 %11, i32 %12, i32 %13)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i8* %3, i8* %4)
%16 = call i32 @strlen(i8* %3)
%17 = call i32 @strlen(i8* %3)
%18 = call i32 @strlen(i8* %4)
%19 = call i32 @strlen(i8* %4)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 %16, i32 %17, i32 %18, i32 %19)
ret i32 0
}