#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 */
char getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a = 0;
  char c;
  float f = 12.5;
  printf("Please Enter an Integer   ");
  scanf("%d", &a);
  printf("Please Enter a Character   ");
  c = getchar();
  c = getchar();
  printf("integer a has value %d %0x %f\n", a, c, f);
  printf("char c has value \'%c\'\n", c);
  printf("float f has value %f", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movss  0xeb2(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%esi
movsbl -0x9(%rbp),%edx
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe94(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x9(%rbp),%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
movl   $0x0,0xc(%rsp)
lea    0xec4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
lea    0xec3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0xc(%rsp),%esi
movsbl %al,%ebx
lea    0xebc(%rip),%rdi
movsd  0xe72(%rip),%xmm0
mov    %ebx,%edx
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeca(%rip),%rdi
movsd  0xe4a(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please Enter an Integer \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Please Enter a Character \00"
@.str.3 = [31 x i8] c"integer a has value %d %0x %f\0A\00"
@.str.4 = [23 x i8] c"char c has value '%c'\0A\00"
@.str.5 = [21 x i8] c"float f has value %f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
%4 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store float 1.250000e+01, float* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 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), i32* %2)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%8 = call signext i8 (...) @getchar()
store i8 %8, i8* %3
%9 = call signext i8 (...) @getchar()
store i8 %9, i8* %3
%10 = load i32, i32* %2
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %10, i32 %12, double %14)
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double %20)
ret i32 0
}

LLVM IR (-O2):
@.str = [27 x i8] c"Please Enter an Integer \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [28 x i8] c"Please Enter a Character \00"
@.str.3 = [31 x i8] c"integer a has value %d %0x %f\0A\00"
@.str.4 = [23 x i8] c"char c has value '%c'\0A\00"
@.str.5 = [21 x i8] c"float f has value %f\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0))
%6 = call signext i8 (...) @getchar()
%7 = call signext i8 (...) @getchar()
%8 = load i32, i32* %1
%9 = sext i8 %7 to i32
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0), i32 %8, i32 %9, double 1.250000e+01)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i32 %9)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), double 1.250000e+01)
ret i32 0
}