#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 getchar();
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(int);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, char *, int *);
int main() {
  int c;
  printf("Enter a value :");
  c = getchar();
  printf("\nYou entered: ");
  putchar(c);
  char str[100];
  printf("Enter a value :");
  gets(str);
  printf("\nYou entered: ");
  puts(str);
  int i;
  printf("Enter a value :");
  scanf("%s %d", str, &i);
  printf("\nYou entered: %s %d ", str, i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
lea    0xe8e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    %eax,-0x4(%rbp)
lea    0xe86(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%edi
call   1030 <putchar@plt>
lea    0xe60(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1070 <gets@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rdi
call   1040 <puts@plt>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x70(%rbp),%rsi
lea    0xe3f(%rip),%rdi
lea    -0x74(%rbp),%rdx
call   1080 <scanf@plt>
lea    -0x70(%rbp),%rsi
mov    -0x74(%rbp),%edx
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x80,%rsp
lea    0xe8e(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    %eax,%ebp
lea    0xe84(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   1070 <gets@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe48(%rip),%rdi
lea    0xc(%rsp),%rdx
mov    %rbp,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%edx
lea    0xe36(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [16 x i8] c"Enter a value :\00"
@.str.1 = [15 x i8] c"\0AYou entered: \00"
@.str.2 = [6 x i8] c"%s %d\00"
@.str.3 = [21 x i8] c"\0AYou entered: %s %d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%5 = call i32 (...) @getchar()
store i32 %5, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %1
%8 = call i32 @putchar(i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%11 = call i32 @gets(i8* %10)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%13 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%14 = call i32 @puts(i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%16 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%17 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %16, i32* %3)
%18 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %18, i32 %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"Enter a value :\00"
@.str.1 = [15 x i8] c"\0AYou entered: \00"
@.str.2 = [6 x i8] c"%s %d\00"
@.str.3 = [21 x i8] c"\0AYou entered: %s %d \00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca i32
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 (...) @getchar()
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @putchar(i32 %4)
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @gets(i8* %7)
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @puts(i8* %7)
%12 = bitcast i32* %2 to i8*
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %7, i32* %2)
%15 = load i32, i32* %2
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0), i8* %7, i32 %15)
ret i32 0
}