#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 *, float *);
main() {
  float conta, gorjeta;
  printf("\n\tEntre com valor da conta: ");
  scanf("%f", &conta);
  gorjeta = conta * 0.1;
  printf("\nValor da gorjeta = %.2f\n", gorjeta);
  conta = conta + gorjeta;
  printf("O valor final da conta e = %.2f\n", conta);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea9(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee0(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mulsd  0xeb1(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x4(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xec4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
movss  %xmm0,(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xebc(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0A\09Entre com valor da conta: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"\0AValor da gorjeta = %.2f\0A\00"
@.str.3 = [33 x i8] c"O valor final da conta e = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 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), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.000000e-01
%8 = fptrunc double %7 to float
store float %8, float* %2
%9 = load float, float* %2
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %10)
%12 = load float, float* %1
%13 = load float, float* %2
%14 = fadd float %12, %13
store float %14, float* %1
%15 = load float, float* %1
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %16)
ret i32 0
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0A\09Entre com valor da conta: \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"\0AValor da gorjeta = %.2f\0A\00"
@.str.3 = [33 x i8] c"O valor final da conta e = %.2f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 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), float* %1)
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = fmul double %6, 1.000000e-01
%8 = fptrunc double %7 to float
%9 = fpext float %8 to double
%10 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = load float, float* %1
%12 = fadd float %11, %8
store float %12, float* %1
%13 = fpext float %12 to double
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.3, i64 0, i64 0), double %13)
ret i32 0
}