#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 *, ...);
int main() {
  int filial;
  float v1, v2, v3;
  printf("\ndigite o numero da filial: ");
  scanf("%d", &filial);
  printf("Digite o valor do 1 mes de vendas: ");
  scanf("%f", &v1);
  printf("Digite o valor do 2 mes de vendas: ");
  scanf("%f", &v2);
  printf("Digite o valor do 3 mes de vendas: ");
  scanf("%f", &v3);
  float totalf = v1 + v2 + v3;
  if (totalf > 0)
    printf("\no valor total desta filial sera de: %f", totalf);
  else
    printf("\nO valor nao podera ser exibido, favor digitar um valor diferente "
           "de 0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed9(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf4d(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xece(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf2d(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf0d(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
addss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11f0 <main+0xd0>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11fe <main+0xde>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf56(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xed3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xeda(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0x8(%rsp),%xmm0
addss  0x4(%rsp),%xmm0
addss  (%rsp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11cf <main+0xaf>
cvtss2sd %xmm0,%xmm0
lea    0xec6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11dd <main+0xbd>
lea    0xede(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [29 x i8] c"\0Adigite o numero da filial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Digite o valor do 1 mes de vendas: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [36 x i8] c"Digite o valor do 2 mes de vendas: \00"
@.str.5 = [36 x i8] c"Digite o valor do 3 mes de vendas: \00"
@.str.6 = [40 x i8] c"\0Ao valor total desta filial sera de: %f\00"
@.str.7 = [71 x i8] c"\0AO valor nao podera ser exibido, favor digitar um valor diferente de 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %5)
%15 = load float, float* %3
%16 = load float, float* %4
%17 = fadd float %15, %16
%18 = load float, float* %5
%19 = fadd float %17, %18
store float %19, float* %6
%20 = load float, float* %6
%21 = fcmp ogt float %20, 0.000000e+00
br i1 %21, label %22, label %26
22: ; preds = %0
%23 = load float, float* %6
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), double %24)
br label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
br label %28
28: ; preds = %26, %22
%29 = load i32, i32* %1
ret i32 %29
}

LLVM IR (-O2):
@.str = [29 x i8] c"\0Adigite o numero da filial: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"Digite o valor do 1 mes de vendas: \00"
@.str.3 = [3 x i8] c"%f\00"
@.str.4 = [36 x i8] c"Digite o valor do 2 mes de vendas: \00"
@.str.5 = [36 x i8] c"Digite o valor do 3 mes de vendas: \00"
@.str.6 = [40 x i8] c"\0Ao valor total desta filial sera de: %f\00"
@.str.7 = [71 x i8] c"\0AO valor nao podera ser exibido, favor digitar um valor diferente de 0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = bitcast i32* %1 to i8*
%6 = bitcast float* %2 to i8*
%7 = bitcast float* %3 to i8*
%8 = bitcast float* %4 to i8*
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %2)
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.4, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %3)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), float* %4)
%17 = load float, float* %2
%18 = load float, float* %3
%19 = fadd float %17, %18
%20 = load float, float* %4
%21 = fadd float %19, %20
%22 = fcmp ogt float %21, 0.000000e+00
br i1 %22, label %23, label %26
23: ; preds = %0
%24 = fpext float %21 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.6, i64 0, i64 0), double %24)
br label %28
26: ; preds = %0
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @.str.7, i64 0, i64 0))
br label %28
28: ; preds = %26, %23
ret i32 0
}