#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 ReadLine1(char *, int);
int /*<<< orphan*/ printf(char *, ...);
void GetInput1() {
  char firstname[5];
  char lastname[5];
  int lens_firstname, lens_lastname;
  printf("Enter your first name:");
  lens_firstname = ReadLine1(firstname, 5);
  printf("Enter your last name:");
  lens_lastname = ReadLine1(lastname, 5);
  printf("Hello, %s, %s\n", firstname, lastname);
  printf("lens_firstname is %d, lens_lastname is %d\n", lens_firstname,
         lens_lastname);
}


x86 assembly (clang, -O0):
<GetInput1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x5(%rbp),%rdi
mov    $0x5,%esi
call   1040 <ReadLine1@plt>
mov    %eax,-0x10(%rbp)
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0xa(%rbp),%rdi
mov    $0x5,%esi
call   1040 <ReadLine1@plt>
mov    %eax,-0x14(%rbp)
lea    -0x5(%rbp),%rsi
lea    -0xa(%rbp),%rdx
lea    0xeb8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetInput1>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xecf(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x13(%rsp),%r14
mov    %r14,%rdi
mov    $0x5,%esi
call   1040 <ReadLine1@plt>
mov    %eax,%r15d
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1040 <ReadLine1@plt>
mov    %eax,%ebp
lea    0xeb7(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    %r15d,%esi
mov    %ebp,%edx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"Enter your first name:\00"
@.str.1 = [22 x i8] c"Enter your last name:\00"
@.str.2 = [15 x i8] c"Hello, %s, %s\0A\00"
@.str.3 = [43 x i8] c"lens_firstname is %d, lens_lastname is %d\0A\00"
define void @GetInput1() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = alloca i32
%4 = alloca i32
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%7 = call i32 @ReadLine1(i8* %6, i32 5)
store i32 %7, i32* %3
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%10 = call i32 @ReadLine1(i8* %9, i32 5)
store i32 %10, i32* %4
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %11, i8* %12)
%14 = load i32, i32* %3
%15 = load i32, i32* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Enter your first name:\00"
@.str.1 = [22 x i8] c"Enter your last name:\00"
@.str.2 = [15 x i8] c"Hello, %s, %s\0A\00"
@.str.3 = [43 x i8] c"lens_firstname is %d, lens_lastname is %d\0A\00"
define void @GetInput1() {
%1 = alloca [5 x i8]
%2 = alloca [5 x i8]
%3 = getelementptr inbounds [5 x i8], [5 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %2, i64 0, i64 0
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @ReadLine1(i8* %3, i32 5)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @ReadLine1(i8* %4, i32 5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %3, i8* %4)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.3, i64 0, i64 0), i32 %6, i32 %8)
ret void
}