#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 *);
int /*<<< orphan*/ troco(float);
int main(void) {
  int a;
  float c, d, e, f, g;
  c = 0.7;
  d = 1;
  e = 2;
  f = 0.50;
  g = 1.50;
  printf("A seguir você podera escolher algum tipo de doce\n\n");
  printf("1.Jujuba R$ %.2f\n2.batom Garoto R$ %.2f\n3.Picole R$ "
         "%.2f\n4.Pirulito R$ %.2f\n5.twist R$ %.2f\n\nPara escolher digite o "
         "numero relativo ao doce\n",
         c, d, e, f, g);
  scanf("%d", &a);
  switch (a) {
  case 1:
    troco(c);
    break;
  case 2:
    troco(d);
    break;
  case 3:
    troco(e);
    break;
  case 4:
    troco(f);
    break;
  case 5:
    troco(g);
    break;
  default:
    printf("Erro:\nNao existe esta opcao!!\n");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3f333333,-0xc(%rbp)
movl   $0x3f800000,-0x10(%rbp)
movl   $0x40000000,-0x14(%rbp)
movl   $0x3f000000,-0x18(%rbp)
movl   $0x3fc00000,-0x1c(%rbp)
lea    0xeab(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x14(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movss  -0x18(%rbp),%xmm3
cvtss2sd %xmm3,%xmm3
movss  -0x1c(%rbp),%xmm4
cvtss2sd %xmm4,%xmm4
lea    0xea4(%rip),%rdi
mov    $0x5,%al
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x28(%rbp)
sub    $0x4,%eax
ja     122f <main+0xff>
mov    -0x28(%rbp),%rax
lea    0xe25(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  -0xc(%rbp),%xmm0
call   1050 <troco@plt>
jmp    123d <main+0x10d>
movss  -0x10(%rbp),%xmm0
call   1050 <troco@plt>
jmp    123d <main+0x10d>
movss  -0x14(%rbp),%xmm0
call   1050 <troco@plt>
jmp    123d <main+0x10d>
movss  -0x18(%rbp),%xmm0
call   1050 <troco@plt>
jmp    123d <main+0x10d>
movss  -0x1c(%rbp),%xmm0
call   1050 <troco@plt>
jmp    123d <main+0x10d>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf98(%rip),%rdi
call   1030 <puts@plt>
lea    0xefc(%rip),%rdi
movsd  0xea4(%rip),%xmm0
movsd  0xea4(%rip),%xmm1
movsd  0xea4(%rip),%xmm2
movsd  0xea4(%rip),%xmm3
movsd  0xea4(%rip),%xmm4
mov    $0x5,%al
call   1040 <printf@plt>
lea    0xf53(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11ba <main+0x7a>
lea    0xe95(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movss  0xe80(%rip),%xmm0
jmp    11ee <main+0xae>
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
jmp    11f3 <main+0xb3>
movss  0xe64(%rip),%xmm0
jmp    11ee <main+0xae>
movss  0xe56(%rip),%xmm0
jmp    11ee <main+0xae>
movss  0xe48(%rip),%xmm0
jmp    11ee <main+0xae>
movss  0xe3a(%rip),%xmm0
call   1060 <troco@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [52 x i8] c"A seguir voc\C3\AA podera escolher algum tipo de doce\0A\0A\00"
@.str.1 = [141 x i8] c"1.Jujuba R$ %.2f\0A2.batom Garoto R$ %.2f\0A3.Picole R$ %.2f\0A4.Pirulito R$ %.2f\0A5.twist R$ %.2f\0A\0APara escolher digite o numero relativo ao doce\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [31 x i8] c"Erro:\0ANao existe esta opcao!!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store float 0x3FE6666660000000, float* %3
store float 1.000000e+00, float* %4
store float 2.000000e+00, float* %5
store float 5.000000e-01, float* %6
store float 1.500000e+00, float* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = load float, float* %5
%14 = fpext float %13 to double
%15 = load float, float* %6
%16 = fpext float %15 to double
%17 = load float, float* %7
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), double %10, double %12, double %14, double %16, double %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%21 = load i32, i32* %2
switch i32 %21, label %37 [
i32 1, label %22
i32 2, label %25
i32 3, label %28
i32 4, label %31
i32 5, label %34
]
22: ; preds = %0
%23 = load float, float* %3
%24 = call i32 @troco(float %23)
br label %39
25: ; preds = %0
%26 = load float, float* %4
%27 = call i32 @troco(float %26)
br label %39
28: ; preds = %0
%29 = load float, float* %5
%30 = call i32 @troco(float %29)
br label %39
31: ; preds = %0
%32 = load float, float* %6
%33 = call i32 @troco(float %32)
br label %39
34: ; preds = %0
%35 = load float, float* %7
%36 = call i32 @troco(float %35)
br label %39
37: ; preds = %0
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.3, i64 0, i64 0))
br label %39
39: ; preds = %37, %34, %31, %28, %25, %22
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [141 x i8] c"1.Jujuba R$ %.2f\0A2.batom Garoto R$ %.2f\0A3.Picole R$ %.2f\0A4.Pirulito R$ %.2f\0A5.twist R$ %.2f\0A\0APara escolher digite o numero relativo ao doce\0A\00"
@.str.2 = [3 x i8] c"%d\00"
@str = [51 x i8] c"A seguir voc\C3\AA podera escolher algum tipo de doce\0A\00"
@str.4 = [30 x i8] c"Erro:\0ANao existe esta opcao!!\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([141 x i8], [141 x i8]* @.str.1, i64 0, i64 0), double 0x3FE6666660000000, double 1.000000e+00, double 2.000000e+00, double 5.000000e-01, double 1.500000e+00)
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
switch i32 %6, label %17 [
i32 1, label %7
i32 2, label %9
i32 3, label %11
i32 4, label %13
i32 5, label %15
]
7: ; preds = %0
%8 = call i32 @troco(float 0x3FE6666660000000)
br label %19
9: ; preds = %0
%10 = call i32 @troco(float 1.000000e+00)
br label %19
11: ; preds = %0
%12 = call i32 @troco(float 2.000000e+00)
br label %19
13: ; preds = %0
%14 = call i32 @troco(float 5.000000e-01)
br label %19
15: ; preds = %0
%16 = call i32 @troco(float 1.500000e+00)
br label %19
17: ; preds = %0
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.4, i64 0, i64 0))
br label %19
19: ; preds = %17, %15, %13, %11, %9, %7
ret i32 0
}