#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 main() {
  int codigo, qtd;
  printf("Digite o código do produto: ");
  scanf("%d", &codigo);
  printf("Digite a quantidade: ");
  scanf("%d", &qtd);
  switch (codigo) {
  case 100:
    printf("Pedido: %d Cachorro quente\n", qtd);
    printf("Total: R$ %.2f", 1.20 * qtd);
    break;
  case 101:
    printf("Pedido: %d Bauru Simples\n", qtd);
    printf("Total: R$ %.2f", 1.30 * qtd);
    break;
  case 102:
    printf("Pedido: %d Bauru com ovo\n", qtd);
    printf("Total: R$ %.2f", 1.50 * qtd);
    break;
  case 103:
    printf("Pedido: %d Hamburguer\n", qtd);
    printf("Total: R$ %.2f", 1.20 * qtd);
    break;
  case 104:
    printf("Pedido: %d Cheeseburguer\n", qtd);
    printf("Total: R$ %.2f\n", 1.70 * qtd);
    break;
  case 105:
    printf("Pedido: %d Suco(s)\n", qtd);
    printf("Total: R$ %.2f\n", 2.20 * qtd);
    break;
  case 106:
    printf("Pedido: %d Refrigerante(s)\n", qtd);
    printf("Total: R$ %.2f\n", 1.00 * qtd);
    break;
  default:
    printf("Código de produto inválido!");
    break;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xf16(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x21(%rbp)
call   1030 <printf@plt>
lea    0xf23(%rip),%rdi
mov    %rdi,-0x20(%rbp)
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x21(%rbp),%al
lea    0xf0f(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffff9c,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x6,%eax
ja     130c <main+0x1ec>
mov    -0x18(%rbp),%rax
lea    0xea0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0xc(%rbp),%esi
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe61(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xedd(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xed6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xe3c(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xea8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xdff(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xdc2(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe3e(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xe82(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xd85(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe7d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xd48(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
mov    -0xc(%rbp),%esi
lea    0xe56(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm1
movsd  0xd0b(%rip),%xmm0
mulsd  %xmm1,%xmm0
lea    0xe13(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    131a <main+0x1fa>
lea    0xe40(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xf18(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf28(%rip),%rbx
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xf17(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffff9c,%eax
cmp    $0x6,%eax
ja     118b <main+0x6b>
lea    0xeb3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x8(%rsp),%esi
lea    0xef2(%rip),%rdi
jmp    11ed <main+0xcd>
lea    0xfb9(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
jmp    1275 <main+0x155>
mov    0x8(%rsp),%esi
lea    0xefd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xe62(%rip),%xmm0
jmp    1202 <main+0xe2>
mov    0x8(%rsp),%esi
lea    0xef5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xe38(%rip),%xmm0
jmp    1202 <main+0xe2>
mov    0x8(%rsp),%esi
lea    0xeed(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xe0e(%rip),%xmm0
lea    0xe8e(%rip),%rdi
jmp    126e <main+0x14e>
mov    0x8(%rsp),%esi
lea    0xedb(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xddd(%rip),%xmm0
jmp    1267 <main+0x147>
mov    0x8(%rsp),%esi
lea    0xee3(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
mulsd  0xdb3(%rip),%xmm0
jmp    1267 <main+0x147>
mov    0x8(%rsp),%esi
lea    0xed5(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
lea    0xe9d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Digite o c\C3\B3digo do produto: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Digite a quantidade: \00"
@.str.3 = [28 x i8] c"Pedido: %d Cachorro quente\0A\00"
@.str.4 = [15 x i8] c"Total: R$ %.2f\00"
@.str.5 = [26 x i8] c"Pedido: %d Bauru Simples\0A\00"
@.str.6 = [26 x i8] c"Pedido: %d Bauru com ovo\0A\00"
@.str.7 = [23 x i8] c"Pedido: %d Hamburguer\0A\00"
@.str.8 = [26 x i8] c"Pedido: %d Cheeseburguer\0A\00"
@.str.9 = [16 x i8] c"Total: R$ %.2f\0A\00"
@.str.10 = [20 x i8] c"Pedido: %d Suco(s)\0A\00"
@.str.11 = [28 x i8] c"Pedido: %d Refrigerante(s)\0A\00"
@.str.12 = [30 x i8] c"C\C3\B3digo de produto inv\C3\A1lido!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%8 = load i32, i32* %2
switch i32 %8, label %58 [
i32 100, label %9
i32 101, label %16
i32 102, label %23
i32 103, label %30
i32 104, label %37
i32 105, label %44
i32 106, label %51
]
9: ; preds = %0
%10 = load i32, i32* %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = load i32, i32* %3
%13 = sitofp i32 %12 to double
%14 = fmul double 1.200000e+00, %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %14)
br label %60
16: ; preds = %0
%17 = load i32, i32* %3
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to double
%21 = fmul double 1.300000e+00, %20
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %21)
br label %60
23: ; preds = %0
%24 = load i32, i32* %3
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = load i32, i32* %3
%27 = sitofp i32 %26 to double
%28 = fmul double 1.500000e+00, %27
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %28)
br label %60
30: ; preds = %0
%31 = load i32, i32* %3
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %3
%34 = sitofp i32 %33 to double
%35 = fmul double 1.200000e+00, %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %35)
br label %60
37: ; preds = %0
%38 = load i32, i32* %3
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %38)
%40 = load i32, i32* %3
%41 = sitofp i32 %40 to double
%42 = fmul double 1.700000e+00, %41
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %42)
br label %60
44: ; preds = %0
%45 = load i32, i32* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %3
%48 = sitofp i32 %47 to double
%49 = fmul double 2.200000e+00, %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %49)
br label %60
51: ; preds = %0
%52 = load i32, i32* %3
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %52)
%54 = load i32, i32* %3
%55 = sitofp i32 %54 to double
%56 = fmul double 1.000000e+00, %55
%57 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %56)
br label %60
58: ; preds = %0
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
br label %60
60: ; preds = %58, %51, %44, %37, %30, %23, %16, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"Digite o c\C3\B3digo do produto: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [22 x i8] c"Digite a quantidade: \00"
@.str.3 = [28 x i8] c"Pedido: %d Cachorro quente\0A\00"
@.str.4 = [15 x i8] c"Total: R$ %.2f\00"
@.str.5 = [26 x i8] c"Pedido: %d Bauru Simples\0A\00"
@.str.6 = [26 x i8] c"Pedido: %d Bauru com ovo\0A\00"
@.str.7 = [23 x i8] c"Pedido: %d Hamburguer\0A\00"
@.str.8 = [26 x i8] c"Pedido: %d Cheeseburguer\0A\00"
@.str.9 = [16 x i8] c"Total: R$ %.2f\0A\00"
@.str.10 = [20 x i8] c"Pedido: %d Suco(s)\0A\00"
@.str.11 = [28 x i8] c"Pedido: %d Refrigerante(s)\0A\00"
@.str.12 = [30 x i8] c"C\C3\B3digo de produto inv\C3\A1lido!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 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* %1)
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%9 = load i32, i32* %1
switch i32 %9, label %58 [
i32 100, label %10
i32 101, label %17
i32 102, label %24
i32 103, label %31
i32 104, label %38
i32 105, label %45
i32 106, label %52
]
10: ; preds = %0
%11 = load i32, i32* %2
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
%15 = fmul double %14, 1.200000e+00
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %15)
br label %60
17: ; preds = %0
%18 = load i32, i32* %2
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %2
%21 = sitofp i32 %20 to double
%22 = fmul double %21, 1.300000e+00
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %22)
br label %60
24: ; preds = %0
%25 = load i32, i32* %2
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %2
%28 = sitofp i32 %27 to double
%29 = fmul double %28, 1.500000e+00
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %29)
br label %60
31: ; preds = %0
%32 = load i32, i32* %2
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.7, i64 0, i64 0), i32 %32)
%34 = load i32, i32* %2
%35 = sitofp i32 %34 to double
%36 = fmul double %35, 1.200000e+00
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0), double %36)
br label %60
38: ; preds = %0
%39 = load i32, i32* %2
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0), i32 %39)
%41 = load i32, i32* %2
%42 = sitofp i32 %41 to double
%43 = fmul double %42, 1.700000e+00
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %43)
br label %60
45: ; preds = %0
%46 = load i32, i32* %2
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0), i32 %46)
%48 = load i32, i32* %2
%49 = sitofp i32 %48 to double
%50 = fmul double %49, 2.200000e+00
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %50)
br label %60
52: ; preds = %0
%53 = load i32, i32* %2
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.11, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %2
%56 = sitofp i32 %55 to double
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0), double %56)
br label %60
58: ; preds = %0
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
br label %60
60: ; preds = %58, %52, %45, %38, %31, %24, %17, %10
ret i32 0
}