#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*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int valor1;
  printf("\nDigite um valor int: ");
  scanf("%d", &valor1);
  printf("O valor digitado foi [%d]\n", valor1);
  float valor2;
  printf("\nDigite um valor float: ");
  scanf("%f", &valor2);
  printf("O valor digitado foi [%f]\n", valor2);
  char valor3;
  getchar();
  printf("\nDigite um valor char: ");
  scanf("%c", &valor3);
  printf("O valor digitado foi [%c]\n", valor3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb1(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0xd(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movsbl -0xd(%rbp),%esi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xec5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x14(%rsp),%esi
lea    0xeba(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec7(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xed2(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    0xf(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movsbl 0xf(%rsp),%esi
lea    0xeb3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [23 x i8] c"\0ADigite um valor int: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"O valor digitado foi [%d]\0A\00"
@.str.3 = [25 x i8] c"\0ADigite um valor float: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [27 x i8] c"O valor digitado foi [%f]\0A\00"
@.str.6 = [24 x i8] c"\0ADigite um valor char: \00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [27 x i8] c"O valor digitado foi [%c]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca i8
store i32 0, i32* %1
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%11 = load float, float* %3
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %12)
%14 = call i32 (...) @getchar()
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %4)
%17 = load i8, i8* %4
%18 = sext i8 %17 to i32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %18)
ret i32 0
}

LLVM IR (-O2):
@.str = [23 x i8] c"\0ADigite um valor int: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [27 x i8] c"O valor digitado foi [%d]\0A\00"
@.str.3 = [25 x i8] c"\0ADigite um valor float: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [27 x i8] c"O valor digitado foi [%f]\0A\00"
@.str.6 = [24 x i8] c"\0ADigite um valor char: \00"
@.str.7 = [3 x i8] c"%c\00"
@.str.8 = [27 x i8] c"O valor digitado foi [%c]\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i8
%4 = bitcast i32* %1 to i8*
%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 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%7 = load i32, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %7)
%9 = bitcast float* %2 to i8*
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%12 = load float, float* %2
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0), double %13)
%15 = call i32 (...) @getchar()
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %3)
%18 = load i8, i8* %3
%19 = sext i8 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.8, i64 0, i64 0), i32 %19)
ret i32 0
}