#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  int n_chorizo, n_tortilla, n_agua, n_cola, n_tercio;
  float total, entrega, devolucion;
  FILE *F;
  char s;
  printf("Bocadillos de chorizo: ");
  scanf("%d", &n_chorizo);
  printf("Bocadillos de tortilla: ");
  scanf("%d", &n_tortilla);
  printf("Botellas de agua: ");
  scanf("%d", &n_agua);
  printf("Refrescos de cola: ");
  scanf("%d", &n_cola);
  printf("Tercios: ");
  scanf("%d", &n_tercio);
  total = 1.50 * n_chorizo + 1.20 * n_tortilla + 0.50 * n_agua + 0.60 * n_cola +
          0.75 * n_tercio;
  printf("\nEn total son %.2f euros.\n", total);
  printf("\nEntregado: ");
  scanf("%f", &entrega);
  devolucion = entrega - total;
  F = fopen("cuenta.txt", "w");
  fprintf(F, " %2d ", n_chorizo);
  if (n_chorizo == 1)
    fprintf(F, "bocadillo ");
  else
    fprintf(F, "bocadillos");
  fprintf(F, " de chorizo a %5.2f euros son %6.2f euros\n", 1.50,
          1.50 * n_chorizo);
  if (n_tortilla == 1)
    s = ' ';
  else
    s = 's';
  fprintf(F, " %2d bocadillo%c de tortilla a    %5.2f euros son %6.2f euros\n",
          n_tortilla, s, 1.20, 1.20 * n_tortilla);
  if (n_agua == 1)
    s = ' ';
  else
    s = 's';
  fprintf(F, " %2d botella%c de agua a      %5.2f euros son %6.2f euros\n",
          n_agua, s, 0.50, 0.50 * n_agua);
  if (n_cola == 1)
    s = ' ';
  else
    s = 's';
  fprintf(F, " %2d refresco%c de cola a     %5.2f euros son %6.2f euros\n",
          n_cola, s, 0.60, 0.60 * n_cola);
  if (n_tercio == 1)
    s = ' ';
  else
    s = 's';
  fprintf(F, " %2d refresco%c de tercio a  %5.2f euros son %6.2f euros\n",
          n_tercio, s, 0.75, 0.75 * n_tercio);
  fprintf(F, "%42c --------\n", ' ');
  fprintf(F, "%42s  %6.2f euros\n", "TOTAL:", total);
  fprintf(F, "%42s  %6.2f euros\n", "Entrega:", entrega);
  fprintf(F, "%42s  %6.2f euros\n\n", "Devolucion:", devolucion);
  fclose(F);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe6c(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
lea    0xe9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe4c(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
cvtsi2sdl -0x8(%rbp),%xmm1
cvtsi2sdl -0xc(%rbp),%xmm2
movsd  0xe0f(%rip),%xmm0
mulsd  %xmm2,%xmm0
movsd  0xdfb(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xdde(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
movsd  0xdc1(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xda4(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe10(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1c(%rip),%rdi
lea    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1060 <scanf@plt>
movss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
lea    0xdfe(%rip),%rdi
lea    0xe02(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%edx
lea    0xded(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
cmpl   $0x1,-0x8(%rbp)
jne    1300 <main+0x1b0>
mov    -0x30(%rbp),%rdi
lea    0xdd7(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
jmp    1312 <main+0x1c2>
mov    -0x30(%rbp),%rdi
lea    0xdcb(%rip),%rsi
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xcf5(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xdb3(%rip),%rsi
movsd  0xce2(%rip),%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    1350 <main+0x200>
movb   $0x20,-0x31(%rbp)
jmp    1354 <main+0x204>
movb   $0x73,-0x31(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
movsbl -0x31(%rbp),%ecx
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xcb4(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xd95(%rip),%rsi
movsd  0xca1(%rip),%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1399 <main+0x249>
movb   $0x20,-0x31(%rbp)
jmp    139d <main+0x24d>
movb   $0x73,-0x31(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%edx
movsbl -0x31(%rbp),%ecx
cvtsi2sdl -0x10(%rbp),%xmm0
movsd  0xc5b(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xd8b(%rip),%rsi
movsd  0xc48(%rip),%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
cmpl   $0x1,-0x14(%rbp)
jne    13e2 <main+0x292>
movb   $0x20,-0x31(%rbp)
jmp    13e6 <main+0x296>
movb   $0x73,-0x31(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x14(%rbp),%edx
movsbl -0x31(%rbp),%ecx
cvtsi2sdl -0x14(%rbp),%xmm0
movsd  0xc0a(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xd7d(%rip),%rsi
movsd  0xbf7(%rip),%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    142b <main+0x2db>
movb   $0x20,-0x31(%rbp)
jmp    142f <main+0x2df>
movb   $0x73,-0x31(%rbp)
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%edx
movsbl -0x31(%rbp),%ecx
cvtsi2sdl -0x18(%rbp),%xmm0
movsd  0xbb9(%rip),%xmm1
mulsd  %xmm0,%xmm1
lea    0xd6f(%rip),%rsi
movsd  0xba6(%rip),%xmm0
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
lea    0xd8f(%rip),%rsi
mov    $0x20,%edx
mov    $0x0,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd7e(%rip),%rsi
lea    0xd8a(%rip),%rdx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd5c(%rip),%rsi
lea    0xd6f(%rip),%rdx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xd5d(%rip),%rsi
lea    0xd6a(%rip),%rdx
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeb0(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1c(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xea2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe99(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x14(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1060 <scanf@plt>
cvtsi2sdl 0x8(%rsp),%xmm0
cvtsi2sdl 0x20(%rsp),%xmm1
mulsd  0xdec(%rip),%xmm1
mulsd  0xdec(%rip),%xmm0
addsd  %xmm1,%xmm0
xorps  %xmm1,%xmm1
cvtsi2sdl 0x1c(%rsp),%xmm1
mulsd  0xddf(%rip),%xmm1
cvtsi2sdl 0x18(%rsp),%xmm2
addsd  %xmm0,%xmm1
mulsd  0xdd5(%rip),%xmm2
addsd  %xmm1,%xmm2
xorps  %xmm0,%xmm0
cvtsi2sdl 0x14(%rsp),%xmm0
mulsd  0xdc8(%rip),%xmm0
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,0x24(%rsp)
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0xe16(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe23(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe22(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
lea    0xe06(%rip),%rdi
lea    0xe0a(%rip),%rsi
call   1070 <fopen@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%edx
lea    0xdf9(%rip),%rsi
mov    %rax,%rdi
xor    %eax,%eax
call   1050 <fprintf@plt>
cmpl   $0x1,0x8(%rsp)
lea    0xde9(%rip),%rax
lea    0xded(%rip),%rdi
cmove  %rax,%rdi
mov    $0xa,%esi
mov    $0x1,%edx
mov    %rbx,%rcx
call   1080 <fwrite@plt>
xorps  %xmm1,%xmm1
cvtsi2sdl 0x8(%rsp),%xmm1
movsd  0xcf8(%rip),%xmm0
mulsd  %xmm0,%xmm1
lea    0xdc6(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    0x20(%rsp),%edx
cmp    $0x1,%edx
mov    $0x20,%r14d
mov    $0x73,%ecx
cmove  %r14d,%ecx
mov    $0x73,%ebp
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movsd  0xcb1(%rip),%xmm0
mulsd  %xmm0,%xmm1
lea    0xdb2(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    0x1c(%rsp),%edx
cmp    $0x1,%edx
mov    $0x73,%ecx
cmove  %r14d,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movsd  0xc8d(%rip),%xmm0
mulsd  %xmm0,%xmm1
lea    0xdbd(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    0x18(%rsp),%edx
cmp    $0x1,%edx
mov    $0x73,%ecx
cmove  %r14d,%ecx
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movsd  0xc61(%rip),%xmm0
mulsd  %xmm0,%xmm1
lea    0xdc4(%rip),%rsi
mov    %rbx,%rdi
mov    $0x2,%al
call   1050 <fprintf@plt>
mov    0x14(%rsp),%edx
cmp    $0x1,%edx
cmove  %r14d,%ebp
movss  0xc(%rsp),%xmm0
subss  0x24(%rsp),%xmm0
movss  %xmm0,0xc(%rsp)
xorps  %xmm1,%xmm1
cvtsi2sd %edx,%xmm1
movsd  0xc28(%rip),%xmm0
mulsd  %xmm0,%xmm1
lea    0xdbe(%rip),%rsi
mov    %rbx,%rdi
mov    %ebp,%ecx
mov    $0x2,%al
call   1050 <fprintf@plt>
lea    0xde5(%rip),%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
xor    %eax,%eax
call   1050 <fprintf@plt>
lea    0xdde(%rip),%rbp
lea    0xdea(%rip),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
movsd  0x28(%rsp),%xmm0
mov    $0x1,%al
call   1050 <fprintf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdcd(%rip),%rdx
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1050 <fprintf@plt>
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdb8(%rip),%rsi
lea    0xdc5(%rip),%rdx
mov    %rbx,%rdi
mov    $0x1,%al
call   1050 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Bocadillos de chorizo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Bocadillos de tortilla: \00"
@.str.3 = [19 x i8] c"Botellas de agua: \00"
@.str.4 = [20 x i8] c"Refrescos de cola: \00"
@.str.5 = [10 x i8] c"Tercios: \00"
@.str.6 = [27 x i8] c"\0AEn total son %.2f euros.\0A\00"
@.str.7 = [13 x i8] c"\0AEntregado: \00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [11 x i8] c"cuenta.txt\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [6 x i8] c" %2d \00"
@.str.12 = [11 x i8] c"bocadillo \00"
@.str.13 = [11 x i8] c"bocadillos\00"
@.str.14 = [43 x i8] c" de chorizo a %5.2f euros son %6.2f euros\0A\00"
@.str.15 = [63 x i8] c" %2d bocadillo%c de tortilla a %5.2f euros son %6.2f euros\0A\00"
@.str.16 = [59 x i8] c" %2d botella%c de agua a %5.2f euros son %6.2f euros\0A\00"
@.str.17 = [59 x i8] c" %2d refresco%c de cola a %5.2f euros son %6.2f euros\0A\00"
@.str.18 = [58 x i8] c" %2d refresco%c de tercio a %5.2f euros son %6.2f euros\0A\00"
@.str.19 = [15 x i8] c"%42c --------\0A\00"
@.str.20 = [19 x i8] c"%42s %6.2f euros\0A\00"
@.str.21 = [7 x i8] c"TOTAL:\00"
@.str.22 = [9 x i8] c"Entrega:\00"
@.str.23 = [20 x i8] c"%42s %6.2f euros\0A\0A\00"
@.str.24 = [12 x i8] c"Devolucion:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca i32*
%11 = alloca i8
store i32 0, i32* %1
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
%22 = load i32, i32* %2
%23 = sitofp i32 %22 to double
%24 = load i32, i32* %3
%25 = sitofp i32 %24 to double
%26 = fmul double 1.200000e+00, %25
%27 = call double @llvm.fmuladd.f64(double 1.500000e+00, double %23, double %26)
%28 = load i32, i32* %4
%29 = sitofp i32 %28 to double
%30 = call double @llvm.fmuladd.f64(double 5.000000e-01, double %29, double %27)
%31 = load i32, i32* %5
%32 = sitofp i32 %31 to double
%33 = call double @llvm.fmuladd.f64(double 6.000000e-01, double %32, double %30)
%34 = load i32, i32* %6
%35 = sitofp i32 %34 to double
%36 = call double @llvm.fmuladd.f64(double 7.500000e-01, double %35, double %33)
%37 = fptrunc double %36 to float
store float %37, float* %7
%38 = load float, float* %7
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), double %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %8)
%43 = load float, float* %8
%44 = load float, float* %7
%45 = fsub float %43, %44
store float %45, float* %9
%46 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
store i32* %46, i32** %10
%47 = load i32*, i32** %10
%48 = load i32, i32* %2
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %47, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %48)
%50 = load i32, i32* %2
%51 = icmp eq i32 %50, 1
br i1 %51, label %52, label %55
52: ; preds = %0
%53 = load i32*, i32** %10
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %53, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0))
br label %58
55: ; preds = %0
%56 = load i32*, i32** %10
%57 = call i32 (i32*, i8*, ...) @fprintf(i32* %56, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
br label %58
58: ; preds = %55, %52
%59 = load i32*, i32** %10
%60 = load i32, i32* %2
%61 = sitofp i32 %60 to double
%62 = fmul double 1.500000e+00, %61
%63 = call i32 (i32*, i8*, ...) @fprintf(i32* %59, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double 1.500000e+00, double %62)
%64 = load i32, i32* %3
%65 = icmp eq i32 %64, 1
br i1 %65, label %66, label %67
66: ; preds = %58
store i8 32, i8* %11
br label %68
67: ; preds = %58
store i8 115, i8* %11
br label %68
68: ; preds = %67, %66
%69 = load i32*, i32** %10
%70 = load i32, i32* %3
%71 = load i8, i8* %11
%72 = sext i8 %71 to i32
%73 = load i32, i32* %3
%74 = sitofp i32 %73 to double
%75 = fmul double 1.200000e+00, %74
%76 = call i32 (i32*, i8*, ...) @fprintf(i32* %69, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i32 %70, i32 %72, double 1.200000e+00, double %75)
%77 = load i32, i32* %4
%78 = icmp eq i32 %77, 1
br i1 %78, label %79, label %80
79: ; preds = %68
store i8 32, i8* %11
br label %81
80: ; preds = %68
store i8 115, i8* %11
br label %81
81: ; preds = %80, %79
%82 = load i32*, i32** %10
%83 = load i32, i32* %4
%84 = load i8, i8* %11
%85 = sext i8 %84 to i32
%86 = load i32, i32* %4
%87 = sitofp i32 %86 to double
%88 = fmul double 5.000000e-01, %87
%89 = call i32 (i32*, i8*, ...) @fprintf(i32* %82, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.16, i64 0, i64 0), i32 %83, i32 %85, double 5.000000e-01, double %88)
%90 = load i32, i32* %5
%91 = icmp eq i32 %90, 1
br i1 %91, label %92, label %93
92: ; preds = %81
store i8 32, i8* %11
br label %94
93: ; preds = %81
store i8 115, i8* %11
br label %94
94: ; preds = %93, %92
%95 = load i32*, i32** %10
%96 = load i32, i32* %5
%97 = load i8, i8* %11
%98 = sext i8 %97 to i32
%99 = load i32, i32* %5
%100 = sitofp i32 %99 to double
%101 = fmul double 6.000000e-01, %100
%102 = call i32 (i32*, i8*, ...) @fprintf(i32* %95, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.17, i64 0, i64 0), i32 %96, i32 %98, double 6.000000e-01, double %101)
%103 = load i32, i32* %6
%104 = icmp eq i32 %103, 1
br i1 %104, label %105, label %106
105: ; preds = %94
store i8 32, i8* %11
br label %107
106: ; preds = %94
store i8 115, i8* %11
br label %107
107: ; preds = %106, %105
%108 = load i32*, i32** %10
%109 = load i32, i32* %6
%110 = load i8, i8* %11
%111 = sext i8 %110 to i32
%112 = load i32, i32* %6
%113 = sitofp i32 %112 to double
%114 = fmul double 7.500000e-01, %113
%115 = call i32 (i32*, i8*, ...) @fprintf(i32* %108, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0), i32 %109, i32 %111, double 7.500000e-01, double %114)
%116 = load i32*, i32** %10
%117 = call i32 (i32*, i8*, ...) @fprintf(i32* %116, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i32 32)
%118 = load i32*, i32** %10
%119 = load float, float* %7
%120 = fpext float %119 to double
%121 = call i32 (i32*, i8*, ...) @fprintf(i32* %118, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), double %120)
%122 = load i32*, i32** %10
%123 = load float, float* %8
%124 = fpext float %123 to double
%125 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0), double %124)
%126 = load i32*, i32** %10
%127 = load float, float* %9
%128 = fpext float %127 to double
%129 = call i32 (i32*, i8*, ...) @fprintf(i32* %126, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0), double %128)
%130 = load i32*, i32** %10
%131 = call i32 @fclose(i32* %130)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Bocadillos de chorizo: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [25 x i8] c"Bocadillos de tortilla: \00"
@.str.3 = [19 x i8] c"Botellas de agua: \00"
@.str.4 = [20 x i8] c"Refrescos de cola: \00"
@.str.5 = [10 x i8] c"Tercios: \00"
@.str.6 = [27 x i8] c"\0AEn total son %.2f euros.\0A\00"
@.str.7 = [13 x i8] c"\0AEntregado: \00"
@.str.8 = [3 x i8] c"%f\00"
@.str.9 = [11 x i8] c"cuenta.txt\00"
@.str.10 = [2 x i8] c"w\00"
@.str.11 = [6 x i8] c" %2d \00"
@.str.12 = [11 x i8] c"bocadillo \00"
@.str.13 = [11 x i8] c"bocadillos\00"
@.str.14 = [43 x i8] c" de chorizo a %5.2f euros son %6.2f euros\0A\00"
@.str.15 = [63 x i8] c" %2d bocadillo%c de tortilla a %5.2f euros son %6.2f euros\0A\00"
@.str.16 = [59 x i8] c" %2d botella%c de agua a %5.2f euros son %6.2f euros\0A\00"
@.str.17 = [59 x i8] c" %2d refresco%c de cola a %5.2f euros son %6.2f euros\0A\00"
@.str.18 = [58 x i8] c" %2d refresco%c de tercio a %5.2f euros son %6.2f euros\0A\00"
@.str.19 = [15 x i8] c"%42c --------\0A\00"
@.str.20 = [19 x i8] c"%42s %6.2f euros\0A\00"
@.str.21 = [7 x i8] c"TOTAL:\00"
@.str.22 = [9 x i8] c"Entrega:\00"
@.str.23 = [20 x i8] c"%42s %6.2f euros\0A\0A\00"
@.str.24 = [12 x i8] c"Devolucion:\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = bitcast i32* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.4, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%23 = load i32, i32* %1
%24 = sitofp i32 %23 to double
%25 = load i32, i32* %2
%26 = sitofp i32 %25 to double
%27 = fmul double %26, 1.200000e+00
%28 = call double @llvm.fmuladd.f64(double %24, double 1.500000e+00, double %27)
%29 = load i32, i32* %3
%30 = sitofp i32 %29 to double
%31 = call double @llvm.fmuladd.f64(double %30, double 5.000000e-01, double %28)
%32 = load i32, i32* %4
%33 = sitofp i32 %32 to double
%34 = call double @llvm.fmuladd.f64(double %33, double 6.000000e-01, double %31)
%35 = load i32, i32* %5
%36 = sitofp i32 %35 to double
%37 = call double @llvm.fmuladd.f64(double %36, double 7.500000e-01, double %34)
%38 = fptrunc double %37 to float
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0), double %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), float* %6)
%43 = load float, float* %6
%44 = call i32* @fopen(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%45 = load i32, i32* %1
%46 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 %45)
%47 = load i32, i32* %1
%48 = icmp eq i32 %47, 1
%49 = select i1 %48, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0)
%50 = call i64 @fwrite(i8* %49, i64 10, i64 1, i32* %44)
%51 = load i32, i32* %1
%52 = sitofp i32 %51 to double
%53 = fmul double %52, 1.500000e+00
%54 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.14, i64 0, i64 0), double 1.500000e+00, double %53)
%55 = load i32, i32* %2
%56 = icmp eq i32 %55, 1
%57 = select i1 %56, i32 32, i32 115
%58 = sitofp i32 %55 to double
%59 = fmul double %58, 1.200000e+00
%60 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i32 %55, i32 %57, double 1.200000e+00, double %59)
%61 = load i32, i32* %3
%62 = icmp eq i32 %61, 1
%63 = select i1 %62, i32 32, i32 115
%64 = sitofp i32 %61 to double
%65 = fmul double %64, 5.000000e-01
%66 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.16, i64 0, i64 0), i32 %61, i32 %63, double 5.000000e-01, double %65)
%67 = load i32, i32* %4
%68 = icmp eq i32 %67, 1
%69 = select i1 %68, i32 32, i32 115
%70 = sitofp i32 %67 to double
%71 = fmul double %70, 6.000000e-01
%72 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.17, i64 0, i64 0), i32 %67, i32 %69, double 6.000000e-01, double %71)
%73 = load i32, i32* %5
%74 = icmp eq i32 %73, 1
%75 = select i1 %74, i32 32, i32 115
%76 = fsub float %43, %38
%77 = sitofp i32 %73 to double
%78 = fmul double %77, 7.500000e-01
%79 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.18, i64 0, i64 0), i32 %73, i32 %75, double 7.500000e-01, double %78)
%80 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.19, i64 0, i64 0), i32 32)
%81 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), double %39)
%82 = load float, float* %6
%83 = fpext float %82 to double
%84 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.22, i64 0, i64 0), double %83)
%85 = fpext float %76 to double
%86 = call i32 (i32*, i8*, ...) @fprintf(i32* %44, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.24, i64 0, i64 0), double %85)
%87 = call i32 @fclose(i32* %44)
ret i32 0
}