#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*/ LC_ALL;
char *getMonthName(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int main() {
  setlocale(LC_ALL, "Portuguese");
  char *actualMonth;
  int month = 0;
  float reservoirVolumeMax, usedMonth, rainMonth, finalResult,
      monthReservoirUsed[12], monthRain[12];
  printf("****************************************************** \n");
  printf("**** WELCOME TO RESERVOIR CALCULATOR (RU 2136681) ****\n");
  printf("****************************************************** \n\n");
  printf("Please, insert the reservoir max volume (mm):\n");
  scanf("%f", &reservoirVolumeMax);
  finalResult = reservoirVolumeMax;
  while (month < 12) {
    actualMonth = getMonthName(month);
    printf("\n* Seting data to month: %s. Now reservoir max volume is %.2fmm\n",
           actualMonth, finalResult);
    if (finalResult == 0) {
      printf("You can't use reservoir, that's empty.\n");
    } else {
      printf("* Reservoir used (mm):\n");
      scanf("%f", &monthReservoirUsed[month]);
    }
    printf("* Rain quantity (mm):\n");
    scanf("%f", &monthRain[month]);
    printf("* Result on %s\n", actualMonth);
    usedMonth = monthReservoirUsed[month];
    rainMonth = monthRain[month];
    if (month == 0)
      finalResult = reservoirVolumeMax + rainMonth - usedMonth;
    else
      finalResult = finalResult + rainMonth - usedMonth;
    printf("* Reservoir used (mm): %.2f\n", usedMonth);
    printf("* Rain quantity (mm): %.2f\n", rainMonth);
    printf("* Final result: %.2f \n", finalResult);
    if (finalResult == 0) {
      printf("WARNING! On the %s month, reservoir volume is empty! \n",
             actualMonth);
    } else if (finalResult > reservoirVolumeMax) {
      printf("On the %s month, reservoir max volume exceeded with %.2f mm. \n",
             actualMonth, (finalResult - reservoirVolumeMax));
      finalResult = reservoirVolumeMax;
    } else if (finalResult < reservoirVolumeMax) {
      printf("On the %s month, reservoir volume is %.2f mm. \n", actualMonth,
             finalResult);
    } else {
      printf("On the %s month, reservoir volume is equal max volume. \n",
             actualMonth);
    }
    month++;
    printf("****************************************************** \n");
  }
  printf("\n\n****************************************************** \n");
  printf("* RESERVOIR VOLUME ON THE END OF YEAR IS: %.2fmm\n", finalResult);
  printf("****************************************************** \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
lea    0xe9e(%rip),%rsi
call   1050 <setlocale@plt>
movl   $0x0,-0x14(%rbp)
lea    0x1113(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
cmpl   $0xc,-0x14(%rbp)
jge    13f6 <main+0x2b6>
mov    -0x14(%rbp),%edi
call   1040 <getMonthName@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec5(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    121b <main+0xdb>
jp     121b <main+0xdb>
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1244 <main+0x104>
lea    0xef6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x60(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe6d(%rip),%rdi
call   1060 <scanf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
lea    -0x90(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
lea    0xe41(%rip),%rdi
call   1060 <scanf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x14(%rbp),%rax
movss  -0x60(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x1c(%rbp)
movslq -0x14(%rbp),%rax
movss  -0x90(%rbp,%rax,4),%xmm0
ff ff
movss  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    12c6 <main+0x186>
movss  -0x18(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    12da <main+0x19a>
movss  -0x24(%rbp),%xmm0
addss  -0x20(%rbp),%xmm0
subss  -0x1c(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe73(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe78(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    134d <main+0x20d>
jp     134d <main+0x20d>
mov    -0x10(%rbp),%rsi
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13da <main+0x29a>
movss  -0x24(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    138b <main+0x24b>
mov    -0x10(%rbp),%rsi
movss  -0x24(%rbp),%xmm0
subss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x18(%rbp),%xmm0
movss  %xmm0,-0x24(%rbp)
jmp    13d5 <main+0x295>
movss  -0x24(%rbp),%xmm1
movss  -0x18(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    13be <main+0x27e>
mov    -0x10(%rbp),%rsi
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe6b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    13d0 <main+0x290>
mov    -0x10(%rbp),%rsi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13d5 <main+0x295>
jmp    13da <main+0x29a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
lea    0xe9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <main+0x80>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xead(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
lea    0xe96(%rip),%rsi
call   1060 <setlocale@plt>
lea    0x10ea(%rip),%rdi
call   1030 <puts@plt>
lea    0x103e(%rip),%rdi
call   1030 <puts@plt>
lea    0x1069(%rip),%rdi
call   1030 <puts@plt>
lea    0x1096(%rip),%rdi
call   1030 <puts@plt>
lea    0xe65(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
lea    0xeb7(%rip),%r14
lea    0xecc(%rip),%r15
xor    %r13d,%r13d
xor    %r12d,%r12d
jmp    121e <main+0xce>
subss  %xmm2,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xf00(%rip),%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
movss  %xmm0,(%rsp)
nop
lea    0x105d(%rip),%rdi
call   1030 <puts@plt>
add    $0x4,%r12
add    $0x1,%r13d
cmp    $0x30,%r12
je     1399 <main+0x249>
mov    %r13d,%edi
call   1050 <getMonthName@plt>
mov    %rax,%rbp
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdd9(%rip),%rdi
mov    %rax,%rsi
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%rsp),%xmm0
ucomiss 0xdb1(%rip),%xmm0
jne    1270 <main+0x120>
jp     1270 <main+0x120>
lea    0x106f(%rip),%rdi
call   1030 <puts@plt>
jmp    128c <main+0x13c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0x1025(%rip),%rdi
call   1030 <puts@plt>
lea    (%rsp,%r12,1),%rsi
add    $0x40,%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0x1020(%rip),%rdi
call   1030 <puts@plt>
lea    (%rsp,%r12,1),%rsi
add    $0x10,%rsi
mov    %rbx,%rdi
call   1070 <scanf@plt>
lea    0xda4(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
movss  0x40(%rsp,%r12,1),%xmm0
movss  0x10(%rsp,%r12,1),%xmm2
test   %r12,%r12
je     12e0 <main+0x190>
movss  (%rsp),%xmm1
jmp    12e6 <main+0x196>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  0x4(%rsp),%xmm1
addss  %xmm2,%xmm1
subss  %xmm0,%xmm1
movss  %xmm1,(%rsp)
cvtss2sd %xmm0,%xmm0
lea    0xd65(%rip),%rdi
mov    $0x1,%al
movss  %xmm2,0x8(%rsp)
call   1040 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
movsd  %xmm0,0x8(%rsp)
mov    $0x1,%al
call   1040 <printf@plt>
movss  (%rsp),%xmm1
ucomiss 0xcbc(%rip),%xmm1
jne    1360 <main+0x210>
jp     1360 <main+0x210>
lea    0xd64(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1200 <main+0xb0>
xchg   %ax,%ax
movsd  0x8(%rsp),%xmm0
movss  0x4(%rsp),%xmm2
ucomiss %xmm2,%xmm1
ja     11d8 <main+0x88>
ucomiss %xmm1,%xmm2
jbe    1390 <main+0x240>
lea    0xda8(%rip),%rdi
mov    %rbp,%rsi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    1200 <main+0xb0>
lea    0xdc2(%rip),%rdi
jmp    134f <main+0x1ff>
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
movss  (%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xddd(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.1 = [57 x i8] c"****************************************************** \0A\00"
@.str.2 = [56 x i8] c"**** WELCOME TO RESERVOIR CALCULATOR (RU 2136681) ****\0A\00"
@.str.3 = [58 x i8] c"****************************************************** \0A\0A\00"
@.str.4 = [47 x i8] c"Please, insert the reservoir max volume (mm):\0A\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [65 x i8] c"\0A* Seting data to month: %s. Now reservoir max volume is %.2fmm\0A\00"
@.str.7 = [40 x i8] c"You can't use reservoir, that's empty.\0A\00"
@.str.8 = [24 x i8] c"* Reservoir used (mm):\0A\00"
@.str.9 = [23 x i8] c"* Rain quantity (mm):\0A\00"
@.str.10 = [16 x i8] c"* Result on %s\0A\00"
@.str.11 = [29 x i8] c"* Reservoir used (mm): %.2f\0A\00"
@.str.12 = [28 x i8] c"* Rain quantity (mm): %.2f\0A\00"
@.str.13 = [23 x i8] c"* Final result: %.2f \0A\00"
@.str.14 = [55 x i8] c"WARNING! On the %s month, reservoir volume is empty! \0A\00"
@.str.15 = [63 x i8] c"On the %s month, reservoir max volume exceeded with %.2f mm. \0A\00"
@.str.16 = [48 x i8] c"On the %s month, reservoir volume is %.2f mm. \0A\00"
@.str.17 = [57 x i8] c"On the %s month, reservoir volume is equal max volume. \0A\00"
@.str.18 = [59 x i8] c"\0A\0A****************************************************** \0A\00"
@.str.19 = [50 x i8] c"* RESERVOIR VOLUME ON THE END OF YEAR IS: %.2fmm\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca [12 x float]
%9 = alloca [12 x float]
store i32 0, i32* %1
%10 = load i32, i32* @LC_ALL
%11 = call i32 @setlocale(i32 %10, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %4)
%17 = load float, float* %4
store float %17, float* %7
br label %18
18: ; preds = %109, %0
%19 = load i32, i32* %3
%20 = icmp slt i32 %19, 12
br i1 %20, label %21, label %113
21: ; preds = %18
%22 = load i32, i32* %3
%23 = call i8* @getMonthName(i32 %22)
store i8* %23, i8** %2
%24 = load i8*, i8** %2
%25 = load float, float* %7
%26 = fpext float %25 to double
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i8* %24, double %26)
%28 = load float, float* %7
%29 = fcmp oeq float %28, 0.000000e+00
br i1 %29, label %30, label %32
30: ; preds = %21
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.7, i64 0, i64 0))
br label %38
32: ; preds = %21
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0))
%34 = load i32, i32* %3
%35 = sext i32 %34 to i64
%36 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 %35
%37 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %36)
br label %38
38: ; preds = %32, %30
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0))
%40 = load i32, i32* %3
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds [12 x float], [12 x float]* %9, i64 0, i64 %41
%43 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %42)
%44 = load i8*, i8** %2
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %44)
%46 = load i32, i32* %3
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [12 x float], [12 x float]* %8, i64 0, i64 %47
%49 = load float, float* %48
store float %49, float* %5
%50 = load i32, i32* %3
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds [12 x float], [12 x float]* %9, i64 0, i64 %51
%53 = load float, float* %52
store float %53, float* %6
%54 = load i32, i32* %3
%55 = icmp eq i32 %54, 0
br i1 %55, label %56, label %62
56: ; preds = %38
%57 = load float, float* %4
%58 = load float, float* %6
%59 = fadd float %57, %58
%60 = load float, float* %5
%61 = fsub float %59, %60
store float %61, float* %7
br label %68
62: ; preds = %38
%63 = load float, float* %7
%64 = load float, float* %6
%65 = fadd float %63, %64
%66 = load float, float* %5
%67 = fsub float %65, %66
store float %67, float* %7
br label %68
68: ; preds = %62, %56
%69 = load float, float* %5
%70 = fpext float %69 to double
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), double %70)
%72 = load float, float* %6
%73 = fpext float %72 to double
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), double %73)
%75 = load float, float* %7
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), double %76)
%78 = load float, float* %7
%79 = fcmp oeq float %78, 0.000000e+00
br i1 %79, label %80, label %83
80: ; preds = %68
%81 = load i8*, i8** %2
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0), i8* %81)
br label %109
83: ; preds = %68
%84 = load float, float* %7
%85 = load float, float* %4
%86 = fcmp ogt float %84, %85
br i1 %86, label %87, label %95
87: ; preds = %83
%88 = load i8*, i8** %2
%89 = load float, float* %7
%90 = load float, float* %4
%91 = fsub float %89, %90
%92 = fpext float %91 to double
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i8* %88, double %92)
%94 = load float, float* %4
store float %94, float* %7
br label %108
95: ; preds = %83
%96 = load float, float* %7
%97 = load float, float* %4
%98 = fcmp olt float %96, %97
br i1 %98, label %99, label %104
99: ; preds = %95
%100 = load i8*, i8** %2
%101 = load float, float* %7
%102 = fpext float %101 to double
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.16, i64 0, i64 0), i8* %100, double %102)
br label %107
104: ; preds = %95
%105 = load i8*, i8** %2
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.17, i64 0, i64 0), i8* %105)
br label %107
107: ; preds = %104, %99
br label %108
108: ; preds = %107, %87
br label %109
109: ; preds = %108, %80
%110 = load i32, i32* %3
%111 = add nsw i32 %110, 1
store i32 %111, i32* %3
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
br label %18
113: ; preds = %18
%114 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.18, i64 0, i64 0))
%115 = load float, float* %7
%116 = fpext float %115 to double
%117 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.19, i64 0, i64 0), double %116)
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@LC_ALL = global i32 0
@.str = [11 x i8] c"Portuguese\00"
@.str.5 = [3 x i8] c"%f\00"
@.str.6 = [65 x i8] c"\0A* Seting data to month: %s. Now reservoir max volume is %.2fmm\0A\00"
@.str.10 = [16 x i8] c"* Result on %s\0A\00"
@.str.11 = [29 x i8] c"* Reservoir used (mm): %.2f\0A\00"
@.str.12 = [28 x i8] c"* Rain quantity (mm): %.2f\0A\00"
@.str.13 = [23 x i8] c"* Final result: %.2f \0A\00"
@.str.14 = [55 x i8] c"WARNING! On the %s month, reservoir volume is empty! \0A\00"
@.str.15 = [63 x i8] c"On the %s month, reservoir max volume exceeded with %.2f mm. \0A\00"
@.str.16 = [48 x i8] c"On the %s month, reservoir volume is %.2f mm. \0A\00"
@.str.17 = [57 x i8] c"On the %s month, reservoir volume is equal max volume. \0A\00"
@.str.19 = [50 x i8] c"* RESERVOIR VOLUME ON THE END OF YEAR IS: %.2fmm\0A\00"
@str.20 = [55 x i8] c"**** WELCOME TO RESERVOIR CALCULATOR (RU 2136681) ****\00"
@str.21 = [57 x i8] c"****************************************************** \0A\00"
@str.22 = [46 x i8] c"Please, insert the reservoir max volume (mm):\00"
@str.23 = [58 x i8] c"\0A\0A****************************************************** \00"
@str.25 = [23 x i8] c"* Reservoir used (mm):\00"
@str.26 = [22 x i8] c"* Rain quantity (mm):\00"
@str.27 = [56 x i8] c"****************************************************** \00"
@str.28 = [39 x i8] c"You can't use reservoir, that's empty.\00"
define i32 @main() {
%1 = alloca float
%2 = alloca [12 x float]
%3 = alloca [12 x float]
%4 = load i32, i32* @LC_ALL
%5 = tail call i32 @setlocale(i32 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%6 = bitcast float* %1 to i8*
%7 = bitcast [12 x float]* %2 to i8*
%8 = bitcast [12 x float]* %3 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.27, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.20, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.21, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.22, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %1)
%14 = load float, float* %1
br label %15
15: ; preds = %0, %65
%16 = phi i64 [ 0, %0 ], [ %67, %65 ]
%17 = phi float [ %14, %0 ], [ %66, %65 ]
%18 = trunc i64 %16 to i32
%19 = call i8* @getMonthName(i32 %18)
%20 = fpext float %17 to double
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.6, i64 0, i64 0), i8* %19, double %20)
%22 = fcmp oeq float %17, 0.000000e+00
br i1 %22, label %23, label %25
23: ; preds = %15
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.28, i64 0, i64 0))
br label %29
25: ; preds = %15
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.25, i64 0, i64 0))
%27 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 %16
%28 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %27)
br label %29
29: ; preds = %25, %23
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.26, i64 0, i64 0))
%31 = getelementptr inbounds [12 x float], [12 x float]* %3, i64 0, i64 %16
%32 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), float* %31)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0), i8* %19)
%34 = getelementptr inbounds [12 x float], [12 x float]* %2, i64 0, i64 %16
%35 = load float, float* %34
%36 = load float, float* %31
%37 = icmp eq i64 %16, 0
%38 = load float, float* %1
%39 = select i1 %37, float %38, float %17
%40 = fadd float %36, %39
%41 = fsub float %40, %35
%42 = fpext float %35 to double
%43 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0), double %42)
%44 = fpext float %36 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), double %44)
%46 = fpext float %41 to double
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.13, i64 0, i64 0), double %46)
%48 = fcmp oeq float %41, 0.000000e+00
br i1 %48, label %49, label %51
49: ; preds = %29
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.14, i64 0, i64 0), i8* %19)
br label %65
51: ; preds = %29
%52 = load float, float* %1
%53 = fcmp ogt float %41, %52
br i1 %53, label %54, label %59
54: ; preds = %51
%55 = fsub float %41, %52
%56 = fpext float %55 to double
%57 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @.str.15, i64 0, i64 0), i8* %19, double %56)
%58 = load float, float* %1
br label %65
59: ; preds = %51
%60 = fcmp olt float %41, %52
br i1 %60, label %61, label %63
61: ; preds = %59
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.16, i64 0, i64 0), i8* %19, double %46)
br label %65
63: ; preds = %59
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.17, i64 0, i64 0), i8* %19)
br label %65
65: ; preds = %54, %63, %61, %49
%66 = phi float [ %41, %49 ], [ %58, %54 ], [ %41, %61 ], [ %41, %63 ]
%67 = add nuw nsw i64 %16, 1
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.27, i64 0, i64 0))
%69 = icmp eq i64 %67, 12
br i1 %69, label %70, label %15
70: ; preds = %65
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.23, i64 0, i64 0))
%72 = fpext float %66 to double
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.19, i64 0, i64 0), double %72)
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.27, i64 0, i64 0))
ret i32 0
}