#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 *, ...);
int main(int argc, char *argv[]) {
  char name[50] = {0};
  unsigned int age;
  char username[50] = {0};
  printf("Tell me your name: ");
  scanf("%s", name);
  printf("Tell me your age: ");
  scanf("%u", &age);
  printf("Finally, what's your username: ");
  scanf("%s", username);
  printf("\nHere's what I learned about you!\n"
         "Name: %s\n"
         "Age: %u\n"
         "Username: %s\n",
         name, age, username);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   1040 <memset@plt>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x50(%rbp),%rsi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe89(%rip),%rdi
lea    -0x54(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe7a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x90(%rbp),%rsi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    -0x50(%rbp),%rsi
mov    -0x54(%rbp),%edx
lea    -0x90(%rbp),%rcx
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x90,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movw   $0x0,0x80(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movw   $0x0,0x40(%rsp)
lea    0xe9b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea1(%rip),%r15
lea    0x50(%rsp),%r14
mov    %r15,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe8b(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe90(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xe80(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x10(%rsp),%rbx
mov    %r15,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%edx
lea    0xe7c(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Tell me your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Tell me your age: \00"
@.str.3 = [3 x i8] c"%u\00"
@.str.4 = [32 x i8] c"Finally, what's your username: \00"
@.str.5 = [65 x i8] c"\0AHere's what I learned about you!\0AName: %s\0AAge: %u\0AUsername: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [50 x i8]
%7 = alloca i32
%8 = alloca [50 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = bitcast [50 x i8]* %6 to i8*
%10 = bitcast [50 x i8]* %8 to i8*
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %7)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%17 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %6, i64 0, i64 0
%20 = load i32, i32* %7
%21 = getelementptr inbounds [50 x i8], [50 x i8]* %8, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i8* %19, i32 %20, i8* %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"Tell me your name: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [19 x i8] c"Tell me your age: \00"
@.str.3 = [3 x i8] c"%u\00"
@.str.4 = [32 x i8] c"Finally, what's your username: \00"
@.str.5 = [65 x i8] c"\0AHere's what I learned about you!\0AName: %s\0AAge: %u\0AUsername: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [50 x i8]
%4 = alloca i32
%5 = alloca [50 x i8]
%6 = getelementptr inbounds [50 x i8], [50 x i8]* %3, i64 0, i64 0
%7 = bitcast i32* %4 to i8*
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %5, i64 0, i64 0
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %4)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.5, i64 0, i64 0), i8* %6, i32 %15, i8* %8)
ret i32 0
}