int main() {
  int numberPrimary;
  int numberSecondary;
  int option;
  float result;
  printf("\n---------------------------------\n");
  printf("Please, choose an option of operation: \n");
  printf("* 1 = Addition \n");
  printf("* 2 = Subtraction \n");
  printf("* 3 = Multiplication \n");
  printf("* 4 = Division \n");
  printf("* 5 = MOD \n");
  printf("* 6 = Exit \n");
  scanf("%d", &option);
  if (option == 6) {
    printf("-----BYE----- \n");
    exit(0);
  }
  printf("Please, insert the number primary: ");
  scanf("%d", &numberPrimary);
  printf("\nPlease, insert the number secondary: ");
  scanf("%d", &numberSecondary);
  if (option == 1) {
    result = ((numberPrimary) + (numberSecondary));
    printf("Result addition is: %.2f \n", result);
  } else if (option == 2) {
    result = ((numberPrimary) - (numberSecondary));
    printf("Result subtraction is: %.2f \n", result);
  } else if (option == 3) {
    result = ((numberPrimary) * (numberSecondary));
    printf("Result multiplication is: %.2f \n", result);
  } else if (option == 4) {
    result = ((numberPrimary) / (numberSecondary));
    printf("Result division is: %.2f \n", result);
  } else if (option == 5) {
    result = (numberPrimary % numberSecondary);
    printf("Result the mod is: %.2f \n", result);
  } else {
    printf("-----BYE----- \n");
    exit(0);
  }
  printf("\n---------------------------------\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeee(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x6,-0x10(%rbp)
jne    11e0 <main+0xb0>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebe(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
cmpl   $0x1,-0x10(%rbp)
jne    1255 <main+0x125>
mov    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec8(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1355 <main+0x225>
cmpl   $0x2,-0x10(%rbp)
jne    128a <main+0x15a>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeae(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1350 <main+0x220>
cmpl   $0x3,-0x10(%rbp)
jne    12c0 <main+0x190>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    134b <main+0x21b>
cmpl   $0x4,-0x10(%rbp)
jne    12f6 <main+0x1c6>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1346 <main+0x216>
cmpl   $0x5,-0x10(%rbp)
jne    132c <main+0x1fc>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cvtsi2ss %edx,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe66(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1341 <main+0x211>
lea    0xd83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>
jmp    1346 <main+0x216>
jmp    134b <main+0x21b>
jmp    1350 <main+0x220>
jmp    1355 <main+0x225>
lea    0xca4(%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    0x102d(%rip),%rdi
call   1030 <puts@plt>
lea    0xf99(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb5(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb9(%rip),%rdi
call   1030 <puts@plt>
lea    0xfc0(%rip),%rdi
call   1030 <puts@plt>
lea    0xfca(%rip),%rdi
call   1030 <puts@plt>
lea    0xfce(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe68(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0x6,0xc(%rsp)
je     129f <main+0x15f>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe3c(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe4d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     129f <main+0x15f>
lea    0xde5(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    0x4(%rsp),%eax
add    0x8(%rsp),%eax
lea    0xe2f(%rip),%rdi
jmp    127c <main+0x13c>
mov    0x8(%rsp),%eax
sub    0x4(%rsp),%eax
lea    0xe39(%rip),%rdi
jmp    127c <main+0x13c>
mov    0x4(%rsp),%eax
imul   0x8(%rsp),%eax
lea    0xe45(%rip),%rdi
jmp    127c <main+0x13c>
mov    0x8(%rsp),%eax
cltd
idivl  0x4(%rsp)
lea    0xe54(%rip),%rdi
jmp    127c <main+0x13c>
mov    0x8(%rsp),%eax
cltd
idivl  0x4(%rsp)
mov    %edx,%eax
lea    0xe5b(%rip),%rdi
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xee7(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
lea    0xef6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0A---------------------------------\0A\00"
@.str.1 = [41 x i8] c"Please, choose an option of operation: \0A\00"
@.str.2 = [17 x i8] c"* 1 = Addition \0A\00"
@.str.3 = [20 x i8] c"* 2 = Subtraction \0A\00"
@.str.4 = [23 x i8] c"* 3 = Multiplication \0A\00"
@.str.5 = [17 x i8] c"* 4 = Division \0A\00"
@.str.6 = [12 x i8] c"* 5 = MOD \0A\00"
@.str.7 = [13 x i8] c"* 6 = Exit \0A\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [16 x i8] c"-----BYE----- \0A\00"
@.str.10 = [36 x i8] c"Please, insert the number primary: \00"
@.str.11 = [39 x i8] c"\0APlease, insert the number secondary: \00"
@.str.12 = [27 x i8] c"Result addition is: %.2f \0A\00"
@.str.13 = [30 x i8] c"Result subtraction is: %.2f \0A\00"
@.str.14 = [33 x i8] c"Result multiplication is: %.2f \0A\00"
@.str.15 = [27 x i8] c"Result division is: %.2f \0A\00"
@.str.16 = [26 x i8] c"Result the mod is: %.2f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.3, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %4)
%15 = load i32, i32* %4
%16 = icmp eq i32 %15, 6
br i1 %16, label %17, label %19
17: ; preds = %0
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
unreachable
19: ; preds = %0
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%24 = load i32, i32* %4
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %34
26: ; preds = %19
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = add nsw i32 %27, %28
%30 = sitofp i32 %29 to float
store float %30, float* %5
%31 = load float, float* %5
%32 = fpext float %31 to double
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), double %32)
br label %84
34: ; preds = %19
%35 = load i32, i32* %4
%36 = icmp eq i32 %35, 2
br i1 %36, label %37, label %45
37: ; preds = %34
%38 = load i32, i32* %2
%39 = load i32, i32* %3
%40 = sub nsw i32 %38, %39
%41 = sitofp i32 %40 to float
store float %41, float* %5
%42 = load float, float* %5
%43 = fpext float %42 to double
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), double %43)
br label %83
45: ; preds = %34
%46 = load i32, i32* %4
%47 = icmp eq i32 %46, 3
br i1 %47, label %48, label %56
48: ; preds = %45
%49 = load i32, i32* %2
%50 = load i32, i32* %3
%51 = mul nsw i32 %49, %50
%52 = sitofp i32 %51 to float
store float %52, float* %5
%53 = load float, float* %5
%54 = fpext float %53 to double
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), double %54)
br label %82
56: ; preds = %45
%57 = load i32, i32* %4
%58 = icmp eq i32 %57, 4
br i1 %58, label %59, label %67
59: ; preds = %56
%60 = load i32, i32* %2
%61 = load i32, i32* %3
%62 = sdiv i32 %60, %61
%63 = sitofp i32 %62 to float
store float %63, float* %5
%64 = load float, float* %5
%65 = fpext float %64 to double
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), double %65)
br label %81
67: ; preds = %56
%68 = load i32, i32* %4
%69 = icmp eq i32 %68, 5
br i1 %69, label %70, label %78
70: ; preds = %67
%71 = load i32, i32* %2
%72 = load i32, i32* %3
%73 = srem i32 %71, %72
%74 = sitofp i32 %73 to float
store float %74, float* %5
%75 = load float, float* %5
%76 = fpext float %75 to double
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), double %76)
br label %80
78: ; preds = %67
%79 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
unreachable
80: ; preds = %70
br label %81
81: ; preds = %80, %59
br label %82
82: ; preds = %81, %48
br label %83
83: ; preds = %82, %37
br label %84
84: ; preds = %83, %26
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%86 = load i32, i32* %1
ret i32 %86
}

LLVM IR (-O2):
@.str.8 = [3 x i8] c"%d\00"
@.str.10 = [36 x i8] c"Please, insert the number primary: \00"
@.str.11 = [39 x i8] c"\0APlease, insert the number secondary: \00"
@.str.12 = [27 x i8] c"Result addition is: %.2f \0A\00"
@.str.13 = [30 x i8] c"Result subtraction is: %.2f \0A\00"
@.str.14 = [33 x i8] c"Result multiplication is: %.2f \0A\00"
@.str.15 = [27 x i8] c"Result division is: %.2f \0A\00"
@.str.16 = [26 x i8] c"Result the mod is: %.2f \0A\00"
@str.17 = [40 x i8] c"Please, choose an option of operation: \00"
@str.18 = [16 x i8] c"* 1 = Addition \00"
@str.19 = [19 x i8] c"* 2 = Subtraction \00"
@str.20 = [22 x i8] c"* 3 = Multiplication \00"
@str.21 = [16 x i8] c"* 4 = Division \00"
@str.22 = [11 x i8] c"* 5 = MOD \00"
@str.23 = [12 x i8] c"* 6 = Exit \00"
@str.25 = [35 x i8] c"\0A---------------------------------\00"
@str.26 = [15 x i8] c"-----BYE----- \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.25, i64 0, i64 0))
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.17, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.18, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.19, i64 0, i64 0))
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.20, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.21, i64 0, i64 0))
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.22, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.23, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %3)
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 6
br i1 %17, label %18, label %20
18: ; preds = %0
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.26, i64 0, i64 0))
unreachable
20: ; preds = %0
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.10, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
%25 = load i32, i32* %3
switch i32 %25, label %46 [
i32 1, label %26
i32 2, label %30
i32 3, label %34
i32 4, label %38
i32 5, label %42
]
26: ; preds = %20
%27 = load i32, i32* %1
%28 = load i32, i32* %2
%29 = add nsw i32 %28, %27
br label %48
30: ; preds = %20
%31 = load i32, i32* %1
%32 = load i32, i32* %2
%33 = sub nsw i32 %31, %32
br label %48
34: ; preds = %20
%35 = load i32, i32* %1
%36 = load i32, i32* %2
%37 = mul nsw i32 %36, %35
br label %48
38: ; preds = %20
%39 = load i32, i32* %1
%40 = load i32, i32* %2
%41 = sdiv i32 %39, %40
br label %48
42: ; preds = %20
%43 = load i32, i32* %1
%44 = load i32, i32* %2
%45 = srem i32 %43, %44
br label %48
46: ; preds = %20
%47 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.26, i64 0, i64 0))
unreachable
48: ; preds = %30, %38, %42, %34, %26
%49 = phi i32 [ %33, %30 ], [ %41, %38 ], [ %45, %42 ], [ %37, %34 ], [ %29, %26 ]
%50 = phi i8* [ getelementptr inbounds ([30 x i8], [30 x i8]* @.str.13, i64 0, i64 0), %30 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.15, i64 0, i64 0), %38 ], [ getelementptr inbounds ([26 x i8], [26 x i8]* @.str.16, i64 0, i64 0), %42 ], [ getelementptr inbounds ([33 x i8], [33 x i8]* @.str.14, i64 0, i64 0), %34 ], [ getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0), %26 ]
%51 = sitofp i32 %49 to float
%52 = fpext float %51 to double
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %50, double %52)
%54 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.25, i64 0, i64 0))
ret i32 0
}